/* Category visual tokens — single place to tune cover tints, card colors, and tag accents */
:root {
  --cat-tint-warm: #b3402c;
  --cat-tint-green: #1f6f4e;
  --cat-tint-blue: #3178c6;
  --cat-tint-neutral: #5b6068;

  --cat-card-ai: #182924;
  --cat-card-blockchain: #1b2a24;
  --cat-card-crypto: #182924;
  --cat-card-nft: #20222a;
  --cat-card-featured: #1b2a24;
  --cat-card-other: #20222a;
  --cat-card-typescript: #1a2433;
  --cat-card-default: #10141c;

  /* Terminal brand logo — same in light and dark theme */
  --brand-logo-border: color-mix(in srgb, #5eead4 45%, transparent);
  --brand-logo-border-hover: #5eead4;
  --brand-logo-prompt: #2dd4bf;
  --brand-logo-cursor: #5eead4;
}

/* Cover image tint overlays */
.cover[data-cat="blockchain"] .tint,
.cover[data-cat="featured"] .tint {
  background: var(--cat-tint-warm);
}

.cover[data-cat="ai"] .tint,
.cover[data-cat="crypto"] .tint {
  background: var(--cat-tint-green);
}

.cover[data-cat="typescript"] .tint {
  background: var(--cat-tint-blue);
}

.cover[data-cat="nft"] .tint,
.cover[data-cat="other"] .tint {
  background: var(--cat-tint-neutral);
}

/* Featured shorts card backgrounds */
.scard[data-cat="ai"] {
  background: var(--cat-card-ai);
}

.scard[data-cat="blockchain"] {
  background: var(--cat-card-blockchain);
}

.scard[data-cat="crypto"] {
  background: var(--cat-card-crypto);
}

.scard[data-cat="nft"] {
  background: var(--cat-card-nft);
}

.scard[data-cat="featured"] {
  background: var(--cat-card-featured);
}

.scard[data-cat="other"] {
  background: var(--cat-card-other);
}

.scard[data-cat="typescript"] {
  background: var(--cat-card-typescript);
}

.scard:not([data-cat]) {
  background: var(--cat-card-default);
}

/* Post grid entrance stagger */
.post-grid .post-card:nth-child(1) {
  animation-delay: 0ms;
}

.post-grid .post-card:nth-child(2) {
  animation-delay: 35ms;
}

.post-grid .post-card:nth-child(3) {
  animation-delay: 70ms;
}

.post-grid .post-card:nth-child(4) {
  animation-delay: 105ms;
}

.post-grid .post-card:nth-child(5) {
  animation-delay: 140ms;
}

.post-grid .post-card:nth-child(6) {
  animation-delay: 175ms;
}

.post-grid .post-card:nth-child(7) {
  animation-delay: 210ms;
}

.post-grid .post-card:nth-child(8) {
  animation-delay: 245ms;
}

.post-grid .post-card:nth-child(9) {
  animation-delay: 280ms;
}

.post-grid .post-card:nth-child(n + 10) {
  animation-delay: 300ms;
}

:root {
  --font-sans: "Inter", system-ui, sans-serif;
  --font-display: "Space Grotesk", "Inter", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --font-code: Consolas, "Courier New", "Liberation Mono", ui-monospace, monospace;
  --maxw: 1120px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px rgba(8, 10, 16, 0.08);
  color-scheme: light;
}

:root,
:root[data-theme="light"] {
  --bg: #f9f6ee;
  --bg-muted: #f0ebe1;
  --surface: #fdfcf7;
  --surface-2: #f5f1e8;
  --ink: #1a1814;
  --ink-soft: #5c574d;
  --ink-faint: #8a8478;
  --line: #e6dfd3;
  --line-strong: #d5cdc0;
  --accent: #0f766e;
  --accent-2: #14b8a6;
  --accent-soft: rgba(15, 118, 110, 0.12);
  --glow: rgba(20, 184, 166, 0.14);
  --alert: #c2410c;
  --alert-soft: rgba(194, 65, 12, 0.12);
  --gold: #b45309;
  --ticker-bg: #fdfcf7;
  --ticker-ink: #5c574d;
  --ticker-divider: rgba(26, 24, 20, 0.1);
  --hero-panel: #1a1814;
  --hero-panel-ink: #f5f1e8;
  --fab-shadow: 0 12px 32px rgba(26, 24, 20, 0.2);
  --row-hover: rgba(15, 118, 110, 0.06);
  --code-bg: #f2ede4;
  --code-keyword: #0f766e;
  --code-string: #0f766e;
  --code-number: #b45309;
  --code-fn: #1a5c56;
  --code-type: #b45309;
  --code-var: #5c574d;
  --code-comment: #8a8478;
  --cover-filter: grayscale(0.35) contrast(1.05) brightness(0.98);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #080a0f;
  --bg-muted: #10141c;
  --surface: #10141c;
  --surface-2: #161b25;
  --ink: #e8eef6;
  --ink-soft: #9aa6b8;
  --ink-faint: #6d7889;
  --line: #232a36;
  --line-strong: #334056;
  --accent: #5eead4;
  --accent-2: #2dd4bf;
  --accent-soft: rgba(94, 234, 212, 0.12);
  --glow: rgba(45, 212, 191, 0.16);
  --alert: #fb923c;
  --alert-soft: rgba(251, 146, 60, 0.14);
  --gold: #fbbf24;
  --ticker-bg: #05070b;
  --ticker-ink: #c9d4e2;
  --ticker-divider: rgba(255, 255, 255, 0.08);
  --hero-panel: #0c1118;
  --hero-panel-ink: #e8eef4;
  --fab-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
  --row-hover: rgba(94, 234, 212, 0.06);
  --code-bg: #161c27;
  --code-keyword: #5eead4;
  --code-string: #7dd3c0;
  --code-number: #fbbf24;
  --code-fn: #9aa6b8;
  --code-type: #fbbf24;
  --code-var: #c9d4e2;
  --code-comment: #6d7889;
  --cover-filter: grayscale(0.2) contrast(1.08) brightness(0.82);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  background: var(--bg);
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
}

.hide {
  display: none !important;
}

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

a {
  color: inherit;
}

.app {
  min-height: 100vh;
}

/* ---------- TICKER ---------- */
.ticker-wrap {
  background: var(--ticker-bg);
  overflow: hidden;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}

.ticker {
  display: inline-flex;
  align-items: center;
  animation: scroll 32s linear infinite;
  padding: 8px 0;
  will-change: transform;
}

@keyframes scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.ticker span {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ticker-ink);
  padding: 0 22px;
  border-right: 1px solid var(--ticker-divider);
}

