/*
 * saito.macnemo.de
 *
 * Colours are Saito's own (the Nova theme's palette and the logo's brick red),
 * so the page looks like the software it describes. Nothing is loaded from a
 * third party — no font CDN, no analytics, no embeds: the forum itself makes no
 * external request, and a page advertising that should not either.
 */

/* Cabin is Saito's own wordmark face, served from this host. ---------------- */
@font-face {
    font-family: 'Cabin';
    src: url('fonts/cabin-latin-400.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Cabin';
    src: url('fonts/cabin-latin-600.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Cabin';
    src: url('fonts/cabin-latin-700.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --ink: #23201f;
    --muted: #6b6560;
    --ground: #ffffff;
    --surface: #faf9f8;
    --rule: #e2ddd8;
    /* Two reds on purpose: the logo's brick red carries the wordmark and the
       display line, where size makes 4.38:1 comfortable; anything text-sized —
       links, the filled button — uses Nova's darker $primary, which clears 4.5:1
       against white. Measured, not eyeballed. */
    --mark: #d9432f;
    --accent: #c0342a;
    --amber: #b26a00;

    --display: 'Cabin', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --prose: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;

    --measure: 34rem;
    --on-accent: #ffffff;
}

@media (prefers-color-scheme: dark) {
    :root {
        --ink: #e8e3dd;
        --muted: #a49c94;
        --ground: #171514;
        --surface: #1f1c1a;
        --rule: #332e2a;
        --mark: #ef6a54;
        --accent: #ef6a54;
        --amber: #d99a3a;
        --on-accent: #171514;
    }
}
/* The toggle must win over the media query in both directions. */
:root[data-theme='dark'] {
    --ink: #e8e3dd;
    --muted: #a49c94;
    --ground: #171514;
    --surface: #1f1c1a;
    --rule: #332e2a;
    --mark: #ef6a54;
    --accent: #ef6a54;
    --amber: #d99a3a;
    --on-accent: #171514;
}
:root[data-theme='light'] {
    --ink: #23201f;
    --muted: #6b6560;
    --ground: #ffffff;
    --surface: #faf9f8;
    --rule: #e2ddd8;
    --mark: #d9432f;
    --accent: #c0342a;
    --amber: #b26a00;
    --on-accent: #ffffff;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--ground);
    color: var(--ink);
    font-family: var(--prose);
    font-size: 1.0625rem;
    line-height: 1.65;
    -webkit-text-size-adjust: 100%;
}

.wrap {
    max-width: var(--measure);
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* Header ------------------------------------------------------------------- */

/* Header ------------------------------------------------------------------- */
.masthead {
    padding: 2.5rem 0 2.5rem;
}
.masthead img {
    width: 11rem;
    max-width: 60%;
    height: auto;
    display: block;
}
.thesis {
    margin: 1.75rem 0 0;
    font-family: var(--display);
    font-size: clamp(1.5rem, 1.15rem + 1.6vw, 2.1rem);
    font-weight: 600;
    line-height: 1.25;
    text-wrap: balance;
    letter-spacing: -0.01em;
}
.thesis em {
    font-style: normal;
    /* Display size, so the brighter brick red is legible and on-brand here. */
    color: var(--mark);
}

/* Sections ----------------------------------------------------------------- */
section { padding: 2.25rem 0; }
section + section { border-top: 1px solid var(--rule); }

h2 {
    margin: 0 0 1rem;
    font-family: var(--display);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--muted);
}
p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }
a { color: var(--accent); }
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 2px;
}

/* The thread motif: the same shape the logo is built from — a posting and its
   replies, each one step further in. Decorative, so hidden from readers who
   are not looking at it. */
.thread {
    margin: 1.5rem 0 0;
    padding: 1rem 1.15rem;
    border: 1px solid var(--rule);
    border-radius: 0.6rem;
    background: var(--surface);
    font-family: var(--display);
    font-size: 0.94rem;
    line-height: 1.9;
}
.thread div { color: var(--ink); }
.thread div::before {
    content: '•';
    color: var(--mark);
    margin-right: 0.55rem;
}
.thread .r1 { padding-left: 1.4rem; }
.thread .r2 { padding-left: 2.8rem; }
.thread .r1::before,
.thread .r2::before { opacity: 0.55; }
.thread .who { color: var(--muted); }

/* History: the indentation rhymes with the thread above — each entry a reply
   to the one before it. */
.era {
    display: grid;
    grid-template-columns: 4.5rem 1fr;
    gap: 0 1rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--rule);
}
.era:last-of-type { border-bottom: 0; }
.era dt {
    font-family: var(--display);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    padding-top: 0.15rem;
}
.era dd { margin: 0; }
.era.now dt { color: var(--amber); }

