/* Self-hosted fonts (SIL OFL 1.1, see fonts/OFL.txt). No third-party requests. */
@font-face {
  font-family: 'Schibsted Grotesk';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('/fonts/schibsted-grotesk-latin-wght-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Schibsted Grotesk';
  font-style: italic;
  font-weight: 400 900;
  font-display: swap;
  src: url('/fonts/schibsted-grotesk-latin-wght-italic.woff2') format('woff2');
}

@font-face {
  font-family: 'Courier Prime';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/courier-prime-latin-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Courier Prime';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/courier-prime-latin-700-normal.woff2') format('woff2');
}

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

:root {
  --paper: #f5f3ec;
  --paper-raised: #fbfaf6;
  --ink: #16170f;
  --ink-soft: #3b3d31;
  --muted: #6b6c5f;
  --olive: #a7b38c;
  --olive-deep: #4f5d36;
  --rule: #d8d5c7;
  --sub: var(--ink);
  --on-olive: #16170f;
  --olive-hover-bg: var(--olive-deep);
  --olive-hover-fg: #fff;
  --link-line: rgb(79 93 54 / 0.45);
  --selection: rgb(167 179 140 / 0.45);
  --code-bg: rgb(167 179 140 / 0.25);
  --tint: rgb(251 250 246 / 0.55);
  --wash-1: rgb(167 179 140 / 0.26);
  --wash-2: rgb(196 207 160 / 0.22);
  --wash-3: rgb(214 220 174 / 0.30);
  --wash-4: rgb(167 179 140 / 0.18);
  color-scheme: light;
  --frame: 10px;
  --max: 68rem;
  --measure: 42rem;
  --sans: 'Schibsted Grotesk', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --type: 'Courier Prime', 'Courier New', Courier, monospace;
  /* Courier Prime has no weight between 400 and 700; this thickens 400 by a hair. */
  --type-stroke: 0.4px;
}

html {
  -webkit-text-size-adjust: 100%;
  background: var(--paper);
  scroll-padding-top: 1.5rem;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-feature-settings: 'ss01' on;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  flex: 1;
}

/* Desktop frame */
@media (min-width: 900px) {
  body::before {
    content: '';
    position: fixed;
    inset: 0;
    border: var(--frame) solid var(--olive);
    pointer-events: none;
    z-index: 100;
  }

  body {
    padding: var(--frame);
  }
}

a {
  color: var(--olive-deep);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--link-line);
  text-underline-offset: 0.18em;
  transition: color 0.15s, text-decoration-color 0.15s;
}

a:hover {
  color: var(--ink);
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 2px solid var(--olive-deep);
  outline-offset: 3px;
}

::selection {
  background: var(--selection);
}

h1,
h2 {
  font-family: var(--sans);
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  text-wrap: balance;
}

h3,
h4 {
  font-family: var(--type);
  font-weight: 400;
  -webkit-text-stroke: var(--type-stroke) currentColor;
  color: var(--sub);
  letter-spacing: 0;
  line-height: 1.35;
}

p,
li {
  text-wrap: pretty;
}

code,
pre {
  font-family: var(--type);
}

/* ---------- Shared header (inner pages) ---------- */

.wrap {
  width: min(var(--max), 100% - 3rem);
  margin-inline: auto;
}

.site-header {
  border-bottom: 1px solid var(--rule);
}

.site-header .wrap {
  max-width: var(--measure);
  padding: 1.4rem 0;
}

.logo,
.home-nav__logo {
  font-family: var(--sans);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
}

.logo:hover,
.home-nav__logo:hover {
  color: var(--olive-deep);
}

/* ---------- Inner pages: prose ---------- */

.section {
  padding: 3rem 0 5rem;
}

.prose {
  max-width: var(--measure);
}

.back {
  display: inline-block;
  margin-bottom: 2.5rem;
  font-family: var(--type);
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
}

.back:hover {
  color: var(--olive-deep);
}

.prose h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2.1rem, 5vw, 3rem);
}

.prose h2 {
  margin: 3.25rem 0 0.9rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: clamp(1.3rem, 2.6vw, 1.6rem);
  letter-spacing: -0.02em;
}

