/* Hallmark · macrostructure: custom bespoke (logo stage) · tone: calm, confident · anchor hue: 29.4 (CI red)
 * theme: custom (UNIQUE CI, same tokens as the website theme and the cards) · nav: none (start page), hanging Q (other pages)
 * footer: none · enrichment: contour lines of the Q's U, drawn on a canvas
 * user overrides: no content and no menu on the start page, the Q intro of the website ends as the logo
 * Hallmark · pre-emit critique: P5 H4 E5 S5 R5 V4
 *
 * UNIQUE Visitenkarten · theme for the cards installation. Mobile first, black / red / white, Moderat.
 * The cards have their own stylesheet in the plugin; this file covers the start page, the error page
 * and plain pages. */

@font-face {
  font-family: "Moderat";
  src: url("../fonts/Moderat-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Moderat";
  src: url("../fonts/Moderat-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --color-ink: oklch(10% 0.005 30);
  --color-ink-2: oklch(17% 0.007 30);
  --color-white: oklch(99% 0.005 40);
  --color-red: oklch(60.1% 0.218 29.4);
  --color-red-canvas: rgb(230 48 35); /* sRGB twin of --color-red for the canvas */
  --color-muted: oklch(76% 0.008 40);
  --color-line-dark: oklch(99% 0.003 40 / 0.16);

  --font: "Moderat", "Helvetica Neue", Arial, sans-serif;
  --text-xs: 0.8125rem;
  --text-sm: 0.9375rem;
  --text-base: 1.0625rem;
  --text-lg: clamp(1.125rem, 1.05rem + 0.35vw, 1.3125rem);
  --text-3xl: clamp(2.5rem, 1.4rem + 4.6vw, 5.75rem);
  --leading-tight: 0.92;
  --tracking-display: -0.035em;

  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --gutter: clamp(1rem, 0.5rem + 2.4vw, 3rem);
  --top: 4.75rem;

  --radius-pill: 999px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-micro: 120ms;
  --dur-short: 220ms;

  /* The Q at rest on the start page */
  --logo: clamp(5.5rem, 3.5rem + 9vmin, 10rem);
}

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

html {
  background: var(--color-ink);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
html, body { overflow-x: clip; }

body {
  margin: 0;
  min-height: 100svh;
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: 1.55;
  color: var(--color-white);
  background: var(--color-ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--color-red); color: var(--color-ink); }
:focus-visible { outline: 2px solid var(--color-white); outline-offset: 3px; }

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* The Q, drawn from two strokes like the logo file (viewBox 316 × 299) */
.q-u,
.q-d {
  fill: none;
  stroke: currentColor;
  stroke-width: 38;
}
.q-u { stroke-dasharray: 675; }
.q-d { stroke-dasharray: 189; }

/* Contour lines of the Q's U (canvas, drawn by cards.js) */
.lines {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ---------- Start page: the Q alone ---------- */
.stage {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  pointer-events: none;
}
.stage__q {
  display: block;
  width: var(--logo);
  color: var(--color-red);
  line-height: 0;
  pointer-events: auto;
}
.stage__mark {
  width: 100%;
  height: auto;
  overflow: visible;
  transform-origin: 50% 50%;
}
.stage__q:focus-visible { outline-offset: 1.25rem; }

/* ---------- The Q hanging from the top edge (error page, plain pages) ---------- */
.top {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  padding: env(safe-area-inset-top) var(--gutter) 0;
}
.top__q {
  display: block;
  width: 2.75rem;
  color: var(--color-red);
}
.top__q svg { width: 100%; height: auto; overflow: visible; }
.top__q:focus-visible { outline-offset: 6px; }

/* ---------- Error page and plain pages ---------- */
.page {
  position: relative;
  z-index: 1;
  width: min(100% - 2 * var(--gutter), 44rem);
  margin-inline: auto;
  padding: calc(var(--top) + 3rem + env(safe-area-inset-top)) 0 var(--space-10);
}
.page--lost {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100svh;
  padding-top: calc(var(--top) + env(safe-area-inset-top));
}
.page__title {
  margin: 0;
  font-size: var(--text-3xl);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
  overflow-wrap: anywhere;
}
.page__lead {
  max-width: 34ch;
  margin: var(--space-5) 0 0;
  color: var(--color-muted);
  font-size: var(--text-lg);
}
.page__actions { margin: var(--space-8) 0 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.5rem;
  padding: 0 var(--space-8);
  border-radius: var(--radius-pill);
  background: var(--color-red);
  color: var(--color-ink);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  transition:
    background-color var(--dur-short) var(--ease-out),
    transform var(--dur-micro) var(--ease-out);
}
.btn:hover { background: var(--color-white); }
.btn:active { transform: translateY(1px); }

.entry__content { margin-top: var(--space-8); }
.entry__content > * { max-width: 65ch; }
.entry__content h2,
.entry__content h3 {
  margin: var(--space-10) 0 var(--space-3);
  line-height: 1.15;
}
.entry__content p,
.entry__content ul,
.entry__content ol { margin: 0 0 var(--space-4); }
.entry__content a {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
.entry__content a:hover { color: var(--color-red); }


/* ---------- Large screens ---------- */
@media (min-width: 960px) {
  :root { --top: clamp(6rem, 12vh, 9rem); }
  .top__q { width: 3.5rem; }
}

/* ---------- Intro states (cards.js removes them; the head script has a failsafe) ---------- */
.is-pending [data-q],
.is-pending [data-fade] { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
