:root {
  --ink: #0c0d10;
  --ink-2: #16181d;
  --line-dark: rgba(255, 255, 255, 0.10);
  --paper: #f6f5f1;
  --card: #ffffff;
  --text: #1b1c1f;
  --muted: #6c6e74;
  --line: #e4e2db;
  --accent: oklch(0.60 0.17 256);
  --accent-soft: oklch(0.60 0.17 256 / 0.12);
  --on-dark: #eceae5;
  --on-dark-muted: #9a9ca3;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --display: "Space Grotesk", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}
.layout { display: grid; grid-template-columns: 372px 1fr; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.side {
  background: var(--ink);
  color: var(--on-dark);
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  padding: 44px 38px;
  display: flex;
  flex-direction: column;
  gap: 30px;
  border-right: 1px solid var(--line-dark);
}
.side::-webkit-scrollbar { width: 7px; }
.side::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 4px; }

.brandmark { display: flex; align-items: center; gap: 11px; }
.brandmark .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 14px var(--accent); }
.brandmark span { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--on-dark-muted); }

.photo {
  display: block;
  flex: 0 0 auto;
  width: 172px;
  height: 240px;
  background: #e7e6e1;
  border-radius: 16px;
  object-fit: cover;
  object-position: 50% 50%;
}
.id-block h1 { font-family: var(--display); font-weight: 600; font-size: 33px; line-height: 1.05; letter-spacing: -0.015em; color: #fff; }
.id-block .role { margin-top: 9px; font-size: 14.5px; color: var(--accent); font-weight: 500; }
.id-block .loc { margin-top: 4px; font-size: 13px; color: var(--on-dark-muted); font-family: var(--mono); }

.side-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--on-dark-muted); margin-bottom: 13px; }

.contact-list { display: flex; flex-direction: column; gap: 11px; }
.contact-list a, .contact-list .ci { display: flex; align-items: center; gap: 11px; color: var(--on-dark); text-decoration: none; font-size: 13.5px; transition: color .18s; }
.contact-list a:hover { color: var(--accent); }
.contact-list svg { width: 16px; height: 16px; flex: none; color: var(--on-dark-muted); }
.contact-list a:hover svg { color: var(--accent); }

.langs { display: flex; flex-direction: column; gap: 14px; }
.lang-row .lt { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 6px; }
.lang-row .lt .lvl { color: var(--on-dark-muted); font-family: var(--mono); font-size: 11px; }
.bar { height: 3px; background: rgba(255, 255, 255, 0.10); border-radius: 3px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transform-origin: left; transform: scaleX(0); transition: transform 1s cubic-bezier(.2, .7, .2, 1); }
.side-foot { margin-top: auto; font-family: var(--mono); font-size: 10.5px; color: var(--on-dark-muted); letter-spacing: 0.04em; }

/* ---------- Main ---------- */
.main { padding: 64px clamp(40px, 6vw, 96px) 96px; max-width: 980px; }
section { margin-bottom: 64px; }
.sec-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 30px; }
.sec-head .num { font-family: var(--mono); font-size: 12px; color: var(--accent); letter-spacing: 0.1em; }
.sec-head h2 { font-family: var(--display); font-weight: 600; font-size: 21px; letter-spacing: -0.01em; }
.sec-head .rule { flex: 1; height: 1px; background: var(--line); }

.lede { font-size: clamp(19px, 2.1vw, 23px); line-height: 1.5; font-family: var(--display); font-weight: 400; letter-spacing: -0.01em; max-width: 30ch; }
.lede.first { margin-bottom: 0; }
#about p + p { margin-top: 18px; font-family: var(--sans); font-size: 16px; line-height: 1.6; color: #44464b; max-width: 62ch; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-top: 34px; }
.stat { background: var(--card); padding: 22px 20px; }
.stat .v { font-family: var(--display); font-weight: 600; font-size: 30px; letter-spacing: -0.02em; }
.stat .l { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.35; }

/* Experience */
.xp { position: relative; padding-left: 26px; }
.xp::before { content: ""; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.job { position: relative; padding-bottom: 34px; }
.job:last-child { padding-bottom: 0; }
.job::before { content: ""; position: absolute; left: -25.5px; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--paper); border: 2px solid var(--accent); }
.job .period { font-family: var(--mono); font-size: 11.5px; color: var(--muted); letter-spacing: 0.04em; }
.job .title-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 12px; margin-top: 7px; }
.job h3 { font-family: var(--display); font-weight: 600; font-size: 19px; letter-spacing: -0.01em; }
.job .at { color: var(--muted); font-size: 14px; }
.job .at b { color: var(--text); font-weight: 600; }
.tag { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent); background: var(--accent-soft); padding: 3px 8px; border-radius: 5px; }
.job .blurb { color: #54565b; font-size: 14px; margin-top: 10px; max-width: 70ch; }
.job ul { list-style: none; margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.job ul li { position: relative; padding-left: 18px; font-size: 14.5px; color: #2c2e33; max-width: 74ch; }
.job ul li::before { content: ""; position: absolute; left: 0; top: 9px; width: 5px; height: 5px; border-radius: 1px; background: var(--accent); transform: rotate(45deg); }
.chip-label { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); margin-top: 20px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip-label + .chip-row { margin-top: 9px; }
.chip { font-size: 12.5px; font-family: var(--mono); padding: 5px 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--card); color: #44464b; }
.chip.win { border-color: transparent; background: var(--ink); color: var(--on-dark); display: inline-flex; gap: 8px; align-items: center; }
.chip.win::before { content: "★"; color: var(--accent); font-size: 11px; }

/* Skills */
.skill-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.skill-cell { background: var(--card); padding: 20px 22px; }
.skill-cell h4 { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent); margin-bottom: 12px; }
.skill-cell .tags { display: flex; flex-wrap: wrap; gap: 7px; }
.skill-cell .tags span { font-size: 13px; color: #34363b; }
.skill-cell .tags span:not(:last-child)::after { content: "·"; color: var(--line); margin-left: 7px; }

/* Two-col grid for edu/training */
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.stack { display: flex; flex-direction: column; gap: 22px; }
.ed .period { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.ed h4 { font-family: var(--display); font-size: 15.5px; font-weight: 600; margin-top: 5px; }
.ed .org { font-size: 13.5px; color: var(--text); margin-top: 3px; }
.ed .note { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.tr-row { display: flex; gap: 14px; align-items: baseline; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.tr-row:last-child { border-bottom: none; padding-bottom: 0; }
.tr-row .d { font-family: var(--mono); font-size: 11.5px; color: var(--accent); flex: none; width: 58px; }
.tr-row .t { font-size: 14px; }

.interests { display: flex; flex-wrap: wrap; gap: 9px; }
.interests span { font-size: 13.5px; padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: #44464b; }
.detail { display: flex; flex-wrap: wrap; gap: 10px 32px; margin-top: 26px; font-family: var(--mono); font-size: 13px; color: #44464b; }
.detail b { color: var(--accent); font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em; font-size: 10.5px; margin-right: 10px; }

.endnote { font-family: var(--mono); font-size: 11.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 22px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* reveal */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .bar > i { transition: none; }
  html { scroll-behavior: auto; }
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: column; }
  .main { padding: 48px 28px 72px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .skill-grid { grid-template-columns: 1fr; }
  .two { grid-template-columns: 1fr; gap: 40px; }
}

/* No-JS fallback: reveal content even if the enhancement script doesn't run */
.no-js .reveal { opacity: 1; transform: none; }
.no-js .bar > i { transform: scaleX(var(--lvl, 0)); }
