/* MailJD website. Colours are the application's own theme tokens
   (docs/DESIGN.md §2, resources/themes/precision.json); light and dark
   follow the visitor's system. Hairlines instead of boxes, no shadows,
   no gradients (scripts/check_site_style.py enforces the rules). */

@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/jetbrains-mono-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  --surface: #ffffff;
  --sidebar: #e7edef;
  --subtle: #f3f6f7;
  --text: #101923;
  --secondary: #30434d;
  --accent: #00636a;
  --on-accent: #ffffff;
  --selection: #c4e1e0;
  --divider: #c1ced4;
  --border: #778995;
  --focus: #00636a;
  --text-face: "Atkinson Hyperlegible", "Noto Sans", system-ui, sans-serif;
  --mono-face: "JetBrains Mono", "Cascadia Code", ui-monospace, monospace;
  --measure: 38rem;
  --rail: 11rem;
  --gap: 2.5rem;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --surface: #172128;
    --sidebar: #101a20;
    --subtle: #1c2830;
    --text: #f6f8fa;
    --secondary: #ccd9e1;
    --accent: #79d6d2;
    --on-accent: #102427;
    --selection: #214348;
    --divider: #344b58;
    --border: #8099a8;
    --focus: #79d6d2;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 4.5rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--text-face);
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
code, pre, kbd { font-family: var(--mono-face); font-size: 0.86em; }
pre { background: var(--subtle); border-left: 3px solid var(--accent); padding: 0.75rem 1rem; overflow-x: auto; line-height: 1.5; margin: 0.75rem 0 1.25rem; }
kbd {
  display: inline-block; min-width: 1.6em; padding: 0 0.35em; text-align: center;
  border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 3px;
  background: var(--subtle); color: var(--text); line-height: 1.45;
}
h1, h2, h3 { line-height: 1.2; font-weight: 700; }
h2 { font-size: 1.05rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--secondary); margin: 0 0 1.25rem; }
h3 { font-size: 1.35rem; margin: 0 0 0.5rem; }

.skip { position: absolute; left: -100vw; top: 0.5rem; background: var(--accent); color: var(--on-accent); padding: 0.4rem 0.8rem; z-index: 10; }
.skip:focus { left: 0.5rem; }

/* Top bar: wordmark and plain links, a hairline below. */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: baseline; gap: 2rem; flex-wrap: wrap;
  padding: 0.85rem max(1rem, calc((100vw - 78rem) / 2 + 1rem)) 0.7rem;
  background: var(--surface); border-bottom: 1px solid var(--divider);
}
.wordmark { font-weight: 700; font-size: 1.3rem; color: var(--text); text-decoration: none; letter-spacing: -0.01em; }
.top ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; margin: 0; padding: 0; list-style: none; }
.top nav a { color: var(--secondary); text-decoration: none; }
.top nav a:hover { color: var(--accent); text-decoration: underline; }

/* Page grid: a narrow rail for the section names, content to the right. */
main, .bottom { max-width: 78rem; margin: 0 auto; padding: 0 1rem; }
main > section { padding: 3rem 0; border-top: 1px solid var(--divider); }
main > section.opening { border-top: 0; padding-top: 2.5rem; }
@media (min-width: 64rem) {
  main > section:not(.opening) { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); column-gap: var(--gap); }
  main > section:not(.opening) > h2 { grid-column: 1; grid-row: 1 / span 40; align-self: start; position: sticky; top: 4.75rem; }
  main > section:not(.opening) > :not(h2) { grid-column: 2; }
}

/* Opening: one plain sentence, the release line, then the hero. */
.lead { font-size: clamp(1.6rem, 1.1rem + 2vw, 2.5rem); max-width: 30ch; margin: 0 0 1rem; letter-spacing: -0.015em; }
.detail { max-width: var(--measure); color: var(--secondary); margin: 0 0 1rem; font-size: 1.125rem; }
.release { margin: 0 0 2rem; }
.release .primary { font-weight: 700; }
.shots-note { color: var(--secondary); font-size: 0.95rem; max-width: 52rem; margin-top: 0.75rem; }