.ticker span b {
  color: var(--accent-2);
  font-weight: 600;
}

.ticker span.down b {
  color: #f0a891;
}

/* ---------- HEADER ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  gap: 16px;
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 9px;
}

.brand a {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.brand-name {
  white-space: nowrap;
}

.brand-sub {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-logo-btn {
  display: inline-flex;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  flex: none;
  border-radius: 6px;
}

.brand-logo-btn:hover .brand-logo,
.brand-logo-btn:focus-visible .brand-logo {
  border-color: var(--brand-logo-border-hover);
  transform: translateY(-1px);
}

.brand-logo-btn:focus-visible {
  outline: 2px solid var(--brand-logo-border-hover);
  outline-offset: 3px;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  width: 32px;
  height: 22px;
  padding: 0 6px;
  border-radius: 4px;
  border: 1px solid var(--brand-logo-border);
  background: transparent;
  flex: none;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.brand-logo-prompt {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-logo-prompt);
  line-height: 1;
}

.brand-logo .term-cursor {
  display: inline-block;
  width: 7px;
  height: 12px;
  background: var(--brand-logo-cursor);
  flex: none;
  animation: termBlink 1.05s step-end infinite;
}

.term-cursor {
  display: inline-block;
  width: 7px;
  height: 12px;
  background: var(--accent);
  flex: none;
  animation: termBlink 1.05s step-end infinite;
}

@keyframes termBlink {
  50% { opacity: 0; }
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.write-link {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.write-link svg {
  width: 18px;
  height: 18px;
}

.write-link:hover,
.theme-toggle:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  grid-area: 1 / 1;
}

[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
:root:not([data-theme]) .icon-sun { display: none; }

.viewtabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
}

.tab {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
}

.tab.active {
  background: var(--ink);
  color: var(--bg);
}

/* ---------- FEED ---------- */
.feed {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px 24px 120px;
}

