/* ===== Tokens ===== */
:root {
  --background: hsl(48 24% 96%);
  --foreground: hsl(0 0% 10%);
  --muted: hsl(40 13% 91%);
  --muted-foreground: hsl(0 0% 40%);
  --border: hsl(40 13% 88%);
  --font-heading: 'Cormorant Garamond', ui-serif, Georgia, serif;
  --font-body: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --radius: 0.25rem;
  --maxw: 1280px;
  --pad: 1.5rem;
}

@media (min-width: 768px) { :root { --pad: 3rem; } }
@media (min-width: 1024px) { :root { --pad: 5rem; } }

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--foreground); color: var(--background); }

/* ===== Typography helpers ===== */
.font-heading { font-family: var(--font-heading); }
.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: 0.25em; color: var(--muted-foreground); margin-bottom: 1.5rem; }
.kicker { font-size: 11px; text-transform: uppercase; letter-spacing: 0.25em; color: rgba(0,0,0,0.6); }
.body-muted { color: var(--muted-foreground); font-size: 0.95rem; line-height: 1.7; }
.maxw-xl { max-width: 36rem; }
.mt { margin-top: 2rem; }

.display-quote { font-family: var(--font-heading); font-weight: 300; font-size: clamp(1.75rem, 3vw, 2.75rem); line-height: 1.25; }
.display-quote-sm { font-family: var(--font-heading); font-weight: 300; font-size: clamp(1.4rem, 2.2vw, 2rem); line-height: 1.4; }
.italic-quote { font-family: var(--font-heading); font-style: italic; font-size: clamp(1.3rem, 2.4vw, 1.9rem); line-height: 1.5; color: rgba(0,0,0,0.8); }
.italic-quote-lg { font-family: var(--font-heading); font-style: italic; font-weight: 300; font-size: clamp(1.6rem, 3.5vw, 3rem); line-height: 1.2; }
.italic-sign { font-family: var(--font-heading); font-style: italic; font-size: 1.3rem; color: rgba(0,0,0,0.7); margin-top: 3rem; }

.link-underline {
  display: inline-block; margin-top: 2.5rem;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.2em;
  border-bottom: 1px solid rgba(0,0,0,0.4); padding-bottom: 4px;
  transition: border-color 0.5s ease;
}
.link-underline:hover { border-color: var(--foreground); }

.center { text-align: center; max-width: 42rem; margin-left: auto; margin-right: auto; }

/* ===== Layout ===== */
.section { padding: 6rem var(--pad); }
@media (min-width: 768px) { .section { padding: 10rem var(--pad); } }
.page-section { padding-top: 8rem; }
@media (min-width: 768px) { .page-section { padding-top: 10rem; } }

.closing { border-top: 1px solid rgba(0,0,0,0.08); }

.page-title { font-family: var(--font-heading); font-weight: 300; font-size: clamp(3rem, 7vw, 6rem); line-height: 0.95; letter-spacing: -0.02em; max-width: 48rem; margin-bottom: 0; }
.page-section .reveal > .body-muted { margin-top: 2.5rem; }

/* ===== Header ===== */
#header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  transition: background 0.7s ease, border-color 0.7s ease, backdrop-filter 0.7s ease;
  border-bottom: 1px solid transparent;
}
#header.scrolled, #header.open {
  background: rgba(248,246,240,0.85);
  backdrop-filter: blur(12px);
  border-bottom-color: rgba(0,0,0,0.08);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem var(--pad);
}
.brand { font-family: var(--font-heading); font-size: 1.15rem; text-transform: uppercase; letter-spacing: 0.25em; }
.nav-desktop { display: none; gap: 2.5rem; }
.nav-desktop a { font-size: 11px; text-transform: uppercase; letter-spacing: 0.2em; color: rgba(0,0,0,0.7); transition: color 0.5s ease; }
.nav-desktop a:hover { color: var(--foreground); }
@media (min-width: 768px) { .nav-desktop { display: flex; } }

