/* ============ Tokens ============ */
:root {
  --bg: #fafaf7;
  --bg-2: #f1f0ea;
  --fg: #0e0e10;
  --fg-dim: #525259;
  --fg-muted: #8a8a92;
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.18);
  --accent: #4f46e5;
  --accent-glow: rgba(79, 70, 229, 0.22);
  --accent-warm: #f97316;
  --serif: "Instrument Serif", ui-serif, Georgia, serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --container: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  cursor: none;
}
@media (max-width: 900px), (hover: none) {
  body { cursor: auto; }
  .cursor, .cursor-dot { display: none !important; }
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: none; }
img { max-width: 100%; display: block; }

::selection { background: var(--accent); color: #fff; }

/* ============ Background FX ============ */
.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 1;
  opacity: 0.05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.9'/></svg>");
}
.orb {
  position: fixed;
  z-index: 0;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.5;
  pointer-events: none;
  animation: drift 22s var(--ease) infinite alternate;
}
.orb-1 {
  width: 620px; height: 620px;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.18), transparent 65%);
  top: -200px; left: -200px;
  opacity: 0.7;
}
.orb-2 {
  width: 560px; height: 560px;
  background: radial-gradient(circle, rgba(249, 115, 22, 0.14), transparent 65%);
  top: 40%; right: -200px;
  animation-delay: -8s;
  opacity: 0.7;
}
@keyframes drift {
  0%   { transform: translate3d(0,0,0) scale(1); }
  50%  { transform: translate3d(40px,60px,0) scale(1.08); }
  100% { transform: translate3d(-30px,20px,0) scale(0.96); }
}

/* ============ Custom cursor ============ */
.cursor, .cursor-dot {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  transform: translate3d(-100px, -100px, 0);
  will-change: transform;
}
.cursor {
  width: 36px; height: 36px;
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 50%;
  transition: width 0.3s var(--ease), height 0.3s var(--ease), background 0.3s var(--ease), border-color 0.3s var(--ease);
  margin: -18px 0 0 -18px;
  mix-blend-mode: difference;
}
.cursor-dot {
  width: 4px; height: 4px;
  background: var(--fg);
  border-radius: 50%;
  margin: -2px 0 0 -2px;
}
.cursor.is-hover {
  width: 64px; height: 64px;
  margin: -32px 0 0 -32px;
  background: rgba(255,255,255,0.18);
  border-color: transparent;
}

/* ============ Layout ============ */
.nav, main > section, .footer {
  position: relative;
  z-index: 2;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(20px, 4vw, 48px);
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  transition: background 0.4s var(--ease), backdrop-filter 0.4s var(--ease), border-color 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(250, 250, 247, 0.78);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom-color: var(--line);
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.01em;
}
.logo-text {
  font-family: var(--serif);
  font-size: 26px;
  font-style: italic;
  letter-spacing: -0.02em;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 34px);
  font-size: 14px;
  color: var(--fg-dim);
}
.nav-links a { transition: color 0.25s var(--ease); }
.nav-links a:hover { color: var(--fg); }
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--fg) !important;
  background: rgba(0,0,0,0.02);
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
}
.nav-cta:hover {
  background: var(--fg);
  color: var(--bg) !important;
  border-color: var(--fg);
}
@media (max-width: 640px) {
  .nav-links a:not(.nav-cta) { display: none; }
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  transition: transform 0.3s var(--ease), background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
  will-change: transform;
}
.btn-primary {
  background: var(--fg);
  color: var(--bg);
}
.btn-primary:hover {
  background: var(--accent);
  color: #fff;
}
.btn-ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--line-strong);
}
.btn-ghost:hover {
  border-color: var(--fg);
  background: rgba(0,0,0,0.04);
}
.btn-large {
  padding: 20px 32px;
  font-size: 17px;
}