/* Tour: text beside its screenshot, the screenshot gets the width. */
.stop { display: grid; gap: 1rem 2rem; padding: 0 0 3rem; }
.stop + .stop { padding-top: 2.5rem; border-top: 1px solid var(--divider); }
.stop .text p { max-width: var(--measure); margin: 0 0 1rem; }
@media (min-width: 52rem) {
  .stop { grid-template-columns: minmax(14rem, 19rem) minmax(0, 1fr); align-items: start; }
}
.keys { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; align-items: baseline; }
.keys div { display: contents; }
.keys dt { white-space: nowrap; }
.keys dd { margin: 0; color: var(--secondary); }

/* Light/dark comparison. Without JavaScript the image of the visitor's
   own scheme shows; site.js turns on the split line and its slider. */
.compare { margin: 0; }
.compare .frame { position: relative; border: 1px solid var(--divider); background: var(--subtle); aspect-ratio: 1440 / 900; overflow: hidden; }
.compare img { display: block; width: 100%; height: auto; }
.compare img.dark { position: absolute; inset: 0; clip-path: inset(0 0 0 100%); }
@media (prefers-color-scheme: dark) { .compare:not(.live) img.dark { clip-path: inset(0); } }
.compare.live img.dark { clip-path: inset(0 0 0 var(--split, 50%)); }
.compare .split, .compare .legend { display: none; }
.compare.live .split {
  display: block; position: absolute; top: 0; bottom: 0; left: var(--split, 50%);
  width: 2px; margin-left: -1px; background: var(--accent); pointer-events: none;
}
.compare.live .split::after {
  content: "\2194"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 1.9rem; height: 1.9rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); font-size: 1rem; line-height: 1;
}
.compare.live .legend {
  display: flex; justify-content: space-between; margin: 0 0 0.3rem;
  font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--secondary);
}
.compare input[type="range"] {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0;
  opacity: 0; cursor: ew-resize; touch-action: pan-y;
}
.compare .frame:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 3px; }
.compare figcaption { color: var(--secondary); font-size: 0.95rem; margin-top: 0.6rem; max-width: 52rem; }
.compare .full { white-space: nowrap; }

/* Tables: real tables with hairlines. */
table { border-collapse: collapse; width: 100%; margin: 0 0 1.5rem; font-variant-numeric: tabular-nums; }
caption { text-align: left; font-weight: 700; padding-bottom: 0.4rem; }
th, td { text-align: left; vertical-align: top; padding: 0.55rem 1rem 0.55rem 0; border-bottom: 1px solid var(--divider); }
thead th { font-size: 0.85rem; color: var(--secondary); font-weight: 700; border-bottom-color: var(--border); }
tbody th { font-weight: 700; white-space: nowrap; }
.facts th { width: 13rem; }
.num { text-align: right; white-space: nowrap; }
.not { max-width: var(--measure); color: var(--secondary); }
.quality td:nth-child(2) { color: var(--secondary); }
.quality img { vertical-align: middle; }
@media (max-width: 52rem) {
  .quality thead { display: none; }
  .quality tr { display: block; padding: 0.6rem 0; border-bottom: 1px solid var(--divider); }
  .quality th, .quality td { display: block; border: 0; padding: 0.1rem 0; }
  .facts th { width: auto; white-space: normal; }
}

.docs { display: grid; gap: 0.8rem; margin: 0; }
.docs div { display: grid; grid-template-columns: 13rem 1fr; gap: 1rem; }
.docs dt { font-weight: 700; }
.docs dd { margin: 0; color: var(--secondary); }
@media (max-width: 40rem) { .docs div { grid-template-columns: 1fr; gap: 0; } }

.bottom { border-top: 1px solid var(--divider); padding-top: 1.5rem; padding-bottom: 3rem; color: var(--secondary); font-size: 0.95rem; }
.bottom p { margin: 0 0 0.5rem; }
.built { font-size: 0.85rem; }

dialog { border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 1.25rem 1.5rem; max-width: 26rem; }
dialog::backdrop { background: rgb(0 0 0 / 0.45); }
dialog h2 { margin-bottom: 0.75rem; }
dialog button { margin-top: 1rem; font: inherit; color: var(--text); background: var(--subtle); border: 1px solid var(--border); padding: 0.3rem 0.8rem; cursor: pointer; }
