/* ============================================================
   iyush.dev — shared design system
   Single source of truth for tokens, base styles, status bar,
   footer, service cards, command bar, blog list, and article.
   Linked by: index.html, projects.html, blog.html, blog-post.html
   ============================================================ */

/* ---------- Design tokens: DARK (default) ---------- */
:root {
  --bg: #0A0C10;
  --bg-grid: rgba(255,255,255,0.014);
  --surface: #101319;
  --surface-2: #141822;
  --border: #1C2230;
  --border-bright: #2A3242;
  --text: #E8EBF0;
  --muted: #6B7482;
  --muted-bright: #8B95A5;
  --live: #3FB950;
  --deploy: #D29922;
  --acquired: #A371F7;
  --archived: #545E70;

  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --display: "Space Grotesk", system-ui, sans-serif;

  --maxw: 1080px;
  --pad: clamp(20px, 5vw, 48px);

  /* themable helpers (re-tuned per theme below) */
  --bar-bg: rgba(10,12,16,0.72);
  --terminal-grad-a: #101319;
  --terminal-grad-b: #0D1017;
  --terminal-shadow: 0 24px 60px -30px rgba(0,0,0,0.8);
  --chrome-dot: #20262F;
  --pulse-ring: rgba(63,185,80,0.5);
  --pulse-ring-a: rgba(210,153,34,0.5);
  --sel-bg: rgba(63,185,80,0.28);
  --sel-fg: #ffffff;
  --chip-bg: #141822;
  --code-bg: #0D1017;
  --cmdbar-bg: rgba(16,19,25,0.82);
  --cmdbar-shadow: 0 16px 40px -18px rgba(0,0,0,0.85);
  --sdot-glow: 8px; /* blur radius of status-dot glow */
  --card-glow: 0.9; /* left-edge accent opacity on hover */
}

/* ---------- Design tokens: LIGHT ---------- */
/* Genuine warm-paper palette — not a naive invert.
   Status colors darkened/desaturated so they read on light,
   glows softened or removed. */
[data-theme="light"] {
  --bg: #F5F1E8;                  /* warm off-white paper */
  --bg-grid: rgba(45,38,22,0.035);
  --surface: #FCFAF4;             /* subtly elevated surface */
  --surface-2: #FFFFFF;           /* raised surface */
  --border: #E4DCCC;             /* hairline that reads on paper */
  --border-bright: #CFC4AF;
  --text: #1E2127;               /* dark charcoal */
  --muted: #8C8371;              /* warm gray */
  --muted-bright: #57503F;       /* warm dark gray */
  --live: #1E934F;               /* deep green */
  --deploy: #A66C08;             /* deep ochre-amber */
  --acquired: #7A46C9;           /* deep violet */
  --archived: #96907E;

  --bar-bg: rgba(245,241,232,0.82);
  --terminal-grad-a: #FFFFFF;
  --terminal-grad-b: #FBF8F1;
  --terminal-shadow: 0 22px 48px -30px rgba(45,38,22,0.28);
  --chrome-dot: #DED6C6;
  --pulse-ring: rgba(30,147,79,0.32);
  --pulse-ring-a: rgba(166,108,8,0.30);
  --sel-bg: rgba(30,147,79,0.20);
  --sel-fg: #0A0C10;
  --chip-bg: #F1EBDD;
  --code-bg: #F3EEE2;
  --cmdbar-bg: rgba(252,250,244,0.9);
  --cmdbar-shadow: 0 16px 40px -20px rgba(45,38,22,0.22);
  --sdot-glow: 0px;              /* no neon glow on paper */
  --card-glow: 0.75;
}

/* ============================================================
   DICE THEMES — the 🎲 button cycles through these.
   Each is a complete variable set so every component stays intentional.
   Status colors stay semantically distinct (live / deploy / acquired / archived).
   ============================================================ */

