/* Google Fonts - Modern Bilingual (English + Japanese) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Noto+Sans+JP:wght@400;500;600&display=swap');

:root {
  --bg: #0d1117;
  --bg-secondary: #161b22;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #58a6ff;
  --accent-hover: #79b8ff;
  --border: #30363d;
}

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

html {
  font-size: 18px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 
               'Segoe UI', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 
               'Yu Gothic', 'Meiryo', sans-serif;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header nav {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

header nav > a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.2rem;
}

.nav-categories {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.nav-categories a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.nav-categories a:hover {
  color: var(--accent);
  background: rgba(88, 166, 255, 0.1);
}

/* Nav item with level pills */
.nav-item-with-levels {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}

.nav-item-with-levels > a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 1rem 0 1rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.nav-item-with-levels > a:hover {
  color: var(--accent);
  background: rgba(88, 166, 255, 0.1);
}

.nav-level-pills {
  display: flex;
  gap: 0.35rem;
  padding-left: 1rem;
  flex-wrap: wrap;
}

a.nav-pill {
  display: inline-block;
  padding: 0.1rem 0.4rem !important;
  border-radius: 9999px !important;
  font-size: 0.55rem !important;
  font-weight: 600;
  color: white;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.15s;
}

a.nav-pill:hover {
  opacity: 0.85;
  transform: translateY(-1px);
  text-decoration: none;
  color: white;
  background: inherit;
}