dl { margin: 1.25rem 0 0; }


/* Feature and upgrade lists: a name and one line saying what it is. Same grid
   as the history above, narrower term column — these are labels, not years. */
.feats { margin: 1.25rem 0 0; }
.feat {
    display: grid;
    grid-template-columns: 9rem 1fr;
    gap: 0 1rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--rule);
}
.feat:last-of-type { border-bottom: 0; }
.feat dt {
    font-family: var(--display);
    font-weight: 700;
    font-size: 0.9rem;
    padding-top: 0.15rem;
}
.feat dd { margin: 0; }

/* The current version, stated once and plainly. */
.release {
    margin: 1.5rem 0 0;
    font-family: var(--display);
    font-size: 0.95rem;
    color: var(--muted);
}
.release strong { color: var(--ink); font-variant-numeric: tabular-nums; }

/* Links out ---------------------------------------------------------------- */
.links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1.25rem;
    font-family: var(--display);
    font-size: 0.95rem;
}
.links a {
    display: inline-block;
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--rule);
    border-radius: 0.5rem;
    text-decoration: none;
    color: var(--ink);
}
.links a:hover { border-color: var(--accent); color: var(--accent); }
.links a.primary {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--on-accent);
}
.links a.primary:hover { opacity: 0.9; color: var(--on-accent); }

/* Footer ------------------------------------------------------------------- */
footer {
    margin-top: 1rem;
    padding: 2rem 0 3.5rem;
    border-top: 1px solid var(--rule);
    font-family: var(--display);
    font-size: 0.88rem;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    align-items: baseline;
}
footer a { color: var(--muted); }
footer .spacer { flex: 1; }

button.theme {
    font: inherit;
    color: var(--muted);
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

@media (max-width: 30rem) {
    .masthead { padding-top: 2.5rem; }
    .era { grid-template-columns: 1fr; gap: 0.15rem; }
    .feat { grid-template-columns: 1fr; gap: 0.15rem; }
    .thread .r2 { padding-left: 2rem; }
}

/* Legal pages: the wordmark is a way back, and the page title stands in for the
   thesis line — same rhythm, less shout. */
.masthead.legal { padding: 1.5rem 0 1.5rem; }
.masthead.legal img { width: 7rem; }
.masthead.legal .thesis { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.7rem); }
.masthead.legal a { display: inline-block; }
code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.92em;
    padding: 0.1em 0.35em;
    border-radius: 0.25rem;
    background: var(--surface);
}

/* Logo and the two controls share one line ---------------------------------- */
.masthead-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.controls {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}
.controls a,
.controls button {
    display: flex;
    align-items: center;
    color: var(--muted);
}

/* The language switch is a flag. A flag names a country, not a language, so the
   accessible name carries the actual word — a screen reader announces "English",
   and hovering shows it. The hairline keeps the white fields of the Union Jack
   from dissolving into a light page. */
.controls .flag {
    width: 1.25rem;
    height: auto;
    display: block;
    border-radius: 2px;
    box-shadow: 0 0 0 1px var(--rule);
}
.controls .lang:hover .flag { box-shadow: 0 0 0 1px var(--accent); }

/* Light/dark: the same half-filled circle Saito itself uses. It names the thing
   being changed without claiming which state is current — which a sun or a moon
   always gets wrong for half the readers. */
.controls .icon {
    width: 1.15rem;
    height: 1.15rem;
    display: block;
}
.controls button.theme { text-decoration: none; }
.controls button.theme:hover,
.controls .lang:hover { color: var(--accent); }
