/* ==========================================================
   Magnificat Atelier — La pureza en cada hilo
   ========================================================== */

/* ---------- Fonts (self-hosted, SIL OFL 1.1 — see assets/fonts/OFL.txt) ---------- */
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 300; font-display: swap; src: url("assets/fonts/cormorant-garamond-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: italic; font-weight: 300; font-display: swap; src: url("assets/fonts/cormorant-garamond-latin-300-italic.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 400; font-display: swap; src: url("assets/fonts/cormorant-garamond-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: italic; font-weight: 400; font-display: swap; src: url("assets/fonts/cormorant-garamond-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 500; font-display: swap; src: url("assets/fonts/cormorant-garamond-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "EB Garamond"; font-style: normal; font-weight: 400; font-display: swap; src: url("assets/fonts/eb-garamond-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "EB Garamond"; font-style: italic; font-weight: 400; font-display: swap; src: url("assets/fonts/eb-garamond-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "EB Garamond"; font-style: normal; font-weight: 500; font-display: swap; src: url("assets/fonts/eb-garamond-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Pinyon Script"; font-style: normal; font-weight: 400; font-display: swap; src: url("assets/fonts/pinyon-script-latin-400-normal.woff2") format("woff2"); }

:root {
  --linen: #f3ebdc;
  --cream: #faf6ee;
  --paper: #fffdf8;
  --ink: #3d3125;
  --muted: #7b6b57;
  --gold: #a98a58;
  --gold-soft: #cbb48a;
  --line: rgba(169, 138, 88, 0.35);

  --serif-display: "Cormorant Garamond", "Times New Roman", serif;
  --serif-body: "EB Garamond", Georgia, serif;
  --script: "Pinyon Script", cursive;

  --wrap: 1120px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--serif-body);
  font-size: clamp(1.06rem, 0.98rem + 0.3vw, 1.22rem);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

::selection { background: var(--gold-soft); color: var(--paper); }

:focus-visible { outline: 1px solid var(--gold); outline-offset: 4px; }

.wrap { width: min(var(--wrap), 100% - 3rem); margin-inline: auto; }
.narrow { max-width: 680px; text-align: center; }

h1, h2, h3 {
  font-family: var(--serif-display);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: 0.005em;
  margin: 0;
  color: var(--ink);
}
h1 em, h2 em { font-style: italic; color: var(--gold); font-weight: 300; }

h1 { font-size: clamp(2.8rem, 1.8rem + 4vw, 5.2rem); }
h2 { font-size: clamp(2.2rem, 1.6rem + 2.6vw, 3.8rem); }
h3 { font-size: 1.55rem; font-weight: 400; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  margin: 0 0 1.4rem;
  font-family: var(--serif-display);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
}
.eyebrow svg { width: 0.95em; height: 0.95em; color: var(--gold); }
.eyebrow.center { justify-content: center; }

.rule {
  display: block;
  width: 72px;
  height: 1px;
  margin-top: 2rem;
  background: var(--gold-soft);
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem clamp(1.25rem, 4vw, 3rem);
  transition: background .5s var(--ease), padding .5s var(--ease), box-shadow .5s var(--ease);
}
.site-header.is-scrolled {
  padding-block: 0.7rem;
  background: rgba(250, 246, 238, 0.86);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}
.brand-m {
  font-family: var(--script);
  font-size: 2.1rem;
  line-height: 1;
  color: var(--gold);
  transform: translateY(0.12em);
}
.brand-name {
  font-family: var(--serif-display);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.is-scrolled .brand-name,
.is-solid .brand-name { opacity: 1; transform: none; }
.site-header.is-solid {
  padding-block: 0.7rem;
  background: rgba(250, 246, 238, 0.94);
  box-shadow: 0 1px 0 var(--line);
}

.site-nav { display: flex; gap: clamp(1.1rem, 2.6vw, 2.4rem); }
.site-nav a {
  position: relative;
  font-family: var(--serif-display);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  padding-block: 0.3rem;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .45s var(--ease);
}
.site-nav a:hover::after,
.site-nav a:focus-visible::after { transform: scaleX(1); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 520px;
  overflow: hidden;
  background: var(--linen);
}
.hero picture,
.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero img {
  object-fit: cover;
  object-position: 50% 50%;
  animation: hero-in 2.4s var(--ease) both;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 46%, transparent 52%, rgba(120, 95, 60, 0.12) 100%),
    linear-gradient(to bottom, rgba(250, 246, 238, 0.35), transparent 18%, transparent 78%, rgba(250, 246, 238, 0.7));
}

.hero-foot {
  position: absolute;
  z-index: 2;
  left: 0; right: 0;
  bottom: clamp(1.5rem, 4vh, 2.6rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  animation: fade-up 1.6s .9s var(--ease) both;
}
.hero-tag {
  margin: 0;
  font-family: var(--serif-display);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--muted);
}
.scroll-cue {
  display: block;
  width: 1px;
  height: 46px;
  background: var(--line);
  overflow: hidden;
}
.scroll-cue span {
  display: block;
  width: 100%;
  height: 40%;
  background: var(--gold);
  animation: thread 2.4s var(--ease) infinite;
}

@keyframes hero-in {
  from { opacity: 0; transform: scale(1.06); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
@keyframes thread {
  0%   { transform: translateY(-100%); }
  100% { transform: translateY(260%); }
}

/* ---------- Philosophy ---------- */
.philosophy {
  padding: clamp(5rem, 12vw, 10rem) 0 clamp(4.5rem, 10vw, 8rem);
  background: var(--cream);
}
.philosophy-grid {
  display: grid;
  grid-template-columns: 5fr 6fr;
  gap: clamp(2.5rem, 7vw, 7rem);
  align-items: start;
}
.philosophy-body p { margin: 0 0 1.5rem; color: var(--ink); max-width: 36em; }
.philosophy-body p:last-child { margin-bottom: 0; color: var(--muted); }
.lead {
  font-family: var(--serif-display);
  font-size: clamp(1.45rem, 1.2rem + 0.9vw, 1.95rem);
  font-weight: 400;
  line-height: 1.45;
}
.lead::first-letter {
  float: left;
  font-family: var(--serif-display);
  font-style: italic;
  font-weight: 300;
  font-size: 3.6em;
  line-height: 0.82;
  padding: 0.06em 0.1em 0 0;
  color: var(--gold);
}

/* ---------- Quote band ---------- */
.quote-band {
  position: relative;
  padding: clamp(5rem, 12vw, 9rem) 1.5rem;
  background: var(--linen) url("assets/pattern.webp") center / cover no-repeat;
}
.quote-card {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(2.8rem, 6vw, 4.5rem) clamp(1.8rem, 6vw, 5rem);
  text-align: center;
  background: rgba(255, 253, 248, 0.9);
  border: 1px solid var(--line);
  box-shadow: 0 30px 60px -40px rgba(90, 70, 40, 0.35);
}
.quote-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(169, 138, 88, 0.18);
  pointer-events: none;
}
.quote-star { width: 22px; height: 22px; color: var(--gold); margin: 0 auto 1.6rem; }
.quote-card blockquote {
  margin: 0;
  font-family: var(--serif-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.9rem);
  line-height: 1.25;
  color: var(--ink);
}
.quote-card figcaption {
  margin-top: 1.8rem;
  font-family: var(--script);
  font-size: 1.9rem;
  color: var(--gold);
}

/* ---------- Principles ---------- */
.principles { padding: clamp(5rem, 11vw, 9rem) 0; background: var(--paper); }
.section-head { text-align: center; margin-bottom: clamp(3rem, 6vw, 5rem); }
.section-head .eyebrow { justify-content: center; }

.principles-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
}
.principles-list li {
  position: relative;
  padding: 2.6rem 1.8rem 2.2rem;
  text-align: center;
}
.principles-list li + li { border-left: 1px solid var(--line); }
.p-icon { width: 46px; height: 46px; margin: 0 auto 1.2rem; color: var(--gold); }
.p-num {
  display: block;
  font-family: var(--serif-display);
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  color: var(--gold-soft);
  margin-bottom: 0.4rem;
}
.principles-list h3 { margin-bottom: 0.8rem; }
.principles-list p { margin: 0; font-size: 1rem; color: var(--muted); line-height: 1.65; }

/* ---------- Materials ---------- */
.materials {
  padding: clamp(5rem, 11vw, 9rem) 0;
  background: var(--linen);
}
.materials-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 7vw, 7rem);
  align-items: center;
}
.materials-figure { margin: 0; }
.materials-figure img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: 10px solid var(--paper);
  box-shadow: 0 40px 70px -45px rgba(90, 70, 40, 0.5);
}
.materials-figure figcaption {
  margin-top: 1rem;
  font-family: var(--serif-display);
  font-style: italic;
  font-size: 1rem;
  color: var(--muted);
  text-align: center;
}
.materials-copy h2 { margin-bottom: 2.5rem; }
.materials-list { margin: 0; }
.materials-list > div {
  padding: 1.4rem 0;
  border-top: 1px solid var(--line);
}
.materials-list > div:last-child { border-bottom: 1px solid var(--line); }
.materials-list dt {
  font-family: var(--serif-display);
  font-size: 1.7rem;
  font-weight: 400;
  line-height: 1.2;
}
.materials-list dd { margin: 0.3rem 0 0; color: var(--muted); }

/* ---------- Atelier ---------- */
.atelier {
  padding: clamp(5rem, 12vw, 10rem) 0;
  background: var(--cream);
}
.atelier h2 { margin-bottom: 1.8rem; }
.atelier p { color: var(--muted); margin: 0 auto; max-width: 34em; }
.steps {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: clamp(1.5rem, 6vw, 4.5rem);
  margin: 3.5rem 0 0;
  padding: 0;
}
.steps li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--serif-display);
  font-size: 1.45rem;
  font-style: italic;
}
.steps span {
  font-style: normal;
  font-size: 0.78rem;
  letter-spacing: 0.3em;
  color: var(--gold);
}

