:root {
  --bg: #000000;
  --bg-soft: #0a0a0a;
  --fg: #f5f4f0;
  --fg-muted: #8a8a86;
  --fg-dim: #55554f;
  --rule: rgba(245, 244, 240, 0.12);
  --accent: #f5f4f0;

  --f-serif: "Cormorant Garamond", "Times New Roman", Times, serif;
  --f-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --max: 1200px;
  --pad-x: clamp(20px, 5vw, 64px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-sans);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
}

::selection { background: var(--fg); color: var(--bg); }

a { color: inherit; text-decoration: none; }

/* ---------- Grain overlay ---------- */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.045;
  mix-blend-mode: screen;
  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='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.6 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ---------- Operational strip ---------- */
.ops-strip {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 9px var(--pad-x);
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted);
  background: #000;
  border-bottom: 1px solid var(--rule);
  pointer-events: none;
}

.ops-mid { opacity: 0.85; }

@media (max-width: 640px) {
  .ops-strip { font-size: 9.5px; letter-spacing: 0.1em; padding: 8px var(--pad-x); }
  .ops-mid { display: none; }
}


/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 34px;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px var(--pad-x);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  background: linear-gradient(to bottom, rgba(0,0,0,0.65), rgba(0,0,0,0.15));
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--fg);
  border-radius: 50%;
  font-size: 10px;
  font-family: var(--f-mono);
  letter-spacing: 0;
  transform: translateY(2px);
}

.nav-contact {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg);
  opacity: 0.75;
  transition: opacity 200ms ease;
}

.nav-contact:hover { opacity: 1; }

@media (max-width: 520px) {
  .brand-word { display: none; }
  .nav-contact { font-size: 11px; }
}

/* ---------- Layout ---------- */
main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

.hero {
  padding-top: clamp(140px, 22vh, 240px);
  padding-bottom: clamp(100px, 16vh, 180px);
  max-width: 1040px;
}

.eyebrow {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin: 0 0 40px;
}

.display {
  font-family: var(--f-serif);
  font-weight: 400;
  font-size: clamp(48px, 10vw, 140px);
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin: 0 0 48px;
}

.display span {
  display: block;
  font-style: italic;
}

.display span:nth-child(2) { font-style: normal; padding-left: clamp(24px, 6vw, 96px); }
.display span:nth-child(3) { font-style: normal; }

.lede {
  font-family: var(--f-serif);
  font-weight: 300;
  font-size: clamp(18px, 2.1vw, 24px);
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--fg);
  max-width: 680px;
  margin: 0;
}

/* ---------- Sections ---------- */
.section {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: clamp(24px, 6vw, 96px);
  padding: clamp(60px, 10vh, 120px) 0;
  border-top: 1px solid var(--rule);
}

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

.section-head .label {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted);
  position: sticky;
  top: 110px;
  display: inline-flex;
  align-items: baseline;
  gap: 14px;
}

.section-head .lnum {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--fg-dim);
  font-variant-numeric: tabular-nums;
}

.section-body {
  max-width: 720px;
}

.body {
  font-family: var(--f-serif);
  font-weight: 300;
  font-size: clamp(18px, 1.8vw, 22px);
  line-height: 1.5;
  letter-spacing: -0.005em;
  margin: 0 0 28px;
}

.body:last-child { margin-bottom: 0; }

.body.muted { color: var(--fg-muted); font-size: clamp(14px, 1.3vw, 16px); margin-top: 32px; }

/* ---------- Clients ---------- */
.clients {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.clients li {
  border-bottom: 1px solid var(--rule);
  padding: 24px 0;
  font-family: var(--f-serif);
  font-weight: 400;
  font-size: clamp(32px, 5.5vw, 62px);
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--fg);
}

.clients li:first-child { border-top: 1px solid var(--rule); }

/* ---------- Practice ---------- */
.practice-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.practice-list li {
  display: grid;
  grid-template-columns: 40px 1fr;
  column-gap: 24px;
  row-gap: 6px;
  padding: 28px 0;
  border-bottom: 1px solid var(--rule);
}

