/* Shared by the home page, /skola and /bygg (generated by promo/site/build.py).
   Paper and ink: pages look like sheets, and every picture is real rmink output. */
:root {
  --paper: #f4f2ec;
  --surface: #fbfaf7;
  --ink: #1d1d1b;
  --muted: #62615b;
  --line: #dcd8cd;
  --accent: #2546b8;
  --accent-ink: #ffffff;
  --mark: #c0392b;
  --bezel: #2b2e30;
  --sheet: #ffffff;
  --shadow: 0 1px 2px rgb(0 0 0 / .06), 0 10px 28px -12px rgb(0 0 0 / .18);
  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #171716; --surface: #212120; --ink: #ecebe6; --muted: #a9a8a1; --line: #353532;
    --accent: #8aa4ff; --accent-ink: #10172b; --mark: #ff8a7a; --bezel: #050607;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 10px 28px -12px rgb(0 0 0 / .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #171716; --surface: #212120; --ink: #ecebe6; --muted: #a9a8a1; --line: #353532;
  --accent: #8aa4ff; --accent-ink: #10172b; --mark: #ff8a7a; --bezel: #050607;
  --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 10px 28px -12px rgb(0 0 0 / .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 17px/1.55 var(--display); overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--display); text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2.6rem, 7vw, 4.8rem); font-weight: 800; font-stretch: 72%; line-height: .98; letter-spacing: -.012em; }
h2 { font-size: clamp(1.8rem, 4vw, 2.7rem); font-weight: 800; font-stretch: 76%; line-height: 1.05; }
h3 { font-size: 1.3rem; font-weight: 700; font-stretch: 86%; line-height: 1.2; }
p { margin: 0; }
code { font-family: var(--mono); font-size: .88em; }

.wrap { max-width: 1160px; margin: 0 auto; padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px)); }
.eyebrow { font-family: var(--mono); font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.lede { font-size: 1.16rem; color: var(--muted); max-width: 56ch; }
section { padding-block: clamp(48px, 8vw, 88px); border-top: 1px solid var(--line); }
.head { display: grid; gap: 10px; margin-bottom: 32px; max-width: 720px; }

/* Top bar */
.bar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--paper) 90%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.bar .wrap { display: flex; align-items: center; gap: 8px 20px; min-height: 60px; flex-wrap: wrap; padding-block: 8px; }
.brand { font-weight: 800; font-stretch: 80%; font-size: 1.35rem; color: var(--ink); text-decoration: none; letter-spacing: -.01em; margin-right: auto; }
.bar nav { display: flex; align-items: center; gap: 4px 18px; flex-wrap: wrap; }
.bar nav a, .bar nav button { color: var(--ink); text-decoration: none; font: inherit; font-size: .95rem; background: none; border: 0; padding: 4px 0; cursor: pointer; }
.bar nav a:hover, .bar nav button:hover { color: var(--accent); }
.bar nav .lang { font-family: var(--mono); font-size: .8rem; color: var(--muted); }
@media (max-width: 720px) {
  .bar nav { order: 3; width: 100%; justify-content: space-between; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 10px 20px;
  border: 1.5px solid var(--ink); border-radius: 10px; background: transparent; color: var(--ink);
  font: inherit; font-weight: 650; text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.1); color: var(--accent-ink); }