/* ---------- Contact ---------- */
.contact {
  padding: clamp(4.5rem, 10vw, 8rem) 1.5rem;
  background: var(--linen) url("assets/pattern.webp") center / cover no-repeat;
}
.contact-card {
  max-width: 640px;
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 4.5rem) clamp(1.6rem, 6vw, 4rem);
  text-align: center;
  background: rgba(255, 253, 248, 0.94);
  border: 1px solid var(--line);
}
.contact-m {
  display: block;
  font-family: var(--script);
  font-size: 4.2rem;
  line-height: 1;
  color: var(--gold);
  margin-bottom: 0.6rem;
}
.contact-card h2 { margin-bottom: 1.4rem; font-size: clamp(2rem, 1.5rem + 2vw, 3.1rem); }
.contact-card p { color: var(--muted); margin: 0 auto; max-width: 30em; }

.button {
  display: inline-block;
  margin-top: 2.2rem;
  padding: 1rem 2.6rem;
  font-family: var(--serif-display);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--paper);
  background: var(--gold);
  border: 1px solid var(--gold);
  transition: background .4s var(--ease), color .4s var(--ease);
}
.button:hover,
.button:focus-visible { background: transparent; color: var(--gold); }
.contact-card .contact-mail {
  margin-top: 1.2rem;
  font-size: 0.95rem;
  font-style: italic;
  letter-spacing: 0.02em;
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 4rem 1.5rem 3rem;
  text-align: center;
  background: var(--paper);
  border-top: 1px solid var(--line);
}
.footer-stars { display: flex; justify-content: center; gap: 1.2rem; color: var(--gold-soft); }
.footer-stars svg { width: 14px; height: 14px; }
.footer-script {
  margin: 1rem 0 0.4rem;
  font-family: var(--script);
  font-size: 2.3rem;
  color: var(--gold);
  line-height: 1.2;
}
.footer-latin { margin: 0 0 1.6rem; color: var(--muted); font-size: 1rem; }
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem 1.8rem;
  margin: 0 0 1.4rem;
}
.footer-nav a {
  font-size: 1rem;
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: rgba(123, 107, 87, 0.45);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
  transition: color .3s var(--ease), text-decoration-color .3s var(--ease);
}
.footer-nav a:hover,
.footer-nav a:focus-visible,
.footer-nav a[aria-current="page"] { color: var(--gold); text-decoration-color: var(--gold); }