.featured-section {
  display: block;
}

.featured-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  grid-template-areas:
    "lead cats"
    "more more";
  gap: 16px;
  align-items: stretch;
}

.featured-card--lead {
  grid-area: lead;
}

.featured-board > .hero-categories {
  grid-area: cats;
}

.featured-grid {
  grid-area: more;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.hero-categories {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  min-height: 0;
  height: 100%;
  overflow: auto;
}

.hero-categories-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 12px;
  font-weight: 600;
}

.hero-categories-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hero-cat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.hero-cat-item:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  background: var(--accent-soft);
}

.hero-cat-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.hero-cat-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.hero-cat-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
}

.post-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.post-eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 2px;
  box-shadow: 0 0 12px var(--accent);
  flex: none;
}

.hero-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-faint);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.featured-card {
  position: relative;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  min-height: 100%;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.featured-card:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.featured-card:hover .featured-card-title {
  color: var(--accent);
}

.featured-card-media {
  position: relative;
  width: 100%;
  flex: none;
}

.featured-card-media .post-eyebrow {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  margin: 0;
  padding: 5px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.featured-card-media .post-eyebrow::before {
  width: 6px;
  height: 6px;
}

.featured-card-cover {
  aspect-ratio: 16/9;
  border-radius: 0;
}

.featured-card-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

.featured-card-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
  flex-shrink: 0;
}

.featured-card-title a {
  color: inherit;
  text-decoration: none;
}

.featured-card-title a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.featured-card--lead .featured-card-title {
  font-size: clamp(26px, 3.2vw, 38px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.featured-card--lead .featured-card-cover {
  aspect-ratio: 16 / 9;
}

.featured-card--lead .featured-card-body p {
  -webkit-line-clamp: 3;
  font-size: 15px;
}

.featured-card-body p {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.featured-card-meta {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
}

.author-byline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
}

.author-avatar-link,
.author-name-link {
  text-decoration: none;
  color: inherit;
  transition: opacity 0.15s ease;
}

.author-avatar-link:hover,
.author-name-link:hover {
  opacity: 0.85;
}

.author-name-link:hover .author-name {
  color: var(--accent);
}

.author-byline.sm {
  gap: 6px;
}

.author-byline.sm .author-avatar {
  width: 22px;
  height: 22px;
}

.author-byline.sm .author-name {
  font-size: 11px;
}

.author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--line);
  background: var(--surface-2);
  flex: none;
}

.author-name {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
}

.read-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
  white-space: nowrap;
}

.meta-sep {
  color: var(--ink-faint);
  opacity: 0.6;
}

.row-meta-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.trending-cats {
  margin: 8px 0 4px;
  padding: 18px 0 6px;
  border-top: 1px solid var(--line);
}

.trending-cats-header {
  margin-bottom: 12px;
}

.trending-cats-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0;
  font-weight: 600;
}

.trending-cats-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.trending-cat-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
  font: inherit;
}

.trending-cat-item:hover,
.trending-cat-item.active {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.trending-cat-thumb {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--surface-2);
  flex: none;
}

.trending-cat-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

.trending-cat-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.trending-cat-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
}

.chip,
.chip:visited {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.chip:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.post-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.post-card {
  position: relative;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 14px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(6px);
  animation: rowIn 0.5s ease forwards;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.post-card-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.post-card-media {
  position: relative;
  flex: none;
  overflow: hidden;
}

.post-card-cover {
  width: 100%;
  height: 100%;
}

/* Standard — vertical card, wide rectangular cover */
.post-card--standard {
  background: var(--surface);
  border-radius: 12px;
}

.post-card-link--vertical {
  flex-direction: column;
}

.post-card-media--rect {
  width: 100%;
  aspect-ratio: 21 / 9;
}

.post-card-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.post-card-body h3 a {
  color: inherit;
  text-decoration: none;
}

.post-card-body h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.post-card--standard .post-card-body {
  padding: 14px 16px 16px;
  flex: 1;
  min-width: 0;
}

.post-card--standard .post-card-body h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.35;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
  flex-shrink: 0;
}

.post-card--standard .post-card-body .dek {
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-shrink: 0;
}

.post-card--standard:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.post-card--standard:hover h3 {
  color: var(--ink-soft);
}

.post-card-meta {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-faint);
  flex-shrink: 0;
}