/* One Piece — deep Grand Line ocean, straw-hat gold + red */
[data-theme="onepiece"] {
  --bg: #0A1A2B; --bg-grid: rgba(242,183,5,0.03);
  --surface: #10233A; --surface-2: #16304D;
  --border: #1E3A57; --border-bright: #2E4E70;
  --text: #F4EAD2; --muted: #7C93AB; --muted-bright: #Aec3d8;
  --live: #35C46A; --deploy: #F2B705; --acquired: #E8322F; --archived: #5C7690;
  --bar-bg: rgba(10,26,43,0.78);
  --terminal-grad-a: #10233A; --terminal-grad-b: #0A1A2B;
  --terminal-shadow: 0 24px 60px -30px rgba(0,0,0,0.8);
  --chrome-dot: #274763;
  --pulse-ring: rgba(53,196,106,0.5); --pulse-ring-a: rgba(242,183,5,0.5);
  --sel-bg: rgba(242,183,5,0.28); --sel-fg: #0A1A2B;
  --chip-bg: #16304D; --code-bg: #081521;
  --cmdbar-bg: rgba(10,26,43,0.85); --cmdbar-shadow: 0 16px 40px -18px rgba(0,0,0,0.85);
  --sdot-glow: 8px; --card-glow: 0.9;
}

/* Matrix — phosphor green on black, CRT energy */
[data-theme="matrix"] {
  --bg: #000A02; --bg-grid: rgba(0,255,70,0.035);
  --surface: #02140A; --surface-2: #041F0E;
  --border: #0A3A18; --border-bright: #125A26;
  --text: #B9FFC6; --muted: #2E8A3F; --muted-bright: #57C06A;
  --live: #39FF14; --deploy: #B6FF3A; --acquired: #63FFB0; --archived: #2E8A3F;
  --bar-bg: rgba(0,10,2,0.8);
  --terminal-grad-a: #02140A; --terminal-grad-b: #000A02;
  --terminal-shadow: 0 24px 60px -30px rgba(0,0,0,0.9);
  --chrome-dot: #0F4A20;
  --pulse-ring: rgba(57,255,20,0.5); --pulse-ring-a: rgba(182,255,58,0.5);
  --sel-bg: rgba(57,255,20,0.3); --sel-fg: #000A02;
  --chip-bg: #041F0E; --code-bg: #010A04;
  --cmdbar-bg: rgba(0,12,3,0.86); --cmdbar-shadow: 0 16px 40px -18px rgba(0,20,6,0.9);
  --sdot-glow: 10px; --card-glow: 1;
}

/* Synthwave — indigo night, neon magenta/cyan/orange */
[data-theme="synthwave"] {
  --bg: #190E2B; --bg-grid: rgba(255,79,216,0.035);
  --surface: #221436; --surface-2: #2B1943;
  --border: #3A2357; --border-bright: #52347A;
  --text: #F5E9FF; --muted: #8A73A8; --muted-bright: #B79BD6;
  --live: #36F1CD; --deploy: #FF9E64; --acquired: #FF4FD8; --archived: #6C5A8C;
  --bar-bg: rgba(25,14,43,0.78);
  --terminal-grad-a: #221436; --terminal-grad-b: #190E2B;
  --terminal-shadow: 0 24px 60px -30px rgba(0,0,0,0.85);
  --chrome-dot: #3A2357;
  --pulse-ring: rgba(54,241,205,0.5); --pulse-ring-a: rgba(255,158,100,0.5);
  --sel-bg: rgba(255,79,216,0.3); --sel-fg: #190E2B;
  --chip-bg: #2B1943; --code-bg: #140A22;
  --cmdbar-bg: rgba(25,14,43,0.85); --cmdbar-shadow: 0 16px 40px -18px rgba(0,0,0,0.85);
  --sdot-glow: 10px; --card-glow: 1;
}

/* Dracula — the classic */
[data-theme="dracula"] {
  --bg: #21222C; --bg-grid: rgba(255,255,255,0.02);
  --surface: #282A36; --surface-2: #343746;
  --border: #44475A; --border-bright: #565973;
  --text: #F8F8F2; --muted: #6272A4; --muted-bright: #9AA5D0;
  --live: #50FA7B; --deploy: #F1FA8C; --acquired: #BD93F9; --archived: #6272A4;
  --bar-bg: rgba(33,34,44,0.78);
  --terminal-grad-a: #282A36; --terminal-grad-b: #21222C;
  --terminal-shadow: 0 24px 60px -30px rgba(0,0,0,0.75);
  --chrome-dot: #44475A;
  --pulse-ring: rgba(80,250,123,0.45); --pulse-ring-a: rgba(241,250,140,0.45);
  --sel-bg: rgba(189,147,249,0.3); --sel-fg: #21222C;
  --chip-bg: #343746; --code-bg: #1E1F28;
  --cmdbar-bg: rgba(33,34,44,0.86); --cmdbar-shadow: 0 16px 40px -18px rgba(0,0,0,0.8);
  --sdot-glow: 8px; --card-glow: 0.9;
}

