/* ============================================================
   transformcase.com — design system
   Editorial / typography-forward aesthetic.
   Deep ink + warm paper. Generous whitespace.
   ============================================================ */

:root {
  /* Color — aligned with epochtime.tools palette
     (clean white + slate ink + blue accent) */
  --paper: #ffffff;
  --paper-shade: #f8fafc;
  --paper-deep: #f1f5f9;
  --ink: #0f172a;
  --ink-soft: #334155;
  --ink-mute: #64748b;
  --line: #e2e8f0;
  --line-soft: #f1f5f9;
  --line-strong: #cbd5e1;

  --accent: #3b82f6;
  --accent-deep: #2563eb;
  --accent-soft: #dbeafe;
  --accent-bg: #eff6ff;

  --gold: #f59e0b;
  --warning: #b45309;
  --warning-soft: #fef3c7;
  --danger: #dc2626;

  --add: #10b981;
  --add-bg: #d1fae5;
  --del: #dc2626;
  --del-bg: #fee2e2;

  /* Type */
  --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --sans: 'Geist', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;

  /* Radii */
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 14px;

  /* Type scale */
  --text-xs: 12px;
  --text-sm: 13.5px;
  --text-base: 15.5px;
  --text-lg: 17px;
  --text-xl: 19px;
  --text-2xl: 22px;
  --text-3xl: 28px;
  --text-4xl: 38px;
  --text-5xl: 56px;
  --text-6xl: 84px;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --paper: #0b1220;
    --paper-shade: #111a2c;
    --paper-deep: #172238;
    --ink: #f1f5f9;
    --ink-soft: #cbd5e1;
    --ink-mute: #94a3b8;
    --line: #1f2a40;
    --line-soft: #172238;
    --line-strong: #2a3654;
    --accent: #60a5fa;
    --accent-deep: #93c5fd;
    --accent-soft: #1e3a5f;
    --accent-bg: #142342;
    --add: #34d399;
    --add-bg: #052e23;
    --del: #f87171;
    --del-bg: #3a1414;
  }
}

:root[data-theme="dark"] {
  --paper: #0b1220;
  --paper-shade: #111a2c;
  --paper-deep: #172238;
  --ink: #f1f5f9;
  --ink-soft: #cbd5e1;
  --ink-mute: #94a3b8;
  --line: #1f2a40;
  --line-soft: #172238;
  --line-strong: #2a3654;
  --accent: #60a5fa;
  --accent-deep: #93c5fd;
  --accent-soft: #1e3a5f;
  --accent-bg: #142342;
  --add: #34d399;
  --add-bg: #052e23;
  --del: #f87171;
  --del-bg: #3a1414;
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  font-feature-settings: 'ss01', 'ss02';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Paper grain — disabled in the epochtime-aligned theme for a cleaner look.
   Keeping the rule so any nested z-index assumptions still hold. */
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  background-image: none;
  z-index: 0;
}

/* ─── Typography ─── */
h1, h2, h3, h4 { margin: 0; font-weight: 400; color: var(--ink); }
h1 { font-family: var(--serif); font-weight: 300; line-height: 1.05; letter-spacing: -0.02em; }
h2 { font-family: var(--serif); font-weight: 400; line-height: 1.15; letter-spacing: -0.01em; font-size: var(--text-3xl); }
h3 { font-family: var(--serif); font-weight: 500; font-size: var(--text-xl); line-height: 1.3; }
h4 { font-family: var(--sans); font-weight: 600; font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-mute); }

em { font-style: italic; }
a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-soft); transition: border-color 0.15s; }
a:hover { border-bottom-color: var(--accent); }

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

/* ─── Layout ─── */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 var(--space-5); position: relative; z-index: 1; }
.wrap-narrow { max-width: 720px; margin: 0 auto; padding: 0 var(--space-5); position: relative; z-index: 1; }

