:root {
  --navy: #0b1e33;
  --navy-2: #10294a;
  --teal: #14b8a6;
  --teal-2: #2dd4bf;
  --sky: #38bdf8;
  --ink: #0f172a;
  --muted: #526077;
  --line: #e3e9f1;
  --bg: #ffffff;
  --bg-alt: #f3f7fb;
  --radius: 14px;
  --max: 1120px;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Space Grotesk", var(--sans);
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: var(--bg); line-height: 1.65; font-size: 17px; }
img { max-width: 100%; display: block; }
a { color: inherit; }
.mono { font-family: var(--mono); }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0 0 .5em; }
h2 { font-size: clamp(1.8rem, 3.2vw, 2.4rem); color: var(--navy); }
h3 { font-size: 1.15rem; color: var(--navy); }
p { margin: 0 0 1em; }

/* NAV */
.nav { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; padding: 14px clamp(16px, 4vw, 40px); background: rgba(11, 30, 51, .92); backdrop-filter: blur(10px); color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; text-decoration: none; letter-spacing: .2px; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, var(--teal), var(--sky)); color: var(--navy); font-size: .85rem; }
.nav-links { display: flex; gap: 22px; align-items: center; }
.nav-links a { text-decoration: none; font-size: .93rem; color: #cbd8e8; transition: color .2s; }
.nav-links a:hover { color: #fff; }
.nav-cta { padding: 7px 16px; border: 1px solid var(--teal-2); border-radius: 999px; color: var(--teal-2) !important; }
.nav-toggle { display: none; background: none; border: 0; color: #fff; font-size: 1.5rem; cursor: pointer; }

/* HERO */
.hero { position: relative; overflow: hidden; background: radial-gradient(1200px 600px at 80% 10%, #13406b 0%, var(--navy) 55%); color: #e7eef7; padding: clamp(70px, 11vw, 140px) clamp(20px, 5vw, 40px) 70px; }
.seq-bg { position: absolute; inset: 0; font-family: var(--mono); font-size: 13px; line-height: 1.9; color: rgba(45, 212, 191, .07); word-break: break-all; pointer-events: none; user-select: none; }
.helix { position: absolute; right: clamp(-40px, 6vw, 120px); top: 0; height: 100%; width: auto; opacity: .85; }
.hero-inner { position: relative; max-width: var(--max); margin: 0 auto; }
.eyebrow { color: var(--teal-2); font-size: .9rem; margin-bottom: 18px; }
.hero h1 { font-size: clamp(2.4rem, 6.5vw, 4.6rem); color: #fff; }
.hero h1 .accent { white-space: nowrap; }
.accent { background: linear-gradient(90deg, #fcd34d, #f59e0b); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); max-width: 60ch; color: #c5d3e4; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 50px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; max-width: 760px; margin: 0; }
.stats div { border-left: 2px solid var(--teal); padding-left: 14px; }
.stats dt { font-family: var(--display); font-size: 1.8rem; font-weight: 700; color: #fff; }
.stats dd { margin: 0; font-size: .85rem; color: #9fb3cb; }

/* BUTTONS */
.btn { display: inline-block; padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: .95rem; text-decoration: none; transition: transform .15s, box-shadow .15s, background .2s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: linear-gradient(90deg, var(--teal), var(--sky)); color: var(--navy); box-shadow: 0 6px 20px rgba(20, 184, 166, .3); }
.btn-ghost { border: 1px solid currentColor; color: var(--teal); }
.hero .btn-ghost { color: #e7eef7; }

/* SECTIONS */
.section { padding: clamp(64px, 9vw, 110px) clamp(20px, 5vw, 40px); }
.section.alt { background: var(--bg-alt); }
.section.dark { background: var(--navy); color: #d5e1ee; }
.section.dark h2, .section.dark h3 { color: #fff; }
.container { max-width: var(--max); margin: 0 auto; }
.kicker { color: var(--teal); font-size: .85rem; margin-bottom: 10px; text-transform: lowercase; }
.section-lead { font-size: 1.1rem; color: var(--muted); max-width: 65ch; margin-bottom: 36px; }
.dark .section-lead { color: #a9bccf; }
.two-col { display: grid; grid-template-columns: 340px 1fr; gap: clamp(32px, 5vw, 70px); align-items: start; }

/* ABOUT */
.portrait { position: sticky; top: 100px; }
.portrait img, .portrait-ph { width: 100%; aspect-ratio: 4 / 5; border-radius: 20px; object-fit: cover; box-shadow: 0 20px 50px rgba(11, 30, 51, .18); }
.portrait-ph { display: grid; place-items: center; background: linear-gradient(150deg, var(--navy-2), var(--teal)); color: rgba(255, 255, 255, .85); font-family: var(--display); font-size: 4rem; font-weight: 700; }
.timeline { list-style: none; padding: 0; margin: 28px 0 0; border-top: 1px solid var(--line); }
.timeline li { display: grid; grid-template-columns: 110px 1fr; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: .95rem; }
.timeline .mono { color: var(--teal); font-size: .82rem; padding-top: 3px; }

/* CARDS */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; transition: transform .2s, box-shadow .2s, border-color .2s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(11, 30, 51, .08); border-color: rgba(20, 184, 166, .5); }
.card p { color: var(--muted); font-size: .95rem; margin: 0; }
.card-icon { display: inline-grid; place-items: center; min-width: 46px; height: 46px; padding: 0 10px; border-radius: 11px; background: rgba(20, 184, 166, .1); color: var(--teal); font-size: .85rem; font-weight: 600; margin-bottom: 16px; }
.services { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 36px; }
.dark .card { background: rgba(255, 255, 255, .04); border-color: rgba(255, 255, 255, .1); }
.dark .card p { color: #a9bccf; }

.pub-strip { display: flex; justify-content: space-between; align-items: center; gap: 30px; margin-top: 40px; padding: 28px 32px; border-radius: var(--radius); background: var(--navy); color: #c9d6e5; }
.pub-strip h3 { color: #fff; }
.pub-strip p { margin: 0; max-width: 62ch; }
.pub-strip .btn-ghost { color: var(--teal-2); }
.pub-links { display: flex; gap: 10px; flex-shrink: 0; flex-wrap: wrap; }

/* PROJECTS */
.projects { display: grid; grid-template-columns: 1.4fr 1fr; grid-auto-rows: auto; gap: 20px; }
.project { border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; background: #fff; }
.project.feature { grid-row: span 2; background: linear-gradient(160deg, var(--navy) 0%, #12365d 100%); color: #c9d6e5; border: 0; }
.project.feature h3 { color: #fff; font-size: 1.7rem; }
.project p { color: var(--muted); }
.project.feature p { color: #c9d6e5; }
.tag { font-size: .78rem; color: var(--teal) !important; margin-bottom: 8px; }
.project.feature .tag { color: var(--teal-2) !important; }
.seq { margin-top: 26px; padding: 14px 16px; border-radius: 10px; background: rgba(45, 212, 191, .08); color: var(--teal-2); font-size: .85rem; }

/* TEACHING */
.teach { grid-template-columns: 1.3fr 1fr; align-items: center; }
.checklist { list-style: none; margin: 0; padding: 28px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.checklist li { position: relative; padding: 10px 0 10px 32px; border-bottom: 1px dashed var(--line); }
.checklist li:last-child { border-bottom: 0; }
.checklist li::before { content: "✓"; position: absolute; left: 0; top: 10px; width: 22px; height: 22px; border-radius: 50%; background: rgba(20, 184, 166, .12); color: var(--teal); display: grid; place-items: center; font-size: .75rem; font-weight: 700; }

/* TALKS */
.talks { list-style: none; padding: 0; margin: 0; }
.talks li { display: grid; grid-template-columns: 80px 1fr; gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.talks .mono { color: var(--teal); padding-top: 2px; }
.talks em { color: var(--muted); }

/* CONTACT */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.contact-links { display: grid; gap: 12px; }
.contact-item { display: flex; flex-direction: column; padding: 16px 20px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; font-weight: 500; transition: border-color .2s; }
a.contact-item:hover { border-color: var(--teal); }
.contact-item .mono { font-size: .75rem; color: var(--teal); }

.footer { text-align: center; padding: 30px 20px; background: var(--navy); color: #8aa0b8; font-size: .88rem; }
.footer p { margin: 0; }

/* REVEAL */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

/* RESPONSIVE */
@media (max-width: 980px) {
  .cards, .services { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .projects { grid-template-columns: 1fr; }
  .project.feature { grid-row: auto; }
  .helix { opacity: .3; }
}
@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav-links { position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--navy); padding: 8px 20px 18px; display: none; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 0; width: 100%; border-bottom: 1px solid rgba(255, 255, 255, .06); }
  .nav-cta { border: 0; padding: 12px 0; }
  .two-col, .teach, .contact { grid-template-columns: 1fr; }
  .portrait { position: static; max-width: 280px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pub-strip { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .cards, .services { grid-template-columns: 1fr; }
  .timeline li, .talks li { grid-template-columns: 1fr; gap: 2px; }
}

/* FLYING BINARY */
.binary { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.binary span { position: absolute; bottom: -40px; font-family: var(--mono); font-weight: 600; color: var(--teal-2); opacity: 0; animation: fly linear infinite; }
.binary span.gold { color: #fbbf24; }
@keyframes fly {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 0; }
  10% { opacity: var(--o, .35); }
  85% { opacity: var(--o, .35); }
  100% { transform: translate(var(--dx, 0px), -110vh) rotate(var(--r, 0deg)); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .binary { display: none; } }

/* PORTRAIT FRAME */
.portrait-frame { position: relative; padding: 6px; border-radius: 24px; background: linear-gradient(150deg, var(--teal-2), var(--sky) 45%, #fbbf24); box-shadow: 0 24px 60px rgba(11, 30, 51, .22); }
.portrait-frame::before { content: ""; position: absolute; inset: 18px -18px -18px 18px; border: 2px dashed rgba(20, 184, 166, .45); border-radius: 26px; z-index: -1; }
.portrait-frame img { width: 100%; height: auto; aspect-ratio: 900 / 1107; object-fit: cover; border-radius: 19px; background: #d9d9d9; }
.portrait-seq { position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%); white-space: nowrap; padding: 6px 14px; border-radius: 999px; background: var(--navy); color: var(--teal-2); font-size: .75rem; letter-spacing: .08em; box-shadow: 0 6px 16px rgba(11, 30, 51, .25); }
.portrait-caption { margin: 30px 0 0; text-align: center; font-size: .78rem; color: var(--muted); }
@media (max-width: 820px) { .portrait-frame::before { inset: 12px -12px -12px 12px; } }

/* CONTACT FORM */
.contact .contact-links { margin-top: 24px; }
.contact-form { display: grid; gap: 16px; padding: 30px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-alt); }
.contact-form label { display: grid; gap: 6px; font-size: .88rem; font-weight: 600; color: var(--navy); }
.contact-form input, .contact-form select, .contact-form textarea { width: 100%; font: inherit; font-size: 16px; font-weight: 400; color: var(--ink); padding: 12px 14px; border: 1px solid #cdd7e3; border-radius: 10px; background: #fff; transition: border-color .2s, box-shadow .2s; }
.contact-form textarea { resize: vertical; min-height: 140px; }
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(20, 184, 166, .18); }
.contact-form .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.contact-form button { justify-self: start; border: 0; cursor: pointer; min-height: 46px; }
.contact-form button:disabled { opacity: .6; cursor: wait; }
.contact-form .hp { display: none; }
.form-status { margin: 0; font-size: .92rem; min-height: 1.4em; }
.form-status.ok { color: #0f9f6e; }
.form-status.err { color: #c2410c; }
@media (max-width: 560px) { .contact-form { padding: 20px; } .contact-form .field-row { grid-template-columns: 1fr; } }