.btn.small { min-height: 38px; padding: 6px 14px; font-size: .95rem; }
.btn .play { font-size: .72em; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Hero */
.hero { border-top: 0; padding-block: clamp(36px, 7vw, 76px); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.hero .text { display: grid; gap: 20px; justify-items: start; }
.hero h1 span { display: block; }
.stroke { position: relative; color: var(--accent); }
.note { font-size: .92rem; color: var(--muted); }
@media (max-width: 860px) { .hero .wrap { grid-template-columns: minmax(0, 1fr); } }

/* A tablet showing a page; the page stays white in dark mode, like the real thing */
.tablet { background: var(--bezel); border-radius: 18px; padding: 16px 13px 22px; box-shadow: var(--shadow); }
.tablet img { width: 100%; background: var(--sheet); border-radius: 3px; }
.stack { position: relative; padding: 0 0 0 22%; max-width: 480px; justify-self: center; width: 100%; }
.stack .photo {
  position: absolute; left: 0; bottom: 5%; width: 36%; transform: rotate(-5deg); z-index: 1;
  border: 6px solid var(--sheet); box-shadow: var(--shadow);
}
.stack figcaption { position: absolute; z-index: 2; font-family: var(--mono); font-size: .72rem; left: 0; bottom: 0; color: var(--muted); }
figure { margin: 0; }

/* Cards */
.grid { display: grid; gap: 20px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid, .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid, .grid.two, .grid.four { grid-template-columns: minmax(0, 1fr); } }
.card {
  display: flex; flex-direction: column; gap: 12px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 20px; box-shadow: var(--shadow); min-width: 0;
}
.card .sheet { background: var(--sheet); border: 1px solid var(--line); border-radius: 6px; height: 240px; overflow: hidden; }
.card .sheet img { width: 100%; }
.card p { color: var(--muted); }
.card .more { margin-top: auto; padding-top: 6px; font-weight: 650; }
.tag { align-self: flex-start; font-family: var(--mono); font-size: .72rem; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.tag.open { border-color: var(--accent); color: var(--accent); }
.also { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 0; margin: 24px 0 0; color: var(--muted); font-size: .96rem; }
.also li::before { content: "✓ "; color: var(--accent); }

/* rmink for ... */
.audience { flex-direction: row; gap: 20px; }
.audience .body { display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 0; }
.audience .sheet { flex: 0 0 34%; height: auto; aspect-ratio: 3 / 4; align-self: center; }
.audience .who { font-family: var(--mono); font-size: .8rem; color: var(--muted); }
.audience h3 { font-size: 1.7rem; font-stretch: 76%; font-weight: 800; }
.audience .need { color: var(--ink); font-size: 1.1rem; }
.audience .facts { font-family: var(--mono); font-size: .8rem; }

/* Steps */
.steps { display: grid; gap: 24px; grid-template-columns: repeat(3, minmax(0, 1fr)); counter-reset: step; padding: 0; margin: 0; list-style: none; }
.steps.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .steps, .steps.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .steps, .steps.four { grid-template-columns: minmax(0, 1fr); } }
.steps li { counter-increment: step; display: grid; gap: 8px; align-content: start; min-width: 0; }
.steps li::before { content: counter(step); font: 800 2.2rem/1 var(--display); font-stretch: 72%; color: var(--accent); }
.steps p { color: var(--muted); }
.steps .tablet { margin-bottom: 6px; padding: 10px 8px 14px; border-radius: 12px; }

/* Command with a copy button */
.cmd {
  display: flex; align-items: center; gap: 10px; background: var(--bezel); color: #ecebe6; border-radius: 10px;
  padding: 10px 10px 10px 16px; font-family: var(--mono); font-size: .86rem; margin-top: 8px; min-width: 0;
}
.cmd code { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.cmd button { flex: none; background: rgb(255 255 255 / .14); color: inherit; border: 0; border-radius: 6px; padding: 6px 10px; font: inherit; font-size: .76rem; cursor: pointer; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: minmax(0, 1fr); } }
.prose { display: grid; gap: 14px; }
.prose p { color: var(--muted); }
.warn { border-left: 3px solid var(--mark); padding: 2px 0 2px 14px; color: var(--muted); font-size: .96rem; }

/* Video poster on /skola and /bygg */
.poster { position: relative; display: block; width: 100%; max-width: 400px; padding: 0; border: 0; background: #000; border-radius: 14px; overflow: hidden; cursor: pointer; box-shadow: var(--shadow); justify-self: center; }
.poster img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; opacity: .94; }
.poster span { position: absolute; inset: auto 12px 12px auto; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; font-weight: 650; font-size: .95rem; }

/* Subject list on /skola and fact list on /bygg */
.facts-list { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .facts-list { grid-template-columns: minmax(0, 1fr); } }
.facts-list div { border-top: 2px solid var(--ink); padding-top: 10px; display: grid; gap: 4px; align-content: start; }
.facts-list b { font-size: 1.1rem; }
.facts-list span { color: var(--muted); font-size: .96rem; }

/* Footer */
footer { border-top: 1px solid var(--line); padding-block: 36px 44px; color: var(--muted); font-size: .92rem; }
footer .cols { display: grid; gap: 24px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 24px; }
@media (max-width: 640px) { footer .cols { grid-template-columns: minmax(0, 1fr); } }
footer ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
footer a { color: inherit; }
footer b { color: var(--ink); }

/* Video dialog */
#video-dialog { width: min(94vw, calc((92vh - 52px) * .8)); padding: 0; border: 0; background: transparent; overflow: visible; }
#video-dialog::backdrop { background: rgb(0 0 0 / .78); }
#video-dialog .close { display: block; margin: 0 0 8px auto; background: rgb(255 255 255 / .16); color: #fff; border: 0; border-radius: 999px; width: 44px; height: 44px; font-size: 24px; line-height: 1; cursor: pointer; }
#video-dialog video { display: block; width: 100%; aspect-ratio: 4 / 5; background: #000; border-radius: 12px; }
/* An alternative to the numbered steps, not a step of its own. */
.steps li.alt { counter-increment: none; border-top: 1px solid var(--line); padding-top: 20px; }
.steps li.alt::before { content: none; }