/* Solarized Light — warm classic, easy on the eyes */
[data-theme="solarized"] {
  --bg: #FDF6E3; --bg-grid: rgba(88,110,117,0.05);
  --surface: #F6EFD8; --surface-2: #FFFDF3;
  --border: #E7DEC5; --border-bright: #D3C9AB;
  --text: #073642; --muted: #93A1A1; --muted-bright: #586E75;
  --live: #859900; --deploy: #B58900; --acquired: #6C71C4; --archived: #93A1A1;
  --bar-bg: rgba(253,246,227,0.82);
  --terminal-grad-a: #FFFDF3; --terminal-grad-b: #F6EFD8;
  --terminal-shadow: 0 22px 48px -30px rgba(88,110,117,0.35);
  --chrome-dot: #DDD3B8;
  --pulse-ring: rgba(133,153,0,0.32); --pulse-ring-a: rgba(181,137,0,0.3);
  --sel-bg: rgba(133,153,0,0.2); --sel-fg: #002B36;
  --chip-bg: #F0E8CE; --code-bg: #F3EBD3;
  --cmdbar-bg: rgba(253,246,227,0.9); --cmdbar-shadow: 0 16px 40px -20px rgba(88,110,117,0.28);
  --sdot-glow: 0px; --card-glow: 0.75;
}

/* ---------- Reset / base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  background-image:
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 44px 44px;
  color: var(--text);
  font-family: var(--display);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-bottom: clamp(90px, 14vh, 120px); /* clearance for floating command bar */
  transition: background-color .35s ease, color .35s ease;
}

a { color: inherit; text-decoration: none; }

::selection { background: var(--sel-bg); color: var(--sel-fg); }

:focus-visible {
  outline: 2px solid var(--live);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--pad); }

/* ---------- Status bar ---------- */
.statusbar {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid var(--border);
  background: var(--bar-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-family: var(--mono);
  font-size: 12.5px;
  transition: background-color .35s ease, border-color .35s ease;
}
.statusbar__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 11px var(--pad);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.sb-left { display: flex; align-items: center; gap: 10px; color: var(--muted-bright); min-width: 0; }
.sb-id { color: var(--text); }
.sb-sep { color: var(--border-bright); }
.sb-status { color: var(--live); white-space: nowrap; }
.sb-right { display: flex; align-items: center; gap: 16px; }
.sb-nav { display: flex; align-items: center; gap: 20px; }
.sb-nav a { color: var(--muted-bright); transition: color .18s ease; white-space: nowrap; }
.sb-nav a:hover { color: var(--live); }
.sb-nav a[aria-current="page"] { color: var(--text); }
.sb-nav .ext { color: var(--muted); }

/* theme toggle */
.theme-toggle {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 12px;
  color: var(--muted-bright); background: transparent;
  border: 1px solid var(--border); border-radius: 7px;
  padding: 5px 9px; cursor: pointer; line-height: 1;
  transition: color .18s ease, border-color .18s ease, background-color .18s ease;
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-bright); background: var(--surface); }
.theme-toggle .tt-icon { font-size: 12.5px; }
.theme-toggle .tt-label { letter-spacing: 0.02em; }

.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--live); flex: none;
  box-shadow: 0 0 0 0 var(--pulse-ring);
  animation: pulse 2.6s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 var(--pulse-ring); }
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ---------- Hero ---------- */
.hero { padding-top: clamp(56px, 11vh, 128px); padding-bottom: clamp(40px, 8vh, 88px); }

.terminal {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--terminal-grad-a) 0%, var(--terminal-grad-b) 100%);
  box-shadow: var(--terminal-shadow);
  overflow: hidden;
  transition: background-color .35s ease, border-color .35s ease, box-shadow .35s ease;
}
.terminal__chrome {
  display: flex; align-items: center; gap: 7px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  font-family: var(--mono); font-size: 11.5px; color: var(--muted);
}
.tl { width: 11px; height: 11px; border-radius: 50%; background: var(--chrome-dot); }
.terminal__chrome .path { margin-left: 10px; letter-spacing: .02em; }

