/* ==========================================================================
   roberjo.github.io · hand-written CSS, no framework

   ROOM II · THE STYLE FORGE · 2011 · Kelsey Advertising & Design

   Two years at an ad agency in LaGrange, GA teach you that the best ideas
   hide in plain sight, usually in the style guide. One custom property below
   is never used by any element. Agencies call that "brand equity."

   It has been rotated thirteen places, the way a junior designer rotates a
   logo until the client says "the first one." Rotate it back.

   Then go somewhere robots are told not to.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius: 14px;
  --radius-sm: 8px;
  --container: 1160px;
  --nav-h: 64px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  --fragment-2: "GUR"; /* <- the brand equity */
}

:root,
[data-theme="dark"] {
  --bg: #0a0e14;
  --bg-alt: #0d121a;
  --surface: #111823;
  --surface-2: #16202c;
  --border: #1f2a38;
  --border-strong: #2d3b4f;
  --text: #e6edf3;
  --text-muted: #9aa7b6;
  --text-faint: #6b7889;
  --accent: #38d9c0;
  --accent-strong: #6ff3dc;
  --accent-ink: #042620;
  --accent-soft: rgba(56, 217, 192, .12);
  --amber: #f5b454;
  --violet: #a78bfa;
  --sky: #60a5fa;
  --grid-line: rgba(255, 255, 255, .04);
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 18px 40px -20px rgba(0, 0, 0, .7);
  --glass: rgba(10, 14, 20, .72);
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f7f8fa;
  --bg-alt: #eef1f5;
  --surface: #ffffff;
  --surface-2: #f3f5f8;
  --border: #dde3ea;
  --border-strong: #c3ccd8;
  --text: #0f1722;
  --text-muted: #4a5868;
  --text-faint: #6b7889;
  --accent: #0d9480;
  --accent-strong: #0a7a69;
  --accent-ink: #ffffff;
  --accent-soft: rgba(13, 148, 128, .10);
  --amber: #b26b00;
  --violet: #6d4ed8;
  --sky: #2563eb;
  --grid-line: rgba(15, 23, 34, .05);
  --shadow: 0 1px 2px rgba(15, 23, 34, .05), 0 12px 28px -16px rgba(15, 23, 34, .28);
  --glass: rgba(247, 248, 250, .78);
  color-scheme: light;
}

/* Konami code → 3270 green screen. Up, up, down, down... you know the rest. */
[data-mainframe] {
  --bg: #020a03; --bg-alt: #031005; --surface: #04140a; --surface-2: #061a0d;
  --border: #0d3a1a; --border-strong: #155c29;
  --text: #33ff66; --text-muted: #22c34d; --text-faint: #179038;
  --accent: #33ff66; --accent-strong: #8dffad; --accent-ink: #011a06; --accent-soft: rgba(51, 255, 102, .12);
  --amber: #b6ff33; --violet: #33ff99; --sky: #66ffcc;
  --grid-line: rgba(51, 255, 102, .06);
  --font-sans: var(--font-mono);
  color-scheme: dark;
}
[data-mainframe] body { text-shadow: 0 0 6px rgba(51, 255, 102, .35); }
[data-mainframe] body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 200;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .25) 0 1px, transparent 1px 3px);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.02em; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
code, pre, kbd, .mono { font-family: var(--font-mono); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent); color: var(--accent-ink); }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .container { padding: 0 24px; } }

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 300;
  background: var(--accent); color: var(--accent-ink);
  padding: 8px 14px; border-radius: var(--radius-sm); font-weight: 600;
}
.skip-link:focus { top: 12px; color: var(--accent-ink); }

.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

kbd {
  font: 600 11px/1 var(--font-mono); padding: 3px 6px; border-radius: 5px;
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-muted);
}