.nav-pill.pill-a1 { background: #22c55e; }
.nav-pill.pill-a2 { background: #10b981; }
.nav-pill.pill-b1 { background: #3b82f6; }
.nav-pill.pill-b2 { background: #6366f1; }
.nav-pill.pill-c1 { background: #a855f7; }
.nav-pill.pill-c2 { background: #ec4899; }

@media (max-width: 768px) {
  header nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .nav-categories {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  
  .nav-categories a {
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
  }
  
  .nav-item-with-levels {
    width: 100%;
  }
  
  .nav-item-with-levels > a {
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
  }
  
  .nav-level-pills {
    padding-left: 0.8rem;
    gap: 0.3rem;
  }
  
  .nav-pill {
    font-size: 0.5rem;
    padding: 0.08rem 0.35rem;
  }
}

main {
  flex: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 2rem;
  width: 100%;
}

article header {
  margin-bottom: 2.5rem;
}

article header h1 {
  font-size: 2.2rem;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

article header time {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

/* Categories */
.post-categories {
  margin: 0.5rem 0;
}

.category {
  background: var(--accent);
  color: var(--bg);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
  margin-right: 0.5rem;
}

/* CEFR Level badges */
.cefr-level {
  margin: 0.5rem 0;
}

.level-badge {
  padding: 0.3rem 0.8rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.level-A1, .level-A2 {
  background: #22c55e;
  color: white;
}

.level-B1, .level-B2 {
  background: #f59e0b;
  color: white;
}

.level-C1, .level-C2 {
  background: #dc2626;
  color: white;
}

/* Level navigation */
.level-navigation {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 2rem 0;
}

.level-navigation h3 {
  margin: 0 0 1rem 0;
  color: var(--accent);
  font-size: 1.1rem;
}

.level-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.level-link {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: transform 0.2s ease;
}

.level-link:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.level-link.level-A1,
.level-link.level-A2 {
  background: #22c55e;
  color: white;
}

.level-link.level-B1,
.level-link.level-B2 {
  background: #f59e0b;
  color: white;
}

.level-link.level-C1,
.level-link.level-C2 {
  background: #dc2626;
  color: white;
}

h1, h2, h3, h4 {
  color: var(--text);
  margin-top: 2rem;
  margin-bottom: 1rem;
}

h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

p {
  margin-bottom: 1.25rem;
}

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

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

ul, ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
}

code {
  background: var(--bg-secondary);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9rem;
}

pre {
  background: var(--bg-secondary);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 1.25rem;
}

pre code {
  background: none;
  padding: 0;
}

blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-style: italic;
}

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

img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

/* Featured images */
.featured-image {
  margin: 2rem 0 2.5rem 0;
}

.featured-image img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

footer {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

/* Index page */
.post-list {
  list-style: none;
  padding: 0;
}

.post-item {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}

.post-item:last-child {
  border-bottom: none;
}

.post-item.with-image {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.post-thumbnail {
  flex-shrink: 0;
  width: 160px;
  height: 120px;
}

.post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.post-content {
  flex: 1;
  min-width: 0;
}

.post-content a {
  font-size: 1.2rem;
  font-weight: 500;
  text-decoration: none;
}

.post-content a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.post-content time {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.post-content p {
  margin-top: 0.5rem;
  margin-bottom: 0;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Fallback for posts without images */
.post-item:not(.with-image) .post-content a {
  font-size: 1.2rem;
  font-weight: 500;
}

.post-item:not(.with-image) .post-content time {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.post-item:not(.with-image) .post-content p {
  margin-top: 0.5rem;
  margin-bottom: 0;
  color: var(--text-muted);
}

@media (max-width: 600px) {
  html { font-size: 16px; }
  main { padding: 2rem 1rem; }
  article header h1 { font-size: 1.8rem; }
  
  /* Mobile layout for post thumbnails */
  .post-item.with-image {
    flex-direction: column;
    gap: 1rem;
  }
  
  .post-thumbnail {
    width: 100%;
    height: 180px;
    align-self: center;
  }
  
  /* Mobile level navigation */
  .level-navigation {
    padding: 1rem;
  }
  
  .level-links {
    flex-direction: column;
  }
  
  .level-link {
    text-align: center;
    padding: 0.75rem;
  }
  
  /* Mobile categories */
  .post-categories {
    margin-bottom: 1rem;
  }
}

/* Grammar pill styling */
.grammar-pill {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.5rem;
  font-weight: 500;
  margin-bottom: 0;
  letter-spacing: 0.02em;
  box-shadow: 0 1px 2px rgba(102, 126, 234, 0.3);
  vertical-align: middle;
  line-height: 1.1;
}

/* Top word-info labels (フレーズ / 意味 / 品詞): keep heading level, make pill larger and aligned */
h1 .grammar-pill,
h2 .grammar-pill,
h3 .grammar-pill,
h4 .grammar-pill {
  font-size: 1rem;
  padding: 0.3rem 1rem;
  vertical-align: middle;
}

/* Top word-info rows (単語/フレーズ / 意味 / 品詞) — plain h3s without grammar-pill */
article > h3[id^="単語"],
article > h3[id^="フレーズ"],
article > h3[id^="意味"],
article > h3[id^="品詞"] {
  margin: 0.65rem 0;
  padding: 0.6rem 0.85rem;
  border: 1px solid #cbd5e1;
  border-left: 5px solid #334155;
  border-radius: 10px;
  background: #f8fafc;
  color: #0f172a;
  line-height: 1.45;
  font-size: 1.05rem;
}

/* Top data area rows (phrase/meaning/part-of-speech/etc.) */
article > h3:has(> .grammar-pill),
article > h2:has(> .grammar-pill) {
  margin: 0.65rem 0;
  padding: 0.6rem 0.85rem;
  border: 1px solid #cbd5e1;
  border-left: 5px solid #334155;
  border-radius: 10px;
  background: #f8fafc;
  color: #0f172a;
  line-height: 1.45;
  font-size: 1.05rem;
}

article > h3:has(> .grammar-pill) .grammar-pill,
article > h2:has(> .grammar-pill) .grammar-pill {
  background: #334155;
  color: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.2);
}

/* Reduce gap between grammar pill and following dialogue */
p:has(.grammar-pill) {
  margin-bottom: 0.05rem;
}

p:has(.grammar-pill) + p {
  margin-top: 0;
}

/* Distinct block for common mistakes section at bottom of dialogues */
.mistake-box {
  margin: 1.25rem 0 1.5rem;
  padding: 1rem 1.1rem;
  border: 1px solid #cbd5e1;
  border-left: 5px solid #334155;
  border-radius: 12px;
  background: #f8fafc;
  color: #0f172a;
}

.mistake-box p {
  margin: 0.6rem 0;
  line-height: 1.6;
}

.mistake-pill {
  display: inline-flex;
  align-items: center;
  background: #334155;
  color: #fff;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.2);
}

.mistake-box del {
  color: #991b1b;
  text-decoration-thickness: 2px;
}

.mistake-box code {
  background: #e2e8f0;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  padding: 0.08rem 0.35rem;
  border-radius: 4px;
}

/* Category Pills */
.post-categories-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  align-items: center;
}

a.category-pill,
.category-pill {
  display: inline-block;
  padding: 0.3rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: #3b82f6;
  color: white;
  text-decoration: none;
  transition: opacity 0.15s;
}

a.category-pill:hover {
  opacity: 0.85;
}

/* News category */
.category-pill.cat-news {
  background: #6366f1;
}

/* CEFR Level Colors */
.category-pill.cat-a1 { background: #22c55e; }
.category-pill.cat-a2 { background: #10b981; }
.category-pill.cat-b1 { background: #3b82f6; }
.category-pill.cat-b2 { background: #6366f1; }
.category-pill.cat-c1 { background: #a855f7; }
.category-pill.cat-c2 { background: #ec4899; }

/* Dialogues category */
.category-pill.cat-dialogues {
  background: #f59e0b;
}

/* Small category pills for feed pages */
.post-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.4rem;
}

a.category-pill-sm,
.category-pill-sm {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 9999px;
  font-size: 0.55rem;
  font-weight: 600;
  background: #3b82f6;
  color: white;
  text-decoration: none;
}

a.category-pill-sm:hover {
  opacity: 0.85;
}

.category-pill-sm.cat-a1 { background: #22c55e; }
.category-pill-sm.cat-a2 { background: #10b981; }
.category-pill-sm.cat-b1 { background: #3b82f6; }
.category-pill-sm.cat-b2 { background: #6366f1; }
.category-pill-sm.cat-c1 { background: #a855f7; }
.category-pill-sm.cat-c2 { background: #ec4899; }
.category-pill-sm.cat-news { background: #6366f1; }
.category-pill-sm.cat-dialogues { background: #f59e0b; }

:root{--bg:#0d1117;--bg-secondary:#161b22;--text:#e6edf3;--text-muted:#8b949e;--accent:#58a6ff;--accent-hover:#79b8ff;--border:#30363d;--body-font:Inter,system-ui,sans-serif;--heading-font:Inter,system-ui,sans-serif}
body{font-family:var(--body-font)}h1,h2,h3,h4,h5,h6{font-family:var(--heading-font)}
/* Original Salvage Terminal, with its workbench beneath the name. */
.amiga-only, .commodore-only, .c64-only, .vic20-only, .sasquatch-only { display: none; }
@font-face {
  font-family: 'Ubuntu Mono';
  src: url('/images/fonts/ubuntu-mono.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
body {
  --identity-sky: linear-gradient(to bottom, rgb(48 130 210 / 52%) 0%, rgb(112 183 234 / 30%) 50%, transparent 100%);
  --accent: #ffad58;
  --accent-hover: #ffd29c;
  --border: #514635;
  --text: #f0dcb7;
  --text-muted: #9c8f7c;
  background: radial-gradient(ellipse at 75% 10%, #37281766, transparent 60%), #171713;
  color: #f0dcb7;
  font-family: Arial, Helvetica, sans-serif;
}

a:focus-visible { outline: 2px solid #ffad58; outline-offset: 5px; }
body > header, .shell > header, body > footer, .shell > footer { max-width: 1290px; width: 100%; margin: auto; }
body > header, body > footer { padding-inline: 5%; }
header nav { padding: 29px 0; border-bottom: 2px solid #726045; gap: 20px; background-image: var(--identity-sky); }
header nav > a { color: #e9d7b9; font-size: 15px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.nav-brand { display: inline-flex; align-items: center; gap: 5px; vertical-align: middle; }
.nav-brand-logo { display: block; width: 64px; height: 64px; flex: 0 0 64px; object-fit: contain; border-radius: 50%; mix-blend-mode: screen; }
.nav-brand-name { white-space: nowrap; text-transform: uppercase; font-size: 2em; line-height: 1.1; }
.nav-brand-first { color: #f0dcb7; }
.nav-brand-rest { color: #ffb15c; }
html[data-theme='amiga'] .nav-brand-first,
html[data-theme='amiga'] .nav-brand-rest { color: #fff; }
html[data-theme='amiga'] header nav > a { background: #5965ba; padding: 2px 5px; }
html:is([data-theme='c64'], [data-theme='vic20']) .nav-brand-first,
html:is([data-theme='c64'], [data-theme='vic20']) .nav-brand-rest { color: var(--cbm-ink); }
html:is([data-theme='amiga'], [data-theme='c64'], [data-theme='vic20']) .nav-brand-logo { border-radius: 0; mix-blend-mode: normal; image-rendering: pixelated; }
html:is([data-theme='amiga'], [data-theme='c64'], [data-theme='vic20']) header nav { background-image: none; }
.nav-categories { gap: 30px; }
.nav-categories a { padding: 0; color: #c5bcac; border-radius: 0; font: 12px ui-monospace, monospace; }
.nav-categories a:hover { background: transparent; color: #ffad58; }
main > h1:first-child, article > h1:first-child { margin-top: 0; }

.surface { position: relative; isolation: isolate; overflow: clip; min-height: 100vh; }
.surface::after { content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: .07; background: repeating-linear-gradient(0deg, transparent, transparent 2px, #a7c5c5 3px, transparent 4px); }
.shell { max-width: 1290px; padding: 0 5%; margin: auto; }
.terminal-main { max-width: none; padding: 39px 0 52px; margin: 0; }
.rack-top, .rail { display: flex; justify-content: space-between; gap: 20px; color: #a49477; font: 10px/1.6 ui-monospace, monospace; letter-spacing: .1em; }
.rack-top { padding-bottom: 17px; justify-content: flex-end; }
.rack { position: relative; border: 1px solid #6a5b43; background: linear-gradient(120deg, #26241b, #171914); box-shadow: 0 20px 55px #0005, inset 0 0 60px #0002; padding: 42px; }
.rack::before, .rack::after { content: '⊗'; position: absolute; top: 12px; color: #847153; font: 20px monospace; }
.rack::before { left: 12px; }
.rack::after { right: 12px; }
.terminal-label { color: #e9b66c; font: 10px/1.7 ui-monospace, monospace; letter-spacing: .15em; }
.terminal-main h1 { max-width: none; margin: 27px 0 33px; color: #f0dcb7; font: 400 clamp(60px, 8vw, 112px)/.95 Impact, 'Arial Narrow', Arial, sans-serif; letter-spacing: -.035em; text-transform: uppercase; text-shadow: 2px 2px #30261b; }
.terminal-main h1 > span { display: block; }
.terminal-main h1 .title-rest { color: #ffb15c; }
.identity-heading { position: relative; z-index: 4; display: flex; align-items: center; gap: 4px; margin: 27px 0 33px; }
.identity-heading::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--identity-sky);
}
.heading-logo { display: block; flex: 0 0 auto; width: clamp(160px, 20vw, 240px); height: auto; aspect-ratio: 1; object-fit: contain; border-radius: 50%; mix-blend-mode: screen; }
.terminal-main .identity-heading h1 { margin: 0; min-width: 0; }

/* The homepage menu replaces the old separate logo/name heading. Its outer
   space stays fixed while the visible bar follows the visitor's scroll. */
html { scroll-padding-top: var(--workbench-menu-height, 0px); }
.site-home { --header-hero-logo: clamp(160px, 20vw, 240px); --header-hero-font: clamp(60px, 8vw, 112px); }
.site-home .shell > header { position: sticky; top: 0; z-index: 20; align-self: start; pointer-events: none; --header-progress: 0; }
.site-home header nav { background-color: #171713; pointer-events: auto; }
.site-home header .nav-brand { gap: 4px; }
.site-home header .nav-brand-logo {
  width: calc(var(--header-hero-logo) * (1 - var(--header-progress)) + 64px * var(--header-progress));
  height: calc(var(--header-hero-logo) * (1 - var(--header-progress)) + 64px * var(--header-progress));
  flex-basis: calc(var(--header-hero-logo) * (1 - var(--header-progress)) + 64px * var(--header-progress));
}
.site-home header .nav-brand-name { font-size: calc(var(--header-hero-font) * (1 - var(--header-progress)) + 2em * var(--header-progress)); line-height: .95; letter-spacing: -.035em; font-weight: 400; }
.site-home header .nav-brand-name > span { display: block; }
.site-home .terminal-main > .home-title { position: absolute; width: 1px; height: 1px; padding: 0; margin: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.site-home .terminal-tree a[id] { scroll-margin-top: calc(var(--workbench-menu-height, 150px) + 16px); }
html[data-theme='amiga'] .site-home { --header-hero-logo: 128px; --header-hero-font: 48px; }
html[data-theme='c64'] .site-home { --header-hero-logo: 128px; --header-hero-font: 40px; }
html[data-theme='vic20'] .site-home { --header-hero-logo: 128px; --header-hero-font: 28px; }

/* Break the menu background out of the centered content column on every page.
   Keep its contents aligned with the column and respect narrow-screen insets. */
html body:not(.site-home) > header > nav,
html .site-home .shell > header > nav {
  width: var(--menu-viewport-width, 100%);
  max-width: none;
  margin-inline: calc((100% - var(--menu-viewport-width, 100%)) / 2);
  padding-left: max(16px, calc((var(--menu-viewport-width, 100%) - 100%) / 2), env(safe-area-inset-left));
  padding-right: max(16px, calc((var(--menu-viewport-width, 100%) - 100%) / 2), env(safe-area-inset-right));
}
html:is([data-theme='c64'], [data-theme='vic20']) .site-home header nav { background-color: var(--cbm-screen); }

.monitor {
  position: relative;
  isolation: isolate;
  z-index: 4;
  width: 100%;
  overflow: hidden;
  padding: 0;
  border: 1px solid #8b7855;
  border-radius: 2px;
  background: #0c0e0a;
  box-shadow: 0 8px 0 #11130d, 0 12px 26px #0006, inset 0 0 32px #0005;
  color: #e6c58b;
  font-family: 'Ubuntu Mono', 'Liberation Mono', 'Courier New', monospace;
  font-variant-ligatures: none;
}
.monitor::after { content: ''; position: absolute; inset: 37px 0 20px; z-index: 1; pointer-events: none; opacity: .1; background: repeating-linear-gradient(transparent, transparent 2px, #39442b 3px, transparent 4px); }
.terminal-titlebar { position: relative; z-index: 2; display: flex; align-items: center; gap: 11px; min-height: 37px; padding: 7px 11px 7px 13px; border-bottom: 1px solid #786b4b; background: linear-gradient(#373426, #28291d); }
.terminal-icon { color: #f0c67b; font-size: 15px; }
.monitor-label { margin: 0; color: #e3cf9f; font: 400 14px/1.3 'Ubuntu Mono', 'Liberation Mono', 'Courier New', monospace; letter-spacing: 0; }
.window-controls { display: flex; align-items: center; gap: 6px; margin-left: auto; color: #d2c19b; }
.window-controls > span { display: grid; place-items: center; width: 20px; height: 19px; border: 1px solid #675f43; background: #202418; font: 12px/1 monospace; }
.window-controls > span:last-child { background: #4b3526; border-color: #785039; color: #e8bc8c; }
.terminal-session { position: relative; z-index: 2; padding: 25px 28px 23px; }
.monitor-prompt { margin: 0; color: #dcb579; font: 16px/1.6 'Ubuntu Mono', 'Liberation Mono', 'Courier New', monospace; }
.terminal-host { color: #bec799; }
.monitor .terminal-art { margin: 22px 0 24px; padding: 0; border: 0; border-radius: 0; background: transparent; overflow: visible; white-space: pre; color: #bf914f; font: 14px/1.15 'Ubuntu Mono', 'Liberation Mono', 'Courier New', monospace; letter-spacing: 0; }
.ascii-compact { display: none; }
.workbench-intro { max-width: none; margin: 9px 0 20px; color: #e8cc99; font: 18px/1.65 'Ubuntu Mono', 'Liberation Mono', 'Courier New', monospace; letter-spacing: 0; }
.terminal-comment { margin: 0 0 16px; color: #929173; font: 15px/1.6 'Ubuntu Mono', 'Liberation Mono', 'Courier New', monospace; }
.terminal-menu { margin: 23px 0 20px; }
.terminal-tree { display: flex; flex-direction: column; align-items: flex-start; margin-top: 9px; font: 18px/1.8 'Ubuntu Mono', 'Liberation Mono', 'Courier New', monospace; }
.tree-root { color: #bec799; }
.terminal-tree a { display: block; padding: 2px 8px 2px 0; color: #efc47c; white-space: pre; text-decoration: none; }
.tree-branch { color: #929173; }
.terminal-tree a:hover, .terminal-tree a:focus-visible { color: #fff1c6; background: #d7b76c18; }
.terminal-tree a > span:last-child { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #efc47c66; }
.terminal-tree a[data-theme-choice][aria-current] { color: #fff1c6; }
.terminal-tree a[data-theme-choice][aria-current] > span:last-child::after { content: ' *'; }
.theme-options { display: grid; gap: 18px; margin: 25px 0; }
.theme-option { display: block; padding: 20px; border: 1px solid #685338; color: #efc47c; font-family: 'Ubuntu Mono', monospace; text-decoration: none; }
.theme-option strong { display: block; font-size: 23px; margin-bottom: 9px; }
.theme-option span { display: block; color: #c5bcac; font-size: 16px; line-height: 1.7; }
.theme-option:hover, .theme-option[aria-current] { border-color: #efc47c; background: #d7b76c10; text-decoration: none; }
.theme-option[aria-current] strong::after { content: ' [selected]'; font-size: 14px; }
.terminal-ready { margin-bottom: 0; }
.terminal-cursor { color: #e4bd78; font-size: 16px; }
.terminal-status { position: relative; z-index: 2; display: flex; justify-content: space-between; gap: 12px; padding: 4px 13px; border-top: 1px solid #474a30; background: #1e2317; color: #aaa587; font: 11px/1.3 'Ubuntu Mono', 'Liberation Mono', 'Courier New', monospace; }

.rack-bottom { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 32px; margin-top: 31px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.actions a { display: flex; align-items: center; justify-content: space-between; gap: 35px; padding: 17px 21px; border: 1px solid #685338; background: #1c1d17; color: #dfcba9; font: 11px ui-monospace, monospace; letter-spacing: .08em; }
.actions a:first-child { color: #1a1812; border-color: #ffad58; background: #ffad58; font-weight: 700; }
.actions a:hover { text-decoration: none; border-color: #edc38c; filter: brightness(1.1); }
.tape { padding: 11px 15px; max-width: 260px; background: #cbb781; color: #252217; font: 700 10px/1.6 ui-monospace, monospace; transform: rotate(-3deg); box-shadow: 0 5px 10px #0003; clip-path: polygon(2% 0, 100% 3%, 98% 94%, 0 100%); }
.patches { display: flex; justify-content: space-between; gap: 20px; margin-top: 30px; padding-top: 18px; border-top: 1px solid #5b503b; color: #d8ba84; font: 9px/1.6 ui-monospace, monospace; letter-spacing: .05em; }
.patches span::before { content: '●'; margin-right: 7px; color: #ffac50; }
.rail { align-items: center; margin-top: 18px; font-size: 9px; color: #a6977b; }
.stripes { width: 190px; height: 9px; flex-shrink: 0; background: repeating-linear-gradient(120deg, #ab8641 0, #ab8641 7px, transparent 7px, transparent 14px); opacity: .7; }
.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; padding: 25px 0; border-top: 1px solid #514635; color: #9c8f7c; font: 9px/1.6 ui-monospace, monospace; letter-spacing: .06em; text-align: left; }
.visitor-counts { display: flex; flex: 0 0 100%; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px 24px; padding-top: 16px; font-size: 12px; letter-spacing: 0; }
.visitor-counts-label { display: inline-flex; align-items: center; gap: 8px; }
.visitor-counts-label::before { content: ''; width: 5px; height: 5px; background: currentColor; opacity: .35; }
.visitor-counts[data-state='live'] .visitor-counts-label::before { background: #a6ba86; opacity: 1; box-shadow: 0 0 5px #a6ba8640; }
.visitor-counts dl { display: flex; gap: 18px; margin: 0; }
.visitor-counts dl > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.visitor-counts dt { font-weight: normal; }
.visitor-counts dd { margin: 0; color: var(--accent); font-weight: bold; font-variant-numeric: tabular-nums; }
html[data-theme='amiga'] .visitor-counts dd { color: inherit; }
html:is([data-theme='c64'], [data-theme='vic20']) .visitor-counts { font-size: 9px; }
@media (max-width: 480px) {
  .visitor-counts { flex-direction: column; gap: 8px; }
  .visitor-counts dl { width: 100%; justify-content: center; gap: 15px; }
  .visitor-counts dl > div { flex-direction: column; align-items: center; gap: 2px; }
}

@media (max-width: 900px) {
  .rack { padding: 35px 28px; }
  .terminal-session { padding: 23px; }
  .monitor .terminal-art { font-size: 12px; }
  .rack-top, .rail { font-size: 8px; }
  .stripes { width: 100px; }
}

@media (max-width: 700px) {
  .site-home { --header-hero-logo: clamp(72px, 23vw, 140px); --header-hero-font: clamp(36px, 11vw, 67px); }
  .nav-brand-name > span { display: block; }
  .shell { padding-inline: 6%; }
  header nav { padding: 24px 0; gap: 22px; }
  header nav > a { font-size: 13px; }
  .nav-categories { gap: 26px; }
  .nav-categories a { font-size: 11px; padding: 0; }
  .terminal-main { padding: 26px 0 35px; }
  .rack-top { font-size: 7px; gap: 15px; }
  .rack-top > span:last-child { text-align: right; }
  .rack { padding: 34px 22px 28px; }
  .terminal-label { font-size: 8px; }
  .terminal-main h1 { font-size: clamp(61px, 18vw, 77px); margin: 24px 0 28px; }
  .identity-heading { margin: 24px 0 28px; }
  .heading-logo { width: clamp(72px, 23vw, 140px); }
  .terminal-main .identity-heading h1 { font-size: clamp(36px, 11vw, 67px); }
  .terminal-titlebar { gap: 8px; padding-inline: 10px 7px; min-height: 34px; }
  .monitor-label { font-size: 13px; }
  .window-controls { gap: 4px; }
  .window-controls > span { width: 16px; height: 16px; font-size: 10px; }
  .terminal-session { padding: 20px 17px; }
  .monitor .ascii-wide { display: none; }
  .monitor .ascii-compact { display: block; font-size: 12px; margin: 19px 0 23px; }
  .workbench-intro { font-size: 17px; line-height: 1.65; margin-top: 9px; }
  .monitor-prompt { font-size: 13px; line-height: 1.6; }
  .terminal-comment { font-size: 12px; }
  .terminal-tree { font-size: 17px; }
  .terminal-status { font-size: 10px; padding-inline: 10px; }
  .rack-bottom { margin-top: 26px; gap: 26px; }
  .actions { width: 100%; gap: 11px; }
  .actions a { flex: 1; font-size: 9px; padding: 15px 13px; gap: 15px; }
  .tape { margin: 0 auto; font-size: 9px; }
  .patches { font-size: 7px; gap: 15px; }
  .rail { font-size: 7px; gap: 12px; }
  .stripes { width: 48px; height: 8px; }
  .site-footer { font-size: 8px; flex-wrap: wrap; gap: 15px; }
  .site-footer > span:nth-child(2) { display: none; }
}

@media (max-width: 360px) {
  html[data-theme='vic20'] .nav-brand-name { font-size: 1.75em; }
  .rack { padding-inline: 17px; }
  .terminal-session { padding: 19px 13px; }
  .monitor-label { font-size: 12px; }
  .window-controls { gap: 3px; }
  .window-controls > span { width: 14px; }
  .workbench-intro { font-size: 16px; }
  .monitor-prompt { font-size: 12px; }
  .actions a { font-size: 8px; padding: 14px 11px; }
  .patches, .rail { font-size: 6px; }
}

@media (max-width: 600px) {
  html[data-theme='amiga'] .site-home { --header-hero-logo: 80px; --header-hero-font: 32px; }
  html[data-theme='c64'] .site-home { --header-hero-logo: 80px; --header-hero-font: 24px; }
  html[data-theme='vic20'] .site-home { --header-hero-logo: 80px; --header-hero-font: 16px; }
}
@media (max-width: 360px) {
  html[data-theme='vic20'] .site-home { --header-hero-font: 14px; }
  html[data-theme='vic20'] .site-home header .nav-brand-name { font-size: 14px; }
}