#menuBtn { display: flex; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 4px; }
#menuBtn span { width: 22px; height: 1.5px; background: var(--foreground); transition: transform 0.4s ease, opacity 0.4s ease; }
#header.open #menuBtn span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
#header.open #menuBtn span:nth-child(2) { transform: translateY(-6.5px) rotate(-45deg); }
@media (min-width: 768px) { #menuBtn { display: none; } }

.nav-mobile {
  display: flex; flex-direction: column; gap: 1.25rem;
  padding: 1.5rem var(--pad) 2rem;
  border-top: 1px solid rgba(0,0,0,0.08);
  background: var(--background);
  max-height: 0; overflow: hidden; transition: max-height 0.5s ease, padding 0.5s ease;
  padding-top: 0; padding-bottom: 0;
}
#header.open .nav-mobile { max-height: 400px; padding-top: 1.5rem; padding-bottom: 2rem; }
.nav-mobile a { font-family: var(--font-heading); font-size: 1.6rem; color: rgba(0,0,0,0.8); }
@media (min-width: 768px) { .nav-mobile { display: none; } }

/* ===== Hero ===== */
.hero { position: relative; height: 100vh; min-height: 640px; width: 100%; overflow: hidden; }
.hero-img {
  position: absolute; inset: 0;
  background-image: url('https://media.base44.com/images/public/6a71c5ad753e5206a32ade8e/22fe3df4e_generated_image.png');
  background-size: cover; background-position: center;
}
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(248,246,240,0.3), rgba(248,246,240,0.2), rgba(248,246,240,0.6)); }
.hero-content { position: relative; z-index: 2; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 0 1.5rem; gap: 1.5rem; }
.hero-title { font-family: var(--font-heading); font-weight: 300; font-size: clamp(4.5rem, 18vw, 12rem); line-height: 0.9; letter-spacing: -0.02em; }
.hero-title em { font-style: italic; font-weight: 400; }
.hero-sub { max-width: 28rem; font-size: 0.95rem; color: rgba(0,0,0,0.7); line-height: 1.7; margin-top: 0.5rem; }
.hero-scroll { position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%); z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 0.5rem; color: rgba(0,0,0,0.5); }
.hero-scroll span { font-size: 10px; text-transform: uppercase; letter-spacing: 0.25em; }
.hero-scroll svg { animation: bounce 2s infinite; }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

.hero-zoom { animation: heroZoom 24s ease-out forwards; }
@keyframes heroZoom { from { transform: scale(1.08); } to { transform: scale(1); } }
.slow-fade { animation: slowFade 1.6s ease-out forwards; }
@keyframes slowFade { from { opacity: 0; } to { opacity: 1; } }

/* ===== Intro ===== */
.intro .reveal { max-width: 42rem; margin: 0 auto; text-align: center; }
.intro .display-quote { margin-top: 2rem; }
.intro .body-muted { margin-top: 2.5rem; max-width: 36rem; margin-left: auto; margin-right: auto; }

/* ===== Portals ===== */
.portals-grid { display: grid; gap: 6rem 4rem; }
@media (min-width: 768px) { .portals-grid { grid-template-columns: 1fr 1fr; gap: 8rem 4rem; } }
.portal { display: block; }
.portal-img { position: relative; overflow: hidden; background: var(--muted); }
.portal-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.6s cubic-bezier(0.2,0,0.2,1); }
.portal:hover .portal-img img { transform: scale(1.04); }
.portal-text { margin-top: 2rem; display: flex; align-items: baseline; gap: 1.25rem; }
.portal-text .num { font-size: 11px; letter-spacing: 0.25em; color: var(--muted-foreground); }
.portal-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.2em; color: var(--muted-foreground); margin-bottom: 0.5rem; }
.portal-title { font-family: var(--font-heading); font-weight: 300; font-size: clamp(1.8rem, 3vw, 2.5rem); }
.portal-text .body-muted { margin-top: 1rem; max-width: 28rem; }

/* ===== Frames & aspect ratios ===== */
.frame { position: relative; overflow: hidden; background: var(--muted); }
.frame img { width: 100%; height: 100%; object-fit: cover; }
.aspect-45 { aspect-ratio: 4 / 5; }
.aspect-43 { aspect-ratio: 4 / 3; }
.aspect-sq { aspect-ratio: 1 / 1; }
.aspect-wide { aspect-ratio: 16 / 10; }
@media (min-width: 768px) { .aspect-wide { aspect-ratio: 16 / 8; } }

