:root {
  --bg: #f4f3ee;
  --grid-line: rgba(30, 40, 60, 0.055);
  --surface: #ffffff;
  --ink: #16191d;
  --ink-2: #4a5059;
  --ink-3: #7c828b;
  --line: #dcdad2;
  --line-2: #e9e7e0;
  --accent: #2456d6;
  --accent-ink: #ffffff;
  --accent-soft: #e4ebfb;
  --career: #b9bcc2;
  --today: #d8382b;
  --live: #1f8a4c;
  --paused: #8a8f97;
  --shadow: 0 1px 0 rgba(20, 25, 35, 0.04), 0 8px 24px -12px rgba(20, 25, 35, 0.18);
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --label-w: 300px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317;
    --grid-line: rgba(200, 210, 230, 0.045);
    --surface: #181b20;
    --ink: #e9ebee;
    --ink-2: #b2b7bf;
    --ink-3: #828892;
    --line: #2b2f36;
    --line-2: #22262c;
    --accent: #6f94f2;
    --accent-ink: #0d1220;
    --accent-soft: #1d2740;
    --career: #4a4f58;
    --today: #f0604f;
    --live: #4cc47f;
    --paused: #8a8f97;
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 10px 30px -14px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}

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

html { scroll-behavior: smooth; scroll-padding-top: 64px; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 24px 24px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
h1, h2, h3, h4 { line-height: 1.15; margin: 0; }
p { margin: 0; }

.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 24px; }

/* ---- Toolbar ---- */

.toolbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.toolbar-inner { display: flex; align-items: center; justify-content: space-between; height: 48px; gap: 16px; }
.file { font-family: var(--mono); font-size: 14px; font-weight: 500; }
.file .ext { color: var(--ink-3); }
.toolbar nav { display: flex; gap: 20px; }
.toolbar nav a { font-family: var(--mono); font-size: 13px; color: var(--ink-2); text-decoration: none; }
.toolbar nav a:hover { color: var(--accent); }

/* ---- Buttons ---- */

.links { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 16px; border-radius: 6px;
  font-family: var(--mono); font-size: 14px; font-weight: 500;
  text-decoration: none; color: var(--ink);
  border: 1px solid var(--line); background: var(--surface);
  transition: border-color .15s, transform .15s;
}
.btn:hover { border-color: var(--ink-3); transform: translateY(-1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }

/* ---- Hero ---- */

.hero { display: grid; grid-template-columns: 1fr auto; gap: 48px; align-items: center; padding-top: 72px; padding-bottom: 72px; }
.eyebrow { font-family: var(--mono); font-size: 13px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 14px; }
.hero h1 { font-size: clamp(40px, 6vw, 68px); font-weight: 700; letter-spacing: -.02em; margin-bottom: 20px; }
.lead { font-size: 21px; line-height: 1.5; max-width: 640px; margin-bottom: 12px; }
.sub { color: var(--ink-2); max-width: 600px; margin-bottom: 28px; }

.hero-photo {
  position: relative; width: 240px; aspect-ratio: 1;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
  box-shadow: var(--shadow); overflow: hidden;
  display: grid; place-items: center;
}
.hero-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.initials { font-family: var(--mono); font-size: 56px; font-weight: 500; color: var(--ink-3); }

/* ---- Sections ---- */

main section { padding-top: 40px; padding-bottom: 56px; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: 20px; }
.section-head h2, footer h2 { font-size: 28px; letter-spacing: -.01em; }
.section-sub { color: var(--ink-2); max-width: 560px; }
.note { font-family: var(--mono); font-size: 12px; color: var(--ink-3); margin-top: 10px; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 18px; height: 8px; border-radius: 2px; }
.sw-career { background: var(--career); }
.sw-active { background: var(--accent); }
.sw-running { background: repeating-linear-gradient(90deg, var(--accent) 0 4px, transparent 4px 7px); outline: 1px solid var(--accent); outline-offset: -1px; }
.sw-today { width: 2px; height: 12px; background: var(--today); }

/* ---- Gantt ---- */

.gantt {
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: var(--shadow); overflow: hidden;
}
.g-head, .g-row { display: grid; grid-template-columns: var(--label-w) 1fr; }
.g-head { border-bottom: 1px solid var(--line); background: var(--line-2); }
.g-colname { font-family: var(--mono); font-size: 12px; color: var(--ink-3); padding: 8px 14px; border-right: 1px solid var(--line); }
.g-axis { position: relative; height: 34px; margin-right: 16px; }
.g-tick { position: absolute; top: 9px; transform: translateX(-50%); font-family: var(--mono); font-size: 11px; color: var(--ink-2); white-space: nowrap; }
.g-tick.minor { color: var(--ink-3); }
.g-zoom {
  position: absolute; top: 8px; transform: translateX(8px);
  font-family: var(--mono); font-size: 10px; color: var(--accent);
  background: var(--accent-soft); padding: 0 5px; border-radius: 3px;
}

.g-body { position: relative; }
.g-overlay { position: absolute; top: 0; bottom: 0; left: var(--label-w); right: 16px; pointer-events: none; }
.g-grid { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line-2); }
.g-grid.minor { background: transparent; border-left: 1px dashed var(--line-2); }
.g-break {
  position: absolute; top: 0; bottom: 0; width: 8px; transform: translateX(-4px);
  background: repeating-linear-gradient(135deg, var(--line) 0 2px, transparent 2px 6px);
}
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--today); transform: translateX(-1px); z-index: 2; }
.g-today b {
  position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
  font-family: var(--mono); font-size: 10px; font-weight: 500; color: #fff;
  background: var(--today); padding: 1px 5px; border-radius: 3px;
}