.footer-legal {
  margin: 0;
  font-family: var(--serif-display);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Legal pages ---------- */
.legal {
  padding: clamp(8rem, 14vw, 10rem) 0 clamp(4.5rem, 9vw, 7rem);
  background: var(--cream);
}
.legal-wrap { width: min(760px, 100% - 3rem); margin-inline: auto; }
.legal h1 { font-size: clamp(2.5rem, 1.8rem + 3vw, 4rem); margin-bottom: 0.8rem; }
.legal .updated {
  margin: 0 0 3rem;
  font-style: italic;
  color: var(--muted);
  font-size: 1rem;
}
.legal h2 {
  font-size: clamp(1.6rem, 1.35rem + 0.9vw, 2.05rem);
  font-weight: 400;
  margin: 3rem 0 1rem;
  padding-top: 2.2rem;
  border-top: 1px solid var(--line);
}
.legal h3 { font-size: 1.3rem; margin: 1.8rem 0 0.6rem; }
.legal p, .legal li { color: var(--ink); }
.legal p { margin: 0 0 1.1rem; }
.legal ul { margin: 0 0 1.2rem; padding-left: 1.2rem; }
.legal li { margin-bottom: 0.45rem; }
.legal li::marker { color: var(--gold); }
.legal a { color: var(--ink); text-decoration-color: var(--gold-soft); text-underline-offset: 0.2em; }
.legal a:hover { color: var(--gold); }

.legal-data {
  margin: 0 0 1.5rem;
  padding: 1.6rem 1.8rem;
  background: var(--paper);
  border: 1px solid var(--line);
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.55rem 1.6rem;
}
.legal-data dt {
  font-family: var(--serif-display);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  padding-top: 0.3rem;
}
.legal-data dd { margin: 0; }

.table-scroll { overflow-x: auto; margin: 0 0 1.5rem; }
.legal table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.98rem;
  background: var(--paper);
  border: 1px solid var(--line);
}
.legal th, .legal td {
  text-align: left;
  vertical-align: top;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--line);
}
.legal th {
  font-family: var(--serif-display);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}