.category-page .back-btn {
  margin-bottom: 8px;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 0 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}

.category-header-thumb {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--surface-2);
  flex: none;
}

.category-header-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 4px;
}

.category-header-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-faint);
  margin: 0;
}

.author-page .back-btn {
  margin-bottom: 8px;
}

.author-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 8px 0 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}

.author-header-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--line);
  background: var(--surface-2);
  flex: none;
}

.author-header-name {
  font-family: var(--font-display);
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 4px;
}

.author-header-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-faint);
  margin: 0 0 12px;
}

.author-header-bio {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0 0 14px;
  max-width: 52ch;
}

.author-header-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.author-social-link,
.author-website-link {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-soft);
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.author-social-link:hover,
.author-website-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.author-posts-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 16px;
  font-weight: 600;
}

.empty-list {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-faint);
  padding: 24px 0;
  margin: 0;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 28px 0 8px;
  flex-wrap: wrap;
}

.page-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.page-link,
.page-nav {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.page-link:hover,
.page-nav:hover:not(.disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.page-link.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.page-nav.disabled {
  opacity: 0.4;
  cursor: default;
}

@media (max-width: 600px) {
  .brand {
    font-size: 17px;
  }

  .brand-sub {
    display: none;
  }

  .author-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .author-header-links {
    justify-content: center;
  }

  .author-header-bio {
    max-width: none;
  }
}

.related-grid {
  margin-top: 4px;
}

.art-related {
  border-top: 1px solid var(--line);
  margin-top: 42px;
  padding-top: 28px;
}

.art-related h4 {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 14px;
}

.art-related h4 a {
  color: var(--accent);
  text-decoration: none;
}

.art-related h4 a:hover {
  text-decoration: underline;
}

@media (max-width: 720px) {
  .post-grid {
    grid-template-columns: 1fr;
  }
}
.chipbar {
  display: flex;
  gap: 8px;
  padding: 26px 0 18px;
  flex-wrap: wrap;
}

.ledger {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 22px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 16px;
  cursor: default;
  opacity: 0;
  transform: translateY(6px);
  animation: rowIn 0.5s ease forwards;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

@keyframes rowIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.row .meta {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-faint);
  padding-top: 3px;
}

.tag,
.row .meta .tag,
.art-tag,
.post-card-body .tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid transparent;
  width: fit-content;
}

.row .meta .tag,
.art-tag {
  margin-bottom: 8px;
}

.tag.daily,
.tag.nft,
.tag.other {
  background: var(--bg-muted);
  color: var(--ink-soft);
  border-color: var(--line);
}

.tag.funding,
.tag.blockchain,
.tag.featured,
.tag.typescript {
  background: var(--alert-soft);
  color: var(--alert);
  border-color: color-mix(in srgb, var(--alert) 25%, var(--line));
}

.tag.market,
.tag.ai,
.tag.crypto {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 25%, var(--line));
}

.row h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}

.row .dek {
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.55;
  margin: 0;
  max-width: 62ch;
}

.row .figure {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 15px;
  color: var(--gold);
  white-space: nowrap;
  padding-top: 4px;
  text-align: right;
}

.row .figure.pct { color: var(--accent); }
.row .figure.pct.neg { color: var(--alert); }

@media (max-width: 720px) {
  .featured-board {
    grid-template-columns: 1fr;
    grid-template-areas:
      "lead"
      "cats"
      "more";
  }

  .featured-grid {
    grid-template-columns: 1fr;
  }

  .art-related .post-grid {
    grid-template-columns: 1fr;
  }

  .row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .row .figure {
    text-align: left;
    padding-top: 0;
  }
  .row .meta { padding-top: 0; }
}

.fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  border: none;
  border-radius: 999px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: var(--fab-shadow);
  transition: transform 0.15s ease;
  z-index: 40;
}