.terminal__body { padding: clamp(24px, 4vw, 44px) clamp(20px, 4vw, 44px) clamp(30px, 4.5vw, 50px); }

.prompt {
  font-family: var(--mono); font-size: 14px; color: var(--muted-bright);
  margin-bottom: 20px; opacity: 0;
}
.prompt .caret { color: var(--live); }

.name {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(2.6rem, 8vw, 5.2rem);
  line-height: 0.98; letter-spacing: -0.035em;
  margin-bottom: 18px;
  opacity: 0; transform: translateY(14px);
}
.name .cursorblock {
  display: inline-block; width: 0.5em; height: 0.82em;
  background: var(--live); margin-left: 8px; transform: translateY(2px);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.role {
  font-family: var(--mono); font-weight: 400;
  font-size: clamp(0.95rem, 2.4vw, 1.25rem);
  color: var(--muted-bright); letter-spacing: -0.01em;
  min-height: 1.5em;
  opacity: 0;
}
.role .hl { color: var(--text); }
.role .typed-caret {
  display: inline-block; width: 8px; height: 1.05em;
  background: var(--live); margin-left: 3px; transform: translateY(3px);
  animation: blink 1.1s steps(1) infinite;
}

/* ---------- Metrics ---------- */
.metrics {
  display: flex; flex-wrap: wrap; gap: clamp(24px, 6vw, 64px);
  margin-top: clamp(28px, 5vh, 48px);
  font-family: var(--mono);
  opacity: 0; transform: translateY(10px);
}
.metric__num {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(1.7rem, 4.5vw, 2.4rem); letter-spacing: -0.03em;
  line-height: 1;
}
.metric__num .unit { color: var(--live); font-size: 0.55em; margin-left: 2px; }
.metric__label {
  font-size: 11.5px; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.14em; margin-top: 9px;
}

/* ---------- Section / eyebrow ---------- */
.section { padding-block: clamp(48px, 9vh, 96px); }
.eyebrow {
  font-family: var(--mono); font-size: 12.5px; color: var(--muted);
  letter-spacing: 0.06em; margin-bottom: 26px;
  display: flex; align-items: center; gap: 12px;
}
.eyebrow::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--border) 0%, transparent 100%);
}
.eyebrow .cmt { color: var(--live); }

/* page header (lighter than the hero, for /projects and /blog) */
.pagehead { padding-top: clamp(40px, 8vh, 84px); padding-bottom: clamp(8px, 2vh, 20px); }
.pagehead__title {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(2rem, 6vw, 3.3rem); letter-spacing: -0.03em; line-height: 1.02;
  margin-bottom: 14px;
}
.pagehead__lead {
  font-family: var(--mono); font-size: clamp(0.9rem, 2vw, 1.02rem);
  color: var(--muted-bright); max-width: 62ch; line-height: 1.55;
}

/* ---------- Services / project cards ---------- */
.grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.service {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  padding: 22px 22px 20px;
  display: flex; flex-direction: column; gap: 14px;
  transition: border-color .2s ease, transform .2s ease, background-color .25s ease, box-shadow .3s ease, color .3s ease;
  opacity: 0; transform: translateY(16px);
  overflow: hidden;
}
.service::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 2px;
  background: var(--sc, var(--live)); opacity: 0; transition: opacity .2s ease;
}
.service:hover {
  border-color: var(--border-bright);
  background: var(--surface-2);
  transform: translateY(-3px);
}
.service:hover::before { opacity: var(--card-glow); }

.service__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.service__status {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--sc, var(--live));
  display: inline-flex; align-items: center; gap: 8px;
}
.sdot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--sc, var(--live));
  box-shadow: 0 0 var(--sdot-glow) 0 var(--sc, var(--live));
  flex: none;
}
.service__tag {
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  letter-spacing: 0.02em; text-align: right;
}
.service__name {
  font-family: var(--display); font-weight: 500;
  font-size: 1.3rem; letter-spacing: -0.02em;
}
.service__desc { color: var(--muted-bright); font-size: 0.94rem; line-height: 1.45; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--mono); font-size: 11px; color: var(--muted-bright);
  background: var(--chip-bg); border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 9px; letter-spacing: 0.02em;
  transition: background-color .25s ease, border-color .25s ease, color .25s ease;
}
.service__link {
  margin-top: auto; font-family: var(--mono); font-size: 12.5px;
  color: var(--muted-bright); display: inline-flex; align-items: center; gap: 8px;
  transition: color .18s ease;
}
.service__link .arrow { color: var(--live); transition: transform .18s ease; }
/* the whole card is the link — animate the cue on card hover */
a.service { cursor: pointer; }
.service:hover .service__link { color: var(--text); }
.service:hover .service__link .arrow { transform: translateX(3px); }
/* non-clickable card (e.g. acquired/sold) — quiet footnote, no hover cue */
.service__note {
  margin-top: auto; font-family: var(--mono); font-size: 12px; color: var(--muted);
}