/* ─── Nav ─── */
.topnav {
  border-bottom: 1px solid var(--line-soft);
  background: var(--paper);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: color-mix(in oklab, var(--paper) 90%, transparent);
}
.topnav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  max-width: 1180px; margin: 0 auto;
}
.brand {
  font-family: var(--serif);
  font-weight: 700;
  font-size: var(--text-xl);
  letter-spacing: -0.01em;
  color: var(--ink);
  border-bottom: none;
  display: inline-flex; align-items: baseline; gap: 2px;
}
.brand em { color: var(--accent); font-style: italic; font-weight: 700; }
.brand-dot { color: var(--ink-mute); font-family: var(--sans); font-size: var(--text-sm); font-weight: 500; }

.topnav-links { display: flex; align-items: center; gap: var(--space-5); }
.topnav-links a {
  color: var(--ink-soft); border-bottom: none;
  font-size: var(--text-sm); font-weight: 500;
  transition: color 0.15s ease;
}
.topnav-links a:hover { color: var(--accent); }
.topnav-links a.active { color: var(--accent); }

/* ─── Nav dropdown (e.g. Free Tools menu) ─── */
.nav-dropdown { position: relative; }
.nav-dropdown-trigger {
  cursor: pointer;
  user-select: none;
  color: var(--ink-soft);
  font-size: var(--text-sm);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s ease;
}
.nav-dropdown-trigger::after {
  content: '▾';
  font-size: 9px;
  opacity: 0.6;
}
.nav-dropdown:hover .nav-dropdown-trigger,
.nav-dropdown:focus-within .nav-dropdown-trigger { color: var(--accent); }
.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px;
  min-width: 220px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
  z-index: 60;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.nav-dropdown-menu a {
  display: block;
  padding: 8px 12px;
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 13px;
  border-radius: 3px;
  border-bottom: 0;
  transition: background 0.1s, color 0.1s;
}
.nav-dropdown-menu a:hover {
  background: var(--paper-shade);
  color: var(--accent);
}

/* Mobile menu group label */
.mobile-menu .group-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 14px 4px 4px;
}

.theme-toggle {
  background: transparent; border: 1px solid var(--line); border-radius: var(--radius-sm);
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--ink-soft);
  transition: all 0.15s;
}
.theme-toggle:hover { border-color: var(--ink-soft); color: var(--ink); }

/* ─── Hero ─── */
.hero {
  padding: var(--space-9) 0 var(--space-7);
  position: relative;
}
.hero h1 {
  font-size: clamp(48px, 9vw, var(--text-6xl));
  margin: 0 0 var(--space-4);
}
.hero h1 em {
  color: var(--accent);
  font-style: italic;
  font-weight: 300;
}
.hero .lede {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(18px, 2.2vw, 22px);
  color: var(--ink-soft);
  line-height: 1.45;
  max-width: 38ch;
  margin: 0;
  font-style: italic;
}
.hero .lede strong { color: var(--ink); font-style: normal; font-weight: 400; }

/* ─── Workspace ─── */
.workspace {
  background: var(--paper);
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-top: var(--space-6);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02), 0 8px 24px -16px rgba(15, 23, 42, 0.08);
}

.workspace-tabs {
  display: flex; gap: var(--space-1);
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: var(--space-3);
  flex-wrap: wrap;
}
.tab {
  background: transparent;
  border: 1px solid transparent;
  font-family: var(--sans);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink-soft);
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}
.tab:hover { color: var(--ink); background: var(--paper-shade); }
.tab[aria-selected="true"] {
  background: var(--ink);
  color: var(--paper);
}

.tab-group-label {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-mute);
  padding: 6px 8px;
  border-right: 1px solid var(--line-soft);
  margin-right: var(--space-2);
  align-self: center;
}

/* ─── Style guide selector ─── */
.style-selector {
  display: none;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--paper-shade);
  border-radius: var(--radius);
  border: 1px solid var(--line-soft);
}
.style-selector.visible { display: flex; flex-wrap: wrap; }
.style-selector label {
  font-family: var(--mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
  font-weight: 600;
}
.style-pills { display: flex; gap: 4px; flex-wrap: wrap; }
.style-pill {
  background: transparent;
  border: 1px solid var(--line);
  font-family: var(--sans);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--ink-soft);
  padding: 4px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.12s;
}
.style-pill:hover { border-color: var(--ink-soft); color: var(--ink); }
.style-pill[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}

