/* Govo Guides: one reading column on Govo's canvas. Screens sit in a device
   bezel and enlarge on tap; landscape screens run full width or in pairs,
   portrait screens sit three across. */

@font-face {
  font-family: 'Public Sans';
  src: url('/assets/fonts/public-sans-latin.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}

@font-face {
  font-family: 'Archivo';
  src: url('/assets/fonts/archivo-latin.woff2') format('woff2');
  font-weight: 600 800;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('/assets/fonts/jetbrains-mono-latin.woff2') format('woff2');
  font-weight: 500 600;
  font-display: swap;
}

:root {
  --ground: #eef4f8; /* Govo's canvas */
  --surface: #ffffff;
  --ink: #1c3340;
  --ink-2: #3f5a69;
  --line: #d5e2ea;
  --brand: #2d586f; /* Govo navy */
  --brand-soft: #dbe8f0;
  --bezel: #17242c;
  --live: #c43b2f;
  --official: #1f7a4f;
  --own: #b5402f;
  --note: #8a5708;
  --note-soft: #fbefd6;
  --fresh: #086a73;
  --fresh-soft: #d7f1f3;
  --veil: rgb(8 16 20 / 0.82);
  --veil-ink: #e4eef3;
  --font-display: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Public Sans', system-ui, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --ground: #0f1a20;
    --surface: #16242c;
    --ink: #e4eef3;
    --ink-2: #a9bfcb;
    --line: #2a3d48;
    --brand: #8fc0db;
    --brand-soft: #1f3542;
    --bezel: #05090c;
    --live: #ef7b70;
    --official: #6fd0a0;
    --own: #f19484;
    --note: #f0c06a;
    --note-soft: #3a2e17;
    --fresh: #6fd6de;
    --fresh-soft: #163a3e;
    color-scheme: dark;
  }
}

:root[data-theme='dark'] {
  --ground: #0f1a20;
  --surface: #16242c;
  --ink: #e4eef3;
  --ink-2: #a9bfcb;
  --line: #2a3d48;
  --brand: #8fc0db;
  --brand-soft: #1f3542;
  --bezel: #05090c;
  --live: #ef7b70;
  --official: #6fd0a0;
  --own: #f19484;
  --note: #f0c06a;
  --note-soft: #3a2e17;
  --fresh: #6fd6de;
  --fresh-soft: #163a3e;
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 1rem/1.6 var(--font-body);
}

img {
  max-width: 100%;
}

a {
  color: var(--brand);
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* The bar across the top of every page: the Govo mark, back to the guides. */
.site-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.site-bar-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding-block: 0.75rem;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.site-bar a.home {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
  border-radius: 6px;
}

.site-bar svg {
  display: block;
  height: 1.375rem;
  width: auto;
}

.site-bar .section-name {
  font: 600 0.75rem/1 var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding-left: 0.85rem;
  border-left: 1px solid var(--line);
}

.wrap {
  max-width: 72rem;
  margin: 0 auto;
  padding-block: 2.5rem 4rem;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: grid;
  gap: 3.5rem;
}

.intro {
  display: grid;
  gap: 1rem;
  max-width: 46rem;
}

.eyebrow {
  font: 600 0.75rem/1.3 var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
}

h1 {
  font: 800 clamp(2.25rem, 6vw, 3.5rem) / 1.05 var(--font-display);
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

h2 {
  font: 800 1.625rem/1.2 var(--font-display);
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}

.lede {
  font-size: 1.125rem;
  color: var(--ink-2);
  margin: 0;
  max-width: 40rem;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font: 500 0.8125rem/1.4 var(--font-mono);
  color: var(--ink-2);
}

.facts li {
  display: flex;
  gap: 0.4rem;
}

.facts b {
  color: var(--ink);
  font-weight: 600;
}

/* The key: what each colour means on a screen, one meaning per line. */
.key {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(0, 1fr);
  max-width: 46rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem;
}

.key h2 {
  grid-column: 1 / -1;
}

.key div {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  font-size: 0.9375rem;
}

.key p {
  margin: 0;
  color: var(--ink-2);
}

.key strong {
  color: var(--ink);
  font-weight: 600;
}

/* One width for every chip in the key, so the meanings start on one edge. */
.key .chip {
  min-width: 8.5rem;
}

.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font: 600 0.75rem/1 var(--font-body);
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  white-space: nowrap;
}

.chip.official {
  background: var(--official);
  color: var(--surface);
}

.chip.own {
  border: 1.5px solid var(--own);
  color: var(--own);
}

.chip.floor {
  background: var(--live);
  color: var(--surface);
  letter-spacing: 0.06em;
}

.chip.note {
  background: var(--note-soft);
  color: var(--note);
  border: 1px solid var(--note);
}

.chip.fresh {
  background: var(--fresh-soft);
  color: var(--fresh);
  border: 1px solid var(--fresh);
  letter-spacing: 0.06em;
}

section {
  display: grid;
  gap: 1.75rem;
}

.section-head {
  display: grid;
  gap: 0.35rem;
  max-width: 44rem;
}

.section-head p {
  margin: 0;
  color: var(--ink-2);
}

figure {
  margin: 0;
  display: grid;
  gap: 0.85rem;
  min-width: 0;
}

.shot {
  display: block;
  width: 100%;
  border: 0;
  cursor: zoom-in;
  background: var(--bezel);
  border-radius: 18px;
  padding: clamp(6px, 1.2vw, 12px);
  box-shadow:
    0 1px 2px rgb(0 0 0 / 0.08),
    0 12px 32px -12px rgb(16 40 56 / 0.35);
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.shot.laptop {
  border-radius: 12px 12px 4px 4px;
}

figcaption {
  display: grid;
  gap: 0.25rem;
  max-width: 46rem;
}

figcaption h3 {
  font: 600 1.0625rem/1.35 var(--font-body);
  margin: 0;
}

figcaption p {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.9375rem;
}

.device {
  font: 500 0.75rem/1 var(--font-mono);
  color: var(--ink-2);
  letter-spacing: 0.02em;
}

.pair {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: 1fr;
}

@media (min-width: 60rem) {
  .pair {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

.portraits {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  align-items: start;
}

/* The guides home: one row per guide, its first screen beside its summary. */
.guide-list {
  display: grid;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.guide {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  color: var(--ink);
  text-decoration: none;
}

@media (min-width: 46rem) {
  .guide {
    grid-template-columns: minmax(0, 22rem) minmax(0, 1fr);
    gap: 1.75rem;
    padding: 1.25rem;
  }
}

.guide:hover {
  border-color: var(--brand);
}

.guide .thumb {
  display: block;
  background: var(--bezel);
  border-radius: 12px;
  padding: 6px;
}

.guide .thumb img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
}

.guide-text {
  display: grid;
  gap: 0.5rem;
  min-width: 0;
}

.guide-text h2 {
  font-size: 1.5rem;
}

.guide-text p {
  margin: 0;
  color: var(--ink-2);
}

.guide-text .go {
  font-weight: 600;
  color: var(--brand);
}

.page-foot {
  color: var(--ink-2);
  font-size: 0.875rem;
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
  display: grid;
  gap: 0.35rem;
}

.page-foot p {
  margin: 0;
}

/* The enlarged screen. */
dialog {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 96vw;
  max-height: 96vh;
  max-height: 96dvh;
}

dialog::backdrop {
  background: var(--veil);
}

dialog img {
  display: block;
  max-width: 96vw;
  /* Room for the bar below: Close stays on screen, toolbars included. */
  max-height: calc(96vh - 4.5rem);
  max-height: calc(96dvh - 4.5rem);
  width: auto;
  height: auto;
  border-radius: 10px;
}

dialog .bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 0.2rem 0;
  color: var(--veil-ink);
  font-size: 0.875rem;
}

dialog button {
  font: 600 0.875rem/1 var(--font-body);
  color: var(--bezel);
  background: var(--veil-ink);
  border: 0;
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  min-height: 44px;
  cursor: pointer;
}

dialog button:focus-visible {
  outline-color: var(--veil-ink);
}

@media (prefers-reduced-motion: no-preference) {
  .shot,
  .guide {
    transition:
      transform 160ms ease-out,
      border-color 160ms ease-out;
  }

  .shot:hover {
    transform: translateY(-2px);
  }
}