/* status colors */
.s-live     { --sc: var(--live); }
.s-deploy   { --sc: var(--deploy); }
.s-acquired { --sc: var(--acquired); }
.s-archived { --sc: var(--archived); }
.s-deploy .sdot { animation: pulse-a 2s infinite; }
@keyframes pulse-a {
  0% { box-shadow: 0 0 0 0 var(--pulse-ring-a); }
  70% { box-shadow: 0 0 0 6px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ---------- CTA commands ---------- */
.commands {
  margin-top: 30px; display: flex; flex-wrap: wrap; gap: 14px;
  font-family: var(--mono); font-size: 14px;
}
.cmd {
  display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid var(--border); border-radius: 8px;
  padding: 12px 16px; color: var(--muted-bright);
  transition: border-color .18s ease, color .18s ease, background-color .18s ease;
}
.cmd .arrow { color: var(--live); transition: transform .18s ease; }
.cmd:hover { border-color: var(--border-bright); color: var(--text); background: var(--surface); }
.cmd:hover .arrow { transform: translateX(4px); }
.cmd .sym { color: var(--live); }

/* ---------- Blog list (commit-log energy) ---------- */
.loglist { border-top: 1px solid var(--border); }
.logitem {
  position: relative; display: grid;
  grid-template-columns: 132px 1fr 92px; gap: 4px 24px;
  align-items: baseline;
  padding: 24px 14px; border-bottom: 1px solid var(--border);
  transition: background-color .2s ease;
}
.logitem::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--live); opacity: 0; transition: opacity .2s ease;
}
.logitem:hover { background: var(--surface); }
.logitem:hover::before { opacity: var(--card-glow); }
.logitem__date { font-family: var(--mono); font-size: 12.5px; color: var(--muted); letter-spacing: 0.02em; white-space: nowrap; }
.logitem__title { font-family: var(--display); font-weight: 500; font-size: 1.15rem; letter-spacing: -0.02em; margin-bottom: 6px; }
.logitem:hover .logitem__title { color: var(--live); }
.logitem__excerpt { color: var(--muted-bright); font-size: 0.92rem; line-height: 1.45; }
.logitem__read { font-family: var(--mono); font-size: 11.5px; color: var(--muted); text-align: right; white-space: nowrap; }
.sample-tag {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--deploy); border: 1px solid var(--border); border-radius: 4px;
  padding: 1px 6px; margin-left: 10px; vertical-align: middle;
}
.logempty { padding: 40px 14px 44px; }
.logempty__cmd { font-family: var(--mono); font-size: 14px; color: var(--muted-bright); margin-bottom: 12px; }
.logempty__prompt { color: var(--live); margin-right: 10px; }
.logempty__caret {
  display: inline-block; width: 8px; height: 1.05em; background: var(--live);
  margin-left: 3px; transform: translateY(2px);
  animation: blink 1.1s steps(1) infinite;
}
.logempty__msg { font-family: var(--mono); font-size: 13px; color: var(--muted); }