.g-group {
  position: relative; font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink-3); padding: 10px 14px 4px; border-top: 1px solid var(--line-2);
}
.g-group:first-of-type { border-top: 0; }
.g-row { position: relative; min-height: 40px; color: inherit; text-decoration: none; }
.g-label { display: flex; flex-direction: column; justify-content: center; padding: 5px 14px; border-right: 1px solid var(--line); min-width: 0; }
.g-name { font-size: 14px; font-weight: 500; line-height: 1.3; }
.g-org { font-size: 12px; color: var(--ink-3); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-org a, .before-role a { color: inherit; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.g-org a:hover, .before-role a:hover { color: var(--accent); text-decoration-color: currentColor; }
.g-track { position: relative; margin-right: 16px; }
.g-bar { position: absolute; top: 50%; height: 14px; transform: translateY(-50%); border-radius: 3px; z-index: 1; }
.g-bar.career { background: var(--career); height: 10px; }
.g-bar.active { background: var(--accent); height: 18px; box-shadow: 0 2px 6px -2px color-mix(in srgb, var(--accent) 60%, transparent); }
.g-bar.running {
  height: 18px; border: 1.5px solid var(--accent); border-left: 0; border-radius: 0 3px 3px 0;
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, transparent) 0 4px, transparent 4px 8px);
}
.g-row.project .g-name { color: var(--ink); }
.g-row.project:hover { background: var(--accent-soft); }
.g-row.project:hover .g-name { color: var(--accent); }

/* ---- Cases ---- */

.case {
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: var(--shadow); padding: 28px 32px 24px; margin-bottom: 24px;
  border-top: 4px solid var(--accent);
}
.case-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-family: var(--mono); font-size: 12px; color: var(--ink-3); margin-bottom: 14px; }
.case-num { color: var(--accent); font-weight: 500; }
.status { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 99px; border: 1px solid currentColor; }
.status i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.live { color: var(--live); }
.status.live i { animation: pulse 2s ease-in-out infinite; }
.status.paused { color: var(--paused); }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .status.live i { animation: none; } html { scroll-behavior: auto; } }

.case h3 { font-size: 32px; letter-spacing: -.015em; }
.tagline { font-size: 19px; color: var(--ink-2); margin-top: 4px; }
.summary { margin-top: 14px; max-width: 760px; }
.case h4 {
  font-family: var(--mono); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink-3); margin: 22px 0 8px;
}
.case-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 8px 40px; margin-top: 6px; }
.case-grid p, .case-grid li { font-size: 16px; }
.case ul { margin: 0; padding-left: 18px; }
.case ul li { margin-bottom: 6px; }
.case ul li::marker { color: var(--ink-3); }