.prose h1 + h2,
.prose .updated + h2,
.prose .platform-note + h2 {
  border-top: none;
  padding-top: 0;
  margin-top: 2rem;
}

.prose h3 {
  margin: 2rem 0 0.5rem;
  font-size: 1rem;
}

.prose p,
.prose li {
  color: var(--ink-soft);
}

.prose ul,
.prose ol {
  padding-left: 1.2rem;
}

.prose li {
  margin-bottom: 0.45rem;
}

.prose li::marker {
  color: var(--olive-deep);
}

.prose strong {
  color: var(--ink);
  font-weight: 650;
}

.prose .updated {
  margin: 0 0 2.5rem;
  font-family: var(--type);
  font-size: 0.9rem;
  color: var(--muted);
}

.prose code {
  font-size: 0.92em;
  background: var(--code-bg);
  padding: 0.05em 0.35em;
  border-radius: 2px;
}

.page-platform .platform-note {
  margin: 1.25rem 0 2rem;
  padding: 0.25rem 0 0.25rem 1.1rem;
  border-left: 3px solid var(--olive);
  font-size: 0.95rem;
  color: var(--muted);
}

/* Definition lists (business details, operator facts) */

.facts,
.home-facts {
  margin: 0;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--rule);
}

.facts > div,
.home-facts > div {
  display: grid;
  grid-template-columns: minmax(9rem, 13rem) 1fr;
  gap: 0.25rem 1.5rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--rule);
}

.facts dt,
.home-facts dt {
  font-family: var(--type);
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--muted);
  padding-top: 0.12em;
}

.facts dd,
.home-facts dd {
  margin: 0;
  color: var(--ink);
}

@media (max-width: 560px) {
  .facts > div,
  .home-facts > div {
    grid-template-columns: 1fr;
  }
}

/* About page */

.about-block {
  margin-bottom: 1rem;
}

.prose .about-block__name {
  margin-bottom: 0.6rem;
}

.about-block__role {
  margin: 0 0 2rem;
  font-family: var(--type);
  font-size: 1rem;
  color: var(--olive-deep);
}

.about-block__stack {
  margin-top: 2rem;
  font-family: var(--type);
  font-size: 0.88rem;
}

.prose p.about-block__stack {
  color: var(--muted);
}

/* ---------- Footer ---------- */

.site-mini-footer {
  margin-top: auto;
  padding: 2.25rem 1.5rem 2.5rem;
  border-top: 1px solid var(--rule);
  background: transparent;
  text-align: center;
}

.site-mini-footer__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 0.75rem;
  margin-bottom: 1rem;
  font-family: var(--type);
  font-size: 0.88rem;
}

.site-mini-footer__nav a {
  color: var(--ink-soft);
  text-decoration: none;
}

.site-mini-footer__nav a:hover,
.site-mini-footer__nav a[aria-current='page'] {
  color: var(--olive-deep);
  text-decoration: underline;
}

.site-mini-footer__nav span {
  color: var(--rule);
}

.site-mini-footer__legal {
  margin: 0 0 0.4rem;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--muted);
}

.site-mini-footer__copy {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

/* ---------- Home page ---------- */

.home-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  width: min(var(--max), 100% - 3rem);
  margin-inline: auto;
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--rule);
}

.home-nav__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  font-family: var(--type);
  font-size: 0.92rem;
}

.home-nav__links a {
  color: var(--ink-soft);
  text-decoration: none;
}

.home-nav__links a:hover {
  color: var(--olive-deep);
  text-decoration: underline;
}

.home-hero {
  width: min(var(--max), 100% - 3rem);
  margin-inline: auto;
  padding: clamp(4rem, 12vh, 8rem) 0 clamp(4rem, 10vh, 6.5rem);
}

.home-hero__inner {
  max-width: 54rem;
}

.home-hero h1 {
  margin: 0;
  font-size: clamp(3rem, 10vw, 6.75rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.95;
}

.home-hero__role {
  margin: 1.5rem 0 0;
  font-family: var(--type);
  font-size: clamp(0.95rem, 1.8vw, 1.1rem);
  color: var(--olive-deep);
}

.home-hero__desc {
  max-width: 40rem;
  margin: 2rem 0 0;
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  line-height: 1.55;
  color: var(--ink-soft);
}

.home-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.5rem;
}

