:root {
  --bg: #ffffff;
  --ink: #141414;
  --text: #3a3a3a;
  --muted: #6c6c6c;
  --line: #e5e5e5;
  --soft: #f3f4f6;
  --accent: #2b62a8;
  --font: "Libre Franklin", "Helvetica Neue", Arial, sans-serif;
  /* used by the terminal preview */
  --font-display: var(--font);
  --font-term: "Source Sans 3", "Source Sans Pro", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --sheet: #ffffff; --rule: var(--line);
  --t-bg: #171614; --t-input: #2d2b27; --t-key: #292724; --t-key-line: #413e3a; --t-line: #2a2a2a; --t-plot: #000000;
  --t-ink: #e8e8e8; --t-grey: #8a8a8a; --t-amber: #ffb000; --t-s1: #c98500; --t-up: #3ddc84; --t-dn: #ff5c5c;
  --shadow: 0 30px 60px -34px rgba(0, 0, 0, 0.55);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 17px/1.65 var(--font); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.wrap { width: min(1240px, calc(100% - 64px)); margin: 0 auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.site-head { display: flex; justify-content: space-between; align-items: baseline; gap: 14px 32px; flex-wrap: wrap; padding: 34px 0 26px; }
.brand { font-size: 19px; font-weight: 600; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.nav { display: flex; gap: 28px; font-size: 15.5px; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }

.intro { padding: 44px 0 68px; max-width: 860px; }
.intro p { font-size: clamp(24px, 2.7vw, 33px); line-height: 1.32; color: var(--ink); margin: 0; letter-spacing: -0.01em; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 60px 30px; padding-bottom: 110px; }
.card { display: block; text-decoration: none; color: inherit; }
.card .cover { aspect-ratio: 4 / 3; overflow: hidden; background: var(--soft); }
.card .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.card:hover .cover img { transform: scale(1.03); }
.card h2 { font-size: 17.5px; font-weight: 600; color: var(--ink); margin: 17px 0 3px; line-height: 1.3; }
.card p { font-size: 15px; color: var(--muted); margin: 0; line-height: 1.45; }
.card:hover h2 { color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .card .cover img { transition: none; } .card:hover .cover img { transform: none; } }

.project { padding-top: 26px; }
.p-head { max-width: 880px; margin-bottom: 60px; }
.p-head h1 { font-size: clamp(32px, 4.3vw, 52px); font-weight: 600; line-height: 1.1; letter-spacing: -0.015em; color: var(--ink); margin: 0 0 22px; text-wrap: balance; }
.lede { font-size: clamp(19px, 1.8vw, 22px); line-height: 1.5; color: var(--text); margin: 0; max-width: 780px; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 32px; margin: 36px 0 0; padding: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 15px; }
.facts dt { font-size: 13px; color: var(--muted); }
.facts dd { margin: 3px 0 0; color: var(--ink); line-height: 1.45; }
.body > * + * { margin-top: 64px; }
.text { max-width: 700px; }
.text h2 { font-size: 23px; font-weight: 600; color: var(--ink); margin: 0 0 12px; line-height: 1.25; }
.text p { margin: 0 0 1em; }
.text p:last-child { margin-bottom: 0; }
.media { margin-left: 0; margin-right: 0; }
.media img { width: 100%; }
.media figcaption, .cap { font-size: 14.5px; color: var(--muted); margin-top: 14px; max-width: 780px; line-height: 1.5; }
.media.narrow img { max-width: 860px; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px; }
.table-wrap { overflow-x: auto; max-width: 900px; }
table.t { border-collapse: collapse; width: 100%; font-size: 15.5px; font-variant-numeric: tabular-nums; }
table.t th { text-align: left; font-weight: 500; color: var(--muted); font-size: 13.5px; padding: 0 18px 10px 0; border-bottom: 1px solid var(--ink); vertical-align: bottom; }
table.t td { padding: 11px 18px 11px 0; border-bottom: 1px solid var(--line); color: var(--ink); vertical-align: top; }
table.t .n { text-align: right; }
table.t td.n { white-space: nowrap; }
table.t tr.hl td { font-weight: 600; }
.days { list-style: none; padding: 0; margin: 0; max-width: 860px; border-top: 1px solid var(--line); }
.days li { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 24px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.days b { color: var(--ink); font-weight: 600; }
.works { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 56px; max-width: 1040px; }
.works h3 { font-size: 18px; font-weight: 600; color: var(--ink); margin: 0 0 6px; line-height: 1.3; }
.works p { margin: 0; font-size: 16px; }
.next { margin-top: 110px; border-top: 1px solid var(--line); padding: 34px 0 86px; display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.next-link { display: flex; align-items: center; gap: 20px; text-decoration: none; }
.next-link .thumb { width: 128px; aspect-ratio: 4 / 3; overflow: hidden; background: var(--soft); flex: none; }
.next-link .thumb img { width: 100%; height: 100%; object-fit: cover; }
.next-link small { display: block; font-size: 13px; color: var(--muted); }
.next-link strong { font-size: 19px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.next-link:hover strong { color: var(--accent); }
.all { font-size: 15px; color: var(--muted); }

.about { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 56px 88px; padding: 26px 0 110px; }
.about h1 { font-size: clamp(32px, 4vw, 46px); font-weight: 600; line-height: 1.1; color: var(--ink); margin: 0 0 26px; letter-spacing: -0.012em; }
.bio p { font-size: 19px; line-height: 1.62; margin: 0 0 1em; }
.side > section + section { margin-top: 44px; }
.side h2, .bio h2 { font-size: 15px; font-weight: 600; color: var(--ink); margin: 0 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.bio h2 { margin-top: 44px; }
.cv { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.cv b { display: block; color: var(--ink); font-weight: 600; }
.cv span { display: block; font-size: 15px; color: var(--muted); }
.cv p { margin: 6px 0 0; font-size: 16px; }
.plain { margin: 0; padding-left: 1.1em; }
.plain li { margin-bottom: 0.4em; }
.skills { margin: 0; display: grid; gap: 12px; font-size: 16px; }
.skills dt { color: var(--ink); font-weight: 600; font-size: 15px; }
.skills dd { margin: 0; }

.site-foot { border-top: 1px solid var(--line); padding: 28px 0 44px; display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.site-foot a { color: var(--muted); }
.site-foot nav { display: flex; gap: 22px; flex-wrap: wrap; }

@media (max-width: 1080px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .wrap { width: calc(100% - 40px); }
  body { font-size: 16.5px; }
  .grid { grid-template-columns: minmax(0, 1fr); gap: 44px; }
  .intro { padding: 24px 0 44px; }
  .facts, .pair, .works, .about { grid-template-columns: minmax(0, 1fr); }
  .days li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .body > * + * { margin-top: 48px; }
  .next { margin-top: 72px; }
  .nav { gap: 20px; }
  table.t { font-size: 14.5px; }
  table.t th { font-size: 12.5px; padding-right: 10px; }
  table.t td { padding-right: 10px; }
}

/* ---------- oil terminal preview ---------- */
/* ---------- terminal ---------- */
.term {
  background: var(--t-bg);
  color: var(--t-ink);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  font-family: var(--font-term);
  font-size: 15px;
  line-height: 1.4;
}
.t-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 22px 10px;
  border-bottom: 1px solid var(--t-line);
}
.t-brand { font-size: 16px; }
.t-brand b { color: var(--t-amber); letter-spacing: .1em; font-weight: 700; }
.t-brand span { color: var(--t-grey); }
.t-clock { color: var(--t-grey); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.t-bar { padding: 14px 22px 0; display: grid; gap: 12px; }
.t-cmd { display: flex; gap: 8px; }
.t-field { position: relative; flex: 1; }
.t-cmd input {
  width: 100%;
  background: var(--t-input);
  border: 1px solid var(--t-input);
  border-radius: 8px;
  color: var(--t-ink);
  font: 16px var(--font-term);
  padding: 11px 14px;
  text-transform: uppercase;
}
.t-cmd input::placeholder { color: #a7a39b; text-transform: none; }
.t-cmd input:focus { outline: none; border-color: var(--t-amber); }
.t-caret {
  position: absolute; left: 14px; top: 50%; width: 9px; height: 19px; margin-top: -10px;
  background: var(--t-amber); opacity: .9; pointer-events: none;
  animation: blink 1.1s steps(1) infinite;
}
.t-cmd input:focus + .t-caret, .t-cmd input:not(:placeholder-shown) + .t-caret { display: none; }
.t-cmd input:placeholder-shown { text-indent: 18px; }
.t-cmd input:focus:placeholder-shown { text-indent: 0; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .t-caret { animation: none; } }
.t-go {
  background: var(--t-key); border: 1px solid var(--t-key-line); color: var(--t-amber);
  font: 700 14px var(--font-term); letter-spacing: .08em; border-radius: 8px; padding: 0 16px; cursor: pointer;
}
.t-keys { display: flex; flex-wrap: wrap; gap: 8px; }
.t-keys button {
  background: var(--t-key); border: 1px solid var(--t-key-line); color: var(--t-ink);
  font: 15px var(--font-term); border-radius: 8px; padding: 7px 16px; cursor: pointer; min-width: 74px;
}
.t-keys button:hover { border-color: #6b665f; }
.t-keys button[aria-pressed="true"] { border-color: var(--t-amber); color: var(--t-amber); }
.t-keys button:focus-visible, .t-go:focus-visible { outline: 2px solid var(--t-amber); outline-offset: 2px; }
.t-msg { min-height: 1.4em; margin: 0; color: var(--t-amber); font-size: 14px; }
.t-msg:empty { min-height: 0; }
.t-screen { padding: 6px 22px 22px; }
.t-sec {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap;
  border-bottom: 1px solid var(--t-line); padding: 2px 0 6px; margin: 10px 0 14px;
}
.t-sec b { color: var(--t-amber); letter-spacing: .1em; font-size: 16px; }
.t-sec span { color: var(--t-grey); font-size: 13px; }
.t-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 20px; margin-bottom: 14px; }
.t-metric .lbl { font-size: 14px; color: var(--t-ink); }
.t-metric .val { font-size: 32px; line-height: 1.15; font-weight: 400; }
.t-metric .dlt { font-size: 14px; display: inline-flex; gap: 4px; padding: 1px 8px; border-radius: 999px; margin-top: 2px; }
.t-metric .dlt.up { color: var(--t-up); background: rgba(61, 220, 132, .12); }
.t-metric .dlt.dn { color: var(--t-dn); background: rgba(255, 92, 92, .12); }
.t-metric .dlt.flat { color: var(--t-grey); background: rgba(138, 138, 138, .14); }
.t-plot { background: var(--t-plot); padding: 8px 0 2px; position: relative; }
.t-plot-title { color: var(--t-grey); font: 13px var(--font-mono); padding: 2px 12px 4px; }
.t-note {
  color: #9a9a9a; font-size: 13.5px; line-height: 1.45; border-left: 2px solid var(--t-s1);
  padding: 2px 0 2px 9px; margin: 12px 0 0;
}
.t-note b { color: var(--t-amber); font-weight: 600; letter-spacing: .06em; font-size: 11.5px; }
.t-shot { max-height: 640px; overflow-y: auto; border-radius: 4px; scrollbar-color: #413e3a var(--t-bg); }
.t-shot img { width: 100%; height: auto; }
.t-ax { fill: var(--t-grey); font: 11.5px var(--font-mono); }
.t-ann { fill: var(--t-grey); font: 11px var(--font-mono); }
.t-end { fill: var(--t-ink); font: 12px var(--font-mono); }
.hero-cap {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 32px; align-items: start;
  margin-top: 18px; font-family: var(--font-display); font-size: 15px; color: var(--text);
}
.hero-cap p { margin: 0; max-width: 62em; }
.hero-cap .fine { color: var(--muted); font-size: 14px; margin-top: 4px; }


.tip {
  position: absolute; z-index: 5; pointer-events: none; min-width: 150px;
  background: var(--sheet); color: var(--text); border: 1px solid var(--rule); border-radius: 8px;
  padding: 8px 10px; font: 13px/1.35 var(--font-display); font-variant-numeric: tabular-nums;
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .35);
}
.tip .h { color: var(--muted); margin-bottom: 4px; }
.tip .r { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.tip .r strong { color: var(--ink); font-weight: 650; }
.tip .k { width: 12px; height: 3px; border-radius: 2px; flex: none; }
.tip.dark { background: #1c1b19; border-color: #3a3833; color: #c9c6bf; font-family: var(--font-mono); font-size: 12px; }
.tip.dark .h { color: var(--t-grey); }
.tip.dark .r strong { color: var(--t-ink); }


.term { border-radius: 10px; }
.t-plot .chart { position: relative; }
.chart svg { display: block; overflow: visible; }
.hit { cursor: crosshair; }
.hit:focus { outline: none; }
.term-note { font-size: 14.5px; color: var(--muted); margin-top: 14px; max-width: 780px; }
@media (max-width: 760px) { .t-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } .t-metric .val { font-size: 26px; } .t-shot { max-height: none; } }
@media (max-width: 480px) { .t-head, .t-bar, .t-screen { padding-left: 14px; padding-right: 14px; } .t-keys button { min-width: 0; padding: 7px 12px; } }
