/* site.css — the shared theme for ancientlives.github.io and its project sub-sites.
   Minimal: off-white / light grey in light mode, charcoal grey in dark mode. Colour comes from the Nord
   palette and is reserved for links, code, snippets, diff readings and highlights.
   Keep the copies in both repositories in sync. */

:root {
  /* neutrals */
  --bg: #f7f7f5;
  --surface: #eeeeec;
  --surface-2: #e6e6e3;
  --border: #dcdcd8;
  --text: #2e3440;          /* nord0 */
  --text-strong: #1f232b;
  --muted: #646a75;
  --sel: #d8dee9;           /* nord4 */

  /* Nord accents, deepened where needed for contrast on a light background */
  --link: #4c6d96;          /* nord10, darker */
  --frost: #3f7f86;         /* nord7/8, darker */
  --blue: #4c6d96;
  --green: #5d7a45;         /* nord14, darker */
  --red: #a3434d;           /* nord11, darker */
  --orange: #a15d3c;        /* nord12, darker */
  --purple: #845c80;        /* nord15, darker */
  --mark: rgba(235, 203, 139, .55);   /* nord13 */
  --code-bg: #eceff4;       /* nord6 */
  --code-text: #2e3440;
  --code-muted: #6b7385;

  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #242629;
    --surface: #2c2e32;
    --surface-2: #33363b;
    --border: #3b3e44;
    --text: #d8dee9;        /* nord4 */
    --text-strong: #eceff4; /* nord6 */
    --muted: #9aa1ad;
    --sel: #434c5e;         /* nord2 */
    --link: #88c0d0;        /* nord8 */
    --frost: #8fbcbb;       /* nord7 */
    --blue: #81a1c1;        /* nord9 */
    --green: #a3be8c;       /* nord14 */
    --red: #bf616a;         /* nord11 */
    --orange: #d08770;      /* nord12 */
    --purple: #b48ead;      /* nord15 */
    --mark: rgba(235, 203, 139, .28);
    --code-bg: #1e2023;
    --code-text: #d8dee9;
    --code-muted: #7b8394;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #242629;
  --surface: #2c2e32;
  --surface-2: #33363b;
  --border: #3b3e44;
  --text: #d8dee9;
  --text-strong: #eceff4;
  --muted: #9aa1ad;
  --sel: #434c5e;
  --link: #88c0d0;
  --frost: #8fbcbb;
  --blue: #81a1c1;
  --green: #a3be8c;
  --red: #bf616a;
  --orange: #d08770;
  --purple: #b48ead;
  --mark: rgba(235, 203, 139, .28);
  --code-bg: #1e2023;
  --code-text: #d8dee9;
  --code-muted: #7b8394;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--sel); }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 2px; }

mark { background: var(--mark); color: inherit; padding: 0 .15em; border-radius: 2px; }
strong { color: var(--text-strong); font-weight: 600; }

.wrap { max-width: 760px; margin: 0 auto; padding: 0 20px; }

/* ── header ─────────────────────────────────────────────────────────────── */
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap;
  padding-top: 22px; padding-bottom: 22px;
}
.brand { color: var(--text-strong); font-weight: 600; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand .sep { color: var(--muted); font-weight: 400; margin: 0 .35em; }
.brand .sub { color: var(--text); font-weight: 500; }
.nav { display: flex; align-items: center; gap: 4px 20px; flex-wrap: wrap; font-size: 15px; }
.nav a { color: var(--muted); }
.nav a:hover { color: var(--text-strong); text-decoration: none; }
.theme-toggle {
  display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; cursor: pointer;
  color: var(--muted); background: none; border: 1px solid var(--border); border-radius: 50%;
}
.theme-toggle:hover { color: var(--text-strong); border-color: var(--muted); }
.theme-toggle svg { width: 15px; height: 15px; }

/* ── type ───────────────────────────────────────────────────────────────── */
h1, h2, h3 { color: var(--text-strong); line-height: 1.25; letter-spacing: -.015em; }
h1 { font-size: clamp(32px, 5.5vw, 44px); font-weight: 650; margin: 0 0 12px; }
h2 { font-size: 20px; font-weight: 600; margin: 0 0 14px; }
h3 { font-size: 16px; font-weight: 600; margin: 0 0 4px; }
p { margin: 0 0 14px; }
.lede { font-size: 19px; color: var(--muted); max-width: 40em; margin-bottom: 26px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.hero { padding: 48px 0 28px; }
section { padding: 34px 0 6px; border-top: 1px solid var(--border); margin-top: 34px; }
.hero + section { margin-top: 12px; }

/* ── buttons ────────────────────────────────────────────────────────────── */
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-block; padding: 8px 16px; border-radius: 6px; font-size: 15px; font-weight: 500;
  border: 1px solid var(--border); color: var(--text-strong); background: var(--surface);
}
.btn:hover { text-decoration: none; background: var(--surface-2); }
.btn.primary { background: var(--text-strong); color: var(--bg); border-color: var(--text-strong); }
.btn.primary:hover { opacity: .88; background: var(--text-strong); }

/* ── code ───────────────────────────────────────────────────────────────── */
code, pre, kbd, samp { font-family: var(--mono); font-size: 13.5px; }
:not(pre) > code {
  background: var(--code-bg); color: var(--code-text); padding: .12em .38em; border-radius: 4px;
  font-size: .86em;
}
pre {
  margin: 14px 0 18px; padding: 16px 18px; overflow-x: auto; line-height: 1.6;
  background: var(--code-bg); color: var(--code-text); border-radius: 8px;
}
pre .c { color: var(--code-muted); }   /* comment */
pre .k { color: var(--blue); }         /* keyword / label */
pre .f { color: var(--frost); }        /* function / command */
pre .s { color: var(--green); }        /* string / literal */
pre .n { color: var(--purple); }       /* number */
pre .add { color: var(--green); }
pre .del { color: var(--red); }
pre .mov { color: var(--orange); }
pre u { text-decoration-color: var(--code-muted); text-underline-offset: 3px; }

/* ── lists and grids ────────────────────────────────────────────────────── */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px 28px; }
.features p { margin: 0; color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 16px 0; }
.card {
  display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 8px;
  background: var(--surface); border: 1px solid transparent; color: var(--text);
}
a.card:hover { text-decoration: none; border-color: var(--border); background: var(--surface-2); }
.card h3 { margin: 0; }
.card p { margin: 0; font-size: 14.5px; color: var(--muted); }
.card .go { margin-top: auto; padding-top: 6px; font-size: 14px; color: var(--link); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12px; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 1px 9px; }