.fab:hover { transform: translateY(-2px); }
.fab .term-cursor { background: var(--accent-2); }

/* ---------- SHORTS ---------- */
.shorts {
  position: fixed;
  inset: 0;
  background: #05070b;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shorts-frame {
  position: relative;
  width: 100%;
  max-width: 460px;
  height: 100%;
  max-height: 900px;
  padding: 16px 14px 22px;
  display: flex;
  flex-direction: column;
}

.progressbar {
  display: flex;
  gap: 5px;
  padding: 6px 4px 14px;
}

.progressbar .seg {
  flex: 1;
  height: 3px;
  background: rgba(244, 242, 234, 0.22);
  border-radius: 2px;
  overflow: hidden;
}

.progressbar .seg i {
  display: block;
  height: 100%;
  width: 0%;
  background: #e8eef4;
  transition: width 0.15s linear;
}

.progressbar .seg.done i { width: 100%; }

.shorts-close {
  position: absolute;
  top: 20px;
  right: 18px;
  z-index: 20;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(20, 23, 26, 0.55);
  border: 1px solid rgba(244, 242, 234, 0.2);
  color: #e8eef4;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.cardstack {
  position: relative;
  flex: 1;
  min-height: 0;
}

.scard {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  padding: 26px 24px 28px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: var(--card-color, #10141c);
  color: #e8eef4;
  touch-action: none;
  user-select: none;
  transition: transform 0.32s cubic-bezier(0.2, 0.7, 0.3, 1), opacity 0.32s ease;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.scard .cover {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.scard .cover .wash {
  background: linear-gradient(
    180deg,
    rgba(8, 10, 15, 0) 30%,
    rgba(8, 10, 15, 0.4) 62%,
    rgba(8, 10, 15, 0.96) 100%
  );
}

.scard .sc-top {
  position: absolute;
  top: 22px;
  left: 24px;
  right: 24px;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.scard .sc-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  font-weight: 600;
  background: rgba(244, 242, 234, 0.14);
  border: 1px solid rgba(244, 242, 234, 0.25);
}

.scard .sc-src {
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(244, 242, 234, 0.65);
}

.scard h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 27px;
  line-height: 1.16;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  position: relative;
  z-index: 2;
}

.scard .sc-dek {
  font-size: 14.5px;
  line-height: 1.55;
  color: rgba(244, 242, 234, 0.85);
  margin: 0 0 14px;
  max-width: 42ch;
  position: relative;
  z-index: 2;
}

.scard .sc-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(244, 242, 234, 0.55);
  position: relative;
  z-index: 2;
}

.scard .sc-read {
  align-self: flex-start;
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #e8eef4;
  background: rgba(94, 234, 212, 0.16);
  border: 1px solid rgba(94, 234, 212, 0.35);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  position: relative;
  z-index: 6;
  text-decoration: none;
}

.scard .sc-read:hover { background: rgba(94, 234, 212, 0.28); }

.tapzone {
  position: absolute;
  top: 0;
  bottom: 56px;
  width: 32%;
  z-index: 5;
}
.tapzone-left { left: 0; }
.tapzone-right { right: 0; }

.shorts-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding-top: 14px;
}

.navbtn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(244, 242, 234, 0.08);
  border: 1px solid rgba(244, 242, 234, 0.2);
  color: #e8eef4;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.navbtn:hover { background: rgba(244, 242, 234, 0.16); }

#counter {
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(244, 242, 234, 0.6);
  min-width: 52px;
  text-align: center;
}

/* ---------- COVER IMAGES ---------- */
.cover {
  position: relative;
  overflow: hidden;
  background: var(--bg-muted);
}

.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: var(--cover-filter);
}

.cover .tint {
  position: absolute;
  inset: 0;
  mix-blend-mode: color;
  opacity: 0.38;
}

.cover .wash {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 40%,
    color-mix(in srgb, var(--bg) 55%, transparent) 100%
  );
}

.row-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: 10px;
  margin-bottom: 9px;
}

.art-cover {
  border-radius: 16px;
  aspect-ratio: 16/8;
  margin: 6px 0 28px;
  border: 1px solid var(--line);
}

@media (max-width: 720px) {
  .art-cover { aspect-ratio: 4/3; }
}