.decisions ol { list-style: none; counter-reset: d; margin: 0; padding: 0; }
.decisions ol li { counter-increment: d; position: relative; padding-left: 40px; margin-bottom: 14px; }
.decisions ol li::before {
  content: counter(d, decimal-leading-zero); position: absolute; left: 0; top: 2px;
  font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--accent);
  border: 1px solid var(--accent); border-radius: 4px; padding: 0 5px; line-height: 1.6;
}
.decisions strong { display: block; font-weight: 600; }
.cut { border-left: 3px solid var(--today); padding: 2px 0 2px 14px; margin-top: 6px; }
.cut h4 { margin-top: 0; color: var(--today); }

.case-foot {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 32px;
  border-top: 1px solid var(--line-2); margin-top: 22px; padding-top: 18px;
}
.status-note { font-size: 15px; color: var(--ink-2); max-width: 640px; }
.stack { font-family: var(--mono); font-size: 12px; color: var(--ink-3); margin-top: 6px; }

.shot { width: fit-content; max-width: 100%; margin: 20px 0 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--line-2); }
.shot-bar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.shot-bar span { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.shot-bar em { font-style: normal; font-family: var(--mono); font-size: 11px; color: var(--ink-3); margin-left: 8px; }
.shot img { display: block; max-width: 100%; height: auto; }

.compact-title { font-size: 20px; margin: 16px 0 12px; }
.compact {
  display: grid; grid-template-columns: 200px 1fr auto; align-items: center; gap: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: 14px 18px; margin-bottom: 10px; color: inherit; text-decoration: none;
}
.compact:hover { border-color: var(--accent); }
.compact-name { font-weight: 600; }
.compact-summary { color: var(--ink-2); font-size: 15px; }

/* ---- Before this ---- */

.before { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.before li { display: grid; grid-template-columns: 130px 1fr; gap: 24px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.before-years { font-family: var(--mono); font-size: 14px; color: var(--ink-3); padding-top: 2px; }
.before-role { font-weight: 600; margin-bottom: 2px; }
.before-role span { font-weight: 400; color: var(--ink-3); }
.before li p + p { color: var(--ink-2); max-width: 760px; }
.before .evidence { font-size: 14px; color: var(--ink-3); margin-top: 6px; }
.before .evidence a { font-family: var(--mono); font-size: 13px; }

/* ---- Footer ---- */

footer { padding-top: 48px; padding-bottom: 72px; border-top: 1px solid var(--line); margin-top: 24px; }
footer h2 { margin-bottom: 18px; }
.langs { font-family: var(--mono); font-size: 13px; color: var(--ink-3); margin-top: 20px; }

/* ---- Narrow screens ---- */

@media (max-width: 860px) {
  :root { --label-w: 0px; }
  .hero { grid-template-columns: 1fr; gap: 28px; padding-top: 40px; padding-bottom: 40px; }
  .hero-photo { width: 140px; order: -1; }
  .initials { font-size: 36px; }
  .case-grid { grid-template-columns: 1fr; }
  .case { padding: 22px 20px 20px; }
  .case h3 { font-size: 27px; }

  /* Gantt: label above its bar, full-width track */
  .g-head, .g-row { grid-template-columns: 1fr; }
  .g-colname { display: none; }
  .g-axis, .g-track { margin: 0 12px; }
  .g-overlay { left: 12px; right: 12px; }
  .g-label { border-right: 0; padding: 8px 12px 0; flex-direction: row; justify-content: flex-start; align-items: baseline; gap: 8px; }
  .g-org { flex: 1; }
  .g-track { height: 24px; }
  .g-tick { font-size: 10px; }
  .g-tick.minor { display: none; }
  .g-row.project .g-org { display: none; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap { padding-inline: 16px; }
  .toolbar nav { gap: 12px; }
  .toolbar nav a:nth-child(3) { display: none; }
  .lead { font-size: 18px; }
  .before li { grid-template-columns: 1fr; gap: 4px; }
  .g-axis .g-tick:nth-child(even):not(.minor) { visibility: hidden; }
}
