/* Pustio: modern and minimalist (D66, D67). Near-black on off-white, red only as an accent (the dot, the price,
   the numbers), like the e-ink screen. System fonts: nothing loaded from elsewhere. */

:root {
  --ink: #111111;
  --muted: #6b6b66;
  --paper: #fafaf7;
  --raised: #ffffff;
  --line: #e4e4de;
  --red: #e3262d;
  /* The red for text: --red is under 4.5:1 on the paper, this one passes AA. */
  --red-text: #c8141b;
  --radius: 14px;
  --wrap: 68rem;
  --gap: clamp(3.5rem, 9vw, 7rem);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f2f2ee;
    --muted: #9a9a94;
    --paper: #0f0f0f;
    --raised: #181818;
    --line: #2a2a28;
    --red: #ff4a50;
    --red-text: #ff4a50;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main, header.top, footer .wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--red-text); }

h1, h2, h3 { letter-spacing: -0.025em; line-height: 1.1; font-weight: 650; margin: 0; }
h1 { font-size: clamp(2rem, 5vw, 3rem); }
.hero h1 { font-size: clamp(2.6rem, 7vw, 4.6rem); max-width: 12ch; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.2rem); }
p { margin: 0.9rem 0 0; }
sub { font-size: 0.7em; line-height: 0; }

/* Readable by screen readers only. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip { position: absolute; left: 1rem; top: -4rem; padding: 0.6rem 1rem; background: var(--ink); color: var(--paper); border-radius: 8px; z-index: 1; }
.skip:focus { top: 1rem; color: var(--paper); }

.note { color: var(--muted); font-size: 0.9rem; }
.lead { font-size: clamp(1.15rem, 2vw, 1.3rem); color: var(--muted); max-width: 34rem; margin-top: 1.5rem; }
.eyebrow {
  margin: 0 0 1.2rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Header */

header.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.6rem;
  padding-bottom: 1.6rem;
}
.brand { font-weight: 750; font-size: 1.35rem; letter-spacing: -0.03em; text-decoration: none; }
.brand::after { content: "."; content: "." / ""; color: var(--red); }
.brand:hover { color: inherit; }
/* The menu: links on wide screens, a hamburger on narrow ones (a <details>, no script). */
header.top { position: relative; }
header nav a { text-decoration: none; color: var(--muted); }
header nav a:hover, header nav a[aria-current="page"] { color: var(--ink); }
header nav a[aria-current="page"] { font-weight: 600; }
nav.wide { display: none; align-items: center; gap: 1.6rem; font-size: 0.95rem; }
.nav-cta {
  padding: 0.45rem 1rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper) !important;
  font-weight: 600;
}
.nav-cta:hover { opacity: 0.88; }

details.menu > summary {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-right: -0.6rem;
  border-radius: 999px;
  list-style: none;
  cursor: pointer;
}
details.menu > summary::-webkit-details-marker { display: none; }
details.menu > summary:hover { background: var(--line); }
.bars { display: grid; gap: 5px; width: 20px; }
.bars span { display: block; height: 2px; border-radius: 2px; background: var(--ink); transition: transform 160ms ease, opacity 160ms ease; }
details.menu[open] .bars span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
details.menu[open] .bars span:nth-child(2) { opacity: 0; }
details.menu[open] .bars span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
details.menu > nav {
  position: absolute;
  top: 100%;
  left: clamp(1.25rem, 4vw, 2.5rem);
  right: clamp(1.25rem, 4vw, 2.5rem);
  z-index: 10;
  display: grid;
  gap: 0.2rem;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--raised);
  box-shadow: 0 24px 48px -24px rgb(0 0 0 / 0.3);
}
details.menu > nav a { padding: 0.75rem 0.9rem; border-radius: 10px; font-size: 1.05rem; }
details.menu > nav a:not(.nav-cta):hover { background: var(--paper); }
details.menu > nav .nav-cta { margin-top: 0.5rem; text-align: center; }
.end { display: flex; align-items: center; gap: 0.6rem; }

