/* =============================================================
   1. Tokens
   ============================================================= */
@property --mesh-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@property --mesh-x     { syntax: "<percentage>"; inherits: false; initial-value: 30%; }
@property --mesh-y     { syntax: "<percentage>"; inherits: false; initial-value: 40%; }

:root {
  /* Dark theme — flagship */
  --bg:        #0f1512;
  --bg-2:      #161d19;
  --bg-3:      #1c2521;
  --cream:     #f1ece1;
  --cream-2:   #d7d1c1;
  --cream-3:   #8d9089;
  --accent:    #6fa89a;
  --accent-2:  #ab98bd;
  --line:      rgba(241, 236, 225, 0.12);
  --shadow-color: 0deg 0% 0%;

  --serif: "Fraunces", "Iowan Old Style", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:     cubic-bezier(0.7, 0, 0.84, 0);
  --ease-soft:   cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  --nav-h: 76px;
  --container-w: 1280px;

  color-scheme: dark;
}

[data-theme="light"] {
  --bg:       #f7f4ec;
  --bg-2:     #efe9da;
  --bg-3:     #e6ded0;
  --cream:    #16211c;
  --cream-2:  #33413c;
  --cream-3:  #6d766f;
  --accent:   #3c6560;
  --accent-2: #6a5578;
  --line:     rgba(22, 33, 28, 0.14);
  color-scheme: light;
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  tab-size: 2;
  scroll-behavior: smooth;
  overflow-x: clip;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--bg);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
  transition: background-color .6s var(--ease-out), color .6s var(--ease-out);
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.05; letter-spacing: -0.01em; font-family: var(--serif); font-weight: 480; }
ul { list-style: none; padding: 0; }
::selection { background: var(--accent); color: var(--bg); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* =============================================================
   3. Utilities
   ============================================================= */
.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 9999;
  padding: .7rem 1.1rem; background: var(--cream); color: var(--bg);
  border-radius: 8px; font-weight: 600; font-size: .9rem;
  transition: top .3s var(--ease-out);
}
.skip-link:focus { top: 1rem; }

.container {
  width: 100%;
  max-width: var(--container-w);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.kicker {
  display: block;
  font-family: var(--sans);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.1rem;
}

.eyebrow-num {
  font-family: var(--sans);
  font-size: .78rem;
  letter-spacing: .1em;
  color: var(--cream-3);
}

/* =============================================================
   4. Typography
   ============================================================= */
.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-style: italic;
  font-variation-settings: "opsz" 40;
  max-width: 16ch;
}
.section-title em { color: var(--accent); font-style: italic; }

.lede {
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  color: var(--cream-2);
  max-width: 62ch;
  line-height: 1.7;
}

.body-copy {
  max-width: 60ch;
  color: var(--cream-2);
  font-size: 1.02rem;
  line-height: 1.75;
}
.body-copy + .body-copy { margin-top: 1.3em; }

.split-word, .split-char { display: inline-block; will-change: transform, opacity; }
[data-split] { opacity: 1; } /* base state before JS enhances; JS animates children in */
.reveal[data-split] { opacity: 1; transform: none; } /* defensive: never let a split element hide via .reveal rule */

/* =============================================================
   5. Components
   ============================================================= */

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .95rem 1.7rem;
  border-radius: 999px;
  font-size: .92rem; font-weight: 600;
  letter-spacing: .01em;
  transition: transform .45s var(--ease-soft), box-shadow .45s var(--ease-soft), background-color .3s, color .3s;
}
.btn-primary {
  background: var(--accent); color: var(--bg);
  box-shadow: 0 12px 30px -10px color-mix(in srgb, var(--accent) 55%, transparent);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 20px 40px -12px color-mix(in srgb, var(--accent) 65%, transparent); }
.btn-ghost {
  border: 1px solid var(--line);
  color: var(--cream);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-3px); }
.btn-arrow { transition: transform .35s var(--ease-out); display: inline-block; }
.btn:hover .btn-arrow { transform: translateX(4px); }

.magnetic-inner { display: inline-flex; align-items: center; gap: inherit; will-change: transform; transition: transform .8s var(--ease-soft); }
.has-magnetic { display: inline-flex; position: relative; isolation: isolate; }

/* Nav */
.nav {
  position: fixed; inset-inline: 0; top: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center;
  transition: background-color .4s var(--ease-out), backdrop-filter .4s var(--ease-out), box-shadow .4s var(--ease-out), border-color .4s var(--ease-out);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.nav-brand { display: flex; align-items: center; gap: .65rem; font-family: var(--serif); font-style: italic; font-size: 1.05rem; }
.nav-brand img { width: 26px; height: 26px; }
.nav-links { display: none; align-items: center; gap: 2.1rem; }
.nav-link { position: relative; padding: .25rem 0; font-size: .92rem; font-weight: 500; color: var(--cream-2); }
.nav-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px;
  height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right;
  transition: transform .45s var(--ease-out);
}
.nav-link:hover { color: var(--cream); }
.nav-link:hover::after { transform: scaleX(1); transform-origin: left; }
.nav-actions { display: flex; align-items: center; gap: 1rem; }