/* ============ Hero ============ */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  padding: 160px clamp(20px, 4vw, 48px) 100px;
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}
.hero-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--fg-dim);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 36px;
  align-self: flex-start;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(6px);
}
.dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.hero-title {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(48px, 9.2vw, 148px);
  line-height: 0.95;
  letter-spacing: -0.035em;
  margin: 0 0 36px;
}
.hero-title .line {
  display: block;
  overflow: hidden;
}
.hero-title em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.015em;
  background: linear-gradient(90deg, var(--accent-warm), var(--accent) 55%, var(--accent-warm));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-right: 0.08em;
  animation: shimmer 10s linear infinite;
}
.hero-sub {
  max-width: 620px;
  font-size: clamp(17px, 1.35vw, 21px);
  color: var(--fg-dim);
  line-height: 1.55;
  margin: 0 0 42px;
}
.hero-ctas {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-scroll {
  position: absolute;
  bottom: 40px;
  left: clamp(20px, 4vw, 48px);
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.hero-scroll-line {
  width: 56px;
  height: 1px;
  background: linear-gradient(90deg, var(--fg-muted), transparent);
  position: relative;
  overflow: hidden;
}
.hero-scroll-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--fg);
  transform: translateX(-100%);
  animation: scrollHint 2.4s var(--ease) infinite;
}
@keyframes scrollHint {
  0% { transform: translateX(-100%); }
  60% { transform: translateX(100%); }
  100% { transform: translateX(100%); }
}

/* ============ Marquee ============ */
.marquee {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 28px 0;
  background: var(--bg-2);
}
.marquee-track {
  display: inline-flex;
  gap: 36px;
  white-space: nowrap;
  animation: marquee 44s linear infinite;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(36px, 6vw, 80px);
  color: var(--fg-muted);
  letter-spacing: -0.02em;
  padding-left: 36px;
}
.marquee-track span:nth-child(odd) {
  color: var(--fg);
}
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ============ Sections ============ */
.section {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(100px, 14vw, 180px) clamp(20px, 4vw, 48px);
}
.section-head {
  margin-bottom: 72px;
  max-width: 820px;
}
.eyebrow {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 24px;
}
.section-title {
  font-size: clamp(36px, 5.2vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  font-weight: 500;
  margin: 0 0 24px;
}
.section-title em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}
.section-lede {
  font-size: clamp(16px, 1.2vw, 19px);
  color: var(--fg-dim);
  max-width: 640px;
  margin: 0;
}

/* ============ Cards ============ */
.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
@media (max-width: 820px) {
  .cards { grid-template-columns: 1fr; }
}
.card {
  position: relative;
  padding: 44px clamp(26px, 3.4vw, 44px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff, var(--bg-2));
  overflow: hidden;
  transition: border-color 0.4s var(--ease), transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}
.card:hover {
  box-shadow: 0 24px 48px -24px rgba(79,70,229,0.18), 0 2px 8px rgba(0,0,0,0.04);
}
.card:hover {
  border-color: var(--line-strong);
  transform: translateY(-4px);
}
.card-num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  color: var(--fg-muted);
  margin-bottom: 60px;
}
.card-title {
  font-size: clamp(32px, 3.4vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  font-weight: 500;
  margin: 0 0 18px;
}
.card-body {
  color: var(--fg-dim);
  margin: 0 0 28px;
  font-size: 16px;
  line-height: 1.6;
  max-width: 46ch;
}
.card-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--line);
}
.card-list li {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  color: var(--fg);
  display: flex;
  align-items: center;
  gap: 12px;
}
.card-list li::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}
.card-glow {
  position: absolute;
  pointer-events: none;
  width: 420px; height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow), transparent 60%);
  filter: blur(60px);
  opacity: 0;
  top: var(--my, 50%);
  left: var(--mx, 50%);
  transform: translate(-50%, -50%);
  transition: opacity 0.4s var(--ease);
}
.card:hover .card-glow { opacity: 0.25; }