.related-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: 10px;
  margin-bottom: 9px;
}

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

/* ---------- ARTICLE VIEW ---------- */
.article-view {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 22px 24px 120px;
}

.article-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

.article-layout--no-toc {
  display: block;
}

.article-main {
  min-width: 0;
}

.article-toc {
  position: sticky;
  top: 78px;
  max-height: calc(100dvh - 96px);
  overflow: auto;
  padding-right: 8px;
  scrollbar-width: thin;
}

.article-toc-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 12px;
}

.article-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.article-toc-item {
  margin: 0;
  line-height: 1.35;
}

.article-toc-item + .article-toc-item {
  margin-top: 6px;
}

.article-toc-depth-2 {
  padding-left: 0;
}

.article-toc-depth-3 {
  padding-left: 14px;
}

.article-toc-depth-4 {
  padding-left: 28px;
}

.article-toc-depth-5 {
  padding-left: 42px;
}

.article-toc-depth-6 {
  padding-left: 56px;
}

.article-toc-link {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-soft);
  text-decoration: none;
  border-left: 2px solid transparent;
  padding: 3px 0 3px 10px;
  margin-left: -2px;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.article-toc-link:hover {
  color: var(--accent);
}

.article-toc-link.is-active {
  color: var(--accent);
  font-weight: 600;
  border-left-color: var(--accent);
  background: var(--accent-soft);
  border-radius: 0 6px 6px 0;
}

@media (max-width: 960px) {
  .article-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .article-toc {
    position: static;
    max-height: none;
    margin-bottom: 20px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
  }
}

.article {
  max-width: 760px;
  margin: 0 auto;
  padding: 0;
}

.art-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0 22px;
}

.art-nav .art-tag {
  margin-bottom: 0;
}

.art-nav .back-btn {
  padding: 0;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 0 22px;
  text-decoration: none;
}

.back-btn:hover { color: var(--accent); }

.art-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 4.2vw, 42px);
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
}

.art-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-faint);
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 26px;
}

.art-meta .author-name {
  font-size: 13px;
}

.related-ledger {
  margin-top: 4px;
}

.art-figure {
  background: var(--hero-panel);
  color: var(--hero-panel-ink);
  border-radius: 12px;
  padding: 20px 24px;
  font-family: var(--font-mono);
  margin-bottom: 26px;
  display: inline-block;
}

.art-figure .label {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #93a0b2;
}

.art-figure .amount {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 30px;
  color: var(--accent-2);
  margin-top: 2px;
}

.art-figure .amount.neg { color: #f0a891; }

.art-body p {
  font-size: 17px;
  line-height: 1.8;
  color: var(--ink);
  margin: 0 0 1.15em;
}

.art-body p:first-of-type {
  font-size: 18.5px;
  color: var(--ink-soft);
}

.art-body h1,
.art-body h2,
.art-body h3,
.art-body h4,
.art-body .art-heading {
  scroll-margin-top: 88px;
}

.art-body h1,
.art-body h2,
.art-body h3,
.art-body h4 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 2em 0 0.75em;
  color: var(--ink);
}

.art-body h1 { font-size: 1.75rem; }
.art-body h2 { font-size: 1.45rem; }
.art-body h3 { font-size: 1.2rem; }
.art-body h4 { font-size: 1.05rem; }

.art-body ul,
.art-body ol {
  margin: 0 0 1.25rem;
  padding-left: 1.4rem;
  line-height: 1.8;
  color: var(--ink);
}

.art-body li { margin-bottom: 0.4rem; }

.art-body blockquote {
  margin: 1.6rem 0;
  padding: 0.9rem 1.15rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  color: var(--ink-soft);
  font-size: 1.05rem;
  border-radius: 0 12px 12px 0;
}

.art-body .code-block {
  margin: 0 0 1.5rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.art-body .code-block-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 0 14px;
}

.art-body .code-block-lang {
  font-family: var(--font-code);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-right: auto;
}

.art-body .code-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.art-body .code-copy:hover,
.art-body .code-copy:focus-visible {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  color: var(--accent);
  outline: none;
}

.art-body .code-copy.copied {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  color: var(--accent);
}

.art-body .code-copy svg {
  width: 15px;
  height: 15px;
}