/* ─── I/O panels ─── */
.io-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
@media (max-width: 760px) {
  .io-grid { grid-template-columns: 1fr; }
}
.panel {
  display: flex; flex-direction: column;
}
.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--space-2);
  min-height: 28px;
}
.panel-label {
  font-family: var(--mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--ink-mute);
}
.panel-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-icon {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  height: 28px;
  padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0;
  white-space: nowrap;
  transition: all 0.12s;
}
.btn-icon:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }
.btn-icon.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.textarea-wrap {
  position: relative;
  background: var(--paper-shade);
  border: 3px solid var(--ink-mute);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.textarea-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}
.workspace textarea {
  width: 100%;
  min-height: 240px;
  border: none;
  background: transparent;
  font-family: var(--mono);
  font-size: var(--text-base);
  line-height: 1.55;
  color: var(--ink);
  padding: var(--space-4);
  resize: vertical;
  outline: none;
  display: block;
  font-feature-settings: 'liga' 0, 'calt' 0;
}
.workspace textarea::placeholder { color: var(--ink-mute); font-style: italic; }

.output {
  min-height: 240px;
  background: var(--paper-shade);
  border: 3px solid var(--ink-mute);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: var(--text-base);
  line-height: 1.55;
  color: var(--ink);
  padding: var(--space-4);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-y: auto;
}
.output:empty::before {
  content: 'Output appears here.';
  color: var(--ink-mute); font-style: italic;
}

/* ─── Diff view ─── */
.output ins, .diff-add {
  background: var(--add-bg);
  color: var(--add);
  text-decoration: none;
  padding: 1px 2px;
  border-radius: 2px;
  font-weight: 500;
}
.output del, .diff-del {
  background: var(--del-bg);
  color: var(--del);
  text-decoration: line-through;
  text-decoration-color: var(--del);
  padding: 1px 2px;
  border-radius: 2px;
}

/* ─── Explain mode ─── */
.output .explain-word {
  cursor: help;
  border-bottom: 1px dotted var(--ink-mute);
  position: relative;
}
.output .explain-word:hover {
  background: var(--accent-bg);
  border-bottom-color: var(--accent);
}
.output .explain-word[data-cap="true"] {
  border-bottom-color: var(--accent);
}
.output .explain-word[data-cap="false"] {
  border-bottom-style: dashed;
}

.tooltip {
  position: fixed;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: var(--text-xs);
  line-height: 1.5;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  max-width: 280px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}
.tooltip.visible { opacity: 1; }
.tooltip strong { color: var(--paper); font-weight: 600; }

/* ─── Bottom action bar ─── */
.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line-soft);
}
.stats {
  display: flex;
  gap: var(--space-5);
  font-family: var(--mono);
  font-size: var(--text-xs);
  color: var(--ink-mute);
  flex-wrap: wrap;
}
.stats span strong {
  color: var(--ink);
  font-weight: 600;
  margin-right: 4px;
}

.bar-actions { display: flex; gap: var(--space-2); }
.btn {
  font-family: var(--sans);
  font-size: var(--text-sm);
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.12s;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  white-space: nowrap;
}
.btn:hover { border-color: var(--ink-soft); }
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.btn-primary:hover { background: var(--accent); border-color: var(--accent); }

/* ─── Toast ─── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 100px);
  background: var(--ink);
  color: var(--paper);
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-weight: 500;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s;
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}
.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ─── Sections ─── */
.section {
  padding: var(--space-8) 0;
  border-top: 1px solid var(--line-soft);
}
.section-header {
  margin-bottom: var(--space-6);
}
.section-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: var(--space-3);
}
.section-title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-4);
  max-width: 22ch;
}
.section-title em { color: var(--accent); font-style: italic; }
.section-lede {
  font-family: var(--serif);
  font-weight: 300;
  font-style: italic;
  font-size: var(--text-xl);
  color: var(--ink-soft);
  max-width: 56ch;
  margin: 0;
}