.theme-toggle {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  transition: border-color .3s, transform .3s var(--ease-out);
}
.theme-toggle:hover { border-color: var(--accent); transform: rotate(14deg); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }

.nav-burger { display: grid; place-items: center; width: 40px; height: 40px; }
.nav-burger span { position: relative; width: 20px; height: 1px; background: currentColor; display: block; }
.nav-burger span::before, .nav-burger span::after {
  content: ""; position: absolute; left: 0; width: 20px; height: 1px; background: currentColor;
  transition: transform .3s var(--ease-out), top .3s var(--ease-out);
}
.nav-burger span::before { top: -6px; }
.nav-burger span::after { top: 6px; }

.nav-mobile {
  position: fixed; inset: 0; z-index: 150;
  background: var(--bg); color: var(--cream);
  display: grid; place-items: center;
  clip-path: inset(0 0 100% 0);
  transition: clip-path .6s var(--ease-soft);
}
.nav-mobile[data-open="true"] { clip-path: inset(0); }
.nav-mobile-links { display: flex; flex-direction: column; gap: 1.6rem; text-align: center; }
.nav-mobile-links a { font-family: var(--serif); font-style: italic; font-size: 2rem; }
.nav-mobile-close { position: absolute; top: 22px; right: clamp(1.25rem, 4vw, 3rem); }

/* Forms */
.field { position: relative; margin-bottom: 1.3rem; }
.field input, .field textarea {
  width: 100%; padding: 1.35rem 1rem .55rem;
  border: 1px solid var(--line); border-radius: 10px;
  background: transparent; color: var(--cream);
  font-family: var(--sans); font-size: .98rem;
  transition: border-color .25s var(--ease-out);
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--accent); }
.field label {
  position: absolute; left: 1rem; top: 1.15rem;
  pointer-events: none; transition: all .22s var(--ease-out);
  color: var(--cream-3); font-size: .98rem;
}
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label {
  top: .5rem; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
}

.form-panel { position: relative; }
.form-submit { position: relative; width: 100%; justify-content: center; margin-top: .3rem; }
.form-submit-label { transition: opacity .2s; }
.form-submit-spinner, .form-submit-check { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; pointer-events: none; }
.form-panel.is-sending .form-submit-label { opacity: 0; }
.form-panel.is-sending .form-submit-spinner { opacity: 1; }
.form-submit-spinner::after {
  content: ""; width: 16px; height: 16px;
  border: 1.5px solid color-mix(in srgb, var(--bg) 30%, transparent); border-top-color: var(--bg);
  border-radius: 50%; animation: spin .85s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.form-success {
  margin-top: 1.4rem; padding: 1.1rem 1.3rem;
  border: 1px solid var(--accent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  opacity: 0; transform: translateY(8px);
  transition: opacity .6s var(--ease-out), transform .6s var(--ease-soft);
  pointer-events: none;
}
.form-success.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.form-panel.is-sent form { opacity: .35; pointer-events: none; }

/* Tilt (subtle depth, used sparingly) */
.has-tilt {
  --rx: 0deg; --ry: 0deg;
  transform: perspective(1000px) rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  transition: transform .6s var(--ease-soft);
}
.has-tilt:hover { transition-duration: .18s; }

/* =============================================================
   6. Sections
   ============================================================= */
section { padding-block: clamp(4.5rem, 10vw, 8.5rem); }

/* Hero */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; align-items: center;
  padding-top: var(--nav-h);
  overflow: clip;
  isolation: isolate;
}
.hero::before {
  content: ""; position: absolute; inset: -15% -10% -10% -10%; z-index: -1;
  background:
    radial-gradient(48% 40% at var(--mesh-x) var(--mesh-y), color-mix(in srgb, var(--accent) 38%, transparent), transparent 62%),
    conic-gradient(from var(--mesh-angle), color-mix(in srgb, var(--accent-2) 20%, transparent), transparent 35%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%);
  filter: blur(90px) saturate(120%);
  opacity: .8;
  animation: meshShift 26s linear infinite;
  mix-blend-mode: var(--mesh-blend, screen);
}
[data-theme="light"] .hero::before { --mesh-blend: multiply; opacity: .5; }
@keyframes meshShift {
  0%   { --mesh-angle: 0deg;   --mesh-x: 26%; --mesh-y: 34%; }
  50%  { --mesh-angle: 180deg; --mesh-x: 68%; --mesh-y: 58%; }
  100% { --mesh-angle: 360deg; --mesh-x: 26%; --mesh-y: 34%; }
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
  width: 100%;
}
.hero-copy { max-width: 640px; }
.hero-title {
  font-size: clamp(2.35rem, 5.6vw, 4.2rem);
  font-style: italic;
  font-variation-settings: "opsz" 60, "wght" 380;
  text-wrap: pretty;
  margin-bottom: 1.4rem;
}
.hero-sub { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--cream-2); max-width: 46ch; line-height: 1.7; margin-bottom: 2.2rem; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 1rem; }