.art-body .code-copy-check {
  display: none;
}

.art-body .code-copy.copied .code-copy-icon {
  display: none;
}

.art-body .code-copy.copied .code-copy-check {
  display: block;
}

.art-body pre {
  background: transparent;
  color: var(--ink);
  border: 0;
  border-radius: 0;
  padding: 10px 16px 16px;
  overflow-x: auto;
  font-family: var(--font-code);
  font-size: 16.5px;
  line-height: 1.7;
  margin: 0;
}

.art-body code {
  font-family: var(--font-code);
  font-size: 1em;
  background: var(--code-bg);
  padding: 0.12em 0.4em;
  border-radius: 5px;
  border: 1px solid var(--line);
}

.art-body pre code,
.art-body .hljs {
  background: none;
  padding: 0;
  border: 0;
  color: var(--ink);
  font-family: var(--font-code);
  font-size: 16.5px;
}

.art-body .hljs-comment,
.art-body .hljs-quote {
  color: var(--code-comment);
  font-style: italic;
}

.art-body .hljs-keyword,
.art-body .hljs-selector-tag,
.art-body .hljs-literal,
.art-body .hljs-section,
.art-body .hljs-link {
  color: var(--code-keyword);
}

.art-body .hljs-string,
.art-body .hljs-regexp,
.art-body .hljs-addition,
.art-body .hljs-attr,
.art-body .hljs-attribute {
  color: var(--code-string);
}

.art-body .hljs-number,
.art-body .hljs-symbol,
.art-body .hljs-bullet,
.art-body .hljs-meta {
  color: var(--code-number);
}

.art-body .hljs-title,
.art-body .hljs-title.function_,
.art-body .hljs-title.class_,
.art-body .hljs-function .hljs-title {
  color: var(--code-fn);
}

.art-body .hljs-type,
.art-body .hljs-class .hljs-title,
.art-body .hljs-built_in,
.art-body .hljs-builtin-name {
  color: var(--code-type);
}

.art-body .hljs-variable,
.art-body .hljs-template-variable,
.art-body .hljs-name,
.art-body .hljs-selector-id,
.art-body .hljs-selector-class,
.art-body .hljs-selector-attr,
.art-body .hljs-property {
  color: var(--code-var);
}

.art-body .hljs-deletion {
  color: var(--alert);
}

.art-body .hljs-tag,
.art-body .hljs-punctuation,
.art-body .hljs-operator {
  color: var(--ink-soft);
}

.art-body .hljs-subst,
.art-body .hljs-params {
  color: var(--ink);
}

.art-body a {
  color: var(--accent);
  text-underline-offset: 3px;
}

.art-body img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 1.5rem 0;
  border: 1px solid var(--line);
}

.art-body hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 2rem 0;
}

.art-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.5rem;
  font-size: 14.5px;
}

.art-body th,
.art-body td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
}