/* ---------- Article (blog post template) ---------- */
.article { max-width: 68ch; margin: 0 auto; padding-block: clamp(20px, 5vh, 40px); }
.article__back {
  font-family: var(--mono); font-size: 12.5px; color: var(--muted-bright);
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 28px;
  transition: color .18s ease;
}
.article__back .arrow { color: var(--live); transition: transform .18s ease; }
.article__back:hover { color: var(--text); }
.article__back:hover .arrow { transform: translateX(-4px); }
.article__meta { font-family: var(--mono); font-size: 12.5px; color: var(--muted); margin-bottom: 14px; letter-spacing: 0.02em; }
.article__meta .sep { color: var(--border-bright); margin: 0 8px; }
.article h1 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(1.9rem, 5vw, 2.8rem); letter-spacing: -0.03em; line-height: 1.05;
  margin-bottom: 24px;
}
.article h2 {
  font-family: var(--display); font-weight: 700; font-size: 1.5rem; letter-spacing: -0.02em;
  margin: 40px 0 14px;
}
.article h3 {
  font-family: var(--display); font-weight: 500; font-size: 1.2rem; letter-spacing: -0.01em;
  margin: 30px 0 10px;
}
.article p { color: var(--text); line-height: 1.72; margin-bottom: 20px; }
.article a.link { color: var(--live); border-bottom: 1px solid color-mix(in srgb, var(--live) 40%, transparent); }
.article a.link:hover { border-bottom-color: var(--live); }
.article ul, .article ol { margin: 0 0 20px 1.2em; color: var(--text); line-height: 1.7; }
.article li { margin-bottom: 8px; }
.article blockquote {
  border-left: 2px solid var(--acquired);
  padding: 4px 0 4px 20px; margin: 24px 0;
  color: var(--muted-bright); font-style: italic;
}
.article hr { border: none; border-top: 1px solid var(--border); margin: 40px 0; }

/* code — legible in both themes via themed --code-bg */
code {
  font-family: var(--mono); font-size: 0.88em;
  background: var(--code-bg); border: 1px solid var(--border);
  border-radius: 5px; padding: 2px 6px;
  transition: background-color .3s ease, border-color .3s ease;
}
pre {
  background: var(--code-bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px 18px; overflow: auto; margin: 0 0 22px;
  transition: background-color .3s ease, border-color .3s ease;
}
pre code { background: none; border: none; padding: 0; font-size: 13.5px; line-height: 1.65; display: block; }
.tok-c { color: var(--muted); }              /* comment */
.tok-k { color: var(--acquired); }           /* keyword */
.tok-s { color: var(--live); }               /* string  */
.tok-f { color: var(--deploy); }             /* function/attr */

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding-block: 28px;
  font-family: var(--mono); font-size: 12.5px; color: var(--muted);
  transition: border-color .35s ease;
}
.footer__inner {
  max-width: var(--maxw); margin: 0 auto; padding-inline: var(--pad);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
}
.footer a { color: var(--muted-bright); transition: color .18s ease; }
.footer a:hover { color: var(--live); }
.footer__links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer .build { display: inline-flex; align-items: center; gap: 9px; }

/* ---------- Floating command bar ---------- */
.cmdbar {
  position: fixed; left: 50%; bottom: clamp(16px, 4vh, 28px);
  transform: translateX(-50%); z-index: 60;
  width: min(460px, calc(100vw - 28px));
  display: flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 13.5px;
  background: var(--cmdbar-bg);
  border: 1px solid var(--border-bright);
  border-radius: 12px;
  padding: 11px 13px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--cmdbar-shadow);
  transition: border-color .2s ease, background-color .3s ease, box-shadow .3s ease;
}
.cmdbar:focus-within { border-color: var(--live); }
.cmdbar__prompt { color: var(--live); font-weight: 500; flex: none; }
.cmdbar__caret {
  display: none; width: 8px; height: 1.05em; background: var(--live);
  flex: none; animation: blink 1.1s steps(1) infinite;
}
.cmdbar.idle .cmdbar__caret { display: inline-block; }
.cmdbar__input {
  flex: 1; min-width: 0; background: none; border: none; outline: none;
  color: var(--text); font-family: var(--mono); font-size: 13.5px; padding: 0;
}
.cmdbar__input::placeholder { color: var(--muted); }
.cmdbar__key {
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  border: 1px solid var(--border); border-radius: 5px; padding: 1px 7px;
  background: var(--surface); flex: none; transition: opacity .18s ease;
}
.cmdbar:focus-within .cmdbar__key { opacity: 0; }

