/* Johnice Edwards Tech — site styles
   Every color, font and size is a token on :root. Dark is the default theme;
   [data-theme="light"] swaps the tokens. Sections are ordered:
   tokens → base → layout → components → pages → motion. */

:root {
  --bg: #0A0B10;
  --bg-2: #0F1117;
  --surface: #14161E;
  --surface-2: #1A1D27;
  --surface-3: #222634;
  --line: rgba(232, 236, 255, 0.08);
  --line-strong: rgba(232, 236, 255, 0.16);
  --text: #E9ECF5;
  --text-2: #C3C8D8;
  --muted: #8C93A8;
  --blue: #6E95FF;
  --blue-strong: #4F7BFF;
  --lavender: #B9A2FF;
  --mint: #6FE3C8;
  --amber: #F4C67A;
  --rose: #FF8FA8;
  --glow-blue: rgba(79, 123, 255, 0.22);
  --glow-lavender: rgba(185, 162, 255, 0.18);
  --gradient: linear-gradient(115deg, #6E95FF 0%, #9C8CFF 50%, #C9A8FF 100%);
  --gradient-soft: linear-gradient(135deg, rgba(110, 149, 255, 0.14), rgba(185, 162, 255, 0.10));
  --on-accent: #0A0B10;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 20px 50px -24px rgba(0, 0, 0, 0.7);
  --code-bg: #0D0F15;

  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --radius-lg: 24px;
  --radius: 16px;
  --radius-sm: 10px;
  --wrap: 1180px;
  --header-h: 68px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #F5F6FA;
  --bg-2: #EEF0F6;
  --surface: #FFFFFF;
  --surface-2: #F7F8FC;
  --surface-3: #ECEEF5;
  --line: rgba(20, 24, 40, 0.09);
  --line-strong: rgba(20, 24, 40, 0.18);
  --text: #121521;
  --text-2: #31364A;
  --muted: #5D6479;
  --blue: #2F5BEA;
  --blue-strong: #2449C9;
  --lavender: #6E4FD8;
  --mint: #0F8A70;
  --amber: #A86A00;
  --rose: #C2365A;
  --glow-blue: rgba(47, 91, 234, 0.12);
  --glow-lavender: rgba(110, 79, 216, 0.10);
  --gradient: linear-gradient(115deg, #2F5BEA 0%, #5B4FE0 55%, #8A55D8 100%);
  --gradient-soft: linear-gradient(135deg, rgba(47, 91, 234, 0.08), rgba(110, 79, 216, 0.07));
  --on-accent: #FFFFFF;
  --shadow: 0 1px 2px rgba(20, 24, 40, 0.04), 0 18px 40px -26px rgba(20, 24, 40, 0.35);
  --code-bg: #0F1219;
  color-scheme: light;
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--lavender); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
::selection { background: rgba(110, 149, 255, 0.35); color: var(--text); }

h1, h2, h3, h4 { font-family: var(--font-display); color: var(--text); margin: 0; font-weight: 600; letter-spacing: -0.02em; line-height: 1.12; }
h1 { font-size: clamp(40px, 6.2vw, 74px); letter-spacing: -0.035em; line-height: 1.02; }
h2 { font-size: clamp(30px, 3.6vw, 44px); letter-spacing: -0.03em; }
h3 { font-size: 21px; }
h1 em, h2 em { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
p { margin: 0; }
code, kbd, pre { font-family: var(--font-mono); }

.skip-link { position: absolute; left: -9999px; top: 0; }
.skip-link:focus { left: 16px; top: 12px; z-index: 200; background: var(--surface); color: var(--text); padding: 10px 16px; border-radius: 999px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Layout ---------- */

.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.wrap-narrow { max-width: 760px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.section { padding-top: 104px; padding-bottom: 104px; position: relative; }
.section-tight { padding-top: 64px; padding-bottom: 64px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 960px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .section { padding-top: 72px; padding-bottom: 72px; }
  .wrap, .wrap-narrow { padding-left: 16px; padding-right: 16px; }
}

.lede { font-size: 19px; line-height: 1.6; color: var(--text-2); max-width: 640px; }
.muted { color: var(--muted); }
.small { font-size: 14px; color: var(--muted); }
.mono { font-family: var(--font-mono); }
.gradient-text { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--blue);
}
.eyebrow::before { content: ''; width: 18px; height: 1px; background: currentColor; opacity: 0.7; }

.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 44px; flex-wrap: wrap; }
.section-head .stack { gap: 14px; max-width: 680px; }
.section-link { font-family: var(--font-mono); font-size: 14px; text-decoration: none; white-space: nowrap; }
.section-link:hover { text-decoration: underline; }

/* Ambient background: faint grid + two glows. Purely decorative. */
.backdrop { position: relative; isolation: isolate; }
.backdrop::before {
  content: ''; position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 30%, transparent 75%);
  opacity: 0.55;
}
.backdrop::after {
  content: ''; position: absolute; inset: -10% 0 0 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(600px 380px at 78% 18%, var(--glow-lavender), transparent 70%),
    radial-gradient(640px 420px at 12% 8%, var(--glow-blue), transparent 70%);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50; min-height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 16.5px; letter-spacing: -0.01em; }
.brand-sub { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); letter-spacing: 0.06em; }

.site-nav { display: flex; align-items: center; gap: 6px; }
.nav-list { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav-list a {
  display: block; padding: 8px 12px; border-radius: 999px; text-decoration: none;
  color: var(--text-2); font-size: 14.5px; font-weight: 500; transition: color .2s, background .2s;
}
.nav-list a:hover { color: var(--text); background: var(--surface-2); }
.nav-list a[aria-current="page"] { color: var(--text); background: var(--surface-3); }

.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer;
  transition: border-color .2s, background .2s;
}
.icon-btn:hover { border-color: var(--line-strong); background: var(--surface-2); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }
.nav-toggle { display: none; }

@media (max-width: 920px) {
  .nav-toggle { display: inline-grid; }
  .site-nav { gap: 8px; }
  .nav-list {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; gap: 4px; padding: 12px 16px 20px;
    background: var(--bg); border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav-list.open { display: flex; }
  .nav-list a { padding: 12px 14px; border-radius: 12px; font-size: 16px; }
}

/* ---------- Buttons, tags, badges ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent;
  font: 600 15px/1 var(--font-sans); text-decoration: none; cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background .2s, border-color .2s, color .2s;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--gradient); color: var(--on-accent); box-shadow: 0 10px 30px -12px var(--blue-strong); }
.btn-primary:hover { color: var(--on-accent); transform: translateY(-2px); box-shadow: 0 16px 36px -14px var(--blue-strong); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { color: var(--text); border-color: var(--blue); transform: translateY(-2px); }
.btn-text { color: var(--text-2); padding: 0 6px; }
.btn-text:hover { color: var(--text); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

.tag-list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.tag {
  display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px;
  font: 500 12.5px/1.4 var(--font-mono); color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--line); text-decoration: none; white-space: nowrap;
}
a.tag:hover { color: var(--text); border-color: var(--blue); }
.tag-accent { color: var(--blue); border-color: color-mix(in srgb, var(--blue) 35%, transparent); background: color-mix(in srgb, var(--blue) 10%, transparent); }

.status {
  display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px 4px 9px; border-radius: 999px;
  font: 600 12px/1.4 var(--font-mono); letter-spacing: 0.02em; white-space: nowrap;
  border: 1px solid currentColor; background: color-mix(in srgb, currentColor 10%, transparent);
}
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-completed { color: var(--mint); }
.status-in-progress { color: var(--blue); }
.status-in-progress::before { animation: pulse 2s ease-in-out infinite; }
.status-planned { color: var(--amber); }
.status-planned::before { background: transparent; border: 1.5px solid currentColor; }
.status-draft { color: var(--rose); }

/* ---------- Cards ---------- */

.card {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  color: inherit; text-decoration: none; box-shadow: var(--shadow);
  transition: transform .3s cubic-bezier(.2,.7,.2,1), border-color .3s, box-shadow .3s;
}
a.card:hover, .card.is-link:hover { transform: translateY(-4px); border-color: var(--line-strong); color: inherit; }
.card-media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
a.card:hover .card-media img, .card.is-link:hover .card-media img { transform: scale(1.035); }
.card-body { display: flex; flex-direction: column; gap: 12px; padding: 22px 24px 24px; flex: 1; }
.card-kicker { font: 500 12px/1.4 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--blue); }
.card h3 { font-size: 20px; line-height: 1.25; }
.card-excerpt { color: var(--text-2); font-size: 15.5px; line-height: 1.6; }
.card-meta { margin-top: auto; padding-top: 6px; font: 400 13px/1.4 var(--font-mono); color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.card-arrow { margin-left: auto; color: var(--blue); transition: transform .25s; }
a.card:hover .card-arrow, .card.is-link:hover .card-arrow { transform: translateX(4px); }

/* Project cards: a cursor-following spotlight (set by main.js through --mx/--my). */
.project-card::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; border-radius: inherit;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 0%), rgba(140, 160, 255, 0.13), transparent 60%);
  transition: opacity .3s;
}
.project-card:hover::after { opacity: 1; }
.project-card .card-media .status { position: absolute; top: 14px; left: 14px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(6px); }
.project-card .stretched::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.project-card h3 a { color: inherit; text-decoration: none; }
.project-card .card-links { position: relative; z-index: 2; display: flex; gap: 14px; font: 500 13px/1.4 var(--font-mono); }
.project-card .card-links a { text-decoration: none; }
.project-card .card-links a:hover { text-decoration: underline; }