/* ─── Feature grid (style guides, etc.) ─── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-5);
}
.feature-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-5);
  transition: all 0.15s;
}
.feature-card:hover {
  border-color: var(--accent-soft);
  box-shadow: 0 4px 16px -8px rgba(15, 23, 42, 0.08);
}
.feature-card-num {
  font-family: var(--serif);
  font-weight: 300;
  font-style: italic;
  font-size: var(--text-3xl);
  color: var(--accent);
  display: block;
  margin-bottom: var(--space-2);
  line-height: 1;
}
.feature-card h3 { margin-bottom: var(--space-2); }
.feature-card p { margin: 0; color: var(--ink-soft); font-size: var(--text-sm); line-height: 1.6; }

/* ─── Style guide cards (with example) ─── */
.style-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-5);
}
.style-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-5);
  display: flex; flex-direction: column;
}
.style-card-name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: var(--text-xl);
  margin-bottom: var(--space-2);
}
.style-card-desc {
  font-size: var(--text-sm);
  color: var(--ink-soft);
  line-height: 1.6;
  margin-bottom: var(--space-4);
}
.style-card-example {
  background: var(--paper-shade);
  border-left: 3px solid var(--accent);
  padding: var(--space-3) var(--space-4);
  font-family: var(--mono);
  font-size: var(--text-sm);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-top: auto;
}
.style-card-example .label {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-mute);
  margin-bottom: var(--space-1);
  font-weight: 600;
}

/* Home text-tools grid ------------------------------------------- */
.home-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-5);
}
.home-tool-card {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: var(--space-4);
  align-items: start;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-5);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.home-tool-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}
.home-tool-icon {
  font-family: var(--mono);
  font-size: 26px;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-bg);
  color: var(--accent);
  border-radius: 10px;
  line-height: 1;
}
.home-tool-body { min-width: 0; }
.home-tool-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: var(--text-lg);
  line-height: 1.25;
  margin: 0 0 6px;
  color: var(--ink);
}
.home-tool-desc {
  font-family: var(--sans);
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0;
}
.home-tool-card-all {
  background: var(--paper-shade);
  border-style: dashed;
}
.home-tool-card-all .home-tool-icon {
  background: transparent;
  border: 1px dashed var(--accent);
}

/* ─── Footer ─── */
.footer {
  border-top: 1px solid var(--line);
  background: var(--paper-shade);
  padding: var(--space-7) 0 var(--space-5);
  margin-top: var(--space-9);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-5);
}
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
.footer-tag { color: var(--ink-soft); font-size: var(--text-sm); margin-top: var(--space-3); max-width: 36ch; }
.footer-col h4,
.footer-col .footer-col-heading {
  margin: 0 0 var(--space-3);
  font-family: var(--sans);
  font-weight: 600;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-mute);
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: var(--space-2); }
.footer-col a {
  color: var(--ink-soft);
  font-size: var(--text-sm);
  border-bottom: none;
}
.footer-col a:hover { color: var(--ink); }
.footer-bottom {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between;
  flex-wrap: wrap; gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--ink-mute);
}

/* ─── Prose pages (about, privacy, etc.) ─── */
.prose {
  max-width: 64ch;
  font-size: var(--text-lg);
  line-height: 1.7;
  color: var(--ink-soft);
}
.prose h1 {
  font-size: clamp(40px, 6vw, var(--text-5xl));
  color: var(--ink);
  margin-bottom: var(--space-5);
  font-weight: 300;
}
.prose h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--text-2xl);
  color: var(--ink);
  margin: var(--space-7) 0 var(--space-3);
  line-height: 1.2;
}
.prose h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: var(--text-xl);
  color: var(--ink);
  margin: var(--space-5) 0 var(--space-2);
}
.prose p { margin: 0 0 var(--space-4); }
.prose ul, .prose ol { margin: 0 0 var(--space-4); padding-left: var(--space-5); }
.prose li { margin-bottom: var(--space-2); }
.prose code {
  font-family: var(--mono);
  font-size: 0.92em;
  background: var(--paper-shade);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: var(--ink);
}