dl.defs { margin: 0; }
dl.defs dt { font-weight: 600; color: var(--text-strong); margin-top: 16px; }
dl.defs dt:first-child { margin-top: 0; }
dl.defs dd { margin: 2px 0 0; color: var(--muted); }

ul.links { list-style: none; padding: 0; margin: 0; }
ul.links li { display: grid; grid-template-columns: 13em 1fr; gap: 2px 16px; padding: 9px 0; border-bottom: 1px solid var(--border); }
ul.links li:last-child { border-bottom: 0; }
ul.links a { font-family: var(--mono); font-size: 14px; }
ul.links span { color: var(--muted); font-size: 15px; }
@media (max-width: 600px) { ul.links li { grid-template-columns: 1fr; } }

/* project list on the home page */
.projects { list-style: none; padding: 0; margin: 0; }
.project { padding: 20px 0; border-bottom: 1px solid var(--border); }
.project:first-child { padding-top: 4px; }
.project:last-child { border-bottom: 0; }
.project h3 { font-size: 18px; margin-bottom: 6px; }
.project p { color: var(--muted); margin-bottom: 10px; }
.project .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; font-size: 14px; }

/* ── footer ─────────────────────────────────────────────────────────────── */
.site-footer { margin-top: 56px; border-top: 1px solid var(--border); }
.site-footer .wrap { padding-top: 22px; padding-bottom: 40px; font-size: 14px; color: var(--muted);
  display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: space-between; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text-strong); }

/* ── logos (inline SVG marks; colours follow the theme, Nord palette) ───── */
:root { --logo-ink: var(--text-strong); --logo-blue: #5e81ac; --logo-teal: #4f8a8b; --logo-yellow: #c49a3c; --logo-orange: #c0694e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --logo-blue: #88c0d0; --logo-teal: #8fbcbb; --logo-yellow: #ebcb8b; --logo-orange: #d08770; } }
:root[data-theme="dark"] { --logo-blue: #88c0d0; --logo-teal: #8fbcbb; --logo-yellow: #ebcb8b; --logo-orange: #d08770; }
svg.logo { display: block; flex: none; overflow: visible; }
.logo .ink-s { stroke: var(--logo-ink); } .logo .ink-f { fill: var(--logo-ink); }
.logo .acc-s { stroke: var(--logo-blue); } .logo .acc-f { fill: var(--logo-blue); }
.logo .ora-s { stroke: var(--logo-orange); }
.logo .teal-s { stroke: var(--logo-teal); } .logo .yel-f { fill: var(--logo-yellow); } .logo .ora-f { fill: var(--logo-orange); }
.brand { display: inline-flex; align-items: center; gap: 9px; }
.logo-sm { width: 22px; height: 22px; }
.hero-title { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.hero-title h1 { margin: 0; }
.logo-lg { width: clamp(44px, 8vw, 56px); height: clamp(44px, 8vw, 56px); }
.project h3 { display: flex; align-items: center; gap: 10px; }
.logo-md { width: 26px; height: 26px; }