/* The language switch: a dropdown (a <details>, no script) showing the page's language. */
details.lang { position: relative; font-size: 0.95rem; }
details.lang > summary {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 2.75rem;
  padding: 0 0.6rem;
  border-radius: 999px;
  color: var(--muted);
  list-style: none;
  cursor: pointer;
}
details.lang > summary::-webkit-details-marker { display: none; }
details.lang > summary::after { content: "▾"; content: "▾" / ""; font-size: 0.8em; }
details.lang > summary:hover { background: var(--line); color: var(--ink); }
details.lang > ul {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 11;
  margin: 0.3rem 0 0;
  padding: 0.4rem;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--raised);
  box-shadow: 0 24px 48px -24px rgb(0 0 0 / 0.3);
}
details.lang a { display: block; padding: 0.55rem 0.8rem; border-radius: 10px; text-decoration: none; color: var(--ink); white-space: nowrap; }
details.lang a:hover { background: var(--paper); }
details.lang a[aria-current] { font-weight: 600; }
details.lang .code { display: inline-block; min-width: 1.8em; color: var(--muted); }
.narrow { display: flex; align-items: center; gap: 0.9rem; }
.narrow .nav-cta { text-decoration: none; font-size: 0.95rem; }

/* The full menu from 70rem: the Norwegian one needs about 55rem of its own. */
@media (min-width: 70rem) {
  nav.wide { display: flex; }
  .narrow { display: none; }
  .end { gap: 1.6rem; }
}

/* Buttons */

.button, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0 1.6rem;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease;
}
.button:hover, button:hover { color: var(--paper); opacity: 0.88; }
.button:active, button:active { transform: scale(0.98); }
.quiet { color: var(--muted); text-decoration: none; font-weight: 500; }
.quiet::after { content: " →"; content: " →" / ""; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem; margin-top: 2.2rem; }

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

/* Hero */

.hero {
  display: grid;
  gap: clamp(2.5rem, 6vw, 4rem);
  align-items: center;
  padding: clamp(2rem, 7vw, 5rem) 0 var(--gap);
}
@media (min-width: 56rem) { .hero { grid-template-columns: 1.05fr 1fr; } }
/* Narrow screens: the picture right under the headline, so it is on the first screen (guideline 2 in
   docs/landing-page-design.md); the lead and the buttons follow it. */
@media (max-width: 55.99rem) {
  .hero { gap: 0; }
  .hero .copy { display: contents; }
  .hero .lead, .hero .actions { order: 1; }
  .hero .render { margin-top: 1.5rem; }
}

.render { margin: 0; }
.render img { display: block; width: 100%; height: auto; }
.render figcaption { margin-top: 0.6rem; color: var(--muted); font-size: 0.85rem; text-align: center; }
.render.plain img { max-width: 40rem; margin: 0 auto; }
.render.photo { margin-top: 2rem; }
.render.photo img { border-radius: 0.5rem; }

/* Why Pust: four numbered points, two by two */

.points {
  display: grid;
  gap: 2.5rem;
  padding: var(--gap) 0;
  border-top: 1px solid var(--line);
}
@media (min-width: 48rem) {
  .points { grid-template-columns: repeat(2, 1fr); gap: 3rem 4rem; }
  .points h2 { grid-column: 1 / -1; }
}
.points h3 { font-size: 1.25rem; letter-spacing: -0.015em; margin-top: 0.9rem; }
.points p { color: var(--muted); }
.num { font-size: 0.85rem; font-weight: 600; color: var(--red-text); font-variant-numeric: tabular-nums; }

/* Line icons (`icon` in src/pages/mod.rs) */

.icon { width: 1.75rem; height: 1.75rem; flex: none; color: var(--red-text); }

/* The effects of high CO2, each with its icon */

.effects { margin: 0; padding: 0; list-style: none; }
.effects li {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}

/* Three with an icon each: the rooms */

.trio {
  display: grid;
  gap: 2.5rem;
  padding: var(--gap) 0;
  border-top: 1px solid var(--line);
}
@media (min-width: 48rem) {
  .trio { grid-template-columns: repeat(3, 1fr); gap: 3rem; }
  .trio h2 { grid-column: 1 / -1; }
}
.trio h3 { font-size: 1.25rem; letter-spacing: -0.015em; margin-top: 0.9rem; }
.trio p { color: var(--muted); }