.home-hero__cta {
  display: inline-block;
  padding: 0.8rem 1.4rem;
  border: 1.5px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  font-family: var(--type);
  font-size: 0.95rem;
  font-weight: 400;
  -webkit-text-stroke: var(--type-stroke) currentColor;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.home-hero__cta:hover {
  background: var(--ink);
  color: var(--paper);
}

.home-hero__cta--primary {
  background: var(--olive);
  border-color: var(--olive);
  color: var(--on-olive);
}

.home-hero__cta--primary:hover {
  background: var(--olive-hover-bg);
  border-color: var(--olive-hover-bg);
  color: var(--olive-hover-fg);
}

.home-section {
  padding: clamp(3.5rem, 8vw, 5.5rem) 0;
  border-top: 1px solid var(--rule);
}

.home-section__inner {
  width: min(var(--max), 100% - 3rem);
  margin-inline: auto;
}

.home-section__inner--split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: 2.5rem 4rem;
  align-items: start;
}

.home-section__title {
  margin: 0 0 1.25rem;
  font-size: clamp(1.9rem, 4.2vw, 2.75rem);
}

.home-section__lead {
  max-width: var(--measure);
  margin: 0 0 2.75rem;
  font-size: 1.15rem;
  color: var(--ink-soft);
}

.home-section__note {
  margin: 1.5rem 0 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.home-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 0;
  border-top: 2px solid var(--ink);
}

.home-card {
  padding: 1.5rem 1.5rem 1.75rem 0;
  border-bottom: 1px solid var(--rule);
}

.home-cards > .home-card + .home-card {
  padding-left: 1.5rem;
  border-left: 1px solid var(--rule);
}

.home-card h3 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}

.home-card p {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.6;
}

.home-cards--two {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr));
}

.home-card--product {
  padding-top: 2rem;
  padding-bottom: 2.25rem;
}

.home-cards > .home-card--product + .home-card--product {
  padding-left: 2.25rem;
}

.home-card--product h3 {
  margin-bottom: 1rem;
  font-family: var(--sans);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.home-card__list {
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.95rem;
}

.home-card__list li {
  position: relative;
  margin: 0;
  padding: 0.5rem 0 0.5rem 1.4rem;
  border-top: 1px dashed var(--rule);
}

.home-card__list li::before {
  content: '+';
  position: absolute;
  left: 0;
  font-family: var(--type);
  font-weight: 700;
  color: var(--olive-deep);
}

.home-card p.home-card__status {
  margin-top: 1.5rem;
  font-family: var(--type);
  font-size: 0.9rem;
}

.home-prose p {
  max-width: var(--measure);
  margin: 0 0 1.25rem;
  font-size: 1.1rem;
}

.home-prose p.home-stack {
  margin-top: 2.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-family: var(--type);
  font-size: 0.92rem;
  color: var(--muted);
}

.home-section__inner--split .home-section__lead {
  margin-bottom: 0;
}

.home-hero__actions--left {
  margin-top: 0;
}

.home-section--contact {
  background: var(--tint);
}

/* Small screens: stacked cards lose the vertical rules */
@media (max-width: 720px) {
  .home-cards > .home-card + .home-card,
  .home-cards > .home-card--product + .home-card--product {
    padding-left: 0;
    border-left: none;
  }

  .home-card {
    padding-right: 0;
  }
}

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

/* Data-flow diagram (/reporting) */

.pipeline-diagram {
  margin: 1rem 0 2rem;
  padding: 1.25rem 1.5rem;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--olive);
  font-family: var(--type);
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--ink-soft);
  overflow-x: auto;
  white-space: pre;
}

/* ---------- Typed headings (site.js) ---------- */

.tw .home-section__title,
.tw .prose h1,
.tw .prose h2 {
  visibility: hidden;
}

.tw-word {
  white-space: nowrap;
}

/* opacity, not visibility, so find-in-page still matches untyped headings */
.tw-ch {
  opacity: 0;
}