.hero-figure {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 20px;
  overflow: hidden;
  max-width: 420px;
  justify-self: center;
}
.hero-figure img {
  width: 100%; height: 100%; object-fit: cover;
  filter: saturate(0.92) contrast(1.03);
}
.hero-figure::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(200deg, color-mix(in srgb, var(--accent) 22%, transparent), transparent 55%, color-mix(in srgb, var(--bg) 55%, transparent) 100%);
}

/* Practice / origin */
.practice-figure {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 3rem;
}
.practice-figure img {
  width: 100%; height: 100%; object-fit: cover;
  object-position: center 20%;
  filter: saturate(0.9);
  animation: ambientZoom 32s ease-in-out infinite;
}
@keyframes ambientZoom {
  0%, 100% { transform: scale(1.04) translate3d(0,0,0); }
  50%      { transform: scale(1.1) translate3d(-1%,-1%,0); }
}

/* Values / approach pillars */
.pillars {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  margin-top: 3rem;
}
.pillar { border-top: 1px solid var(--line); padding-top: 1.6rem; }
.pillar-num { font-family: var(--sans); font-size: .8rem; color: var(--accent); letter-spacing: .1em; }
.pillar-name { font-family: var(--serif); font-style: italic; font-size: 1.5rem; margin-block: .5rem .3rem; }
.pillar-gloss { font-size: .82rem; color: var(--cream-3); margin-bottom: .8rem; letter-spacing: .02em; }
.pillar-copy { color: var(--cream-2); font-size: .98rem; line-height: 1.7; }

.credentials-line {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
  font-size: .92rem;
  color: var(--cream-3);
  max-width: 62ch;
  line-height: 1.8;
}

/* Offer */
.offer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: start;
}
.offer-price {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  margin-block: 1.3rem .4rem;
}
.offer-price span { font-size: .55em; color: var(--cream-3); font-style: normal; font-family: var(--sans); }

.intro-panel {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: clamp(1.8rem, 3vw, 2.6rem);
  background: var(--bg-2);
  position: relative;
}
.intro-panel-image {
  width: 84px; height: 84px; border-radius: 50%;
  overflow: hidden; margin-bottom: 1.4rem;
}
.intro-panel-image img { width: 100%; height: 100%; object-fit: cover; }
.intro-panel h3 { font-size: 1.3rem; font-style: italic; margin-bottom: .7rem; }
.intro-panel p { color: var(--cream-2); font-size: .95rem; line-height: 1.7; margin-bottom: 1.5rem; }

/* Research teaser */
.research-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.6rem;
  align-items: end;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding-block: clamp(2.5rem, 5vw, 3.5rem);
}
.research-link {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--serif); font-style: italic; font-size: 1.2rem;
  color: var(--accent);
}

/* Connect */
.connect-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3.5rem;
}
.connect-side { display: flex; flex-direction: column; gap: 2.2rem; }
.connect-block h3 { font-size: 1.05rem; margin-bottom: .6rem; }
.connect-block p { color: var(--cream-2); font-size: .95rem; line-height: 1.7; }
.connect-block a.inline-link { color: var(--accent); border-bottom: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); }

.newsletter-row {
  display: flex; gap: .7rem; flex-wrap: wrap;
  margin-top: .9rem;
}
.newsletter-row input {
  flex: 1 1 200px;
  padding: .85rem 1rem; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--cream);
}
.newsletter-row button { flex-shrink: 0; }

/* Footer */
.footer {
  border-top: 1px solid var(--line);
  padding-block: 3rem;
}
.footer-inner {
  display: flex; flex-direction: column; gap: 2rem;
}
.footer-brand { display: flex; align-items: center; gap: .6rem; font-family: var(--serif); font-style: italic; font-size: 1.05rem; }
.footer-brand img { width: 24px; height: 24px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.6rem; font-size: .9rem; color: var(--cream-2); }
.footer-meta { font-size: .8rem; color: var(--cream-3); display: flex; justify-content: space-between; flex-wrap: wrap; gap: .8rem; }

/* =============================================================
   7. Effects
   ============================================================= */
[data-reveal] {
  opacity: 0; transform: translateY(36px);
  transition: opacity .85s var(--ease-soft), transform .85s var(--ease-soft);
}
[data-reveal].is-revealed { opacity: 1; transform: none; }

/* =============================================================
   8. Responsive
   ============================================================= */
@media (min-width: 540px) {
  .hero-ctas { flex-wrap: nowrap; }
}

@media (min-width: 720px) {
  .pillars { grid-template-columns: repeat(3, 1fr); }
  .offer-grid { grid-template-columns: 1.3fr 1fr; }
}

@media (min-width: 960px) {
  .nav-links { display: flex; }
  .nav-burger { display: none; }
  .hero-grid { grid-template-columns: 1.15fr .85fr; gap: 4rem; }
  .research-row { grid-template-columns: 1fr auto; }
  .connect-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1280px) {
  .hero-copy { max-width: 680px; }
}

/* =============================================================
   9. Reduced motion — only genuinely intrusive effects
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .practice-figure img { animation: none; }
  .hero::before { animation-duration: 60s; }
}