/* ============ Steps ============ */
.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0;
  counter-reset: steps;
  border-top: 1px solid var(--line);
}
.step {
  display: grid;
  grid-template-columns: 80px 1fr 2fr;
  gap: 40px;
  padding: 44px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
  transition: background 0.4s var(--ease), padding 0.4s var(--ease);
  position: relative;
}
.step:hover {
  background: linear-gradient(90deg, rgba(79,70,229,0.04), transparent 70%);
  padding-left: 16px;
}
.step-num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 28px;
  color: var(--accent);
}
.step h3 {
  font-size: clamp(26px, 2.6vw, 36px);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0;
}
.step p {
  color: var(--fg-dim);
  font-size: 16px;
  line-height: 1.6;
  margin: 0;
  max-width: 58ch;
}
@media (max-width: 820px) {
  .step {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* ============ Stack ============ */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
}
@media (max-width: 900px) { .stack-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .stack-grid { grid-template-columns: 1fr; } }
.stack-col {
  background: var(--bg);
  padding: 36px 32px;
  transition: background 0.3s var(--ease);
}
.stack-col:hover {
  background: var(--bg-2);
}
.stack-col h4 {
  font-family: var(--serif);
  font-style: italic;
  font-size: 26px;
  font-weight: 400;
  margin: 0 0 24px;
  color: var(--accent);
  letter-spacing: -0.01em;
}
.stack-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.stack-col li {
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-size: 15px;
  color: var(--fg-dim);
  transition: color 0.2s var(--ease);
}
.stack-col li:hover { color: var(--fg); }

/* ============ Principles ============ */
.principles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
}
@media (max-width: 720px) { .principles-grid { grid-template-columns: 1fr; } }
.principle {
  background: var(--bg);
  padding: 44px 40px;
  min-height: 220px;
}
.principle h3 {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(26px, 2.6vw, 34px);
  margin: 0 0 14px;
  letter-spacing: -0.015em;
}
.principle p {
  color: var(--fg-dim);
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
  max-width: 40ch;
}

/* ============ CTA ============ */
.cta {
  text-align: center;
  padding-top: clamp(120px, 16vw, 220px);
  padding-bottom: clamp(120px, 16vw, 220px);
}
.cta-inner { max-width: 840px; margin: 0 auto; }
.cta .eyebrow { margin-bottom: 36px; }
.cta-title {
  font-size: clamp(42px, 7vw, 112px);
  line-height: 1;
  letter-spacing: -0.035em;
  font-weight: 500;
  margin: 0 0 32px;
}
.cta-title em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  background: linear-gradient(90deg, var(--accent-warm), var(--accent), var(--accent-warm));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 8s linear infinite;
}
@keyframes shimmer {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}
.cta-sub {
  font-size: clamp(17px, 1.3vw, 20px);
  color: var(--fg-dim);
  max-width: 560px;
  margin: 0 auto 48px;
}
.cta-note {
  margin-top: 24px;
  font-size: 13px;
  color: var(--fg-muted);
  letter-spacing: 0.02em;
}

/* ============ Footer ============ */
.footer {
  border-top: 1px solid var(--line);
  padding: 40px clamp(20px, 4vw, 48px);
  max-width: var(--container);
  margin: 0 auto;
}
.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 14px 0;
}
.footer-meta {
  color: var(--fg-muted);
  font-size: 14px;
  display: flex;
  gap: 10px;
}
.footer-bottom {
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 24px;
  font-size: 13px;
  color: var(--fg-muted);
}
.footer-bottom a { transition: color 0.2s var(--ease); }
.footer-bottom a:hover { color: var(--fg); }

/* ============ Reveal animations ============ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
  transition-delay: var(--d, 0ms);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}
.hero-title .line.reveal > * {
  display: inline-block;
  opacity: 0;
  transform: translateY(100%);
  transition: transform 1s var(--ease-out), opacity 1s var(--ease-out);
  transition-delay: var(--d, 0ms);
}
.hero-title .line.reveal.in > * {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .reveal, .reveal.in, .hero-title .line.reveal > *, .hero-title .line.reveal.in > * {
    opacity: 1 !important;
    transform: none !important;
  }
}
