:root {
  --bg: #0a0b0d;
  --bg-2: #0f1115;
  --surface: #14171c;
  --line: #1f242c;
  --line-2: #2a313b;
  --fg: #e8ecf2;
  --fg-2: #a4adba;
  --fg-3: #6b7380;
  --accent: oklch(78% 0.16 200);
  --accent-2: oklch(70% 0.18 280);
  --font-sans: "Geist", "Inter", system-ui, sans-serif;
  --font-mono: "Geist Mono", "JetBrains Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
}

a { color: inherit; }

[data-reveal] {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 700ms ease, transform 700ms cubic-bezier(.2,.7,.2,1);
}
[data-revealed] {
  opacity: 1;
  transform: none;
}

/* ============== NAV ============== */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 56px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: color-mix(in oklab, var(--bg) 72%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms;
}
.nav.scrolled { border-color: var(--line); }

.logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 14px; letter-spacing: 0;
  text-decoration: none; color: var(--fg);
}
.logo-mark {
  width: 22px; height: 22px; border-radius: 6px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  position: relative;
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--accent) 35%, transparent);
}
.logo-mark::after {
  content: ""; position: absolute; inset: 5px;
  border-radius: 3px;
  background: var(--bg);
}
.logo-mark::before {
  content: ""; position: absolute; left: 9px; top: 5px; bottom: 5px; width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  z-index: 1;
}

.nav-links { display: flex; gap: 36px; font-size: 14px; color: var(--fg-2); }
.nav-links a { color: inherit; text-decoration: none; transition: color 160ms; }
.nav-links a:hover, .nav-links a:focus-visible { color: var(--fg); }

.nav-cta {
  font-family: var(--font-sans); font-size: 13px; padding: 9px 16px;
  border: 1px solid var(--line-2); border-radius: 999px;
  background: var(--surface); color: var(--fg);
  cursor: pointer; transition: all 160ms;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.nav-cta:hover, .nav-cta:focus-visible { border-color: var(--accent); color: var(--accent); }

.nav-burger {
  display: none;
  background: transparent; border: 1px solid var(--line-2);
  border-radius: 8px; padding: 8px 10px;
  color: var(--fg); cursor: pointer;
  font-family: var(--font-mono); font-size: 12px;
}

/* ============== HERO ============== */
.hero {
  position: relative; padding: 100px 56px 120px; overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.hero-grid-bg {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 70% 30%, black 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 60% at 70% 30%, black 30%, transparent 75%);
  opacity: 0.55;
  pointer-events: none;
}
.hero-glow {
  position: absolute; right: -10%; top: -10%; width: 60%; aspect-ratio: 1;
  background: radial-gradient(circle, color-mix(in oklab, var(--accent) 35%, transparent), transparent 70%);
  filter: blur(80px); pointer-events: none;
}
.hero-glow-2 {
  position: absolute; left: -5%; bottom: -20%; width: 50%; aspect-ratio: 1;
  background: radial-gradient(circle, color-mix(in oklab, var(--accent-2) 28%, transparent), transparent 70%);
  filter: blur(80px); pointer-events: none;
}
.hero-inner { position: relative; max-width: 1280px; margin: 0 auto; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 12px; color: var(--fg-2);
  padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 999px;
  background: color-mix(in oklab, var(--surface) 70%, transparent);
}
.eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

h1 {
  font-size: clamp(48px, 6vw, 84px); line-height: 0.98; letter-spacing: -0.035em;
  font-weight: 500; margin: 28px 0 24px; max-width: 18ch;
}
h1 em {
  font-style: normal;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.hero-sub {
  font-size: 19px; line-height: 1.55; color: var(--fg-2); max-width: 56ch;
  margin: 0 0 40px;
}

.hero-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 22px; border-radius: 10px;
  font-size: 14px; font-weight: 500; cursor: pointer;
  border: 1px solid transparent; transition: all 160ms;
  font-family: inherit;
  text-decoration: none;
}
.btn-primary {
  background: var(--fg); color: var(--bg);
}
.btn-primary:hover, .btn-primary:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px -12px color-mix(in oklab, var(--accent) 60%, transparent);
}
.btn-ghost {
  background: transparent; color: var(--fg); border-color: var(--line-2);
}
.btn-ghost:hover, .btn-ghost:focus-visible { border-color: var(--fg-3); }
.btn .arr { transition: transform 200ms; }
.btn:hover .arr { transform: translateX(3px); }