.feature-post { display: grid; grid-template-columns: 1.15fr 1fr; }
.feature-post .card-media { aspect-ratio: auto; min-height: 320px; border-bottom: 0; border-right: 1px solid var(--line); }
.feature-post .card-body { padding: 36px; gap: 16px; justify-content: center; }
.feature-post h3 { font-size: clamp(24px, 2.6vw, 32px); line-height: 1.15; }
@media (max-width: 820px) {
  .feature-post { grid-template-columns: 1fr; }
  .feature-post .card-media { min-height: 0; aspect-ratio: 16 / 9; border-right: 0; border-bottom: 1px solid var(--line); }
  .feature-post .card-body { padding: 24px; }
}

.empty-state {
  border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); padding: 36px;
  text-align: center; color: var(--muted); background: var(--gradient-soft);
}
.empty-state strong { display: block; color: var(--text); font-family: var(--font-display); font-size: 19px; margin-bottom: 6px; }

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

.hero { padding-top: 88px; padding-bottom: 96px; overflow-x: clip; }
.hero-grid { display: grid; grid-template-columns: 1.08fr 1fr; gap: 56px; align-items: center; }
.hero h1 { margin: 22px 0 24px; font-size: clamp(40px, 5.2vw, 66px); }
.hero h1 .line { display: block; }
.hero .lede { margin-bottom: 34px; }
.hero-note { margin-top: 28px; display: flex; gap: 18px; flex-wrap: wrap; font: 400 13px/1.4 var(--font-mono); color: var(--muted); }
.hero-note span { display: inline-flex; align-items: center; gap: 8px; }
.hero-note span::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 10px var(--mint); }
@media (max-width: 960px) { .hero-grid { grid-template-columns: 1fr; gap: 48px; } .hero { padding-top: 56px; } }