.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60;
  background: linear-gradient(90deg, var(--accent), var(--violet), var(--amber));
  transform-origin: 0 50%; transform: scaleX(0);
}

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  background: var(--glass);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s var(--ease);
}
.nav.is-scrolled { border-bottom-color: var(--border); }
.nav__inner { height: 100%; display: flex; align-items: center; gap: 20px; }
.nav__brand { font-family: var(--font-mono); font-weight: 600; color: var(--text); font-size: 15px; display: inline-flex; align-items: center; }
.nav__brand:hover { color: var(--text); }
.nav__prompt { color: var(--accent); }
.nav__cursor { width: 8px; height: 16px; margin-left: 3px; background: var(--accent); animation: blink 1.1s steps(1) infinite; }
.nav nav { margin-left: auto; }
.nav__links { display: flex; gap: 2px; }
.nav__links a {
  display: block; padding: 6px 12px; border-radius: 999px;
  color: var(--text-muted); font-size: 14px; font-weight: 500;
  transition: color .15s, background .15s;
}
.nav__links a:hover { color: var(--text); background: var(--surface-2); }
.nav__links a.is-active { color: var(--text); background: var(--accent-soft); }
.nav__actions { display: flex; gap: 6px; align-items: center; }
.icon-btn {
  width: 38px; height: 38px; display: inline-grid; place-items: center;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
  border-radius: 10px; cursor: pointer; transition: color .15s, border-color .15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.kbd-btn {
  height: 38px; display: inline-flex; align-items: center; gap: 8px; padding: 0 10px 0 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
  border-radius: 10px; cursor: pointer; transition: color .15s, border-color .15s;
}
.kbd-btn:hover { color: var(--text); border-color: var(--border-strong); }
.kbd-btn .icon { width: 16px; height: 16px; }
[data-theme="dark"] .icon--moon, [data-theme="light"] .icon--sun { display: none; }
.nav__menu { display: none; }

@media (max-width: 920px) {
  .nav__menu { display: inline-grid; }
  .kbd-btn { display: none; }
  .nav__links {
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; gap: 2px; padding: 12px 16px 16px;
    background: var(--bg); border-bottom: 1px solid var(--border);
    display: none;
  }
  .nav__links.is-open { display: flex; }
  .nav__links a { border-radius: var(--radius-sm); padding: 10px 12px; font-size: 15px; }
}

/* ---------- Buttons, chips, tags ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: 11px;
  font: 600 15px/1 var(--font-sans); cursor: pointer;
  border: 1px solid transparent;
  transition: transform .15s var(--ease), background .15s, border-color .15s, color .15s, box-shadow .2s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 0 var(--accent-soft); }
.btn--primary:hover { background: var(--accent-strong); color: var(--accent-ink); box-shadow: 0 0 0 6px var(--accent-soft); }
.btn--ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn--ghost:hover { border-color: var(--accent); color: var(--text); }
.kbd-inline { margin-left: 4px; }

.chip {
  padding: 6px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
  font: 500 13px/1.4 var(--font-mono); transition: all .15s;
}
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip.is-active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags li {
  font: 500 12px/1 var(--font-mono); color: var(--text-muted);
  padding: 6px 9px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border);
}
.tags--lg li { font-size: 13px; padding: 8px 11px; transition: border-color .15s, color .15s; }
.tags--lg li:hover { border-color: var(--accent); color: var(--text); }

.badge {
  display: inline-block; font: 700 10px/1 var(--font-mono); letter-spacing: .06em;
  padding: 4px 6px; border-radius: 4px; margin-right: 8px; vertical-align: 1px;
}
.badge--aws { background: rgba(255, 153, 0, .14); color: #ff9900; border: 1px solid rgba(255, 153, 0, .35); }
[data-theme="light"] .badge--aws { color: #b36b00; }
.badge--cred { background: var(--accent-soft); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: calc(100svh - var(--nav-h)); display: flex; align-items: center; padding: 56px 0 88px; overflow: hidden; isolation: isolate; }
.hero__shader { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; display: block; }
.hero.no-webgl::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background: radial-gradient(60% 60% at 70% 30%, var(--accent-soft), transparent 70%), radial-gradient(40% 40% at 90% 80%, rgba(167, 139, 250, .12), transparent 70%);
}
.hero__grid-bg {
  position: absolute; inset: 0; pointer-events: none; z-index: -1;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, #000 20%, transparent 75%);
}
.hero__inner { position: relative; display: grid; grid-template-columns: 1fr 1.05fr; gap: 32px; align-items: center; width: 100%; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 500 13px/1.4 var(--font-mono); color: var(--text-muted); margin-bottom: 22px; padding: 6px 12px 6px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--glass); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); animation: pulse 2.4s ease-in-out infinite; }
.hero__title { font-size: clamp(48px, 7.4vw, 92px); font-weight: 800; letter-spacing: -.045em; line-height: .98; margin-bottom: 18px; }
.hero__title-accent {
  background: linear-gradient(100deg, var(--accent) 0%, var(--violet) 55%, var(--amber) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  background-size: 200% 100%; animation: sheen 8s ease-in-out infinite alternate;
}
.hero__role { font: 500 clamp(14px, 1.6vw, 17px)/1.5 var(--font-mono); color: var(--text-muted); margin-bottom: 20px; }
.hero__role .sep { color: var(--accent); margin: 0 6px; }
.hero__lede { font-size: 18px; color: var(--text-muted); max-width: 540px; }
.hero__lede strong { color: var(--text); font-weight: 600; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 28px; }
.hero__certs { display: grid; gap: 8px; font-size: 14px; color: var(--text-muted); }

.graph { position: relative; margin: 0; aspect-ratio: 1 / 1; max-height: 640px; width: 100%; }
.graph__canvas { width: 100%; height: 100%; display: block; cursor: grab; touch-action: pan-y; }
.graph__tip {
  position: absolute; left: 0; top: 0; pointer-events: none; z-index: 2;
  display: grid; gap: 2px; max-width: 260px; padding: 10px 12px; border-radius: 10px;
  background: var(--glass); border: 1px solid var(--border-strong); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow); font-size: 13px;
}
.graph__tip[hidden] { display: none; }
.graph__tip strong { font: 600 13px/1.3 var(--font-mono); color: var(--text); }
.graph__tip span { color: var(--text-muted); font-size: 12px; }
.graph__tip em { color: var(--accent); font: 500 11px/1.4 var(--font-mono); font-style: normal; }
.graph__legend { position: absolute; left: 0; right: 0; bottom: -8px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; font: 500 12px/1 var(--font-mono); color: var(--text-muted); }
.graph__legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-right: 6px; box-shadow: 0 0 10px var(--c); }
.graph__help { color: var(--text-faint); }

.hero__scroll { position: absolute; left: 50%; bottom: 22px; width: 24px; height: 38px; margin-left: -12px; border: 2px solid var(--border-strong); border-radius: 12px; }
.hero__scroll span { position: absolute; left: 50%; top: 7px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--accent); animation: scrollcue 1.8s ease-in-out infinite; }

@keyframes blink { 50% { opacity: 0; } }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px transparent; } }
@keyframes sheen { to { background-position: 100% 0; } }
@keyframes scrollcue { 0% { transform: translateY(0); opacity: 1; } 80% { transform: translateY(12px); opacity: 0; } 100% { opacity: 0; } }

@media (max-width: 960px) {
  .hero { min-height: 0; padding: 40px 0 72px; }
  .hero__inner { grid-template-columns: 1fr; gap: 24px; }
  .graph { max-width: 520px; margin: 0 auto; }
  .hero__scroll { display: none; }
}

/* ---------- Terminal chrome (shared) ---------- */
.terminal { border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.terminal__bar { display: flex; align-items: center; gap: 7px; padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.terminal__dot { width: 12px; height: 12px; border-radius: 50%; background: var(--border-strong); }
.win-btns { display: inline-flex; gap: 8px; }
.win-btn { border: 0; padding: 0; display: inline-grid; place-items: center; cursor: pointer; }
.win-btn svg { width: 8px; height: 8px; fill: none; stroke: rgba(0, 0, 0, .65); stroke-width: 1.6; stroke-linecap: round; opacity: 0; transition: opacity .12s; }
.terminal__bar:hover .win-btn svg, .win-btn:focus-visible svg { opacity: 1; }
.win-btn:active { filter: brightness(.85); }
.terminal__tool { margin-left: auto; font-size: 13px; line-height: 1; background: none; border: 1px solid var(--border); border-radius: 6px; padding: 3px 6px; cursor: pointer; }
.terminal__tool:hover { border-color: var(--border-strong); }
.terminal__tool + .terminal__close { margin-left: 6px; }
.terminal__dot:nth-child(1) { background: #ff5f57; }
.terminal__dot:nth-child(2) { background: #febc2e; }
.terminal__dot:nth-child(3) { background: #28c840; }
.terminal__title { margin-left: 8px; font: 500 12px/1 var(--font-mono); color: var(--text-faint); }
.terminal__close { margin-left: auto; font: 500 11px/1 var(--font-mono); color: var(--text-faint); background: none; border: 1px solid var(--border); border-radius: 6px; padding: 4px 7px; cursor: pointer; }
.terminal__close:hover { color: var(--text); border-color: var(--border-strong); }
.terminal__body { margin: 0; padding: 18px 20px 22px; font-size: 13.5px; line-height: 1.75; color: var(--text); white-space: pre-wrap; }
.t-prompt { color: var(--accent); }
.t-out { color: var(--text-muted); }
.t-val { color: var(--amber); }
.t-caret { display: inline-block; width: 8px; height: 15px; background: var(--accent); vertical-align: -2px; animation: blink 1.1s steps(1) infinite; }

/* ---------- Sections ---------- */
.section { padding: 104px 0; }
.section--alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section__kicker { font: 500 13px/1 var(--font-mono); color: var(--accent); margin-bottom: 14px; letter-spacing: .02em; }
.section__title { font-size: clamp(28px, 3.8vw, 44px); font-weight: 750; margin-bottom: 36px; max-width: 820px; letter-spacing: -.03em; }
.section__lede { color: var(--text-muted); font-size: 17px; max-width: 760px; margin: -16px 0 32px; }
.section__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 36px; }
.section__head .section__title { margin-bottom: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.subhead { font-size: 20px; margin: 64px 0 20px; }
@media (max-width: 640px) { .section { padding: 76px 0; } }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: 260px 1fr; gap: 56px; align-items: start; }
.about p { color: var(--text-muted); font-size: 17px; max-width: 740px; }
.about__media img { width: 240px; height: 240px; object-fit: cover; border-radius: 22px; border: 1px solid var(--border); box-shadow: var(--shadow); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 20px 0 0; max-width: 240px; }
.facts div { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.facts dt { font: 500 11px/1 var(--font-mono); color: var(--text-faint); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.facts dd { margin: 0; font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.principles { display: grid; gap: 12px; margin-top: 28px; }
.principles li { padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); color: var(--text-muted); font-size: 15px; }
.principles__k { color: var(--text); font-weight: 600; margin-right: 6px; }
@media (max-width: 800px) {
  .about { grid-template-columns: 1fr; gap: 32px; }
  .about__media { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
  .about__media img { width: 140px; height: 140px; }
  .facts { margin: 0; }
}

/* ---------- Cards ---------- */
.cards { display: grid; gap: 18px; }
.cards--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 960px) { .cards--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .cards--2, .cards--3 { grid-template-columns: minmax(0, 1fr); } }

.card {
  position: relative; display: block; min-width: 0; isolation: isolate;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; color: var(--text);
  transition: border-color .2s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
}
/* Cursor spotlight: --mx/--my are set by main.js. */
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1; opacity: 0;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), var(--accent-soft), transparent 60%);
  transition: opacity .25s;
}
.card:hover::before { opacity: 1; }
a.card:hover, .project:hover, .cap:hover { border-color: var(--border-strong); transform: translateY(-3px); box-shadow: var(--shadow); color: var(--text); }
.card h3 { font-size: 18px; }
.card p { color: var(--text-muted); font-size: 15px; }
.card__h { font: 600 13px/1 var(--font-mono); color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 18px; }

.card.is-flash { animation: flash 1.6s var(--ease); }
@keyframes flash { 0%, 40% { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); } }

.cap__icon { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 16px; background: var(--accent-soft); color: var(--accent); }
.cap__icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cap p { margin: 0; }

/* Projects */
.project { display: flex; flex-direction: column; }
.project .tags { margin-top: auto; padding-top: 6px; }
.project__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.project__label { font: 500 12px/1 var(--font-mono); color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }
.project__links { display: inline-flex; align-items: center; gap: 12px; }
.project__live { font: 500 13px/1 var(--font-mono); }
.project__repo { color: var(--text-faint); display: inline-flex; }
.project__repo:hover { color: var(--text); }
.project h3 a { color: var(--text); font-family: var(--font-mono); font-size: 18px; letter-spacing: -.01em; }
.project h3 a:hover { color: var(--accent); }
.project--feature { background: linear-gradient(180deg, var(--surface), var(--surface-2)); }
.project__snippet { margin: 0 0 16px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--bg); border: 1px solid var(--border); font-size: 12.5px; color: var(--text-muted); overflow-x: auto; white-space: pre; }
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 16px; font: 500 12.5px/1 var(--font-mono); }
.flow span:not(.flow__arrow) { padding: 7px 10px; border-radius: 6px; border: 1px dashed var(--border-strong); color: var(--text); }
.flow__arrow { color: var(--accent); }

.mini h4 { font: 600 15px/1.3 var(--font-mono); margin-bottom: 8px; color: var(--text); }
.mini p { font-size: 14px; margin-bottom: 12px; }
.mini__tech { font: 500 12px/1.4 var(--font-mono); color: var(--text-faint); }
.more-link { margin-top: 28px; font: 500 14px/1 var(--font-mono); }
.is-hidden { display: none !important; }

/* ---------- Architecture diagram ---------- */
.arch { padding: 16px; overflow-x: auto; }
.arch__svg { width: 100%; min-width: 720px; height: auto; display: block; }
.arch__lane { font: 600 11px var(--font-mono); fill: var(--text-faint); letter-spacing: .1em; }
.arch__edge { fill: none; stroke: var(--border-strong); stroke-width: 1.6; }
.arch__edge--dash { stroke-dasharray: 4 5; stroke: var(--text-faint); opacity: .6; }
.arch__arrow { fill: var(--border-strong); }
.arch__node rect { fill: var(--surface-2); stroke: var(--border-strong); stroke-width: 1.2; }
.arch__node text { font: 600 13px var(--font-sans); fill: var(--text); text-anchor: middle; }
.arch__node .arch__sub { font: 500 10.5px var(--font-mono); fill: var(--text-muted); }
.arch__node--hub rect { stroke: var(--accent); }
.arch__node--ai rect { stroke: var(--violet); fill: color-mix(in srgb, var(--violet) 10%, var(--surface-2)); }
.arch__node--store rect { stroke-dasharray: 4 4; }
.arch__packet { fill: var(--accent); filter: drop-shadow(0 0 5px var(--accent)); }
.arch__packet--ai { fill: var(--violet); filter: drop-shadow(0 0 5px var(--violet)); }

/* ---------- Career timeline ---------- */
.timeline { position: relative; display: grid; gap: 14px; }
.timeline::before { content: ""; position: absolute; left: 132px; top: 8px; bottom: 8px; width: 1px; background: linear-gradient(var(--accent), var(--violet), var(--amber), transparent); }
.timeline__item { display: grid; grid-template-columns: 116px 1fr; gap: 32px; align-items: start; position: relative; }
.timeline__item::before { content: ""; position: absolute; left: 128px; top: 22px; width: 9px; height: 9px; border-radius: 50%; background: var(--bg-alt); border: 2px solid var(--accent); }
.timeline__years { font: 600 13px/1.4 var(--font-mono); color: var(--accent); padding-top: 16px; text-align: right; }
.timeline__body { padding: 14px 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); transition: border-color .2s; }
.timeline__body:hover { border-color: var(--border-strong); }
.timeline__body h3 { font-size: 17px; margin-bottom: 6px; }
.timeline__body h3 span { color: var(--text-muted); font-weight: 500; font-size: 15px; }
.timeline__body p { color: var(--text-muted); font-size: 14.5px; margin: 0; }
.edu { margin: 28px 0 0; font-size: 15px; }
.edu__k { font: 600 12px/1 var(--font-mono); color: var(--accent); text-transform: uppercase; letter-spacing: .08em; margin-right: 12px; }
@media (max-width: 680px) {
  .timeline::before { left: 6px; }
  .timeline__item { grid-template-columns: 1fr; gap: 6px; padding-left: 26px; }
  .timeline__item::before { left: 2px; top: 6px; }
  .timeline__years { text-align: left; padding-top: 0; }
}

