/* Ömer Kahyaoğlu — portfolio. One stylesheet, light and dark. */

:root {
  --bg: #f8f7f3;
  --bg-2: #f1efe8;
  --surface: #ffffff;
  --ink: #12141a;
  --ink-2: #393e4a;
  --muted: #676d7b;
  --line: #e3e0d6;
  --line-2: #d4d0c4;
  --accent: #2b48c9;
  --accent-ink: #1d3299;
  --accent-soft: #e9edfc;
  --amber: #a85d00;
  --amber-soft: #fbf0df;
  --teal: #0b7365;
  --teal-soft: #e0f3ef;
  --violet: #6b3fb8;
  --violet-soft: #efe8fa;
  --figure-bg: #ffffff;
  --shadow: 0 1px 2px rgba(18, 20, 26, .04), 0 8px 24px -12px rgba(18, 20, 26, .12);
  --shadow-lg: 0 2px 6px rgba(18, 20, 26, .05), 0 24px 48px -20px rgba(18, 20, 26, .22);
  --radius: 14px;
  --radius-sm: 9px;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --max: 1140px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0e12;
    --bg-2: #111419;
    --surface: #14171d;
    --ink: #eceef3;
    --ink-2: #c4c9d4;
    --muted: #8d94a4;
    --line: #232833;
    --line-2: #2e3441;
    --accent: #8da3ff;
    --accent-ink: #b4c2ff;
    --accent-soft: rgba(141, 163, 255, .12);
    --amber: #f2b45c;
    --amber-soft: rgba(242, 180, 92, .12);
    --teal: #5fd4c0;
    --teal-soft: rgba(95, 212, 192, .11);
    --violet: #b99af5;
    --violet-soft: rgba(185, 154, 245, .12);
    --figure-bg: #f4f3ef;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .6);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, .35), 0 24px 48px -20px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0c0e12;
  --bg-2: #111419;
  --surface: #14171d;
  --ink: #eceef3;
  --ink-2: #c4c9d4;
  --muted: #8d94a4;
  --line: #232833;
  --line-2: #2e3441;
  --accent: #8da3ff;
  --accent-ink: #b4c2ff;
  --accent-soft: rgba(141, 163, 255, .12);
  --amber: #f2b45c;
  --amber-soft: rgba(242, 180, 92, .12);
  --teal: #5fd4c0;
  --teal-soft: rgba(95, 212, 192, .11);
  --violet: #b99af5;
  --violet-soft: rgba(185, 154, 245, .12);
  --figure-bg: #f4f3ef;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .6);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .35), 0 24px 48px -20px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16.5px/1.65 var(--sans);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
strong { font-weight: 600; color: var(--ink); }
code, kbd { font: 500 .86em/1.4 var(--mono); background: var(--bg-2); border: 1px solid var(--line); border-radius: 5px; padding: .08em .35em; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(var(--max), 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 16px; }

/* ---------- navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav .wrap { display: flex; align-items: center; gap: 20px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 600; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand .mono-mark {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: var(--ink); color: var(--bg); font: 600 13px/1 var(--serif); letter-spacing: .02em;
}
.brand small { display: block; font: 500 11px/1.2 var(--mono); color: var(--muted); letter-spacing: .02em; }
.nav-links { display: flex; gap: 2px; margin-left: auto; list-style: none; padding: 0; margin-block: 0; }
.nav-links a {
  display: block; padding: 7px 11px; border-radius: 8px; color: var(--ink-2);
  font-size: 14px; font-weight: 500;
}
.nav-links a:hover { background: var(--bg-2); color: var(--ink); text-decoration: none; }
.nav-links a.active { color: var(--ink); background: var(--bg-2); }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; display: inline-grid; place-items: center;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer;
  transition: border-color .15s, color .15s;
}
.icon-btn:hover { border-color: var(--line-2); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }
.menu-btn { display: none; }
.theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: block; }
:root[data-theme="dark"] .theme-btn .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .sun { display: block; }
  :root:not([data-theme="light"]) .theme-btn .moon { display: none; }
}

@media (max-width: 900px) {
  .menu-btn { display: inline-grid; }
  .nav .wrap { gap: 10px; }
  .nav-links {
    position: fixed; inset: 64px 0 auto 0; flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 16px 16px;
    transform: translateY(-8px); opacity: 0; pointer-events: none; transition: .18s ease;
  }
  .nav-links.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-links a { padding: 12px 8px; font-size: 16px; border-bottom: 1px solid var(--line); border-radius: 0; }
  .theme-btn { margin-left: auto; }
}

/* ---------- buttons, chips, badges ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px;
  border-radius: 11px; font: 500 14.5px/1 var(--sans); border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); cursor: pointer; white-space: nowrap;
  transition: transform .12s, border-color .15s, background .15s, box-shadow .15s;
}
.btn:hover { text-decoration: none; border-color: var(--ink-2); box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn.sm { height: 36px; padding: 0 13px; font-size: 13.5px; border-radius: 9px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

.chip {
  display: inline-flex; align-items: center; height: 28px; padding: 0 11px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  font: 500 12.5px/1 var(--sans); white-space: nowrap;
}
.chips { display: flex; flex-wrap: wrap; gap: 7px; }

.badge {
  display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 10px; border-radius: 7px;
  font: 600 11.5px/1 var(--mono); letter-spacing: .02em; text-transform: uppercase; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.preprint { color: var(--amber); background: var(--amber-soft); }
.badge.released { color: var(--teal); background: var(--teal-soft); }
.badge.course { color: var(--violet); background: var(--violet-soft); }

/* ---------- hero ---------- */
.hero { padding: 72px 0 56px; position: relative; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
.eyebrow { font: 500 12.5px/1.4 var(--mono); color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.hero h1 {
  font: 500 clamp(44px, 6.6vw, 78px)/1.02 var(--serif); letter-spacing: -.025em; margin: 18px 0 10px;
}
.hero h1 .accent { font-style: italic; color: var(--accent); }
.hero .role { font: 400 clamp(19px, 2.2vw, 23px)/1.4 var(--serif); color: var(--ink-2); margin: 0 0 22px; font-style: italic; }
.hero .lead { font-size: 18px; line-height: 1.7; color: var(--ink-2); max-width: 600px; margin: 0 0 30px; }
.hero .btn-row { margin-bottom: 28px; }
.socials { display: flex; gap: 8px; flex-wrap: wrap; }
.socials a { color: var(--muted); }
.socials a:hover { color: var(--ink); }

.matrix-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 22px 22px 18px;
  box-shadow: var(--shadow-lg); position: relative;
}
.matrix-card canvas { width: 100%; aspect-ratio: 16 / 7.2; display: block; }
.matrix-legend { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; text-align: center;
  font: italic 500 24px/1 var(--serif); color: var(--ink); margin-top: 10px; }
.matrix-legend span.op { font-style: normal; color: var(--muted); font-size: 20px; }
.matrix-legend small { display: block; font: 500 10.5px/1.3 var(--mono); font-style: normal; color: var(--muted); margin-top: 6px; letter-spacing: .03em; text-transform: uppercase; }
.matrix-caption { margin: 16px 2px 0; padding-top: 14px; border-top: 1px dashed var(--line-2); font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.matrix-caption a { font-weight: 500; }

.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 56px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.stat { padding: 22px 22px 22px 0; }
.stat + .stat { padding-left: 22px; border-left: 1px solid var(--line); }
.stat b { display: block; font: 500 38px/1 var(--serif); letter-spacing: -.02em; color: var(--ink); }
.stat span { display: block; margin-top: 8px; font-size: 14px; color: var(--ink-2); line-height: 1.4; }
.stat small { display: block; margin-top: 4px; font: 500 11.5px/1.4 var(--mono); color: var(--muted); }

@media (max-width: 960px) {
  .hero { padding-top: 40px; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { padding-left: 0; border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 520px) {
  .stats { grid-template-columns: 1fr; }
  .stat, .stat + .stat { padding: 18px 0; border-left: 0; }
  .stat + .stat { border-top: 1px solid var(--line); }
  .matrix-legend { font-size: 19px; }
}

/* ---------- sections ---------- */
section.block { padding: 88px 0; border-top: 1px solid var(--line); }
section.block.tint { background: var(--bg-2); }
.section-head { display: grid; grid-template-columns: 220px 1fr; gap: 40px; margin-bottom: 44px; }
.section-head .num { font: 500 13px/1.6 var(--mono); color: var(--muted); letter-spacing: .03em; padding-top: 8px; }
.section-head .num b { color: var(--accent); font-weight: 600; }
.section-head h2 { font: 500 clamp(32px, 4vw, 46px)/1.08 var(--serif); letter-spacing: -.02em; margin: 0 0 12px; }
.section-head p { margin: 0; color: var(--ink-2); max-width: 680px; font-size: 17px; }
@media (max-width: 860px) {
  section.block { padding: 64px 0; }
  .section-head { grid-template-columns: 1fr; gap: 6px; margin-bottom: 32px; }
}

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: 220px 1fr 330px; gap: 40px; }
.story p { font: 400 19px/1.72 var(--serif); color: var(--ink-2); margin: 0 0 20px; }
.story p:first-child::first-letter { font-size: 3.3em; float: left; line-height: .9; margin: 6px 10px 0 0; color: var(--accent); font-weight: 500; }
.story p strong { color: var(--ink); font-weight: 600; }
.path { list-style: none; margin: 0; padding: 0; position: relative; }
.path::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 1px; background: var(--line-2); }
.path li { position: relative; padding: 0 0 22px 30px; }
.path li::before { content: ""; position: absolute; left: 2px; top: 7px; width: 11px; height: 11px; border-radius: 50%; background: var(--bg); border: 2px solid var(--line-2); }
.path li.now::before { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.path li.next::before { border-style: dashed; border-color: var(--accent); }
.path b { display: block; font-size: 15px; }
.path span { display: block; font: 500 12px/1.5 var(--mono); color: var(--muted); }
.path p { margin: 4px 0 0; font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.side-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.side-card h3 { font: 600 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 18px; }
.side-card + .side-card { margin-top: 16px; }
@media (max-width: 1080px) { .about-grid { grid-template-columns: 1fr 300px; } .about-grid > .spacer { display: none; } }
@media (max-width: 800px) { .about-grid { grid-template-columns: 1fr; } }

.principles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-top: 56px; }
.principle { border-top: 2px solid var(--ink); padding-top: 14px; }
.principle h4 { font: 600 15px/1.35 var(--sans); margin: 0 0 8px; }
.principle p { margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.55; }
.principle .k { font: 500 11.5px/1 var(--mono); color: var(--muted); display: block; margin-bottom: 10px; }
@media (max-width: 1080px) { .principles { grid-template-columns: repeat(3, 1fr); row-gap: 28px; } }
@media (max-width: 680px) { .principles { grid-template-columns: 1fr; } }

/* ---------- research cards ---------- */
.paper {
  display: grid; grid-template-columns: 260px 1fr; gap: 36px; padding: 32px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
}
.paper + .paper { margin-top: 22px; }
.paper .thumb {
  position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--line);
  background: #fff; aspect-ratio: 8.5 / 11; align-self: start;
  box-shadow: 0 1px 0 var(--line), 6px 6px 0 -1px var(--bg-2), 6px 6px 0 0 var(--line);
}
.paper .thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.paper .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 14px; }
.paper .meta .ctx { font: 500 12.5px/1 var(--mono); color: var(--muted); }
.paper h3 { font: 500 clamp(24px, 2.6vw, 31px)/1.18 var(--serif); letter-spacing: -.015em; margin: 0 0 12px; }
.paper h3 a { color: var(--ink); }
.paper .sub { color: var(--ink-2); margin: 0 0 22px; font-size: 16.5px; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 22px; }
.metric { padding: 14px 16px; background: var(--bg); }
.metric + .metric { border-left: 1px solid var(--line); }
.metric b { display: block; font: 600 19px/1.15 var(--mono); letter-spacing: -.02em; color: var(--ink); }
.metric span { display: block; margin-top: 6px; font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.paper .chips { margin-bottom: 22px; }
@media (max-width: 900px) {
  .paper { grid-template-columns: 1fr; padding: 22px; gap: 22px; }
  .paper .thumb { max-width: 220px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metric:nth-child(3) { border-left: 0; }
  .metric:nth-child(n+3) { border-top: 1px solid var(--line); }
}

.notice {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px;
  background: var(--amber-soft); color: var(--ink-2); font-size: 14px; line-height: 1.55; margin-top: 22px;
}
.notice svg { width: 18px; height: 18px; color: var(--amber); flex: none; margin-top: 2px; }

/* ---------- project cards ---------- */
.featured {
  display: grid; grid-template-columns: 1.35fr 1fr; background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; overflow: hidden; box-shadow: var(--shadow-lg); margin-bottom: 26px;
}
.featured .shot { background: #0f1216; position: relative; min-height: 100%; }
.featured .shot img { width: 100%; height: 100%; object-fit: cover; object-position: left top; }
.featured .shot .label { position: absolute; left: 14px; bottom: 14px; font: 500 11.5px/1 var(--mono); color: #cfd5df; background: rgba(12, 14, 18, .72); padding: 7px 10px; border-radius: 7px; backdrop-filter: blur(6px); }
.featured .body { padding: 34px; display: flex; flex-direction: column; }
.featured h3 { font: 500 32px/1.12 var(--serif); letter-spacing: -.015em; margin: 14px 0 12px; }
.featured h3 a { color: var(--ink); }
.featured p { color: var(--ink-2); margin: 0 0 20px; }
.featured .metrics { grid-template-columns: repeat(2, 1fr); }
.featured .metric:nth-child(3) { border-left: 0; }
.featured .metric:nth-child(n+3) { border-top: 1px solid var(--line); }
.featured .btn-row { margin-top: auto; }
.strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border-top: 1px solid var(--line); grid-column: 1 / -1; }
.strip button { padding: 0; border: 0; background: #0f1216; cursor: zoom-in; aspect-ratio: 16 / 9.7; overflow: hidden; }
.strip img { width: 100%; height: 100%; object-fit: cover; object-position: left top; transition: transform .4s ease, opacity .2s; opacity: .92; }
.strip button:hover img { transform: scale(1.03); opacity: 1; }
@media (max-width: 960px) { .featured { grid-template-columns: 1fr; } .featured .shot { aspect-ratio: 16 / 9.7; } .featured .body { padding: 24px; } }

.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  overflow: hidden; box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease, border-color .2s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--line-2); }
.card .cover { aspect-ratio: 16 / 9; background: var(--figure-bg); overflow: hidden; border-bottom: 1px solid var(--line); }
.card .cover img { width: 100%; height: 100%; object-fit: cover; object-position: center top; transition: transform .5s ease; }
.card .cover.contain img { object-fit: contain; padding: 14px; }
.card:hover .cover img { transform: scale(1.025); }
.card .body { padding: 24px; display: flex; flex-direction: column; flex: 1; }
.card h3 { font: 500 24px/1.2 var(--serif); letter-spacing: -.01em; margin: 12px 0 10px; }
.card h3 a { color: var(--ink); }
.card p { color: var(--ink-2); font-size: 15px; margin: 0 0 18px; }
.card .kpis { display: flex; gap: 22px; margin-bottom: 18px; flex-wrap: wrap; }
.card .kpis div b { display: block; font: 600 17px/1.1 var(--mono); color: var(--ink); }
.card .kpis div span { font-size: 12px; color: var(--muted); }
.card .btn-row { margin-top: auto; }
@media (max-width: 860px) { .cards { grid-template-columns: 1fr; } }

/* ---------- notes ---------- */
.notes { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.notes .story p { font-size: 18px; }
.notes .story p:first-child::first-letter { all: unset; }
.steps { counter-reset: s; display: grid; gap: 12px; }
.step { display: grid; grid-template-columns: 44px 1fr; gap: 14px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.step::before { counter-increment: s; content: "0" counter(s); font: 600 13px/44px var(--mono); text-align: center; color: var(--accent); background: var(--accent-soft); border-radius: 10px; height: 44px; }
.step > div { line-height: 1.5; }
.step b { display: block; font-size: 15.5px; margin-bottom: 3px; }
.step span { font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.doc-stack { position: relative; height: 214px; margin: 8px 0 26px; max-width: 470px; }
.doc { position: absolute; overflow: hidden; width: 156px; height: 196px; background: #fff; border: 1px solid #ddd8cc; border-radius: 6px; padding: 18px 14px; box-shadow: var(--shadow); color: #1b1d22; }
.doc h5 { margin: 0 0 8px; font: 600 9.5px/1.3 var(--serif); }
.doc i { display: block; height: 4px; border-radius: 2px; background: #e6e2d8; margin: 0 0 6px; }
.doc i.s { width: 60%; } .doc i.m { width: 82%; }
.doc .eq { font: italic 11px/1.4 var(--serif); color: #2b48c9; margin: 8px 0; text-align: center; }
.doc:nth-child(1) { left: 0; transform: rotate(-5deg); }
.doc:nth-child(2) { left: 150px; top: 4px; transform: rotate(1deg); }
.doc:nth-child(3) { left: 300px; top: 10px; transform: rotate(5deg); }
@media (max-width: 860px) { .notes { grid-template-columns: 1fr; gap: 28px; } }
@media (max-width: 520px) { .doc { width: 122px; height: 172px; padding: 14px 11px; } .doc:nth-child(2) { left: 31%; } .doc:nth-child(3) { left: 62%; } .doc-stack { height: 190px; } }

.other { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 54px; }
.other article { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.other h4 { margin: 0 0 4px; font: 600 16px/1.35 var(--sans); }
.other .when { font: 500 12px/1.5 var(--mono); color: var(--muted); display: block; margin-bottom: 10px; }
.other p { margin: 0; font-size: 14.5px; color: var(--ink-2); line-height: 1.55; }
@media (max-width: 860px) { .other { grid-template-columns: 1fr; } }

/* ---------- CV ---------- */
.cv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.cv-grid h3 { font: 600 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 18px; }
.entries { list-style: none; margin: 0; padding: 0; }
.entry { display: grid; grid-template-columns: 112px 1fr; gap: 18px; padding: 18px 0; border-top: 1px solid var(--line); }
.entry:last-child { border-bottom: 1px solid var(--line); }
.entry time { font: 500 12.5px/1.6 var(--mono); color: var(--muted); padding-top: 2px; }
.entry b { display: block; font-size: 16px; }
.entry em { display: block; font-style: normal; color: var(--accent); font-size: 14px; margin: 2px 0 6px; }
.entry p { margin: 0; font-size: 14.5px; color: var(--ink-2); line-height: 1.55; }
.skills { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 52px; }
.skills h4 { font: 600 14px/1 var(--sans); margin: 0 0 12px; }
.skills ul { list-style: none; margin: 0; padding: 0; }
.skills li { font-size: 14px; color: var(--ink-2); padding: 7px 0; border-bottom: 1px dashed var(--line-2); }
.cv-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; margin-top: 44px; padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.langs { display: flex; flex-wrap: wrap; gap: 8px 26px; font-size: 14.5px; }
.langs b { margin-right: 6px; }
.langs span { color: var(--muted); }
@media (max-width: 960px) { .cv-grid { grid-template-columns: 1fr; } .skills { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .skills { grid-template-columns: 1fr; } .entry { grid-template-columns: 1fr; gap: 4px; } }

/* ---------- contact ---------- */
.contact { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.contact h2 { font: 500 clamp(36px, 5vw, 58px)/1.05 var(--serif); letter-spacing: -.025em; margin: 0 0 18px; }
.contact h2 em { color: var(--accent); }
.contact p { color: var(--ink-2); font-size: 17px; margin: 0 0 24px; max-width: 520px; }
.links { display: grid; gap: 10px; }
.link-row {
  display: flex; align-items: center; gap: 14px; padding: 15px 18px; border: 1px solid var(--line); border-radius: 13px;
  background: var(--surface); color: var(--ink); transition: border-color .15s, transform .15s;
}
.link-row:hover { text-decoration: none; border-color: var(--ink-2); transform: translateX(3px); }
.link-row svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.link-row b { font-weight: 500; font-size: 15px; }
.link-row span { margin-left: auto; font: 500 12.5px/1 var(--mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
@media (max-width: 860px) { .contact { grid-template-columns: 1fr; } }
@media (max-width: 460px) { .link-row span { display: none; } }

footer.site { border-top: 1px solid var(--line); padding: 30px 0 40px; color: var(--muted); font-size: 13.5px; }
footer.site .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }

/* ---------- project pages ---------- */
.crumbs { font: 500 13px/1 var(--mono); color: var(--muted); padding-top: 34px; }
.crumbs a { color: var(--muted); }
.p-head { padding: 26px 0 40px; }
.p-head .meta { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 20px; }
.p-head .meta .ctx { font: 500 13px/1 var(--mono); color: var(--muted); }
.p-head h1 { font: 500 clamp(36px, 5.2vw, 62px)/1.06 var(--serif); letter-spacing: -.025em; margin: 0 0 18px; max-width: 980px; }
.p-head .sub { font: 400 clamp(18px, 2vw, 21px)/1.55 var(--serif); color: var(--ink-2); max-width: 820px; margin: 0 0 28px; font-style: italic; }
.p-hero { border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: var(--figure-bg); box-shadow: var(--shadow-lg); }
.p-hero img { width: 100%; }
.p-hero.pad img { padding: 24px; }
.p-body { display: grid; grid-template-columns: 1fr 300px; gap: 56px; padding: 56px 0 24px; }
.p-body > * { min-width: 0; }
.p-body h2 { font: 500 30px/1.15 var(--serif); letter-spacing: -.015em; margin: 0 0 18px; }
.p-body section + section { margin-top: 52px; }
.prose p { font: 400 18.5px/1.75 var(--serif); color: var(--ink-2); margin: 0 0 18px; }
.prose p strong, .prose p em { color: var(--ink); }
.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ticks li { position: relative; padding: 14px 16px 14px 46px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 15px; color: var(--ink-2); line-height: 1.55; }
.ticks li::before { content: ""; position: absolute; left: 16px; top: 18px; width: 16px; height: 16px; border-radius: 5px; background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.ticks li::after { content: ""; position: absolute; left: 21px; top: 21px; width: 4px; height: 8px; border: solid var(--accent); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { padding: 11px 14px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { font: 600 11.5px/1.3 var(--mono); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--bg); }
td { font-family: var(--mono); font-size: 13.5px; }
td:first-child { font-family: var(--sans); font-size: 14.5px; }
tr:last-child td { border-bottom: 0; }
.table-note { font-size: 13px; color: var(--muted); margin: 10px 2px 0; }
.p-aside { position: sticky; top: 90px; align-self: start; display: grid; gap: 16px; }
.p-aside .metric-list { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); }
.p-aside .metric-list div { padding: 16px 18px; }
.p-aside .metric-list div + div { border-top: 1px solid var(--line); }
.p-aside .metric-list b { display: block; font: 600 21px/1.1 var(--mono); letter-spacing: -.02em; }
.p-aside .metric-list span { display: block; font-size: 13px; color: var(--muted); margin-top: 5px; line-height: 1.4; }
.p-aside .btn { width: 100%; justify-content: center; }
.credit { font-size: 13.5px; color: var(--muted); line-height: 1.5; padding: 0 2px; }
@media (max-width: 960px) {
  .p-body { grid-template-columns: 1fr; gap: 40px; }
  .p-aside { position: static; order: -1; }
  .p-aside .metric-list { grid-template-columns: repeat(2, 1fr); }
  .p-aside .metric-list div + div { border-top: 0; }
  .p-aside .metric-list div:nth-child(even) { border-left: 1px solid var(--line); }
  .p-aside .metric-list div:nth-child(n+3) { border-top: 1px solid var(--line); }
}

.gallery { display: grid; grid-template-columns: 1fr; gap: 30px; }
.gallery figure { margin: 0; }
.gallery button { display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--figure-bg); cursor: zoom-in; }
.gallery button img { width: auto; max-width: 100%; max-height: 600px; margin: 0 auto; transition: transform .4s ease; }
.gallery figure.dark button img { width: 100%; max-height: none; }
.gallery button:hover img { transform: scale(1.015); }
.gallery figure:not(.dark) button img { padding: 18px; }
.gallery figcaption { font-size: 13.5px; color: var(--muted); margin-top: 9px; line-height: 1.5; }
.gallery figcaption b { color: var(--ink-2); font: 600 11.5px/1 var(--mono); margin-right: 6px; }

pre.code {
  margin: 0; padding: 18px 20px; border-radius: 12px; background: #0f1216; color: #dfe5ee; overflow-x: auto;
  font: 500 13.5px/1.7 var(--mono); border: 1px solid #1d222b;
}
pre.code .p { color: #6e7a8f; user-select: none; }
.cite { position: relative; }
.cite pre.code { font-size: 12.5px; white-space: pre-wrap; word-break: break-word; }
.copy { position: absolute; top: 10px; right: 10px; height: 30px; padding: 0 10px; border-radius: 7px; border: 1px solid #2a303b; background: #171b22; color: #c9d1dc; font: 500 12px/1 var(--mono); cursor: pointer; }
.copy:hover { border-color: #47505f; }
.sample { font: italic 400 18px/1.6 var(--serif); color: var(--ink-2); padding: 20px 24px; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 12px 12px 0; white-space: pre-line; margin: 0; }

.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 48px 0 80px; }
.pn a { display: block; padding: 20px 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); transition: border-color .15s; }
.pn a:hover { text-decoration: none; border-color: var(--ink-2); }
.pn a span { display: block; font: 500 12px/1 var(--mono); color: var(--muted); margin-bottom: 8px; }
.pn a b { font: 500 19px/1.3 var(--serif); }
.pn a.next { text-align: right; }
@media (max-width: 620px) { .pn { grid-template-columns: 1fr; } .pn a.next { text-align: left; } }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 200; display: none; place-items: center; background: rgba(8, 10, 13, .9); padding: 24px; cursor: zoom-out; }
.lightbox.open { display: grid; }
.lightbox img { max-width: min(1600px, 100%); max-height: calc(100vh - 110px); border-radius: 10px; background: #fff; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.lightbox p { color: #d6dbe4; font-size: 14px; text-align: center; max-width: 820px; margin: 14px auto 0; }
.lightbox .close { position: absolute; top: 16px; right: 16px; background: rgba(255, 255, 255, .1); color: #fff; border: 0; width: 42px; height: 42px; border-radius: 50%; font-size: 22px; cursor: pointer; }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }
.no-js .reveal { opacity: 1; transform: none; }

@media print {
  .nav, .lightbox, .btn-row, .matrix-card { display: none !important; }
  section.block { padding: 24px 0; }
}