.tw-ch.tw-on,
.tw-off .tw-ch {
  opacity: 1;
}

.tw-ch.tw-cur {
  position: relative;
}

.tw-ch.tw-cur::after {
  content: '';
  position: absolute;
  top: 0.08em;
  bottom: 0.02em;
  right: -0.12em;
  width: 0.07em;
  background: var(--olive-deep);
}

.tw-ch.tw-done::after {
  animation: tw-blink 0.8s steps(1) infinite;
}

@keyframes tw-blink {
  50% {
    opacity: 0;
  }
}

/* ---------- Background wash ---------- */

html::before,
html::after {
  content: '';
  position: fixed;
  inset: -20%;
  z-index: -1;
  pointer-events: none;
  will-change: opacity, transform;
}

html::before {
  background:
    radial-gradient(ellipse 42% 38% at 22% 28%, var(--wash-1), transparent 70%),
    radial-gradient(ellipse 30% 34% at 78% 74%, var(--wash-2), transparent 70%);
  animation: wash-a 26s ease-in-out infinite;
}

html::after {
  background:
    radial-gradient(ellipse 36% 32% at 72% 22%, var(--wash-3), transparent 70%),
    radial-gradient(ellipse 34% 40% at 30% 80%, var(--wash-4), transparent 70%);
  animation: wash-b 34s ease-in-out infinite;
}

@keyframes wash-a {
  0%, 100% { opacity: 0.35; transform: translate(0, 0) scale(1); }
  50% { opacity: 1; transform: translate(4%, 3%) scale(1.06); }
}

@keyframes wash-b {
  0%, 100% { opacity: 0.9; transform: translate(0, 0) scale(1.04); }
  50% { opacity: 0.25; transform: translate(-4%, -3%) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  html::before,
  html::after {
    animation: none;
    opacity: 0.6;
  }
}

/* ---------- Dark mode ---------- */

[data-theme='dark'] {
  --paper: #0c0d0a;
  --paper-raised: #15160f;
  --ink: #ffffff;
  --ink-soft: #d8dacf;
  --muted: #9a9e8b;
  --olive-deep: #c4cfa2;
  --rule: #2a2c23;
  --sub: #c4cfa2;
  --olive-hover-bg: #c4cfa2;
  --olive-hover-fg: #16170f;
  --link-line: rgb(196 207 162 / 0.45);
  --selection: rgb(167 179 140 / 0.35);
  --code-bg: rgb(167 179 140 / 0.16);
  --tint: rgb(255 255 255 / 0.025);
  --wash-1: rgb(167 179 140 / 0.10);
  --wash-2: rgb(196 207 160 / 0.07);
  --wash-3: rgb(167 179 140 / 0.08);
  --wash-4: rgb(120 135 90 / 0.10);
  color-scheme: dark;
}

/* ---------- Theme toggle (added by site.js) ---------- */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-family: var(--type);
  font-size: 0.92rem;
  color: var(--ink-soft);
  cursor: pointer;
}

.theme-toggle:hover {
  color: var(--olive-deep);
}

.theme-toggle__dot {
  width: 0.7em;
  height: 0.7em;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  background: linear-gradient(90deg, currentColor 50%, transparent 50%);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

[data-theme='dark'] .facts dt,
[data-theme='dark'] .home-facts dt {
  color: var(--olive);
}

/* ---------- Print ---------- */

@media print {
  html,
  body {
    background: #fff !important;
    color: #000;
    padding: 0;
  }

  body::before,
  html::before,
  html::after,
  .theme-toggle {
    display: none !important;
  }

  .tw .home-section__title,
  .tw .prose h1,
  .tw .prose h2 {
    visibility: visible;
  }

  .tw-ch {
    opacity: 1 !important;
  }

  .tw-ch.tw-cur::after {
    display: none;
  }

  [data-theme='dark'] {
    --paper: #ffffff;
    --ink: #16170f;
    --ink-soft: #3b3d31;
    --muted: #6b6c5f;
    --olive-deep: #4f5d36;
    --sub: #16170f;
    --rule: #d8d5c7;
    color-scheme: light;
  }
}