.art-body th {
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

body.term-open {
  overflow: hidden;
}

.term-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: color-mix(in srgb, #05070b 62%, transparent);
  backdrop-filter: blur(8px);
}

.term-overlay[hidden] {
  display: none;
}

.term-window {
  width: min(720px, 100%);
  height: min(520px, calc(100dvh - 48px));
  display: flex;
  flex-direction: column;
  background: #0c1118;
  color: #d7e0d2;
  border: 1px solid color-mix(in srgb, #14b8a6 28%, #2a3340);
  border-radius: 12px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  font-family: var(--font-mono);
}

.term-chrome {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #151b24;
  border-bottom: 1px solid #232b36;
}

.term-dots {
  display: flex;
  gap: 6px;
}

.term-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff5f57;
}

.term-dots span:nth-child(2) { background: #febc2e; }
.term-dots span:nth-child(3) { background: #28c840; }

.term-chrome-title {
  flex: 1;
  text-align: center;
  font-size: 11.5px;
  color: #8b96a5;
  letter-spacing: 0.02em;
}

.term-close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #8b96a5;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.term-close:hover {
  color: #fff;
  background: #232b36;
}

.term-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px 16px 12px;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.term-line + .term-line {
  margin-top: 8px;
}

.term-cmd {
  color: #9aa6b2;
}

.term-prompt-echo,
.term-prompt {
  color: #2dd4bf;
  font-weight: 500;
}

.term-accent { color: #5eead4; }
.term-muted { color: #7d8896; }

.term-link {
  color: #7dd3fc;
  text-underline-offset: 3px;
}

.term-link:hover { color: #e0f2fe; }

.term-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: transparent;
}

.term-input-row .term-prompt {
  flex: none;
  font-size: 13px;
  white-space: nowrap;
}

.term-input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  height: 1.55em;
}

.term-input-mirror {
  position: absolute;
  left: 0;
  top: 0;
  white-space: pre;
  visibility: hidden;
  pointer-events: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.55;
}

#termInput {
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 0;
  height: 1.55em;
  border: 0;
  outline: none;
  padding: 0;
  background: transparent;
  color: #f1f5f4;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.55;
  caret-color: transparent;
}

.term-caret {
  position: absolute;
  left: 0;
  top: 50%;
  z-index: 2;
  width: 8px;
  height: 14px;
  margin-top: -7px;
  pointer-events: none;
  background: #2dd4bf;
  animation: termBlink 1.05s step-end infinite;
}

.term-caret.is-idle {
  opacity: 0.45;
  animation: none;
}

.term-matrix {
  position: absolute;
  inset: 40px 0 0;
  overflow: hidden;
  pointer-events: none;
  color: #22c55e;
  font-size: 13px;
  letter-spacing: 0.4em;
  opacity: 0.85;
  padding: 12px;
}

.term-window { position: relative; }

/* ---------- BUILD VERSION PAGE ---------- */
.version-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 22px 24px 80px;
}

.version-header {
  margin-bottom: 24px;
}

.version-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 3.5vw, 32px);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 8px;
}

.version-subtitle {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
}

.version-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
}

.version-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.version-table th,
.version-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.version-table tr:last-child th,
.version-table tr:last-child td {
  border-bottom: 0;
}

.version-table th {
  width: 38%;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 500;
}

.version-table td {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink);
  word-break: break-word;
}

.version-table td time.version-build-time {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink);
}

.version-footnote {
  margin: 16px 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-faint);
}

.version-footnote a {
  color: var(--accent);
  text-decoration: none;
}

.version-footnote a:hover {
  text-decoration: underline;
}

@media (prefers-reduced-motion: reduce) {
  .ticker { animation: none; }
  .term-cursor { animation: none; }
  .row,
  .post-card {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .scard { transition: none; }
}

/* Write page layout */
html.writer-page,
html.writer-page body {
  height: 100%;
  overflow: hidden;
}

.writer-app {
  height: 100dvh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.writer-app .ticker-wrap {
  flex-shrink: 0;
}

.writer-topbar-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.writer-topbar-inner .brand {
  flex: 1 1 auto;
  min-width: 0;
}

.writer-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.writer-mode {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}

.writer-mode button {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  padding: 7px 10px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
}

.writer-mode button[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--accent);
}

.writer-btn {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
}

.writer-btn:hover,
.writer-mode button:hover {
  color: var(--accent);
}

.writer-shell {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(340px, 1.2fr);
  border-top: 1px solid var(--line);
}

.writer-shell[data-mode="write"] {
  grid-template-columns: 1fr;
}

.writer-shell[data-mode="write"] .writer-preview,
.writer-shell[data-mode="preview"] .writer-editor {
  display: none;
}

.writer-shell[data-mode="preview"] {
  grid-template-columns: 1fr;
}

.writer-editor {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.writer-editor-label {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 10px 16px 0;
}

#markdownInput {
  flex: 1;
  min-height: 0;
  width: 100%;
  resize: none;
  border: 0;
  outline: none;
  padding: 12px 16px 24px;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.65;
  tab-size: 2;
}

.writer-preview {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background: var(--bg);
}

.writer-preview .article-view {
  padding-bottom: 64px;
}

.writer-preview .back-btn {
  pointer-events: none;
}

@media (max-width: 860px) {
  .writer-shell[data-mode="split"] {
    grid-template-columns: 1fr;
  }

  .writer-shell[data-mode="split"] .writer-editor {
    max-height: 42dvh;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}