.hero-meta {
  margin-top: 80px; display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 0; border-top: 1px solid var(--line); padding-top: 32px;
}
.hero-meta > div { padding-right: 24px; border-right: 1px solid var(--line); }
.hero-meta > div:last-child { border-right: none; }
.hero-meta .k { font-family: var(--font-mono); font-size: 11px; color: var(--fg-3); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px; }
.hero-meta .v { font-size: 28px; font-weight: 500; letter-spacing: -0.02em; }
.hero-meta .vsub { font-size: 13px; color: var(--fg-2); margin-top: 2px; }

/* ============== CODE PANEL ============== */
.code-panel {
  margin-top: 64px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--bg-2); overflow: hidden;
}
.code-head {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 18px; border-bottom: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 12px; color: var(--fg-3);
}
.code-dots { display: flex; gap: 6px; }
.code-dots span { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.code-live { margin-left: auto; color: var(--accent); }
.code-body {
  font-family: var(--font-mono); font-size: 13px; line-height: 1.7;
  padding: 20px 24px; color: var(--fg-2); white-space: pre;
  overflow-x: auto; margin: 0;
}
.code-body .cm { color: var(--fg-3); }
.code-body .kw { color: var(--accent); }
.code-body .st { color: oklch(80% 0.13 100); }
.code-body .nm { color: var(--accent-2); }

/* ============== SECTIONS ============== */
section { padding: 120px 56px; border-bottom: 1px solid var(--line); position: relative; }
.section-inner { max-width: 1280px; margin: 0 auto; }
.sec-tag { font-family: var(--font-mono); font-size: 12px; color: var(--fg-3); text-transform: uppercase; letter-spacing: 0.1em; }
.sec-title { font-size: clamp(36px, 4.5vw, 56px); line-height: 1.04; letter-spacing: -0.025em; font-weight: 500; margin: 16px 0 20px; max-width: 22ch; }
.sec-title em { font-style: normal; color: var(--accent); }
.sec-lede { font-size: 18px; color: var(--fg-2); max-width: 60ch; line-height: 1.55; }

/* ============== SERVICES ============== */
.svc-grid {
  margin-top: 64px;
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 1px;
  background: var(--line);
  border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
}
.svc-card {
  background: var(--bg-2); padding: 36px 32px;
  display: flex; flex-direction: column; gap: 14px;
  transition: background 220ms;
  position: relative;
}
.svc-card:hover { background: var(--surface); }
.svc-card.span-6 { grid-column: span 6; }
.svc-card.span-4 { grid-column: span 4; }
.svc-card.span-12 { grid-column: span 12; }
.svc-num {
  font-family: var(--font-mono); font-size: 11px; color: var(--fg-3);
  letter-spacing: 0.08em;
}
.svc-title { font-size: 22px; font-weight: 500; letter-spacing: -0.015em; margin: 0; }
.svc-desc { font-size: 15px; line-height: 1.6; color: var(--fg-2); flex: 1; }
.svc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.svc-tag {
  font-family: var(--font-mono); font-size: 11px; padding: 4px 9px;
  border: 1px solid var(--line-2); border-radius: 999px; color: var(--fg-2);
}

/* ============== EXPERT WITNESS ============== */
.ew {
  background: linear-gradient(180deg, var(--bg), var(--bg-2));
}
.ew-grid {
  margin-top: 64px;
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 80px; align-items: start;
}
.ew-list { display: flex; flex-direction: column; }
.ew-item {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 20px;
  padding: 24px 0; border-bottom: 1px solid var(--line);
  align-items: baseline;
  cursor: pointer; transition: padding 220ms;
}
.ew-item:hover { padding-left: 8px; }
.ew-item:hover .ew-name { color: var(--accent); }
.ew-num { font-family: var(--font-mono); font-size: 12px; color: var(--fg-3); }
.ew-name { font-size: 19px; font-weight: 500; transition: color 200ms; margin: 0; }
.ew-name small { display: block; font-size: 13px; font-weight: 400; color: var(--fg-2); margin-top: 4px; }
.ew-arrow { color: var(--fg-3); font-family: var(--font-mono); }

.doc-mock {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; position: relative;
}
.doc-mock-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 11px; color: var(--fg-3);
  text-transform: uppercase; letter-spacing: 0.1em;
}
.doc-mock-head .stamp {
  padding: 3px 8px; border: 1px solid var(--accent); color: var(--accent);
  border-radius: 4px; font-size: 10px;
}
.doc-mock-body { padding: 28px; font-family: var(--font-mono); font-size: 12px; line-height: 1.8; color: var(--fg-2); }
.doc-line { display: flex; gap: 18px; }
.doc-line .ln { color: var(--fg-3); width: 24px; text-align: right; user-select: none; }
.doc-line .tx { flex: 1; }
.doc-line .tx em { font-style: normal; color: var(--accent); }
.doc-line .tx b { font-weight: 400; color: var(--fg); }
.doc-line .tx .hl { background: color-mix(in oklab, var(--accent) 18%, transparent); padding: 1px 4px; border-radius: 3px; }