.legal td code { font-size: 0.9em; }

@media (max-width: 560px) {
  .legal-data { grid-template-columns: 1fr; gap: 0.2rem; }
  .legal-data dd { margin-bottom: 0.7rem; }
  .legal table, .legal tbody, .legal tr, .legal td { display: block; width: 100%; }
  .legal thead { display: none; }
  .legal tr { padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
  .legal tr:last-child { border-bottom: 0; }
  .legal td { border: 0; padding: 0.35rem 1rem; }
  .legal td::before {
    content: attr(data-label);
    display: block;
    font-family: var(--serif-display);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold);
  }
}

/* ---------- Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }
.principles-list li:nth-child(2) { transition-delay: .12s; }
.principles-list li:nth-child(3) { transition-delay: .24s; }
.principles-list li:nth-child(4) { transition-delay: .36s; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .philosophy-grid,
  .materials-grid { grid-template-columns: 1fr; }
  .principles-list { grid-template-columns: repeat(2, 1fr); }
  .principles-list li:nth-child(3) { border-left: 0; }
  .principles-list li:nth-child(n+3) { border-top: 1px solid var(--line); }
  .materials-figure { max-width: 440px; margin-inline: auto; }
}

@media (max-width: 640px) {
  .site-nav a:not(.nav-cta):not(.nav-keep) { display: none; }
  .site-nav { gap: 1.1rem; }
  .site-nav a { font-size: 0.7rem; letter-spacing: 0.16em; white-space: nowrap; }
  .brand-name { display: none; }
  .principles-list { grid-template-columns: 1fr; }
  .principles-list li + li { border-left: 0; border-top: 1px solid var(--line); }
  .steps li { font-size: 1.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
.contact-mail a { text-decoration: none; border-bottom: 1px solid var(--line); }
.contact-mail a:hover { color: var(--gold); }
.contact-mail span { margin: 0 0.5em; color: var(--gold-soft); }