/* The hero "terminal" visual */
.terminal {
  position: relative; border-radius: var(--radius-lg); background: var(--code-bg);
  border: 1px solid var(--line-strong); box-shadow: 0 40px 80px -40px rgba(30, 50, 140, 0.55), var(--shadow);
  overflow: hidden; color: #D6DBEA;
}
.terminal-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.07); background: rgba(255,255,255,0.025); }
.terminal-bar i { width: 11px; height: 11px; border-radius: 50%; background: #3A3F52; }
.terminal-bar i:nth-child(1) { background: #FF8FA8; }
.terminal-bar i:nth-child(2) { background: #F4C67A; }
.terminal-bar i:nth-child(3) { background: #6FE3C8; }
.terminal-bar span { margin-left: 10px; font: 400 12px/1 var(--font-mono); color: #8C93A8; }
.terminal-body { padding: 20px 22px 24px; font: 400 14px/1.75 var(--font-mono); min-height: 286px; }
.terminal-body .ln { display: block; white-space: pre-wrap; }
.terminal-body .prompt { color: #6FE3C8; }
.terminal-body .path { color: #9DB6FF; }
.terminal-body .out { color: #A9B0C4; }
.terminal-body .hl { color: #C9A8FF; }
.terminal-body .ok { color: #6FE3C8; }
.caret { display: inline-block; width: 8px; height: 1.1em; vertical-align: -0.2em; background: #9DB6FF; animation: blink 1.1s steps(1) infinite; }

.hero-visual { position: relative; }
.hero-orbit { position: absolute; inset: -60px -40px auto auto; width: 280px; height: 280px; z-index: -1; opacity: 0.9; }
.hero-chip {
  position: absolute; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--line-strong);
  font: 500 12.5px/1 var(--font-mono); color: var(--text); box-shadow: var(--shadow); backdrop-filter: blur(8px);
  animation: float 7s ease-in-out infinite;
}
.hero-chip b { color: var(--blue); font-weight: 600; }
.hero-chip.c1 { left: -22px; bottom: -20px; }
.hero-chip.c2 { right: -14px; top: -18px; animation-delay: -3s; }
.hero-chip.c2 b { color: var(--lavender); }
@media (max-width: 560px) { .hero-chip.c1 { left: 10px; bottom: -18px; } .hero-chip.c2 { right: 10px; } }

/* ---------- Home: currently exploring ---------- */

.explore-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 960px) { .explore-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .explore-grid { grid-template-columns: 1fr; } }
.explore-item {
  display: grid; grid-template-columns: 44px 1fr; gap: 16px; align-items: start;
  padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
  transition: border-color .25s, transform .25s;
}
.explore-item:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.explore-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--gradient-soft); border: 1px solid var(--line); color: var(--blue); }
.explore-icon svg { width: 22px; height: 22px; }
.explore-item h3 { font-size: 17px; margin-bottom: 4px; }
.explore-item p { font-size: 14.5px; color: var(--muted); line-height: 1.55; }
.explore-stage { display: inline-block; margin-top: 10px; font: 500 11.5px/1 var(--font-mono); color: var(--lavender); letter-spacing: 0.04em; text-transform: uppercase; }

/* ---------- Section tiles (home + footer of section pages) ---------- */

.section-tile {
  position: relative; display: flex; flex-direction: column; gap: 14px; padding: 28px; min-height: 250px;
  border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--surface); overflow: hidden;
  text-decoration: none; color: inherit; transition: transform .3s, border-color .3s;
}
.section-tile:hover { transform: translateY(-4px); border-color: var(--line-strong); color: inherit; }
.section-tile .tile-art { position: absolute; right: -20px; bottom: -20px; width: 170px; height: 170px; opacity: 0.55; transition: opacity .3s, transform .6s; }
.section-tile:hover .tile-art { opacity: 0.9; transform: rotate(-6deg) scale(1.04); }
.section-tile h3 { font-size: 23px; max-width: 80%; }
.section-tile p { font-size: 15px; color: var(--muted); max-width: 82%; }
.section-tile .tile-count { margin-top: auto; font: 500 13px/1 var(--font-mono); color: var(--blue); }

/* ---------- Page header (inner pages) ---------- */

.page-head { padding-top: 80px; padding-bottom: 56px; }
.page-head h1 { font-size: clamp(38px, 5.4vw, 64px); margin: 18px 0 18px; }
.page-head .lede { max-width: 720px; }
.page-head-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: center; }
.page-head-art { width: 100%; max-width: 320px; justify-self: end; }
@media (max-width: 860px) { .page-head-grid { grid-template-columns: minmax(0, 1fr); } .page-head-art { display: none; } .page-head { padding-top: 56px; } }

.topic-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; list-style: none; padding: 0; }

/* ---------- Filters ---------- */

.filters { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; margin-bottom: 32px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  color: var(--text-2); font: 500 14px/1 var(--font-sans); cursor: pointer; transition: all .2s;
}
.chip:hover { border-color: var(--line-strong); color: var(--text); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.search {
  position: relative; flex: 0 1 320px;
}
.search input {
  width: 100%; height: 44px; padding: 0 16px 0 42px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text); font: 400 15px var(--font-sans);
}
.search input::placeholder { color: var(--muted); }
.search svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); }
.result-count { font: 400 13px/1 var(--font-mono); color: var(--muted); margin-bottom: 18px; }
.active-tag { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px; font-size: 14px; }
.active-tag button { background: none; border: 0; color: var(--blue); cursor: pointer; font: inherit; text-decoration: underline; }

/* ---------- Article ---------- */

.article-head { padding-top: 64px; padding-bottom: 36px; }
.breadcrumb { font: 400 13px/1.5 var(--font-mono); color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--blue); }
.article-head h1 { font-size: clamp(34px, 5vw, 56px); margin: 20px 0 18px; line-height: 1.06; }
.article-head .lede { max-width: none; font-size: 20px; }
.byline { display: flex; align-items: center; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
.avatar { width: 44px; height: 44px; border-radius: 50%; flex: none; }
.byline-text { display: flex; flex-direction: column; font-size: 14px; color: var(--muted); line-height: 1.45; }
.byline-text strong { color: var(--text); font-weight: 600; }
.article-cover { margin: 8px auto 48px; max-width: 980px; padding: 0 24px; }
.article-cover figure { margin: 0; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.article-cover img { width: 100%; height: auto; }
@media (max-width: 680px) { .article-cover { padding: 0 16px; } }

.draft-banner {
  display: flex; gap: 12px; align-items: center; padding: 12px 18px; margin-bottom: 20px;
  border-radius: var(--radius-sm); border: 1px solid var(--rose); color: var(--text);
  background: color-mix(in srgb, var(--rose) 10%, transparent); font-size: 14.5px;
}

.prose { font-size: 18px; line-height: 1.78; color: var(--text-2); }
.prose > * + * { margin-top: 1.15em; }
.prose h2 { font-size: clamp(26px, 3vw, 32px); margin-top: 2em; scroll-margin-top: calc(var(--header-h) + 20px); }
.prose h3 { font-size: 22px; margin-top: 1.7em; scroll-margin-top: calc(var(--header-h) + 20px); }
.prose h2 + *, .prose h3 + * { margin-top: 0.7em; }
.prose strong { color: var(--text); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.45em; }
.prose li::marker { color: var(--blue); }
.prose a { color: var(--blue); }
.prose hr { border: 0; height: 1px; background: var(--line-strong); margin: 2.4em 0; }
.prose blockquote {
  margin-left: 0; margin-right: 0; padding: 4px 0 4px 22px; border-left: 3px solid; border-image: var(--gradient) 1;
  font-family: var(--font-serif); font-style: italic; font-size: 25px; line-height: 1.45; color: var(--text);
}
.prose figure { margin: 2em 0; }
.prose figure img, .prose figure svg { border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); width: 100%; height: auto; }
.prose figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); text-align: center; }
.prose :not(pre) > code {
  font-size: 0.86em; padding: 0.12em 0.42em; border-radius: 6px;
  background: var(--surface-3); color: var(--text); border: 1px solid var(--line);
}
.prose table { width: 100%; border-collapse: collapse; font-size: 15.5px; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { color: var(--text); font-family: var(--font-display); font-weight: 600; }
.prose td code { white-space: nowrap; }

.callout {
  display: grid; grid-template-columns: 26px 1fr; gap: 12px; padding: 18px 20px; border-radius: var(--radius);
  background: var(--gradient-soft); border: 1px solid var(--line); font-size: 16.5px; line-height: 1.65;
}
.callout svg { width: 22px; height: 22px; color: var(--lavender); margin-top: 3px; }
.callout p + p { margin-top: 0.6em; }
.callout-title { display: block; color: var(--text); font-weight: 600; margin-bottom: 2px; }

/* Code blocks: <pre><code class="language-bash">…</code></pre>.
   main.js wraps each in .code-block with a label + copy button; highlight.js colors tokens. */
.code-block { position: relative; border-radius: var(--radius); border: 1px solid rgba(255,255,255,0.08); background: var(--code-bg); overflow: hidden; }
.code-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px 8px 16px; border-bottom: 1px solid rgba(255,255,255,0.07); background: rgba(255,255,255,0.025); }
.code-lang { font: 500 11.5px/1 var(--font-mono); color: #8C93A8; letter-spacing: 0.08em; text-transform: uppercase; }
.copy-btn { font: 500 12px/1 var(--font-mono); color: #C3C8D8; background: transparent; border: 1px solid rgba(255,255,255,0.12); border-radius: 8px; padding: 6px 10px; cursor: pointer; }
.copy-btn:hover { color: #fff; border-color: rgba(255,255,255,0.3); }
.prose pre, pre.code { margin: 0; padding: 18px 20px; overflow-x: auto; font-size: 14.5px; line-height: 1.7; color: #D6DBEA; tab-size: 2; }
.prose .code-block { margin-top: 1.4em; margin-bottom: 1.4em; }
.tok-comment { color: #6B7390; font-style: italic; }
.tok-string { color: #9EE6B8; }
.tok-number { color: #F4C67A; }
.tok-keyword { color: #C9A8FF; }
.tok-builtin { color: #8FB3FF; }
.tok-prop { color: #FFB38F; }
.tok-punct { color: #8C93A8; }
.tok-prompt { color: #6FE3C8; user-select: none; }
.tok-var { color: #FF9EB6; }
.tok-flag { color: #8FB3FF; }

.article-foot { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--line); display: grid; gap: 28px; }
.author-box { display: grid; grid-template-columns: 64px 1fr; gap: 18px; padding: 24px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); }
.author-box .avatar { width: 64px; height: 64px; }
.author-box h2 { font-size: 18px; margin-bottom: 6px; }
.author-box p { font-size: 15.5px; color: var(--text-2); }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.post-nav a { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--text); font-weight: 600; font-family: var(--font-display); line-height: 1.3; transition: border-color .2s; }
.post-nav a:hover { border-color: var(--blue); color: var(--text); }
.post-nav a span { font: 400 12px/1 var(--font-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.post-nav .next { text-align: right; grid-column: 2; }
@media (max-width: 600px) { .post-nav { grid-template-columns: 1fr; } .post-nav .next { grid-column: 1; } }

/* ---------- Project detail ---------- */

.project-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 56px; align-items: start; }
.project-aside { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: 22px; padding: 24px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); }
.project-aside h2 { font: 500 12px/1 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.project-aside .btn { width: 100%; }
.project-aside dl { margin: 0; display: grid; gap: 14px; }
.project-aside dt { font: 500 12px/1 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.project-aside dd { margin: 0; color: var(--text); font-size: 15px; }
@media (max-width: 920px) { .project-layout { grid-template-columns: minmax(0, 1fr); } .project-aside { position: static; order: -1; } }

.shot { margin: 2em 0; }
.shot-frame { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-strong); background: var(--surface); box-shadow: var(--shadow); }
.shot-frame .shot-bar { display: flex; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.shot-frame .shot-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }
.shot-frame img { width: 100%; height: auto; }

.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
.timeline li { position: relative; padding: 0 0 22px 28px; }
.timeline li::before { content: ''; position: absolute; left: 6px; top: 10px; bottom: -6px; width: 1px; background: var(--line-strong); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ''; position: absolute; left: 1px; top: 7px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--blue); background: var(--bg); }
.timeline li.done::after { background: var(--blue); }
.timeline strong { color: var(--text); }

/* ---------- About ---------- */

.about-grid { display: grid; grid-template-columns: 340px 1fr; gap: 64px; align-items: start; }
.about-card { position: sticky; top: calc(var(--header-h) + 24px); padding: 28px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); display: grid; gap: 18px; }
.about-card .portrait { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); aspect-ratio: 4 / 5; background: var(--gradient-soft); }
.about-card .portrait img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 920px) { .about-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; } .about-card { position: static; } }
.value-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 1.5em; }
@media (max-width: 600px) { .value-grid { grid-template-columns: 1fr; } }
.value { padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.value h3 { font-size: 17px; margin: 0 0 6px; }
.value p { font-size: 15px; color: var(--muted); line-height: 1.6; }
.prose .value-grid > * + * { margin-top: 0; }

/* ---------- Contact ---------- */

.contact-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 48px; align-items: start; }
@media (max-width: 920px) { .contact-grid { grid-template-columns: 1fr; } }
.link-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.link-item {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 16px; align-items: center; padding: 16px 18px;
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: inherit;
  transition: border-color .2s, transform .2s;
}
a.link-item:hover { border-color: var(--blue); transform: translateX(3px); color: inherit; }
.link-item .explore-icon { width: 44px; height: 44px; }
.link-item strong { display: block; color: var(--text); font-weight: 600; }
.link-item span { font-size: 14px; color: var(--muted); word-break: break-word; }
.link-item .soon { font: 500 11.5px/1 var(--font-mono); color: var(--amber); text-transform: uppercase; letter-spacing: .06em; }

.form-card { padding: 32px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
@media (max-width: 560px) { .form-card { padding: 22px; } }
.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field label { font-weight: 600; color: var(--text); font-size: 15px; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 13.5px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--bg-2); color: var(--text); font: 400 16px/1.5 var(--font-sans); transition: border-color .2s, box-shadow .2s;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px var(--glow-blue); }
.field [aria-invalid="true"] { border-color: var(--rose); }
.field-error { color: var(--rose); font-size: 14px; }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin-top: 14px; padding: 12px 16px; border-radius: 12px; font-size: 15px; }
.form-status.success { background: color-mix(in srgb, var(--mint) 12%, transparent); border: 1px solid var(--mint); color: var(--text); }
.form-status.error { background: color-mix(in srgb, var(--rose) 12%, transparent); border: 1px solid var(--rose); color: var(--text); }

/* ---------- CTA band ---------- */

.cta-band {
  position: relative; overflow: hidden; padding: 56px; border-radius: 28px; border: 1px solid var(--line-strong);
  background: var(--surface);
  display: grid; grid-template-columns: 1.4fr auto; gap: 32px; align-items: center;
}
.cta-band::before { content: ''; position: absolute; inset: 0; background: radial-gradient(500px 260px at 90% 0%, var(--glow-lavender), transparent 70%), radial-gradient(500px 300px at 0% 100%, var(--glow-blue), transparent 70%); pointer-events: none; }
.cta-band > * { position: relative; }
.cta-band h2 { margin: 14px 0 12px; }
@media (max-width: 820px) { .cta-band { grid-template-columns: 1fr; padding: 32px 24px; } }

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

.site-footer { margin-top: 40px; border-top: 1px solid var(--line); background: var(--bg-2); padding: 64px 0 36px; font-size: 15px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 40px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
.footer-brand p { margin-top: 16px; color: var(--muted); max-width: 340px; }
.site-footer h2 { font: 500 12px/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.site-footer a { color: var(--text-2); text-decoration: none; }
.site-footer a:hover { color: var(--blue); }
.footer-bottom { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font: 400 13px/1.5 var(--font-mono); color: var(--muted); }

/* ---------- Motion ---------- */

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); transition-delay: var(--delay, 0s); }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

@keyframes blink { 50% { opacity: 0; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes dash { to { stroke-dashoffset: -200; } }
@keyframes spin { to { transform: rotate(360deg); } }
.orbit-spin { transform-origin: 50% 50%; animation: spin 60s linear infinite; }
.flow { stroke-dasharray: 4 8; animation: dash 6s linear infinite; }

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

@media print {
  .site-header, .site-footer, .post-nav, .copy-btn, .theme-toggle { display: none !important; }
  body { background: #fff; color: #000; }
}