/* ============== ABOUT ============== */
.about-body-wrap { margin-top: 64px; }
.about-bio { max-width: 64ch; }

.about-lede {
  font-size: 22px; line-height: 1.45; color: var(--fg);
  letter-spacing: -0.01em;
  padding-bottom: 28px; border-bottom: 1px solid var(--line); margin-bottom: 28px;
}
.about-lede em { font-style: normal; color: var(--accent); }
.about-body { font-size: 16px; line-height: 1.65; color: var(--fg-2); }
.about-body p { margin: 0 0 16px; }

.principles {
  margin-top: 40px;
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
.principle {
  background: var(--bg-2); padding: 22px 22px;
  display: flex; flex-direction: column; gap: 8px;
  transition: background 200ms;
}
.principle:hover { background: var(--surface); }
.principle .num { font-family: var(--font-mono); font-size: 11px; color: var(--fg-3); letter-spacing: 0.08em; }
.principle .name { font-size: 15px; font-weight: 500; letter-spacing: -0.01em; }
.principle .desc { font-size: 13px; color: var(--fg-2); line-height: 1.55; }

.principal {
  margin-top: 48px;
  display: grid; grid-template-columns: 280px 1fr; gap: 48px; align-items: start;
  padding-top: 48px; border-top: 1px solid var(--line);
}
.principal-photo {
  width: 280px; height: 280px; border-radius: 18px; overflow: hidden;
  border: 1px solid var(--line-2);
  background: var(--bg-2);
}
.principal-photo img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  object-position: center top;    /* anchor to the top */
}
.principal-detail { display: flex; flex-direction: column; gap: 10px; }
.principal-detail .sec-tag { margin-bottom: 6px; }
.principal-name {
  font-size: 28px; font-weight: 500; letter-spacing: -0.02em; margin: 0;
}
.principal-title {
  font-family: var(--font-mono); font-size: 13px; color: var(--fg-2);
  letter-spacing: 0.02em;
}
.principal-affil {
  font-size: 14px; color: var(--fg-2); margin-bottom: 8px;
}
.principal-bio-text {
  margin: 8px 0 0; font-size: 15px; line-height: 1.65; color: var(--fg-2);
  max-width: 60ch;
}
.principal-bio-text em {
  font-style: normal; color: var(--accent);
}
.principal-bio-text a {
  color: var(--fg); text-decoration: underline; text-decoration-color: var(--line-2);
  text-underline-offset: 3px; transition: text-decoration-color 160ms;
}
.principal-bio-text a:hover { text-decoration-color: var(--accent); }
.principal-bio-text cite { font-style: italic; }

@media (max-width: 760px) {
  .principal { grid-template-columns: 1fr; gap: 28px; }
  .principal-photo { width: 200px; height: 200px; }
}

