/* Shared by every page of the holding site. The theme follows the system setting. */

/* Rubik and Fira Mono are self-hosted (SIL Open Font License, see fonts/OFL-*.txt),
   Latin subset only; anything outside it falls back to the system font. */
@font-face {
  font-family: "Rubik";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("/fonts/rubik-latin-wght-normal.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: "Fira Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/fira-mono-latin-400-normal.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;
  --sans: "Rubik", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Fira Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* dark: black solder mask, white silkscreen, gold pads */
  --bg: #0b1110;
  --edge: #2c3d35;
  --silk: #e9e6dc;
  --heading: #f4f6f3;
  --text: #dfe6e1;
  --muted: #b2bdb6;
  --dim: #8d9c94;
  --foot: #74847c;
  --foot-link: #98a79f;
  --link: #d6a24a;
  --link-line: rgba(214, 162, 74, .4);
  --accent: #e8b85c;
  --hole: #050807;
  --grid-major: rgba(205, 225, 215, .075);
  --grid-minor: rgba(205, 225, 215, .035);
  --art: url("/routing-dark.svg");
  --mark-pad: #d6a24a;
  --mark-glow: #ffcf6b;
  --mark-arc: #fff4d6;
}

@media (prefers-color-scheme: light) {
  :root {
    /* light: white solder mask, black silkscreen, gold pads */
    --bg: #f3f1ea;
    --edge: #d3d6cd;
    --silk: #1d2320;
    --heading: #111714;
    --text: #1e2622;
    --muted: #3d4842;
    --dim: #5f6b64;
    --foot: #66726b;
    --foot-link: #4c5852;
    --link: #8a5a0a;
    --link-line: rgba(138, 90, 10, .35);
    --accent: #c9851c;
    --hole: #dcd8cc;
    --grid-major: rgba(30, 60, 45, .09);
    --grid-minor: rgba(30, 60, 45, .045);
    --art: url("/routing-light.svg");
    --mark-pad: #c99232;
    --mark-glow: #f6b445;
    --mark-arc: #8a4300;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  min-height: 100vh; display: flex; flex-direction: column;
  font-family: var(--sans); color: var(--text); background-color: var(--bg); line-height: 1.5;
  background-image:
    var(--art),
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid-minor) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px);
  background-size: min(560px, 92vw) auto, 80px 80px, 80px 80px, 16px 16px, 16px 16px;
  background-position: top right, -1px -1px, -1px -1px, -1px -1px, -1px -1px;
  background-repeat: no-repeat, repeat, repeat, repeat, repeat;
}

/* mounting holes in the corners */
.hole { position: fixed; width: 14px; height: 14px; border: 1.5px solid var(--silk); border-radius: 50%; opacity: .5; }
.hole::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--hole); }
.h1 { top: 14px; left: 14px; } .h2 { top: 14px; right: 14px; } .h3 { bottom: 14px; left: 14px; } .h4 { bottom: 14px; right: 14px; }

main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 72px 24px 32px; }

a { color: var(--link); text-decoration: none; border-bottom: 1px solid var(--link-line); }
a:hover { border-bottom-color: var(--link); }
code { font-family: var(--mono); font-size: .92em; }

.brand { display: flex; align-items: center; gap: 12px; color: inherit; }
a.brand { border-bottom: none; }
.brand .mark { flex: none; }
.mk-pad { fill: var(--mark-pad); }
.mk-glow { fill: var(--mark-glow); }
.mk-arc { stroke: var(--mark-arc); }
.name { font-size: 22px; font-weight: 600; color: var(--silk); line-height: 1.15; }
.name .si { position: relative; display: inline-block; }
.name .si svg { position: absolute; left: 50%; transform: translateX(-50%); top: -0.12em; width: .42em; height: .42em; fill: var(--accent); }
.by { font-family: var(--mono); font-size: 12px; color: var(--dim); }

h1 { font-size: clamp(28px, 4.6vw, 40px); font-weight: 500; line-height: 1.15; color: var(--heading); margin: 56px 0 14px; max-width: 640px; }

footer { width: 100%; max-width: 760px; margin: 0 auto; padding: 16px 24px 40px; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between;
         font-family: var(--mono); font-size: 12px; color: var(--foot); border-top: 1px solid var(--edge); }
footer a { color: var(--foot-link); border-bottom: none; }
.silk { color: var(--silk); opacity: .7; letter-spacing: .08em; }

/* Below 609px the artwork shrinks with the screen and would run into the
   header, so the page starts below it instead. 180/560 is its aspect ratio. */
@media (max-width: 608px) {
  main { padding-top: calc(92vw * 180 / 560 + 8px); }
  h1 { margin-top: 36px; }
}