.practice-list li:first-child { border-top: 1px solid var(--rule); }

.pn {
  grid-column: 1;
  grid-row: 1 / span 2;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--fg-muted);
  letter-spacing: 0.08em;
  padding-top: 12px;
  font-variant-numeric: tabular-nums;
}

.pt {
  grid-column: 2;
  font-family: var(--f-serif);
  font-weight: 400;
  font-size: clamp(22px, 2.6vw, 32px);
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.pd {
  grid-column: 2;
  font-family: var(--f-serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(15px, 1.4vw, 17px);
  line-height: 1.5;
  color: var(--fg-muted);
  max-width: 560px;
}

@media (max-width: 520px) {
  .practice-list li {
    grid-template-columns: 28px 1fr;
    column-gap: 16px;
  }
}

/* ---------- Contact ---------- */
.contact-lede {
  font-family: var(--f-serif);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(22px, 3vw, 36px);
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 0 0 40px;
  max-width: 620px;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-serif);
  font-size: clamp(24px, 3.5vw, 40px);
  font-weight: 300;
  letter-spacing: -0.01em;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 6px;
  transition: border-color 200ms ease, gap 200ms ease;
}

.contact-link:hover {
  border-color: var(--fg);
  gap: 16px;
}

.contact-link svg {
  transition: transform 200ms ease;
}

.contact-link:hover svg {
  transform: translate(2px, -2px);
}

.meta {
  display: flex;
  gap: 64px;
  margin-top: 64px;
  flex-wrap: wrap;
}

.meta > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meta-label {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.meta-value {
  font-family: var(--f-serif);
  font-size: 16px;
  color: var(--fg);
}

/* ---------- Footer ---------- */
.foot {
  max-width: var(--max);
  margin: 0 auto;
  padding: 32px var(--pad-x) 40px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  border-top: 1px solid var(--rule);
  margin-top: 0;
}

.foot > span:first-child { text-align: left; }
.foot > .page-idx { text-align: center; color: var(--fg-dim); }
.foot > span:last-child { text-align: right; }

@media (max-width: 600px) {
  .foot { grid-template-columns: 1fr auto; font-size: 10px; }
  .foot > .page-idx { display: none; }
}

/* ---------- Reveal animations (pure CSS, IntersectionObserver adds .in-view) ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 900ms cubic-bezier(0.22, 1, 0.36, 1), transform 900ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

[data-reveal].in-view {
  opacity: 1;
  transform: translateY(0);
}

[data-reveal-chars] span {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 1100ms cubic-bezier(0.22, 1, 0.36, 1), transform 1100ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

[data-reveal-chars].in-view span {
  opacity: 1;
  transform: translateY(0);
}

[data-reveal-chars].in-view span:nth-child(1) { transition-delay: 100ms; }
[data-reveal-chars].in-view span:nth-child(2) { transition-delay: 240ms; }
[data-reveal-chars].in-view span:nth-child(3) { transition-delay: 380ms; }

.nav.is-scrolled {
  border-bottom: 1px solid rgba(245, 244, 240, 0.08);
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal],
  [data-reveal-chars] span {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- Cursor dot (desktop only) ---------- */
.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f5f4f0;
  pointer-events: none;
  z-index: 200;
  mix-blend-mode: difference;
  transform: translate3d(-100px, -100px, 0);
  will-change: transform, width, height;
  transition: width 320ms cubic-bezier(0.22, 1, 0.36, 1),
              height 320ms cubic-bezier(0.22, 1, 0.36, 1),
              background 240ms ease,
              border-width 240ms ease;
  display: none;
}

.cursor-dot.is-ready { display: block; }

.cursor-dot.is-hovering {
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid #f5f4f0;
}

@media (hover: none), (pointer: coarse), (prefers-reduced-motion: reduce) {
  .cursor-dot { display: none !important; }
}

/* Hide native cursor only when custom dot is active on fine pointer devices */
@media (hover: hover) and (pointer: fine) {
  html.custom-cursor,
  html.custom-cursor a,
  html.custom-cursor button,
  html.custom-cursor [role="button"] {
    cursor: none;
  }
}
