/* ============================================
   FORME — Lagree Studio
   Design System / Base Styles
   ============================================ */

:root {
  /* ===== Color Palette — LA Editorial ===== */
  --bone:        #F5F0E8;   /* primary background — warm cream */
  --bone-2:      #EDE6D9;   /* deeper cream / secondary bg */
  --linen:       #FAF7F2;   /* lightest cream */
  --sand:        #D9CDB8;   /* muted sand */
  --clay:        #B89B7A;   /* warm tan accent */
  --olive:       #6B6A4E;   /* muted olive — sparing use */
  --ink:         #1F1D1A;   /* near-black, warm */
  --slate:       #2C2A26;   /* primary text */
  --slate-2:     #4A463F;   /* secondary text */
  --mist:        #8A857B;   /* tertiary text */
  --rule:        rgba(31,29,26,0.12);
  --rule-soft:   rgba(31,29,26,0.06);

  /* ===== Type Scale ===== */
  --serif:       "Fraunces", "Cormorant Garamond", Georgia, serif;
  --sans:        "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono:        "JetBrains Mono", ui-monospace, monospace;

  /* ===== Spacing ===== */
  --gutter:      clamp(1.25rem, 3vw, 2.5rem);
  --section:     clamp(5rem, 10vw, 9rem);

  /* ===== Motion ===== */
  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --t-fast:      0.3s;
  --t-med:       0.6s;
  --t-slow:      1.2s;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: auto; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--slate);
  background: var(--bone);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, video, picture, svg { display: block; max-width: 100%; height: auto; }
button { font: inherit; cursor: pointer; background: none; border: none; color: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
input, textarea, select { font: inherit; color: inherit; }

::selection { background: var(--ink); color: var(--bone); }

/* ===== Typography ===== */
.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mist);
}

.display {
  font-family: var(--serif);
  font-weight: 300;
  font-style: normal;
  font-size: clamp(3rem, 9.5vw, 9.5rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.display em {
  font-style: italic;
  font-weight: 300;
  color: var(--clay);
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
}

h2 { font-size: clamp(2.25rem, 5vw, 4.25rem); }
h3 { font-size: clamp(1.5rem, 2.5vw, 2.25rem); }
h4 { font-size: clamp(1.125rem, 1.6vw, 1.5rem); }

p { color: var(--slate-2); }

.lead {
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  line-height: 1.55;
  color: var(--slate-2);
  max-width: 56ch;
}

.fine {
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--mist);
}

/* ===== Layout ===== */
.wrap {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.wrap-wide {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gutter);
}

.section {
  padding: var(--section) 0;
}

.section-tight {
  padding: clamp(3rem, 6vw, 5rem) 0;
}

.divider {
  width: 100%;
  height: 1px;
  background: var(--rule);
  border: none;
}

/* ===== Navigation ===== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 1.5rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(245, 240, 232, 0);
  backdrop-filter: blur(0px);
  transition: background var(--t-med) var(--ease-out), backdrop-filter var(--t-med) var(--ease-out), border-color var(--t-med);
  border-bottom: 1px solid transparent;
  mix-blend-mode: normal;
}

.nav.scrolled {
  background: rgba(245, 240, 232, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule);
}

.nav-brand {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 1.5rem;
  letter-spacing: 0.18em;
  color: var(--ink);
}

.nav-brand .dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--clay);
  border-radius: 50%;
  margin-left: 4px;
  vertical-align: middle;
  transform: translateY(-2px);
}

.nav-links {
  display: flex;
  gap: clamp(1.5rem, 3vw, 2.75rem);
  align-items: center;
}

.nav-links a {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--slate);
  position: relative;
  padding: 4px 0;
  transition: color var(--t-fast);
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--t-fast) var(--ease-out);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-cta {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.85rem 1.5rem;
  border: 1px solid var(--ink);
  color: var(--ink);
  background: transparent;
  border-radius: 999px;
  transition: background var(--t-fast), color var(--t-fast);
}

.nav-cta:hover { background: var(--ink); color: var(--bone); }

.nav-burger {
  display: none;
  width: 32px; height: 32px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.nav-burger span {
  width: 22px; height: 1px;
  background: var(--ink);
}

@media (max-width: 880px) {
  .nav-links { display: none; }
  .nav-burger { display: flex; }
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 1.05rem 1.85rem;
  border-radius: 999px;
  transition: all var(--t-fast) var(--ease-out);
  white-space: nowrap;
}

.btn-dark {
  background: var(--ink);
  color: var(--bone);
}
.btn-dark:hover { background: var(--clay); color: var(--ink); }

.btn-light {
  background: var(--bone);
  color: var(--ink);
  border: 1px solid var(--ink);
}
.btn-light:hover { background: var(--ink); color: var(--bone); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: var(--bone); }

.btn .arrow {
  width: 14px; height: 14px;
  transition: transform var(--t-fast) var(--ease-out);
}
.btn:hover .arrow { transform: translateX(4px); }

/* ===== Marquee ===== */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 1.4rem 0;
  background: var(--bone);
}

