/* codedoc.uk — one stylesheet, no frameworks. Light and dark follow the visitor's system setting. */

@font-face { font-family: "Barlow"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/barlow-400.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-style: normal; font-display: swap; src: url("/fonts/barlow-500.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-style: normal; font-display: swap; src: url("/fonts/barlow-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-style: normal; font-display: swap; src: url("/fonts/barlow-condensed-600.woff2") format("woff2"); }

/* Tokens: light (Privo ATC "Paper"), then dark (Privo ATC "Radar"). Contrast checked against --bg. */
:root {
  --bg: #f2f2f3;
  --surface: #e9e9ea;
  --text: #1d1f20;      /* 14.8:1 */
  --text-dim: #5d5d60;  /* 5.9:1 */
  --accent: #3f6488;    /* 5.5:1 */
  --good: #0b7a63;      /* 4.7:1 */
  --danger: #c2410c;    /* 4.6:1 */
  --border: #8a8a8f;    /* 3.1:1, form fields */
  --rule: #d4d4d7;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1b26;
    --surface: #162534;
    --text: #eef6ff;      /* 16.0:1 */
    --text-dim: #97adc2;  /* 7.5:1 */
    --accent: #749dc4;    /* 6.1:1 */
    --good: #6fe3c6;      /* 11.2:1 */
    --danger: #ffb547;    /* 9.9:1 */
    --border: #4f6b85;    /* 3.1:1 */
    --rule: #22384c;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.55 "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (min-width: 64rem) { body { font-size: 1.125rem; } }
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: .15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.skip { position: absolute; left: 1rem; top: -3rem; background: var(--text); color: var(--bg); padding: .5rem .9rem; border-radius: 6px; z-index: 10; }
.skip:focus { top: 1rem; }

.wrap { max-width: 70rem; margin-inline: auto; padding-inline: 1.25rem; }
.narrow { max-width: 42rem; }
.wrap.narrow { max-width: 70rem; }            /* keep the left edge in line with the rest of the page */
.wrap.narrow > * { max-width: 42rem; }        /* …but keep reading lines short */

h1, h2, h3 { font-family: "Barlow Condensed", "Barlow", system-ui, sans-serif; font-weight: 600; line-height: 1.1; margin: 0 0 .5em; }
h1 { font-size: clamp(2.1rem, 6vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: 1.35rem; letter-spacing: .01em; }
p { margin: 0 0 1em; }

/* Header */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; padding-block: 1.1rem; flex-wrap: wrap; }
.home { color: var(--text); display: inline-flex; }
.wordmark { height: 1.6rem; width: auto; display: block; }
.cursor { animation: blink 1.06s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cursor { animation: none; } }
.site-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; margin: 0; padding: 0; font-weight: 500; font-size: .95rem; }
.site-nav a { color: var(--text-dim); text-decoration: none; }
.site-nav a:hover { color: var(--text); text-decoration: underline; }

/* Sections */
.section { padding-block: clamp(2.75rem, 7vw, 4.5rem); border-bottom: 1px solid var(--rule); scroll-margin-top: 1rem; }
.lead { font-size: 1.2em; color: var(--text-dim); max-width: 38ch; }

.promises { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: 1rem; }
@media (min-width: 45rem) { .promises { grid-template-columns: 1fr 1fr; } }
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 1.25rem 1.4rem; }
.card h3 { margin-bottom: .25em; }
.card p { margin: 0; color: var(--text-dim); }

.game { display: grid; gap: 2rem; }
@media (min-width: 64rem) { .game { grid-template-columns: 5fr 7fr; align-items: start; } }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1em; padding: 0; }
.tags li { font: 600 .75rem/1 "Barlow", sans-serif; letter-spacing: .12em; text-transform: uppercase; border: 1px solid var(--border); border-radius: 4px; padding: .35rem .55rem; color: var(--text-dim); }
.shots { display: flex; gap: .75rem; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .5rem; margin: 0; }
.shots figure { margin: 0; flex: 0 0 62%; max-width: 16rem; scroll-snap-align: start; }
.shots img { display: block; width: 100%; border-radius: 1.4rem; border: 1px solid var(--rule); background: #0f1b26; }
.shots figcaption { font-size: .85rem; color: var(--text-dim); margin-top: .5rem; }
@media (min-width: 64rem) {
  .shots { display: grid; grid-template-columns: repeat(3, 1fr); overflow: visible; }
  .shots figure { max-width: none; }
}

.btn {
  display: inline-block; background: var(--text); color: var(--bg); border: 0; border-radius: 8px;
  font: 600 1.15rem/1 "Barlow Condensed", "Barlow", sans-serif; letter-spacing: .04em;
  padding: .85rem 1.4rem; text-decoration: none; cursor: pointer;
}
.btn:hover { opacity: .9; }
.btn[aria-disabled="true"] { opacity: .55; cursor: default; }
.note { font-size: .9rem; color: var(--text-dim); }

details { border-top: 1px solid var(--rule); padding-block: .85rem; }
details:last-of-type { border-bottom: 1px solid var(--rule); }
summary { font-weight: 600; cursor: pointer; }
details p { margin: .6rem 0 0; }

/* Contact form */
.form { display: grid; gap: 1.1rem; max-width: 36rem; }
.field { display: grid; gap: .35rem; }
.field label { font-weight: 500; font-size: .95rem; }
.optional { color: var(--text-dim); font-weight: 400; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; padding: .7rem .85rem; width: 100%;
}
textarea { min-height: 9rem; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 1px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.status { margin: 0; font-weight: 500; }
.status.ok { color: var(--good); }
.status.err { color: var(--danger); }

/* Long-form pages (privacy, thanks) */
.prose h2 { margin-top: 2rem; font-size: clamp(1.5rem, 3vw, 1.9rem); }
.prose h3 { margin-top: 1.5rem; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: .35em; }
.meta { color: var(--text-dim); font-size: .95rem; }

/* Footer */
.site-footer { padding-block: 2.5rem; font-size: .9rem; color: var(--text-dim); }
.site-footer p { margin: .2em 0; }
.site-footer a { color: var(--text-dim); }
