:root {
  --bg: #fbfcfd;
  --ink: #12222b;
  --muted: #55646d;
  --line: #d6e0e6;
  --tint: #eaf1f5;
  --accent: #0f4c5c;
  --accent-soft: #e1eef1;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --nav-w: 76px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; color-scheme: light; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

/* Parallax background */
.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; color: var(--accent); }
.bg-grid {
  position: absolute; inset: -200px 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: .22;
  will-change: transform;
}
.bg-diagram { position: absolute; width: 300px; height: 300px; opacity: .13; will-change: transform; }
.d1 { right: 4%; top: 55%; }
.d2 { left: 14%; top: 85%; width: 260px; height: 260px; }
.d3 { right: 22%; top: 130%; width: 220px; height: 220px; }

main, .side { position: relative; z-index: 1; }
main { padding-left: var(--nav-w); }
.wrap { width: min(1080px, 100% - 64px); margin-inline: auto; }

/* Side navigation */
.side {
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--nav-w);
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px;
  z-index: 10;
}
.side a {
  position: relative; width: 44px; height: 44px; border-radius: 10px;
  display: grid; place-items: center; color: var(--muted); text-decoration: none;
  transition: color .2s, background .2s;
}
.side svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.side a span {
  position: absolute; left: 54px; padding: 4px 10px; border-radius: 6px;
  background: var(--ink); color: #fff; font: 500 12px var(--mono);
  opacity: 0; transform: translateX(-4px); pointer-events: none; white-space: nowrap;
  transition: opacity .2s, transform .2s;
}
.side a:hover span, .side a:focus-visible span { opacity: 1; transform: none; }
.side a:hover { color: var(--accent); background: var(--accent-soft); }
.side a.active { color: #fff; background: var(--accent); }
.side a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Type */
.label { font: 500 13px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); line-height: 1.02; letter-spacing: -.035em; font-weight: 700; }
h2 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.08; letter-spacing: -.03em; font-weight: 700; margin-bottom: 18px; }
h3 { font-size: 1.2rem; letter-spacing: -.01em; margin-bottom: 8px; }
.intro { max-width: 680px; color: var(--muted); font-size: 1.1rem; margin-bottom: 40px; }
.tag { font: 500 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }

.section { padding: 110px 0; }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.btn {
  display: inline-block; padding: 13px 24px; border-radius: 10px; text-decoration: none;
  font-weight: 600; font-size: .95rem; border: 1px solid var(--ink); background: #fff; color: var(--ink);
  transition: background .2s, color .2s, border-color .2s;
}
.btn:hover { background: var(--ink); color: #fff; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #0a3a47; border-color: #0a3a47; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Hero */
.hero { background: linear-gradient(180deg, var(--tint), #f3f7fa); border-bottom: 1px solid var(--line); overflow: hidden; position: relative; }
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(#cfdde5 1px, transparent 1px), linear-gradient(90deg, #cfdde5 1px, transparent 1px);
  background-size: 48px 48px; opacity: .22;
}
.hero-in { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; align-items: end; gap: 24px; }
.hero-text { align-self: center; padding: 80px 0 52px; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font: 500 13px var(--mono); letter-spacing: .06em; text-transform: uppercase; background: #fff; border: 1px solid var(--line); padding: 6px 14px; border-radius: 999px; margin-bottom: 24px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #1d9a6c; }
.lead { font-size: clamp(1.25rem, 2.2vw, 1.65rem); line-height: 1.3; margin-top: 22px; max-width: 560px; font-weight: 500; }
.sub { color: var(--muted); margin-top: 14px; max-width: 520px; }
/* Circular portrait rises from the banner's bottom edge and is cut off by it */
.hero-photo { align-self: end; justify-self: center; width: min(100%, 460px); line-height: 0; margin-bottom: -16%; }
.hero-photo img { width: 100%; height: auto; border-radius: 50%; border: 10px solid #fff; background: #fff; }

/* Cards */
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 28px; }
.num { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--accent); border-radius: 8px; color: var(--accent); font: 600 14px var(--mono); margin-bottom: 18px; }
.card p, .multiplier p, .project p:not(.tag) { color: var(--muted); }

.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
/* Rail: stations under each card, joined into one line that ends in the agentic bar */
.rail { --c: calc((100% - 40px) / 6); position: relative; height: 84px; color: var(--accent); }
.rail::before { content: ""; position: absolute; top: 34px; left: var(--c); right: var(--c); height: 2px; background: currentColor; }
.rail::after { /* line down into the multiplier, with arrowhead */
  content: ""; position: absolute; left: 50%; top: 34px; bottom: 0; width: 2px; margin-left: -1px; background: currentColor;
}
.stop { position: absolute; top: 0; width: 2px; height: 34px; margin-left: -1px; background: currentColor; }
.stop::after { content: ""; position: absolute; left: 50%; bottom: -7px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: #fff; border: 2px solid currentColor; box-sizing: border-box; }
.s1 { left: var(--c); } .s2 { left: 50%; } .s3 { left: calc(100% - var(--c)); }
.s2::after { background: currentColor; }
.multiplier {
  position: relative; margin-top: 0; display: flex; gap: 22px; align-items: center;
  background: var(--accent); color: #fff; border-radius: 14px; padding: 30px 32px;
}
.multiplier .num { border-color: rgba(255,255,255,.6); color: #fff; margin: 0; flex: none; }
.multiplier p { color: rgba(255,255,255,.85); max-width: 640px; }
.multiplier h3 { margin-bottom: 4px; }

.agentic-note { max-width: 720px; margin-top: 28px; color: var(--muted); font-size: 1.05rem; }

/* Projects */
.projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.project { display: flex; flex-direction: column; }
.fig {
  position: relative; aspect-ratio: 16 / 10; margin-bottom: 20px; overflow: hidden;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; color: var(--accent);
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 20px 20px;
}
.fig svg, .fig img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fig figcaption { position: absolute; left: 12px; bottom: 8px; font: 500 11px var(--mono); letter-spacing: .06em; color: var(--muted); text-transform: uppercase; background: #fff; padding: 2px 6px; }
.fig img + figcaption { display: none; }

/* Track record */
.record { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; margin-top: 8px; }
.timeline { list-style: none; position: relative; padding-left: 30px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 2px; background: var(--accent); }
.timeline li { position: relative; padding-bottom: 32px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -30px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.when { display: block; font: 500 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.timeline p, .work p:not(.tag) { color: var(--muted); }
.work article { padding: 0 0 22px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.work .meta { color: var(--muted); font: 400 13px var(--mono); }
.work .tag { margin-bottom: 14px; }

/* Tracks */
.tracks { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 40px; }
.track { padding: 34px; }

/* Contact */
.contact .foot { margin-top: 100px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font: 400 13px var(--mono); }

/* Reveal */
.js .section .wrap > * { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.js .section.in .wrap > * { opacity: 1; transform: none; }
.js .section.in .wrap > *:nth-child(2) { transition-delay: .06s; }
.js .section.in .wrap > *:nth-child(3) { transition-delay: .12s; }
.js .section.in .wrap > *:nth-child(4) { transition-delay: .18s; }
.js .section.in .wrap > *:nth-child(5) { transition-delay: .24s; }

/* Tablet */
@media (max-width: 960px) {
  .pillars, .projects { grid-template-columns: 1fr; }
  .rail { height: 48px; }
  .rail::before, .s1, .s3 { display: none; }
  .rail::after { top: 0; }
  .s2 { height: 0; } .s2::after { bottom: 20px; }
  .projects { gap: 40px; }
  .tracks { grid-template-columns: 1fr; }
  .record { grid-template-columns: 1fr; gap: 40px; }
}

/* Phone: nav moves to a bottom bar */
@media (max-width: 720px) {
  main { padding-left: 0; padding-bottom: 76px; }
  .wrap { width: calc(100% - 40px); }
  .side {
    top: auto; width: 100%; height: 64px; flex-direction: row; justify-content: space-around; padding: 0 8px;
    background: rgba(251,252,253,.94); border-top: 1px solid var(--line); backdrop-filter: blur(8px);
  }
  .side a span { display: none; }
  .section { padding: 80px 0; }
  .hero-in { grid-template-columns: 1fr; gap: 0; }
  .hero-text { padding: 44px 0 40px; }
  .hero-photo { position: absolute; top: 18px; right: 0; width: 88px; margin: 0; }
  .hero-photo img { border-width: 4px; }
  .multiplier { flex-direction: column; align-items: flex-start; padding: 26px; }
  .bg-diagram { opacity: .09; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .section .wrap > * { opacity: 1; transform: none; transition: none; }
}

/* Narrow: a single line runs down the right side of the page, joining all three roles to the agentic bar.
   Dots and the arrow sit at the vertical centre of each badge (45px into a card, 43px into the bar). */
@media (max-width: 960px) {
  .pillars, .multiplier { --edge: 22px; --lc: var(--accent); }
  .rail { display: none; }
  .card, .multiplier { position: relative; }
  .pillars .card::before {
    content: ""; position: absolute; top: 38px; bottom: -20px; right: calc(-1 * var(--edge) - 7px); width: 14px;
    background:
      radial-gradient(circle at 7px 7px, var(--lc) 6px, transparent 6.5px) 0 0 / 14px 14px no-repeat,
      linear-gradient(var(--lc), var(--lc)) 6px 7px / 2px calc(100% - 7px) no-repeat;
  }
  .pillars .card:nth-child(n+2)::before {
    top: -20px;
    background:
      radial-gradient(circle at 7px 7px, var(--lc) 6px, transparent 6.5px) 0 58px / 14px 14px no-repeat,
      linear-gradient(var(--lc), var(--lc)) 6px 0 / 2px 100% no-repeat;
  }
  .pillars .card::after {
    content: ""; position: absolute; top: 44px; right: calc(-1 * var(--edge)); width: var(--edge); height: 2px; background: var(--lc);
  }
  .multiplier { margin-top: 20px; flex-direction: column; align-items: flex-start; padding: 26px; }
  .multiplier::before {
    content: ""; position: absolute;
    top: -20px; right: calc(-1 * var(--edge) - 7px);
    width: calc(var(--edge) + 7px); height: 64px;
    background:
      linear-gradient(var(--lc), var(--lc)) 0 62px / calc(100% - 6px) 2px no-repeat,
      linear-gradient(var(--lc), var(--lc)) calc(100% - 7px) 0 / 2px 100% no-repeat;
  }
}
@media (max-width: 720px) {
  .pillars, .multiplier { --edge: 10px; }
}
