/* ---- palette ----------------------------------------------------------
   Derived from LINUXexpert.org's terminal-desk theme, so the two sites read
   as siblings: the same warm olive ground, amber accent, mono-for-chrome and
   serif-for-prose pairing.

   Dark is the default -- bare :root is the dark palette. Light arrives two
   ways, and both are needed: through prefers-color-scheme for a visitor who
   never touches the toggle, and through [data-theme="light"] for one who
   does. The :not([data-theme="dark"]) guard is what stops the media query
   overriding somebody who explicitly asked for dark on a light desktop. */
:root {
  --ground: #12140F;
  --surface: #1B1E17;
  --surface-2: #21241A;
  --raised: #262A1D;
  --ink: #E7E3D3;
  --ink-soft: #9B9686;
  --ink-faint: #6E6A5C;
  --line: #2A2C22;
  --accent: #E0A233;
  --accent-ink: #1B1305;
  --font-mono: ui-monospace, "JetBrains Mono", "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --font-serif: Charter, "Iowan Old Style", "Palatino Linotype", Georgia, "Times New Roman", serif;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --ground: #EDEAE0;
    --surface: #FFFFFF;
    --surface-2: #F6F3E9;
    --raised: #FFFFFF;
    --ink: #211E14;
    --ink-soft: #5B5646;
    --ink-faint: #8B8571;
    --line: #DAD5C4;
    --accent: #A2670F;
    --accent-ink: #FFFFFF;
  }
}

:root[data-theme="light"] {
  --ground: #EDEAE0;
  --surface: #FFFFFF;
  --surface-2: #F6F3E9;
  --raised: #FFFFFF;
  --ink: #211E14;
  --ink-soft: #5B5646;
  --ink-faint: #8B8571;
  --line: #DAD5C4;
  --accent: #A2670F;
  --accent-ink: #FFFFFF;
}

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

body {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.6;
  /* The page is one short block; hold it in the middle of the viewport
     rather than letting it sit under the header on a tall screen. */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

::selection { background: var(--accent); color: var(--accent-ink); }
a { color: inherit; }
button { font-family: inherit; cursor: pointer; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 1.5rem; }

/* ---- header ---- */
header.site { border-bottom: 1px solid var(--line); background: var(--surface); }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 64px; }

.wordmark {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.05rem;
  white-space: nowrap;
  text-decoration: none;
  color: var(--ink);
}
.wordmark .cursor {
  display: inline-block;
  width: 0.5em;
  height: 0.85em;
  background: var(--accent);
  margin-left: 0.1em;
  vertical-align: -0.1em;
  animation: blink 1.1s steps(1) infinite;
}
@media (prefers-reduced-motion: reduce) { .wordmark .cursor { animation: none; } }
@keyframes blink { 50% { opacity: 0; } }

.theme-toggle {
  display: flex; align-items: center; gap: 0.4rem;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-soft);
  font-family: var(--font-mono); font-size: 0.72rem;
  padding: 0.42rem 0.85rem; border-radius: 999px;
  transition: color .15s, border-color .15s;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--accent); }
.theme-toggle svg { width: 13px; height: 13px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
/* Dark is the default, so the sun ("switch to light") is what shows unless a
   light preference -- system or explicit -- says otherwise. */
.theme-toggle .icon-sun { display: block; }
.theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme="dark"]) .theme-toggle .icon-moon { display: block; }
}
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }
@media (max-width: 560px) {
  .theme-toggle { padding: 0.5rem; }
  .theme-toggle span { display: none; }
}

/* ---- body ---- */
main { flex: 1; display: flex; align-items: center; }
main .wrap { padding-top: 4rem; padding-bottom: 4rem; }

.eyebrow {
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 0.7em;
}
h1 {
  font-family: var(--font-mono); font-weight: 700;
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  text-wrap: balance; margin: 0;
}
.lede { color: var(--ink-soft); max-width: 34em; margin: 0.9rem 0 0; }
.asked {
  font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-faint);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 4px; padding: 0.6rem 0.9rem; margin: 1.2rem 0 0;
  overflow-wrap: anywhere;
}

/* ---- footer ---- */
footer.site { border-top: 1px solid var(--line); background: var(--surface); }
footer.site .wrap { padding-top: 1.2rem; padding-bottom: 1.2rem; }
footer.site p { margin: 0; font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-faint); }