.cmdbar__pop {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 10px);
  background: var(--surface); border: 1px solid var(--border-bright);
  border-radius: 10px; padding: 12px 14px;
  box-shadow: var(--cmdbar-shadow); font-size: 12.5px; line-height: 1.6;
  color: var(--muted-bright);
  max-height: min(62vh, 440px); overflow: auto;
}
/* monospace block output (neofetch / top) */
.pop-pre { font-family: var(--mono); font-size: 12px; line-height: 1.6; white-space: pre; overflow-x: auto; color: var(--text); margin: 0; }
.pop-pre .k { color: var(--muted); }              /* key/label */
.pop-pre .live { color: var(--live); }
.pop-pre .deploy { color: var(--deploy); }
.pop-pre .acquired { color: var(--acquired); }
.pop-pre .archived { color: var(--archived); }
.pop-pre .accent { color: var(--live); }
.pop-h { color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; font-size: 10.5px; margin-bottom: 9px; }
.pop-list { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.pop-list li { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
.pop-list b { color: var(--text); font-weight: 500; }
.pop-list span { color: var(--muted); font-size: 11px; white-space: nowrap; }
.pop-tip { margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--border); color: var(--muted); font-size: 11px; }
.pop-tip kbd, .cmdbar__pop kbd {
  font-family: var(--mono); border: 1px solid var(--border); border-radius: 4px;
  padding: 0 5px; color: var(--muted-bright);
}
.pop-line { color: var(--muted-bright); }
.pop-line b { color: var(--text); }
.pop-err { color: var(--deploy); }
.pop-err b { color: var(--text); }

/* ---------- Dice button ---------- */
.theme-toggle.dice { padding: 5px 8px; }
.theme-toggle.dice .tt-icon { font-size: 14px; line-height: 1; }
@media (prefers-reduced-motion: no-preference) {
  #diceRoll:active .tt-icon { transform: rotate(-20deg) scale(1.1); transition: transform .12s ease; }
}

/* ---------- Theme roll toast ---------- */
.theme-toast {
  position: fixed; top: 60px; left: 50%; transform: translateX(-50%) translateY(-8px);
  z-index: 70; font-family: var(--mono); font-size: 12.5px; color: var(--text);
  background: var(--cmdbar-bg); border: 1px solid var(--border-bright);
  border-radius: 999px; padding: 8px 16px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--cmdbar-shadow);
  opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease;
}
.theme-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Live npm metric on the Owthorize card ---------- */
.live-metric {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12px; color: var(--muted-bright);
  margin-top: 2px;
}
.live-metric .ld {
  width: 7px; height: 7px; border-radius: 50%; background: var(--live);
  box-shadow: 0 0 var(--sdot-glow) 0 var(--live); flex: none;
  animation: pulse 2.6s infinite;
}
.live-metric b { color: var(--text); font-weight: 500; }

/* ---------- GitHub activity signal in the footer ---------- */
.gh-signal { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); }
.gh-signal .gh-label { font-size: 11px; letter-spacing: 0.04em; }
.gh-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 16px; }
.gh-bars i {
  display: block; width: 3px; min-height: 2px; border-radius: 1px;
  background: var(--live); opacity: 0.85;
}
.gh-last { font-size: 11px; color: var(--muted-bright); }

/* ---------- Reveal states (JS adds .in) ---------- */
.reveal { opacity: 0; transform: translateY(16px); }
.reveal.in { animation: rise .55s cubic-bezier(.2,.7,.2,1) forwards; }
.in .prompt,
.in .name,
.in .role,
.in .metrics { animation: rise .6s cubic-bezier(.2,.7,.2,1) forwards; }
.in .prompt  { animation-delay: .15s; }
.in .name    { animation-delay: .35s; }
.in .role    { animation-delay: .95s; }
.in .metrics { animation-delay: 1.15s; }
@keyframes rise { to { opacity: 1; transform: translateY(0); } }

.service.in { animation: rise .55s cubic-bezier(.2,.7,.2,1) forwards; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .grid { grid-template-columns: 1fr; }
  .sb-nav { gap: 14px; }
  .sb-nav .ext { display: none; }
  .metrics { gap: 28px; }
  .sb-right { gap: 12px; }
}
@media (max-width: 640px) {
  .logitem { grid-template-columns: 1fr; gap: 8px; padding: 20px 12px; }
  .logitem__read { text-align: left; }
}
@media (max-width: 460px) {
  .theme-toggle .tt-label { display: none; }
  .theme-toggle { padding: 5px 8px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto; }
  .prompt, .name, .role, .metrics, .service, .reveal { opacity: 1 !important; transform: none !important; }
  .dot, .name .cursorblock, .role .typed-caret, .cmdbar__caret { animation: none !important; }
}
