@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,300;0,400;0,600;1,400&display=swap');

:root {
  --bg:     #0d0d0d;
  --text:   #c8c8c8;
  --muted:  #8888a0;
  --green:  #39ff14;
  --dim:    #1a7a06;
  --white:  #eee;
  --cursor: #39ff14;
}

/* ── CSS-only palette theming ── */
body:has(#p-phosphor:checked) { --green:#39ff14; --dim:#1a7a06; --cursor:#39ff14; }
body:has(#p-amber:checked)    { --green:#ffb800; --dim:#7a5500; --cursor:#ffb800; }
body:has(#p-nixos:checked)    { --green:#7ebae4; --dim:#2a5a7a; --cursor:#7ebae4; }
body:has(#p-dracula:checked)  { --green:#bd93f9; --dim:#5a3a8a; --cursor:#bd93f9; }
body:has(#p-coral:checked)    { --green:#ff6b6b; --dim:#7a2020; --cursor:#ff6b6b; }
body:has(#p-gold:checked)     { --green:#e8b84b; --dim:#7a5510; --cursor:#e8b84b; }

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

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.7;
}

/* CRT glow */
body::before {
  content: '';
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(57,255,20,0.025) 0%, transparent 70%);
  z-index: 9997;
}

/* Scanlines */
body::after {
  content: '';
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 3px,
    rgba(0,0,0,0.10) 3px, rgba(0,0,0,0.10) 4px
  );
  z-index: 9999;
}

/* ── Layout ── */
.screen {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 24px 100px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Boot ── */
.boot-wrap { margin-bottom: 20px; }

.boot-line {
  color: #8888a0;
  font-size: 12px;
  line-height: 1.8;
}
.boot-line .ok   { color: var(--green); transition: color 0.3s; }
.boot-line .info { color: #777; }

.skip-hint {
  font-size: 11px;
  color: #555566;
  margin-top: 6px;
  transition: color 0.2s;
  cursor: pointer;
  user-select: none;
}
.skip-hint:hover { color: #8888a0; }
.skip-hint.hidden { display: none; }

/* ── Divider ── */
hr.divider {
  border: none;
  border-top: 1px solid #1e1e1e;
  margin: 16px 0;
}

/* ── Terminal output ── */
.terminal-output {
  flex: 1;
  padding-bottom: 8px;
}

.out-block { margin-bottom: 2px; }
.gap       { margin-bottom: 10px; }

.prompt-echo {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.ps1 { color: var(--green); white-space: nowrap; transition: color 0.3s; }

.g { color: var(--green); transition: color 0.3s; }
.w { color: var(--white); }
.m { color: var(--muted); }
.r { color: #e05050; }

pre {
  font-family: 'IBM Plex Mono', monospace;
  white-space: pre;
  overflow-x: auto;
  max-width: 100%;
}

.section-label {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: block;
}

.entry {
  border-left: 1px solid #2a2a3a;
  padding-left: 14px;
  margin-bottom: 16px;
  transition: border-color 0.3s;
}
.entry:hover    { border-left-color: var(--dim); }
.entry-title   { color: var(--white); font-weight: 700; }
.entry-sub     { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.entry-body    { color: var(--text); font-size: 13px; line-height: 1.65; }
.entry-story   { color: #666; font-size: 13px; font-style: italic; margin-bottom: 6px; }

.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag {
  font-size: 11px;
  padding: 1px 6px;
  border: 1px solid #282828;
  color: var(--muted);
  border-radius: 2px;
}
.tag.g { border-color: var(--dim); color: var(--green); transition: color 0.3s, border-color 0.3s; }

a { color: var(--green); text-decoration: none; transition: color 0.3s; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

.skills-grid {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 4px 16px;
  font-size: 13px;
  margin: 4px 0;
}
.skills-grid .label { color: var(--muted); }
.skills-grid .vals  { color: var(--text); }

/* ── Input ── */
.input-area {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #1a1a1a;
}

.input-ps1 { color: var(--green); white-space: nowrap; flex-shrink: 0; transition: color 0.3s; font-size: 13px; }

#cmd {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--white);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  caret-color: var(--cursor);
  min-width: 0;
}

/* ── Hint bar ── */
.hint-bar {
  margin-top: 8px;
  color: #444;
  font-size: 11px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.hint-bar span {
  color: var(--green);
  cursor: pointer;
  transition: color 0.3s;
  opacity: 0.7;
}
.hint-bar span:hover { opacity: 1; }
.hint-bar .sep { color: #3a3a4a; }

/* ── Cat ── */
pre.cat {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin: 4px 0 12px;
  transition: color 0.3s;
}
.cat-wrap { margin: 4px 0 12px; display: block; }

/* ── Swatches ── */
.swatches {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 9998;
}

.swatches-label {
  font-size: 9px;
  letter-spacing: 0.1em;
  color: #333;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  margin-bottom: 2px;
}

.swatch {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.07);
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.swatch input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
  pointer-events: none;
}
.swatch:hover { transform: scale(1.35); }
.swatch:has(input:checked) {
  box-shadow: 0 0 0 1px rgba(255,255,255,0.3), 0 0 8px var(--c,#fff);
  transform: scale(1.2);
}
.swatch:has(input:checked)::after {
  content: '✓';
  position: absolute;
  font-size: 8px;
  color: #000;
  font-weight: 900;
  line-height: 1;
}

/* ── Light mode ── */
body.light {
  --bg:    #f4f4f0;
  --text:  #3a3a3a;
  --muted: #777;
  --white: #111;
}

body.light:has(#p-phosphor:checked) { --green:#1a8a00; --dim:#0a4400; --cursor:#1a8a00; }
body.light:has(#p-amber:checked)    { --green:#a06800; --dim:#5a3600; --cursor:#a06800; }
body.light:has(#p-nixos:checked)    { --green:#2266a8; --dim:#0a3a72; --cursor:#2266a8; }
body.light:has(#p-dracula:checked)  { --green:#6030b8; --dim:#38186e; --cursor:#6030b8; }
body.light:has(#p-coral:checked)    { --green:#c02828; --dim:#6a0e0e; --cursor:#c02828; }
body.light:has(#p-gold:checked)     { --green:#966400; --dim:#5a3800; --cursor:#966400; }

body.light::before { background: none; }
body.light::after  { background: none; }

body.light hr.divider           { border-color: #d8d8d0; }
body.light .entry               { border-left-color: #d0d0c8; }
body.light .tag                 { border-color: #ccc; }
body.light .input-area          { border-top-color: #d0d0c8; }
body.light .hint-bar .sep       { color: #bbb; }
body.light .boot-line           { color: #888; }
body.light .boot-line .info     { color: #999; }
body.light .skip-hint           { color: #bbb; }
body.light .swatches-label      { color: #aaa; }
body.light .swatch              { border-color: rgba(0,0,0,0.15); }
body.light .entry-story         { color: #999; }
body.light #cmd                 { color: var(--white); }

/* ── Mode toggle button ── */
.mode-toggle {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  border: 1px solid #2a2a2a;
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, border-color 0.2s;
  z-index: 9998;
  user-select: none;
  line-height: 1;
}
.mode-toggle:hover { color: var(--green); border-color: var(--green); }
body.light .mode-toggle { border-color: #ccc; }
body.light .mode-toggle:hover { border-color: var(--green); }

/* ── Mobile ── */
@media (max-width: 600px) {
  html, body { font-size: 12px; }
  .screen { padding: 20px 16px 120px; }
  pre.cat { font-size: 10px; line-height: 1.4; }
  .nixos-ascii { display: none; }
  .skills-grid { grid-template-columns: 80px 1fr; font-size: 11px; }
  .entry-body  { font-size: 12px; }
  .entry-story { font-size: 11px; }
  .hint-bar { gap: 2px; font-size: 10px; }
  .swatches { bottom: 12px; right: 12px; gap: 5px; }
  .swatch { width: 12px; height: 12px; }
  .swatches-label { font-size: 8px; }
  .input-ps1 { font-size: 11px; }
  #cmd { font-size: 12px; }
  .boot-line { font-size: 11px; }
}