/* ============== EXPERTISE MATRIX ============== */
.matrix {
  margin-top: 64px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
}
.matrix-cell {
  background: var(--bg-2); padding: 28px 24px;
  display: flex; flex-direction: column; gap: 12px; min-height: 180px;
  transition: background 220ms;
}
.matrix-cell:hover { background: var(--surface); }
.matrix-glyph {
  width: 32px; height: 32px; border-radius: 8px;
  background: color-mix(in oklab, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in oklab, var(--accent) 35%, transparent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 13px; color: var(--accent);
}
.matrix-name { font-size: 16px; font-weight: 500; letter-spacing: -0.01em; }
.matrix-desc { font-size: 13px; color: var(--fg-2); line-height: 1.5; }

/* ============== CONTACT ============== */
.contact { padding: 120px 56px; background: var(--bg-2); border-bottom: none; }
.contact-inner { max-width: 1080px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1.1fr; gap: 80px; align-items: start; }
.contact h2 { font-size: clamp(36px, 4vw, 52px); font-weight: 500; letter-spacing: -0.025em; line-height: 1.05; margin: 16px 0 24px; }
.contact p { color: var(--fg-2); line-height: 1.6; font-size: 16px; max-width: 42ch; }
.contact-meta { margin-top: 36px; display: flex; flex-direction: column; gap: 14px; font-family: var(--font-mono); font-size: 13px; }
.contact-meta .row { display: grid; grid-template-columns: 90px 1fr; gap: 14px; color: var(--fg-2); }
.contact-meta .row .k { color: var(--fg-3); text-transform: uppercase; font-size: 11px; letter-spacing: 0.08em; padding-top: 2px; }

.form { display: flex; flex-direction: column; gap: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-family: var(--font-mono); font-size: 11px; color: var(--fg-3); text-transform: uppercase; letter-spacing: 0.08em; }
.field input, .field textarea, .field select {
  background: var(--bg); border: 1px solid var(--line-2); border-radius: 8px;
  color: var(--fg); padding: 12px 14px; font-family: inherit; font-size: 14px;
  outline: none; transition: border-color 160ms, box-shadow 160ms;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 18%, transparent);
}
.field textarea { min-height: 120px; resize: vertical; }
.field .err { color: oklch(70% 0.18 25); font-size: 12px; font-family: var(--font-mono); }
.submit {
  align-self: flex-start;
  background: var(--fg); color: var(--bg);
  padding: 13px 24px; border-radius: 10px;
  font-size: 14px; font-weight: 500; cursor: pointer; border: none;
  display: inline-flex; align-items: center; gap: 10px;
  transition: all 200ms;
  font-family: inherit;
}
.submit:hover, .submit:focus-visible { transform: translateY(-1px); }

.ok {
  padding: 28px; border: 1px solid var(--accent);
  background: color-mix(in oklab, var(--accent) 6%, transparent);
  border-radius: 12px; color: var(--fg);
  display: flex; flex-direction: column; gap: 8px;
}
.ok .ok-tag { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); }
.ok .ok-head { font-size: 18px; font-weight: 500; }
.ok .ok-body { color: var(--fg-2); font-size: 14px; line-height: 1.6; }

/* ============== FOOTER ============== */
.site-footer {
  padding: 40px 56px;
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono); font-size: 12px; color: var(--fg-3);
  border-top: 1px solid var(--line);
}

/* ============== RESPONSIVE ============== */
@media (max-width: 1279px) {
  .nav { padding: 18px 40px; }
  .hero { padding: 80px 40px 100px; }
  section, .contact { padding: 100px 40px; }
  .site-footer { padding: 32px 40px; }
}

@media (max-width: 1023px) {
  .nav-links { display: none; }
  .nav-burger { display: inline-flex; }
  .hero-meta { grid-template-columns: repeat(2, 1fr); gap: 24px 0; }
  .hero-meta > div:nth-child(2) { border-right: none; }
  .svc-card.span-6, .svc-card.span-4 { grid-column: span 6; }
  .ew-grid { grid-template-columns: 1fr; gap: 48px; }
  .matrix { grid-template-columns: repeat(2, 1fr); }
  .contact-inner { grid-template-columns: 1fr; gap: 48px; }
}

@media (max-width: 767px) {
  .nav { padding: 16px 24px; }
  .hero { padding: 64px 24px 80px; }
  section, .contact { padding: 64px 24px; }
  .site-footer { padding: 24px 24px; flex-wrap: wrap; gap: 8px; }
  h1 { font-size: clamp(40px, 8vw, 56px); }
  .hero-meta { grid-template-columns: 1fr; }
  .hero-meta > div { border-right: none; padding-right: 0; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
  .hero-meta > div:last-child { border-bottom: none; padding-bottom: 0; }
  .svc-grid, .principles, .matrix { grid-template-columns: 1fr; }
  .svc-card.span-6, .svc-card.span-4, .svc-card.span-12 { grid-column: span 1; }
  .form-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}

/* mobile menu open */
.nav-mobile-open .nav-links {
  display: flex;
  position: absolute; top: 100%; left: 0; right: 0;
  flex-direction: column; gap: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 8px 24px 16px;
}
.nav-mobile-open .nav-links a {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.nav-mobile-open .nav-links a:last-child { border-bottom: none; }