/* ===== Masonry ===== */
.masonry { columns: 1; column-gap: 2.5rem; margin-top: 4rem; }
@media (min-width: 768px) { .masonry { columns: 2; column-gap: 4rem; } }
.masonry-3 { columns: 1; }
@media (min-width: 768px) { .masonry-3 { columns: 2; } }
@media (min-width: 1024px) { .masonry-3 { columns: 3; } }
.masonry figure { break-inside: avoid; margin-bottom: 3rem; }
@media (min-width: 768px) { .masonry figure { margin-bottom: 5rem; } }
.masonry figcaption { margin-top: 1.25rem; display: flex; align-items: baseline; gap: 1rem; }
.masonry .lam { font-size: 10px; text-transform: uppercase; letter-spacing: 0.25em; color: var(--muted-foreground); }
.masonry h2 { font-family: var(--font-heading); font-weight: 300; font-size: 1.4rem; }
.masonry .materials { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.2em; color: rgba(0,0,0,0.5); margin-top: 0.5rem; }
.masonry .num { font-size: 10px; text-transform: uppercase; letter-spacing: 0.25em; color: var(--muted-foreground); }
.masonry .body-muted { margin-top: 1rem; }

/* ===== Academia ===== */
.page-section .frame { margin-top: 4rem; }
.band { border-top: 1px solid rgba(0,0,0,0.08); border-bottom: 1px solid rgba(0,0,0,0.08); padding: 6rem 0; margin: 6rem 0; }
@media (min-width: 768px) { .band { padding: 7rem 0; } }
.process { margin-top: 2rem; }
.steps { max-width: 48rem; }
.step { display: grid; grid-template-columns: auto 1fr; gap: 2rem; padding: 2rem 0; border-top: 1px solid rgba(0,0,0,0.08); }
.step:last-child { border-bottom: 1px solid rgba(0,0,0,0.08); }
.step-num { font-family: var(--font-heading); font-size: 1.8rem; color: var(--muted-foreground); width: 3rem; }
.step h3 { font-family: var(--font-heading); font-weight: 300; font-size: 1.8rem; }
.step .body-muted { margin-top: 0.75rem; max-width: 36rem; }

/* ===== Sobre ===== */
.sobre-split { display: grid; gap: 3rem; }
@media (min-width: 768px) { .sobre-split { grid-template-columns: 1fr 1fr; gap: 5rem; } }
.sobre-bio { display: flex; flex-direction: column; }
@media (min-width: 768px) { .sobre-bio { position: sticky; top: 8rem; align-self: start; height: fit-content; } }
.bio-body { margin-top: 2.5rem; display: flex; flex-direction: column; gap: 1.5rem; max-width: 28rem; }
.sobre-gallery { display: flex; flex-direction: column; gap: 2.5rem; }
@media (min-width: 768px) { .sobre-gallery { gap: 4rem; } }

/* ===== Footer ===== */
footer { border-top: 1px solid rgba(0,0,0,0.08); padding: 5rem var(--pad) 2rem; }
.footer-inner { display: grid; gap: 3rem; max-width: var(--maxw); margin: 0 auto; }
@media (min-width: 768px) { .footer-inner { grid-template-columns: 2fr 1fr 1fr; } }
.footer-logo { width: 64px; height: auto; margin-bottom: 1.5rem; filter: brightness(0); }
.footer-col { display: flex; flex-direction: column; gap: 0.75rem; }
.footer-col a { font-size: 0.9rem; color: var(--muted-foreground); transition: color 0.4s ease; }
.footer-col a:hover { color: var(--foreground); }
.footer-bottom { display: flex; flex-direction: column; gap: 0.5rem; max-width: var(--maxw); margin: 4rem auto 0; padding-top: 2rem; border-top: 1px solid rgba(0,0,0,0.08); font-size: 0.8rem; color: var(--muted-foreground); }
@media (min-width: 768px) { .footer-bottom { flex-direction: row; justify-content: space-between; } }

/* ===== Reveal animation ===== */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 1s cubic-bezier(0.2,0,0.2,1), transform 1s cubic-bezier(0.2,0,0.2,1); }
.reveal.visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-zoom { animation: none; }
  .slow-fade { animation: none; opacity: 1; }
  html { scroll-behavior: auto; }
}