.marquee-track {
  display: flex;
  gap: 4rem;
  width: max-content;
  animation: marquee 40s linear infinite;
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-style: italic;
  font-weight: 300;
  color: var(--ink);
  white-space: nowrap;
}

.marquee-track span { display: inline-flex; align-items: center; gap: 4rem; }
.marquee-track .star { color: var(--clay); font-style: normal; }

@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* ===== Reveal Animations ===== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1.2s var(--ease-out), transform 1.2s var(--ease-out);
}
.reveal.in { opacity: 1; transform: translateY(0); }

.reveal-img {
  overflow: hidden;
  position: relative;
}
.reveal-img > img {
  transform: scale(1.15);
  transition: transform 1.6s var(--ease-out);
}
.reveal-img.in > img { transform: scale(1); }
.reveal-img::after {
  content: '';
  position: absolute; inset: 0;
  background: var(--bone);
  transform-origin: right;
  transition: transform 1.2s var(--ease-out);
}
.reveal-img.in::after { transform: scaleX(0); }

/* Split text — words wrapped in spans */
.split-line { overflow: hidden; }
.split-word {
  display: inline-block;
  transform: translateY(110%);
  opacity: 0;
  transition: transform 1s var(--ease-out), opacity 1s var(--ease-out);
}
.in .split-word { transform: translateY(0); opacity: 1; }

/* Stagger */
.in .split-word:nth-child(1) { transition-delay: 0.00s; }
.in .split-word:nth-child(2) { transition-delay: 0.04s; }
.in .split-word:nth-child(3) { transition-delay: 0.08s; }
.in .split-word:nth-child(4) { transition-delay: 0.12s; }
.in .split-word:nth-child(5) { transition-delay: 0.16s; }
.in .split-word:nth-child(6) { transition-delay: 0.20s; }
.in .split-word:nth-child(7) { transition-delay: 0.24s; }
.in .split-word:nth-child(8) { transition-delay: 0.28s; }
.in .split-word:nth-child(9) { transition-delay: 0.32s; }
.in .split-word:nth-child(10) { transition-delay: 0.36s; }
.in .split-word:nth-child(n+11) { transition-delay: 0.4s; }

/* ===== Footer ===== */
.footer {
  background: var(--ink);
  color: var(--bone);
  padding: clamp(5rem, 8vw, 7rem) 0 2rem;
  position: relative;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: var(--gutter);
  padding-bottom: 4rem;
  border-bottom: 1px solid rgba(245, 240, 232, 0.12);
}

@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

.footer h4 {
  color: var(--bone);
  font-size: 13px;
  font-family: var(--sans);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.footer .display-mark {
  font-family: var(--serif);
  font-size: clamp(3rem, 8vw, 6.5rem);
  font-weight: 300;
  line-height: 0.9;
  letter-spacing: -0.03em;
  color: var(--bone);
  margin-bottom: 1.25rem;
}

.footer ul li {
  margin-bottom: 0.7rem;
}

.footer a {
  color: rgba(245, 240, 232, 0.72);
  font-size: 14px;
  transition: color var(--t-fast);
}

.footer a:hover { color: var(--clay); }

.footer-meta {
  display: flex;
  justify-content: space-between;
  padding-top: 2rem;
  font-size: 12px;
  color: rgba(245, 240, 232, 0.5);
  letter-spacing: 0.1em;
}

@media (max-width: 640px) {
  .footer-meta { flex-direction: column; gap: 1rem; }
}

/* ===== Smooth Scroll wrapper ===== */
html.lenis { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }
.lenis.lenis-scrolling iframe { pointer-events: none; }

/* ===== Cursor (optional, large screens) ===== */
.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--ink);
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: difference;
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s;
}
@media (max-width: 880px) {
  .cursor { display: none; }
}

/* ===== Utilities ===== */
.txt-center { text-align: center; }
.txt-right { text-align: right; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }
.mb-6 { margin-bottom: 4.5rem; }
.mt-6 { margin-top: 4.5rem; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 1rem; }
.gap-4 { gap: 2rem; }

/* ===== Image fallback (if Unsplash 404s) ===== */
.img-fallback {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--sand) 0%, var(--clay) 60%, var(--olive) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bone);
  font-family: var(--serif);
}
.img-fallback-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
  padding: 2rem;
}
.img-fallback-mark {
  font-size: clamp(3rem, 8vw, 7rem);
  font-style: italic;
  font-weight: 300;
  line-height: 0.9;
  letter-spacing: -0.04em;
}
.img-fallback-text {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.85;
  max-width: 22ch;
}

/* Page transition overlay */
.page-loader {
  position: fixed;
  inset: 0;
  background: var(--ink);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transform: translateY(0);
  transition: transform 1s var(--ease-in-out);
}
.page-loader.gone { transform: translateY(-101%); }
.page-loader-mark {
  font-family: var(--serif);
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 300;
  color: var(--bone);
  font-style: italic;
  letter-spacing: -0.02em;
  opacity: 0;
  animation: loaderFade 1.4s var(--ease-out) forwards;
}
@keyframes loaderFade {
  0% { opacity: 0; transform: translateY(20px); }
  50% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-10px); }
}
