/*
 * Main site theme - clean editorial/research notebook.
 *
 * This keeps the small personal-site footprint and the self-hosted
 * font setup, but drops the previous ornamental framing.
 * Legacy token names are intentionally preserved because a few pages
 * define small inline styles that still read them.
 */

@font-face {
  font-family: 'Spectral';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/spectral-latin-400.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: 'Spectral';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/spectral-latin-600.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 {
  color-scheme: light dark;

  --paper: #fbfaf7;
  --surface: #f1f4f1;
  --surface-strong: #e8ede8;
  --ink: #24272b;
  --ink-faded: #657078;
  --rule: rgba(36, 39, 43, 0.16);
  --rule-strong: rgba(36, 39, 43, 0.28);
  --blue: #1e6d87;
  --green: #4f7358;
  --rust: #a75d42;
  --shadow: rgba(36, 39, 43, 0.07);

  --parchment: var(--paper);
  --parchment-dark: var(--surface);
  --moss: var(--green);
  --dried-lavender: var(--blue);
  --candlelight: var(--rust);
  --ember: var(--rust);
  --frame: var(--rule);
  --frame-corner: var(--rule-strong);
  --underline: rgba(30, 109, 135, 0.42);

  --background-color: var(--paper);
  --text-color: var(--ink);
  --link-color: var(--blue);
  --accent: var(--rust);
  --sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: "Spectral", Georgia, serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #17191b;
    --surface: #202327;
    --surface-strong: #282d31;
    --ink: #e9e5dc;
    --ink-faded: #a9b0b4;
    --rule: rgba(233, 229, 220, 0.16);
    --rule-strong: rgba(233, 229, 220, 0.28);
    --blue: #76bfd4;
    --green: #9ab986;
    --rust: #d18a64;
    --shadow: rgba(0, 0, 0, 0.22);
    --underline: rgba(118, 191, 212, 0.46);
  }
}

* {
  box-sizing: border-box;
}

html {
  background: var(--background-color);
  scrollbar-width: thin;
  scrollbar-color: var(--ink-faded) transparent;
  min-height: 100%;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--background-color);
  color: var(--text-color);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.68;
  text-rendering: optimizeLegibility;
}

.container {
  width: min(90%, 660px);
  margin: 0 auto;
}

header {
  margin: 34px 0 28px;
}

.menu {
  border-bottom: 0;
  padding-bottom: 12px;
}

.menu ul {
  display: flex;
  justify-content: flex-end;
  gap: 1.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu a {
  border: 0;
  color: var(--ink-faded);
  font-family: var(--sans);
  font-size: 0.86rem;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.menu a:hover,
.menu a.nav-dot {
  color: var(--text-color);
}

.menu a.nav-dot {
  position: relative;
}

.menu a.nav-dot::after {
  content: none;
}

main {
  min-height: 56vh;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-color);
  margin: 0 0 0.45em;
}

h1 {
  margin-top: 1.1em;
  font-family: var(--sans);
  font-size: clamp(2rem, 7vw, 3.2rem);
  font-weight: 650;
  line-height: 1.02;
  letter-spacing: 0;
}

h1::after {
  content: "";
  display: block;
  width: 54px;
  height: 3px;
  margin-top: 0.32em;
  background: linear-gradient(90deg, var(--blue), var(--rust));
}

h2 {
  margin-top: 2.1em;
  color: var(--ink-faded);
  font-family: var(--sans);
  font-size: 0.94rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h3 {
  margin-top: 1.6em;
  font-family: var(--sans);
  font-size: 1rem;
}

p, ul, ol {
  margin: 0 0 1em;
}

strong, b {
  font-weight: 600;
}

a {
  border-bottom: 1px solid var(--underline);
  color: var(--link-color);
  text-decoration: none;
  transition: border-color 0.18s ease, color 0.18s ease;
}

a:hover {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

::selection {
  background: rgba(167, 93, 66, 0.22);
}

main img {
  max-width: 100%;
  height: auto;
}

blockquote {
  margin: 1.6em 0;
  padding-left: 1em;
  border-left: 3px solid var(--rule-strong);
  color: var(--ink-faded);
}

hr {
  height: 1px;
  margin: 2.4em 0;
  border: 0;
  background: linear-gradient(90deg, var(--rule-strong), transparent);
}

table {
  width: 100%;
  margin: 1.5em 0;
  border-collapse: collapse;
  font-size: 0.94em;
}

th {
  color: var(--ink-faded);
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-align: left;
  text-transform: uppercase;
}

th, td {
  padding: 0.5em 0.55em;
  border-bottom: 1px solid var(--rule);
}

#line-art-canvas-container {
  margin: 1.7em 0 1.4em;
  display: flex;
  align-items: center;
  justify-content: center;
}

#line-art-canvas {
  display: block;
  pointer-events: none;
  touch-action: none;
  mix-blend-mode: multiply;
  opacity: 0.9;
  filter: grayscale(1) contrast(1.04);
  background-color: transparent;
}

@media (prefers-color-scheme: dark) {
  #line-art-canvas,
  noscript img {
    mix-blend-mode: normal;
    opacity: 1;
    background-color: #f2efe7;
  }
}

main > ul {
  list-style: none;
  padding-left: 0;
}

main > ul > li {
  position: relative;
  padding: 0.22em 0 0.22em 1.05em;
}

main > ul > li::before {
  content: "";
  position: absolute;
  top: 0.96em;
  left: 0;
  width: 0.35em;
  height: 0.35em;
  border-radius: 50%;
  background: var(--green);
}

main > ul > li a {
  color: var(--text-color);
}

pre, code {
  font-family: var(--mono);
  font-size: 0.9em;
}

pre {
  margin: 1.4em 0;
  padding: 1em;
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--surface);
  line-height: 1.55;
}

code {
  padding: 0.1em 0.28em;
  border-radius: 3px;
  background: var(--surface);
}

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

input, select, textarea {
  width: 100%;
  padding: 0.5em 0.6em;
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text-color);
  font: inherit;
}

input[type=submit] {
  width: auto;
  cursor: pointer;
}

input[type=submit]:hover {
  border-color: var(--accent);
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.highlight .c, .highlight .cm, .highlight .c1, .highlight .cs {
  color: var(--ink-faded);
  font-style: italic;
}
.highlight .k, .highlight .kc, .highlight .kd, .highlight .kn,
.highlight .kp, .highlight .kr, .highlight .nf, .highlight .nc {
  color: var(--green);
}
.highlight .s, .highlight .sb, .highlight .sc, .highlight .sd,
.highlight .s2, .highlight .se, .highlight .sh, .highlight .si,
.highlight .sx, .highlight .s1 {
  color: var(--blue);
}
.highlight .m, .highlight .mf, .highlight .mh, .highlight .mi,
.highlight .mo, .highlight .il, .highlight .nt {
  color: var(--rust);
}

footer {
  margin: 62px auto 30px;
  padding-top: 14px;
  border-top: 0;
  color: var(--ink-faded);
  font-family: var(--sans);
  font-size: 0.82rem;
  text-align: right;
}

@media only screen and (max-width: 600px) {
  body {
    font-size: 15px;
  }

  .container {
    width: min(92%, 660px);
  }

  .menu ul {
    gap: 1rem;
  }

  h1 {
    font-size: 2.15rem;
  }
}