/* Two-column sections: the heading on the side */

.split {
  display: grid;
  gap: 2rem;
  padding: var(--gap) 0;
  border-top: 1px solid var(--line);
}
@media (min-width: 56rem) { .split { grid-template-columns: 1fr 1.6fr; gap: 4rem; } }
.side p { color: var(--muted); }

.specs { display: grid; grid-template-columns: 9rem 1fr; margin: 0; }
.specs dt, .specs dd { padding: 1rem 0; border-bottom: 1px solid var(--line); margin: 0; }
.specs dt { font-weight: 600; }
.specs dd { color: var(--muted); }
@media (max-width: 34rem) {
  .specs { grid-template-columns: 1fr; }
  .specs dt { border-bottom: 0; padding-bottom: 0.2rem; }
  .specs dd { padding-top: 0; }
}

/* Links to the other pages */

.more { display: flex; flex-wrap: wrap; gap: 0.8rem; padding: 0 0 var(--gap); }
.more a {
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.95rem;
}
.more a::after { content: " →"; content: " →" / ""; color: var(--muted); }
.more a:hover { border-color: var(--ink); color: var(--ink); }

/* The pages below the landing page */

.page-head { padding: clamp(2rem, 7vw, 5rem) 0 var(--gap); max-width: 46rem; }
.page-head h1 { font-size: clamp(2.4rem, 6vw, 4rem); }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding: 1.1rem 0 1.1rem 3rem; border-bottom: 1px solid var(--line); color: var(--muted); }
.steps li::before { content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: 1.2rem; font-size: 0.85rem; font-weight: 600; color: var(--red-text); }
.steps strong { color: var(--ink); }
.checks { margin: 0; padding: 0; list-style: none; }
.checks li { position: relative; padding: 1rem 0 1rem 2rem; border-bottom: 1px solid var(--line); color: var(--muted); }
.checks li::before { content: ""; position: absolute; left: 0.2rem; top: 1.55rem; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--red); }
.faq { max-width: 46rem; padding-bottom: var(--gap); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { padding: 1.2rem 2rem 1.2rem 0; font-weight: 600; font-size: 1.1rem; cursor: pointer; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; content: "+" / ""; position: absolute; right: 0.2rem; top: 1.05rem; font-size: 1.4rem; font-weight: 400; color: var(--muted); transition: transform 160ms ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 1.4rem; color: var(--muted); }
.cta { padding: var(--gap) 0; border-top: 1px solid var(--line); text-align: center; }
.cta p { color: var(--muted); }
.cta .button { margin-top: 1rem; }

/* The "Why CO₂" page: citations and sources */

.prose-block p { margin-top: 0; margin-bottom: 1rem; color: var(--muted); }
.prose-block p.note { font-size: 0.85rem; }
.prose-block p:last-child { margin-bottom: 0; }
sup.cite { font-size: 0.7em; line-height: 0; margin-left: 0.1em; }
sup.cite a { position: relative; text-decoration: none; color: var(--red-text); }
/* A 24 × 24 px target for fingers (WCAG 2.5.8) that doesn't change the line's height */
sup.cite a::after { content: ""; position: absolute; left: 50%; top: 50%; width: 24px; height: 24px; transform: translate(-50%, -50%); }
.sources { padding: var(--gap) 0; border-top: 1px solid var(--line); }
.sources ol { margin: 1.2rem 0 0; padding-left: 1.6rem; color: var(--muted); font-size: 0.9rem; }
.sources li { margin-top: 0.6rem; scroll-margin-top: 1.5rem; }
.sources li:target { color: var(--ink); }
.sources a { overflow-wrap: anywhere; }

/* The subscriber price */

.offer {
  padding: var(--gap) 0;
  border-top: 1px solid var(--line);
  text-align: center;
}
.offer .price {
  margin: 0;
  font-size: clamp(3rem, 9vw, 5.5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.offer .price::after { content: "."; content: "." / ""; color: var(--red); }
.offer .prices { font-size: 1.15rem; max-width: 30rem; margin: 1.2rem auto 0; }
.offer .note { max-width: 34rem; margin: 1rem auto 0; }

/* The sign-up form */

form { display: grid; gap: 1.2rem; }
/* A field: its label, its control and its error, close together. */
.field { display: grid; gap: 0.45rem; min-width: 0; }
label { display: block; font-weight: 550; font-size: 0.95rem; }
input[type="email"], input[type="text"], input[type="password"], select, textarea {
  display: block;
  width: 100%;
  padding: 0.8rem 0.95rem;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
/* Text fields: a border and a soft ring instead of the outline. The checkbox keeps the :focus-visible outline. */
input:not([type="checkbox"]):focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgb(227 38 45 / 0.18);
}
input[aria-invalid="true"] { border-color: var(--red); }
textarea { resize: vertical; min-height: 5.5rem; }

fieldset {
  display: grid;
  min-width: 0;
  gap: 1rem 1.2rem;
  margin: 0;
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
@media (min-width: 40rem) { fieldset { grid-template-columns: 1fr 1fr; } .field.wide { grid-column: 1 / -1; } }
legend { padding: 0 0.5rem; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

label.consent { display: flex; gap: 0.75rem; align-items: flex-start; font-weight: 400; color: var(--muted); margin: 0; }
label.consent input { margin-top: 0.3rem; width: 1.1rem; height: 1.1rem; accent-color: var(--ink); flex: none; }
form button { justify-self: start; }
.error { color: var(--red-text); font-weight: 550; font-size: 0.92rem; margin: 0; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

#signup .message {
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--raised);
}
#signup .message h2 { font-size: 1.5rem; }

/* Other pages */

.message { padding: clamp(2rem, 8vw, 5rem) 0; max-width: 40rem; }
.message form { margin-top: 1.5rem; }
.prose { max-width: 42rem; padding: clamp(2rem, 6vw, 4rem) 0; }
.prose h2 { font-size: 1.3rem; margin-top: 2.5rem; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-top: 0.4rem; }

footer { margin-top: var(--gap); border-top: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; }
footer .wrap { padding-top: 2rem; padding-bottom: 3rem; }
footer p { margin: 0.3rem 0 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; margin-bottom: 1.2rem; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--ink); }

/* Admin */

.admin main { padding-top: 2rem; padding-bottom: 4rem; }
.admin h1 { font-size: 2rem; max-width: none; }
.admin h2 { font-size: 1.2rem; margin-top: 2.5rem; }
.admin table { border-collapse: collapse; margin: 0.6rem 0; font-variant-numeric: tabular-nums; }
/* A table wider than a phone scrolls by itself, not the page (the lists' are in #results, which does the same). */
.admin main > table { display: block; max-width: 100%; overflow-x: auto; }
.admin td, .admin th { border-bottom: 1px solid var(--line); padding: 0.35rem 1.2rem 0.35rem 0; text-align: left; }
.admin .columns { display: grid; gap: 1rem 2.5rem; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.admin-nav { font-size: 0.95rem; margin-bottom: 1rem; }
/* Log out: a form (a POST, D142) that reads as one more link in the line. */
.admin-nav .logout { display: inline; margin-left: 1.2rem; }
.admin-nav .logout button { display: inline; min-height: 0; padding: 0; font: inherit; color: inherit; background: none; border: 0; text-decoration: underline; }
.admin-nav .logout button:hover { color: var(--red-text); opacity: 1; }
.admin .login { max-width: 22rem; margin-top: 1.5rem; }
.admin h1 + .error { margin-top: 0.75rem; }
.admin .search { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; margin: 1rem 0; }
#results { overflow-x: auto; }
.chart { width: 100%; max-width: 44rem; height: auto; }
.chart rect { fill: var(--ink); }
.chart text { fill: var(--muted); font-size: 10px; }
.chart line { stroke: var(--muted); stroke-width: 1; }
.chart rect.hover { fill: transparent; }
