/*
 * Shared by every page on triivl.app: the app's typefaces, the one colour
 * scheme the site has (the midnight-blue cartography, in light and dark
 * alike), the header with the language switch, and the footer.
 *
 * The tokens are the app's dark palette (Theme.swift) and the share site's
 * (share.triivl_app/src/styles/globals.css): mint brand on midnight blue.
 * Keep the three in step. The map and the icon come from Assets/Brand.
 *
 * The page lives in two languages, Norwegian at / and English at /en/, with
 * the same markup and these same stylesheets; the text is the only difference.
 * Font and image URLs are absolute because nginx serves index.html for
 * every unknown path, and because /en/ pages share them.
 */

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("/fonts/space-grotesk-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk Fallback";
  src: local("Arial");
  ascent-override: 89.71%;
  descent-override: 26.62%;
  line-gap-override: 0%;
  size-adjust: 109.69%;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("/fonts/jetbrains-mono-latin.woff2") format("woff2");
}

:root {
  color-scheme: dark;
  --bg: #10254b;
  --surface: #172e50;
  --surface-raised: #1d3658;
  --border: #385170;
  --text: #ffffff;
  --text-muted: #d7e3f0;
  --text-faint: #a9b6c8;
  --brand: #77eaa9;
  --brand-ink: #a9f5c9;
  --on-brand: #10254b;
  --accent-soft: #1c3a4c;
  --rail-remaining: rgba(185, 203, 224, .55);
  --focus-ring: 0 0 0 3px rgba(119, 234, 169, .4);
  --shadow-md: 0 12px 36px rgba(3, 14, 31, .18);

  --radius-card: 20px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --display: "Space Grotesk", "Space Grotesk Fallback", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  isolation: isolate;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* The cartography stays still while the content scrolls. */
body::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background: url("/triivl-map.svg?v=20261016") center / cover no-repeat;
}

a { color: inherit; }
a:focus-visible { outline: none; border-radius: 4px; box-shadow: var(--focus-ring); }
.nowrap { white-space: nowrap; }

/* Mono caps labels, as on the app's tickets. */
.eyebrow,
.tlabel {
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.eyebrow { margin: 0 0 18px; font-size: 11px; color: var(--text-muted); }
.tlabel { font-size: 10px; color: var(--text-muted); }

/* ---------- Header: brand, section links, language ---------- */
.sitebar {
  width: min(1200px, calc(100% - 48px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: inherit;
  text-decoration: none;
  font-family: var(--display);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -.01em;
  border-radius: 8px;
}
.brand:focus-visible { outline: none; box-shadow: var(--focus-ring); }
/* Shared, generated journey icon (Assets/Brand/mark). */
.brand__mark { width: 42px; height: 42px; display: block; flex: none; }

.sitebar nav { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px 28px; font-size: 14px; }
.sitebar nav a { text-decoration: none; font-weight: 600; }
.sitebar nav a:hover { color: var(--brand); }

/* The other language, one click away on every page. */
.lang {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}
.sitebar nav a.lang:hover { color: var(--on-brand); background: var(--brand); border-color: var(--brand); }

/* ---------- Footer ---------- */
footer {
  width: min(1200px, calc(100% - 48px));
  margin: 0 auto;
  padding: 20px 0 28px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}
footer p { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; }
footer a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
footer a:hover { color: var(--text); }

@media (max-width: 720px) {
  .sitebar, footer { width: calc(100% - 32px); }
  .sitebar { padding: 20px 0; }
  .sitebar nav { gap: 6px 16px; }
  /* The example is right below the fold on a phone; the anchor to it can go. */
  .sitebar nav .in-page { display: none; }
  .brand { font-size: 22px; }
  .brand__mark { width: 36px; height: 36px; }
}