/* ---------- Live activity ---------- */
.langs { display: grid; gap: 12px; }
.lang { display: grid; grid-template-columns: 120px 1fr 44px; align-items: center; gap: 12px; font: 500 13px/1 var(--font-mono); }
.lang__name { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lang--placeholder .lang__name { color: var(--text-faint); grid-column: 1 / -1; }
.lang__bar { position: relative; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.lang__bar::after {
  content: ""; position: absolute; inset: 0 auto 0 0; width: var(--pct); border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--violet));
  animation: grow 1s var(--ease) both; animation-delay: calc(var(--i) * 80ms);
}
.lang__pct { color: var(--text-muted); text-align: right; }
@keyframes grow { from { width: 0; } }
.recent { display: grid; gap: 2px; }
.recent li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.recent li:last-child { border-bottom: 0; }
.recent a { font: 600 14px/1.4 var(--font-mono); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent a:hover { color: var(--accent); }
.recent__meta { font: 500 12px/1.4 var(--font-mono); color: var(--text-faint); white-space: nowrap; }
.activity__meta { margin-top: 18px; font-size: 12.5px; color: var(--text-faint); }

/* ---------- Stack ---------- */
.stack { display: grid; gap: 28px; }
.stack__group { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; padding-bottom: 28px; border-bottom: 1px solid var(--border); }
.stack__group:last-child { border-bottom: 0; padding-bottom: 0; }
.stack__group h3 { font: 600 13px/1.6 var(--font-mono); color: var(--text-muted); margin: 6px 0 0; text-transform: uppercase; letter-spacing: .06em; }
@media (max-width: 720px) { .stack__group { grid-template-columns: 1fr; gap: 12px; } }

/* ---------- Writing ---------- */
.article__meta { display: block; font: 500 12px/1 var(--font-mono); color: var(--accent); margin-bottom: 14px; text-transform: uppercase; letter-spacing: .06em; }
.article h3 { font-size: 19px; }
.article p { margin: 0; }

/* ---------- Contact ---------- */
.contact { text-align: center; }
.contact .section__title { margin-left: auto; margin-right: auto; }
.contact__lede { color: var(--text-muted); font-size: 18px; max-width: 640px; margin: -12px auto 32px; }
.contact__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.socials { display: flex; justify-content: center; gap: 24px; margin-top: 28px; font: 500 14px/1 var(--font-mono); }
.socials a { color: var(--text-muted); }
.socials a:hover { color: var(--accent); }

/* ---------- Footer ---------- */
.footer { padding: 32px 0; border-top: 1px solid var(--border); font-size: 14px; color: var(--text-faint); }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.footer__mono { font-family: var(--font-mono); font-size: 12.5px; }
.footer a { color: var(--text-muted); }

/* ---------- Dialogs: shell & palette ---------- */
dialog { padding: 0; border: 0; background: transparent; color: var(--text); max-width: none; max-height: none; }
dialog::backdrop { background: rgba(3, 6, 10, .55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
[data-theme="light"] dialog::backdrop { background: rgba(15, 23, 34, .28); }

.shell { width: min(900px, calc(100vw - 24px)); margin: auto; }
.shell .terminal__bar { cursor: default; user-select: none; }
.shell.is-max { width: 100vw; height: 100vh; margin: 0; }
.shell.is-max .terminal { height: 100vh; border-radius: 0; border: 0; }
.shell.is-minimizing { animation: minimize .22s var(--ease) forwards; }
@keyframes minimize { to { opacity: 0; transform: translate(-38vw, 42vh) scale(.12); } }

.shell-dock {
  position: fixed; left: 16px; bottom: 16px; z-index: 240;
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px;
  border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); box-shadow: var(--shadow);
  font: 600 13px/1 var(--font-mono); color: var(--text); cursor: pointer; animation: pop .2s var(--ease);
}
.shell-dock[hidden] { display: none; }
.shell-dock:hover { border-color: var(--accent); }
.shell-dock__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.shell-dock__hint { font-weight: 500; color: var(--text-faint); }
@media (max-width: 520px) { .shell-dock__hint { display: none; } }

/* ---------- BBS mode (classic 16-color ANSI, always on a black screen) ---------- */
.shell .terminal:has(.shell__out.is-bbs) { background: #000; border-color: #1c1c3a; }
.shell .terminal:has(.shell__out.is-bbs) .shell__form { border-top-color: #1c1c3a; }
.shell .terminal:has(.shell__out.is-bbs) .shell__in { color: #fff; caret-color: #55ffff; }
.shell .terminal:has(.shell__out.is-bbs) .shell__prompt { color: #55ffff; }
.shell__out.is-bbs { background: #000; color: #aaa; text-shadow: 0 0 4px rgba(85, 255, 255, .18); }
.shell__out.is-bbs a { color: #55ffff; text-decoration: underline; }
.bbs-blu { color: #5555ff; }
.bbs-cyn { color: #55ffff; }
.bbs-mag { color: #ff55ff; }
.bbs-yel { color: #ffff55; }
.bbs-grn { color: #55ff55; }
.bbs-red { color: #ff5555; }
.bbs-wht { color: #fff; }
.bbs-dim { color: #888; }
.bbs-b { font-weight: 700; }
.bbs-key { color: #55ffff; font-weight: 700; }
.bbs-body { color: #ccc; }
.bbs-banner-line { line-height: 1.02; letter-spacing: 0; }
.bbs-banner {
  background: linear-gradient(90deg, #55ffff, #5555ff 35%, #ff55ff 65%, #ffff55);
  -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none;
}
.shell[open] { animation: pop .18s var(--ease); }
.shell .terminal { display: flex; flex-direction: column; height: min(560px, calc(100svh - 48px)); background: color-mix(in srgb, var(--surface) 94%, transparent); }
.shell__out { flex: 1; overflow-y: auto; padding: 16px 18px 8px; font: 13.5px/1.7 var(--font-mono); }
.sh-line { white-space: pre-wrap; word-break: break-word; }
.sh-pre { white-space: pre; overflow-x: auto; line-height: 1.15; }
.sh-prompt { color: var(--accent); }
.sh-cmd { color: var(--accent); }
.sh-key { color: var(--violet); font-weight: 600; }
.sh-val { color: var(--amber); }
.sh-ok { color: #28c840; }
[data-theme="light"] .sh-ok { color: #138a2c; }
.sh-err { color: #ff6b6b; }
[data-theme="light"] .sh-err { color: #c62828; }
.sh-dim { color: var(--text-muted); }
.shell__form { display: flex; align-items: center; gap: 10px; padding: 12px 18px 16px; border-top: 1px solid var(--border); }
.shell__prompt { font: 600 13.5px/1 var(--font-mono); color: var(--accent); white-space: nowrap; }
.shell__in { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: var(--text); font: 13.5px/1.6 var(--font-mono); caret-color: var(--accent); }
@media (max-width: 520px) { .shell__prompt { display: none; } }

.palette { width: min(620px, calc(100vw - 24px)); margin: 12vh auto auto; }
.palette[open] { animation: pop .16s var(--ease); }
.palette__box { border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.palette__in { width: 100%; padding: 18px 20px; border: 0; border-bottom: 1px solid var(--border); background: transparent; color: var(--text); font: 500 16px/1.4 var(--font-sans); outline: none; }
.palette__list { max-height: 50vh; overflow-y: auto; padding: 6px; }
.palette__list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: 9px; cursor: pointer; font-size: 14.5px; }
.palette__list li.is-sel { background: var(--accent-soft); color: var(--text); }
.palette__hint { font: 500 12px/1.6 var(--font-mono); color: var(--text-faint); }
.palette__foot { margin: 0; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--text-faint); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 250; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 12px 16px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); box-shadow: var(--shadow);
  font: 500 13px/1.4 var(--font-mono); color: var(--text); max-width: calc(100vw - 32px);
  transition: opacity .2s, transform .2s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
