/* content/default.css */

/* Self-hosted fonts (OFL), so every OS renders the same faces instead of
   whatever its system font happens to be. Variable weight, latin + latin-ext
   subsets from Google Fonts; the hash in each filename lets the server cache
   them forever (server.go), so a changed font must get a new filename. */
@font-face {
  font-family: 'Atkinson Hyperlegible Mono';
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url(/fonts/AtkinsonHyperlegibleMono-italic-latin-ext.884edc0657.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Atkinson Hyperlegible Mono';
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url(/fonts/AtkinsonHyperlegibleMono-italic-latin.b9418a664a.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Atkinson Hyperlegible Mono';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url(/fonts/AtkinsonHyperlegibleMono-normal-latin-ext.6815df031c.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Atkinson Hyperlegible Mono';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url(/fonts/AtkinsonHyperlegibleMono-normal-latin.f0230cab68.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url(/fonts/Inter-italic-latin-ext.7d263a256b.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url(/fonts/Inter-italic-latin.124b693f9b.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/fonts/Inter-normal-latin-ext.8bc9dee39d.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/fonts/Inter-normal-latin.dd8a4575be.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: italic;
  font-weight: 100 700;
  font-stretch: 100%;
  font-display: swap;
  src: url(/fonts/IBMPlexSans-italic-latin-ext.8e5c23cef1.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: italic;
  font-weight: 100 700;
  font-stretch: 100%;
  font-display: swap;
  src: url(/fonts/IBMPlexSans-italic-latin.add25efa61.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 100 700;
  font-stretch: 100%;
  font-display: swap;
  src: url(/fonts/IBMPlexSans-normal-latin-ext.ae1d854fef.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 100 700;
  font-stretch: 100%;
  font-display: swap;
  src: url(/fonts/IBMPlexSans-normal-latin.056e4e2459.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --bg-color: #f0f2f5;
    --header-bg: #1c1028;
    --header-text: #e8e0f0;
    --text-color: #2a2a2a;
    --text-muted: #6b6570;
    --link-color: #7b3f8d;
    --accent-color: #9738f5;
    --sidebar-bg: #f0f2f5;
    --sidebar-border: #d0c8d8;
    --precode-bg: #eee8f3;
    --precode-color: #4a3660;
    --precode-border: #d5c8e4;
    --code-bg: #ece4f4;
    --code-color: #6b3fa0;
    --hr-color: #d0c8d8;
    --blockquote-border: #b388cc;
    --blockquote-color: #5a4a66;
    /* per-header hues, one each, drawn from the editor's syntax palette:
       keyword-violet, property-blue, function-green, value-amber, value-gold, muted */
    --h1-color: #9738f5;
    --h2-color: #3560cc;
    --h3-color: #35894e;
    --h4-color: #bf6528;
    --h5-color: #97772b;
    --h6-color: #7a6e86;
    /* IBM Plex Sans for reading, Inter for headings, Atkinson Hyperlegible
       Mono for code; all served from /fonts, so the generic fallbacks only
       show if that fails. */
    --font-primary: "IBM Plex Sans", sans-serif;
    --font-heading: "Inter", sans-serif;
    --font-mono: "Atkinson Hyperlegible Mono", monospace;
    /* Sized for the prose measure, not the window: after the side padding
       and --prose-inset, body text runs ~70-75 characters a line. Wider
       than that and lines turn stringy and hard to track back from. */
    /* overridden by /sitter.css: --content-width: 880px; */
    --para-indent: 1.6em;
    --border-color: #2D3642;
}

body.dark-mode {
    --bg-color: #0b0b11;
    --header-bg: #0e0a14;
    --header-text: #d8d0e4;
    --text-color: #d5d0dc;
    --text-muted: #8a8292;
    --link-color: #c49dd4;
    --accent-color: #a855f7;
    --sidebar-bg: #221c2c;
    --sidebar-border: #3a3048;
    --precode-bg: #1e1830;
    --precode-color: #b89cd0;
    --precode-border: #2e2444;
    --code-bg: #2a2040;
    --code-color: #c8a8e8;
    --hr-color: #3a3048;
    --blockquote-border: #7a58a0;
    --blockquote-color: #a898b8;
    --h1-color: #b06bf0;
    --h2-color: #6a9ce6;
    --h3-color: #83cf90;
    --h4-color: #e0a267;
    --h5-color: #d4c47a;
    --h6-color: #9d92b3;
    --border-color: #393045;
}

* {
    box-sizing: border-box;
}

/* Root size drives every rem on the page (headings, sidebar, header), so
   raising it scales the whole site rather than just the prose. */
html {
    font-size: 18px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-primary);
    font-size: 20px;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* full-bleed aligned elements use width: 100vw which is wider than the
       body when a vertical scrollbar is present; suppress horizontal scroll. */
    overflow-x: hidden;
}

/* Header */
.main-header {
    background-color: var(--header-bg);
    color: var(--header-text);
    padding: 3.5rem 1.5rem;
    margin-bottom: 4rem;
    border-bottom: 3px solid var(--accent-color);
}

.header-content {
    max-width: var(--content-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-logo img {
    height: 56px;
    width: 56px;
    margin: 0;
    border: none;
    border-radius: 50%;
}

.header-logo {
    display: inline-block;
}

.main-header h1 {
    margin: 0;
    color: var(--header-text);
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    line-height: 1.3;
}

/* Content Container */
.main-content {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 1.5rem 8rem 1.5rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.25;
    margin-top: 2.5em;
    margin-bottom: 0.6em;
}

h1 { font-size: 2rem;    color: var(--h1-color); }
h2 { font-size: 1.5rem;  color: var(--h2-color); }
h3 { font-size: 1.25rem; color: var(--h3-color); }

h4, h5, h6 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

h4 { color: var(--h4-color); }
h5 { color: var(--h5-color); }
h6 { color: var(--h6-color); }

/* First paragraph — the lede */
.main-content > p:first-of-type,
.preview-content > p:first-of-type {
    font-size: 1.1em;
    color: var(--text-color);
    line-height: 1.65;
    margin-bottom: 2em;
}

p {
    margin-bottom: 1.15em;
}

/* Links */
a {
    color: var(--link-color);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    text-decoration-color: color-mix(in srgb, var(--link-color) 40%, transparent);
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

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

/* Horizontal rules */
hr {
    border: none;
    height: 1px;
    background: var(--hr-color);
    margin: 3.5rem auto;
    max-width: 60%;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 2.5rem auto;
    border-radius: 4px;
}

/* Code — inline */
code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: var(--code-bg);
    color: var(--code-color);
    padding: 2px 6px;
    border-radius: 3px;
}

/* Code — blocks */
pre {
    background: var(--precode-bg);
    border: 1px solid var(--precode-border);
    border-radius: 4px;
    padding: 1.25rem 1.5rem;
    margin: 2rem 0;
    overflow-x: auto;
    font-size: 0.85em;
    line-height: 1.6;
}

pre > code {
    background: none;
    color: var(--precode-color);
    padding: 0;
    margin: 0;
    border-radius: 0;
}

/* Blockquotes */
blockquote {
    border-left: 3px solid var(--blockquote-border);
    margin: 2rem 0;
    padding: 0.5rem 0 0.5rem 1.5rem;
    font-style: italic;
    color: var(--blockquote-color);
}

blockquote p:last-child {
    margin-bottom: 0;
}

/* Strong / emphasis combos */
strong {
    font-weight: 700;
}

/* Indented text blocks (from 4-space indent in markdown) */
.main-content > pre:not([class]),
.preview-content > pre:not([class]) {
    background: transparent;
    border: none;
    border-left: 2px solid var(--hr-color);
    padding: 0.5rem 1.5rem;
    font-family: var(--font-primary);
    font-style: italic;
    font-size: 0.95em;
    color: var(--text-muted);
}

/* Dark Mode Toggle Button */
#theme-toggle {
    background: none;
    border: 1px solid var(--sidebar-border);
    color: var(--text-color);
    padding: 6px 12px;
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    margin-top: 1rem;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    border-radius: 3px;
}

#theme-toggle:hover {
    background-color: var(--link-color);
    color: #fff;
    border-color: var(--link-color);
}