/* ─── Breadcrumb ─── */
.breadcrumb {
  font-family: var(--mono);
  font-size: 13.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
  font-weight: 600;
  padding: var(--space-5) 0 0;
}
.breadcrumb a { color: var(--ink); border-bottom: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { margin: 0 10px; color: var(--ink-mute); font-weight: 400; }

/* ─── Ad banner (below nav, above breadcrumb) ─── */
.ad-banner {
  width: 100%;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--paper-shade);
  display: flex; align-items: center; justify-content: center;
  padding: 10px 16px;
  min-height: 70px;
}
.ad-banner-inner {
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.ad-banner-inner.desktop {
  width: 728px; height: 90px; max-width: 100%;
}
.ad-banner-inner.mobile {
  width: 320px; height: 50px;
  display: none;
}
@media (max-width: 767px) {
  .ad-banner-inner.desktop { display: none; }
  .ad-banner-inner.mobile { display: flex; }
  .ad-banner { min-height: 60px; padding: 8px; }
}

/* ─── Mobile nav ─── */
.mobile-nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  width: 36px; height: 36px;
  cursor: pointer;
  align-items: center; justify-content: center;
  color: var(--ink);
}
@media (max-width: 700px) {
  .topnav-links { display: none; }
  .mobile-nav-toggle { display: inline-flex; }
}
.mobile-menu {
  position: fixed;
  inset: 0;
  background: var(--paper);
  z-index: 100;
  padding: var(--space-5);
  display: none;
  flex-direction: column;
}
.mobile-menu.open { display: flex; }
.mobile-menu .close {
  align-self: flex-end;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  width: 36px; height: 36px;
  font-size: 18px;
  cursor: pointer;
  color: var(--ink);
}
.mobile-menu ul { list-style: none; padding: 0; margin: var(--space-7) 0 0; }
.mobile-menu li { margin-bottom: var(--space-4); }
.mobile-menu a {
  font-family: var(--serif);
  font-size: var(--text-3xl);
  font-weight: 300;
  color: var(--ink);
  border-bottom: none;
}

/* ─── Utility ─── */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ─── Upload bar (file upload / bulk mode) ─── */
.upload-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--paper-shade);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}
.upload-bar-label {
  font-family: var(--mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
  font-weight: 600;
  margin-right: var(--space-2);
}
.upload-mode {
  background: transparent;
  border: 1px solid var(--line);
  font-family: var(--sans);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--ink-soft);
  padding: 5px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.12s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.upload-mode:hover { border-color: var(--ink-soft); color: var(--ink); }
.upload-mode.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}
.upload-file-label { cursor: pointer; }
.upload-hint {
  font-size: var(--text-xs);
  color: var(--ink-mute);
  font-family: var(--mono);
  margin-left: auto;
}
.upload-download {
  margin-left: auto;
}
@media (max-width: 600px) {
  .upload-hint, .upload-download { margin-left: 0; }
}

/* ─── Blog ─── */
.blog-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
  margin-top: var(--space-6);
  max-width: 720px;
}
.blog-card {
  display: block;
  padding: var(--space-5) 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
  border-left: none;
  border-right: none;
  border-top: none;
  text-decoration: none;
  border-bottom: 1px solid var(--line-soft);
}
.blog-card:hover h3 { color: var(--accent); }
.blog-card-meta {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-mute);
  font-weight: 600;
  margin-bottom: var(--space-2);
}
.blog-card h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--text-2xl);
  line-height: 1.25;
  margin: 0 0 var(--space-2);
  color: var(--ink);
  transition: color 0.15s;
}
.blog-card p {
  font-size: var(--text-base);
  color: var(--ink-soft);
  line-height: 1.6;
  margin: 0;
  max-width: 60ch;
}

/* Print */
@media print {
  .topnav, .footer, .mobile-menu, .action-bar, .upload-bar { display: none; }
}
