/* SPDX-License-Identifier: AGPL-3.0-or-later */
/* verkodo – one page. The look of verkodo/brand: near-black ground, the face in paper white, titanium grey as the one
   colour beside it, straight edges, Crimson Pro (fonts/, SIL OFL 1.1) – nothing is loaded from elsewhere. Colours from
   verkodo/brand/generate.py. */

@font-face { font-family: "Crimson Pro"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/CrimsonPro-Regular.ttf") format("truetype"); }
@font-face { font-family: "Crimson Pro"; font-weight: 400; font-style: italic; font-display: swap; src: url("fonts/CrimsonPro-Italic.ttf") format("truetype"); }
@font-face { font-family: "Crimson Pro"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/CrimsonPro-SemiBold.ttf") format("truetype"); }

/* Light (warm paper) by default; dark when the system asks for it, unless the visitor chose light – or when they
   chose dark. theme.js sets data-theme; without it (or without JavaScript) the system decides. */
:root {
  --night: #F7F4EC;       /* the ground */
  --panel: #FFFFFF;
  --text: #14202B;
  --titan: #646A70;       /* the one colour beside the face (5.0 : 1 on the paper) */
  --muted: #3E4650;       /* body text beside headings */
  --line: #DCD6C8;
  --serif: "Crimson Pro", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --night: #0D1117; --panel: #12171E; --text: #E6EDF3; --titan: #8F959B; --muted: #B4BAC1; --line: #222A33;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --night: #0D1117; --panel: #12171E; --text: #E6EDF3; --titan: #8F959B; --muted: #B4BAC1; --line: #222A33;
  color-scheme: dark;
}

/* the brand's artwork in both versions: show the one that fits the ground */
.on-dark { display: none !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .on-dark { display: block !important; }
  :root:not([data-theme="light"]) .on-light { display: none !important; }
}
:root[data-theme="dark"] .on-dark { display: block !important; }
:root[data-theme="dark"] .on-light { display: none !important; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--text); background: var(--night); font: 19px/1.6 var(--serif); -webkit-font-smoothing: antialiased; }
a { color: var(--text); text-decoration: underline; text-decoration-color: var(--titan); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--text); }
::selection { background: var(--titan); color: var(--night); }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; }

/* header */
header { padding: 22px 0; border-bottom: 1px solid var(--line); }
header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
header img { height: 34px; display: block; }
nav { display: flex; gap: 26px; font-size: 17px; }
nav a { color: var(--muted); text-decoration: none; }
nav a:hover { color: var(--text); }
.end { display: flex; align-items: center; gap: 26px; }
.theme { display: flex; border: 1px solid var(--line); }
.theme button { display: flex; align-items: center; justify-content: center; line-height: 0; color: var(--muted); background: none; border: 0; padding: 5px 9px; cursor: pointer; }
.theme svg { display: block; }
.theme button + button { border-left: 1px solid var(--line); }
.theme button:hover { color: var(--text); }
.theme button[aria-pressed="true"] { background: var(--text); color: var(--night); }
.theme button:focus-visible { outline: 2px solid var(--titan); outline-offset: 2px; }

/* hero */
.hero { padding: 84px 0 68px; }
.hero .wrap { display: grid; grid-template-columns: 1.5fr 1fr; gap: 48px; align-items: center; }
.hero h1 { font: 600 clamp(34px, 5vw, 54px)/1.12 var(--serif); margin: 0 0 24px; letter-spacing: -0.01em; }
.hero p { color: var(--muted); font-size: 20px; margin: 0 0 30px; max-width: 34em; }
.hero p strong { color: var(--text); font-weight: 600; }
.hero .mark { width: 100%; max-width: 280px; height: auto; justify-self: center; }
.buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.button { display: inline-block; padding: 9px 20px; border: 1px solid var(--line); font: 600 17px var(--serif); color: var(--text); background: var(--panel); text-decoration: none; }
.button.primary { background: var(--text); border-color: var(--text); color: var(--night); }
.button:hover { border-color: var(--titan); }
.button.primary:hover { background: var(--titan); border-color: var(--titan); }

/* sections */
section { padding: 64px 0; border-top: 1px solid var(--line); }
section h2 { font: 600 28px/1.2 var(--serif); margin: 0 0 24px; }
section > .wrap > p { color: var(--muted); max-width: 40em; margin: 0 0 24px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.cell { background: var(--panel); padding: 22px 24px; border-top: 3px solid var(--titan); }
.cell h3 { margin: 0 0 8px; font: 600 20px/1.3 var(--serif); }
.cell p { margin: 0; color: var(--muted); font-size: 17px; }

/* the name */
pre.story { font: clamp(15px, 2.4vw, 22px)/1.7 var(--mono); margin: 0 0 18px; color: var(--titan); white-space: pre-wrap; }
pre.story b { color: var(--text); font-weight: 700; }
pre.story i { color: var(--text); font-style: normal; }

/* footer */
footer { border-top: 1px solid var(--line); padding: 26px 0 44px; color: var(--titan); font-size: 15px; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
footer a { color: var(--titan); text-decoration: none; }
footer a:hover { color: var(--text); }

/* 404 */
.page { padding-top: 48px; padding-bottom: 72px; }
.page h1 { font: 600 36px var(--serif); margin: 0 0 24px; }
.page p { color: var(--muted); }

@media (max-width: 760px) {
  .hero { padding-top: 48px; }
  .hero .wrap { grid-template-columns: 1fr; }
  .hero .mark { max-width: 150px; order: -1; justify-self: start; }
  nav { display: none; }
}

/* Commands in the text, e.g. `cargo install verkodo`. */
code { font: 0.85em/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; white-space: nowrap; }
