/* D9CD Apps — the company site for Linesider, Kollektion and Tally.
   Tokens first; everything below reads them. Inter is self-hosted (SIL OFL), so the
   site makes no third-party requests at all. See STYLE_GUIDE.md. */

@font-face {
  font-family: "Inter var";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter-var-latin.woff2") format("woff2");
}

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  color-scheme: light dark;

  /* Neutrals — light */
  --bg: #f6f6f4;
  --surface: #ffffff;
  --surface-2: #ececea;
  --line: #dcdcd8;
  --ink: #16171a;
  --ink-muted: #5d6068;
  --ink-faint: #6e7178;

  /* The company voice is ink, not a colour: each app brings its own accent. */
  --accent: var(--ink);
  --accent-text: var(--ink);
  --on-accent: var(--bg);
  --accent-soft: rgba(22, 23, 26, 0.06);

  /* App accents — light mode values are the AA text shades */
  --linesider: oklch(50% 0.13 248);
  --linesider-fill: oklch(50% 0.13 248);
  --linesider-on: #ffffff;
  --kollektion: #a5332f;
  --kollektion-fill: #a5332f;
  --kollektion-on: #ffffff;
  --tally: #0064d2;
  --tally-fill: #0064d2;
  --tally-on: #ffffff;
  --tally-new: #e31b23;
  --tally-repeat: #0a84ff;

  /* Type scale */
  --font: "Inter var", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --fs-label: 12px;
  --fs-small: 14px;
  --fs-body: 17px;
  --fs-lead: 20px;
  --fs-title: 22px;
  --fs-headline: clamp(28px, 4vw, 36px);
  --fs-display: clamp(36px, 6.4vw, 60px);

  /* 4px grid */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-24: 96px;

  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-pill: 999px;

  --control-h: 44px;
  --gutter: 24px;
  --measure: 1080px;
  --prose: 680px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0c0e;
    --surface: #15161a;
    --surface-2: #1e2026;
    --line: #2a2d34;
    --ink: #edeef0;
    --ink-muted: #9aa0a8;
    --ink-faint: #848991;
    --accent-soft: rgba(237, 238, 240, 0.06);

    --linesider: oklch(74% 0.10 248);
    --linesider-fill: oklch(70% 0.10 248);
    --linesider-on: #101114;
    --kollektion: #e08b8a;
    --kollektion-fill: #d2706f;
    --kollektion-on: #140b0b;
    --tally: #5aa9ff;
    --tally-fill: #0a6fe0; /* #0a84ff with white text is 3.6:1; this is 4.8:1 */
    --tally-on: #ffffff;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0c0e;
  --surface: #15161a;
  --surface-2: #1e2026;
  --line: #2a2d34;
  --ink: #edeef0;
  --ink-muted: #9aa0a8;
  --ink-faint: #848991;
  --accent-soft: rgba(237, 238, 240, 0.06);
  --linesider: oklch(74% 0.10 248);
  --linesider-fill: oklch(70% 0.10 248);
  --linesider-on: #101114;
  --kollektion: #e08b8a;
  --kollektion-fill: #d2706f;
  --kollektion-on: #140b0b;
  --tally: #5aa9ff;
  --tally-fill: #0a6fe0;
  --tally-on: #ffffff;
}

/* An app scope re-points the generic accent at that app's colour. */
.app-linesider  { --accent: var(--linesider-fill);  --accent-text: var(--linesider);  --on-accent: var(--linesider-on); }
.app-kollektion { --accent: var(--kollektion-fill); --accent-text: var(--kollektion); --on-accent: var(--kollektion-on); }
.app-tally      { --accent: var(--tally-fill);      --accent-text: var(--tally);      --on-accent: var(--tally-on); }

/* ── Base ───────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.6;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

a { color: var(--accent-text); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; border-radius: var(--r-sm); }

h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.02em; line-height: 1.15; }
p { margin: 0 0 var(--space-4); }

.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 var(--gutter); }
.prose { max-width: var(--prose); }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--gutter); top: var(--space-3); background: var(--surface); padding: var(--space-2) var(--space-3); z-index: 10; }

/* ── Header ─────────────────────────────────────────────────────────────── */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4); min-height: 64px;
}

.wordmark {
  display: inline-flex; align-items: baseline; gap: 0.32em;
  color: var(--ink); text-decoration: none;
  font-size: 19px; font-weight: 750; letter-spacing: -0.01em;
}
.wordmark span { font-weight: 450; color: var(--ink-muted); }

.nav { display: flex; gap: var(--space-1); margin: 0; padding: 0; list-style: none; }
.nav a {
  display: inline-flex; align-items: center; height: 36px; padding: 0 var(--space-3);
  border-radius: var(--r-md); color: var(--ink-muted); text-decoration: none;
  font-size: var(--fs-small); font-weight: 500; white-space: nowrap;
}
.nav a:hover { color: var(--ink); background: var(--accent-soft); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }
.nav .sep { width: 1px; margin: 8px var(--space-2); background: var(--line); }

@media (max-width: 760px) {
  .site-header .wrap { flex-direction: column; align-items: flex-start; gap: 0; padding-top: var(--space-3); }
  /* Without this the nav sizes to its links and the scrolling row overflows the page. */
  .site-header nav { width: 100%; min-width: 0; }
  .nav { width: calc(100% + 2 * var(--gutter)); margin: 0 calc(-1 * var(--gutter)); padding: var(--space-2) calc(var(--gutter) - var(--space-3)) var(--space-3);
         overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 0 var(--space-2); }
  .nav .sep { display: none; }
}

/* ── Type helpers ───────────────────────────────────────────────────────── */
.eyebrow {
  margin: 0 0 var(--space-3); font-size: var(--fs-label); font-weight: 650;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint);
}
/* Applied to <p> as well as headings, so the heading metrics are restated here. */
.display, .headline, .title { font-weight: 650; line-height: 1.15; color: var(--ink); }
.display { font-size: var(--fs-display); letter-spacing: -0.035em; line-height: 1.04; max-width: 16ch; }
.headline { font-size: var(--fs-headline); letter-spacing: -0.025em; }
.title { font-size: var(--fs-title); letter-spacing: -0.015em; }
.lead { font-size: var(--fs-lead); line-height: 1.5; color: var(--ink-muted); max-width: 40ch; }
.muted { color: var(--ink-muted); }
.small { font-size: var(--fs-small); }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  height: var(--control-h); padding: 0 var(--space-5); border-radius: var(--r-md);
  font: inherit; font-size: 15px; font-weight: 600; text-decoration: none; white-space: nowrap;
  border: 1px solid transparent; transition: filter 120ms ease, background 120ms ease;
}
.btn svg { width: 15px; height: 15px; flex: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { background: var(--surface-2); }

.store-badge { display: inline-block; height: var(--control-h); }
.store-badge img { height: 100%; width: auto; }
.store-badge .on-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .store-badge .on-light { display: none; }
  :root:not([data-theme="light"]) .store-badge .on-dark { display: block; }
}
:root[data-theme="dark"] .store-badge .on-light { display: none; }
:root[data-theme="dark"] .store-badge .on-dark { display: block; }

/* ── Home hero ──────────────────────────────────────────────────────────── */
.hero { padding: var(--space-24) 0 var(--space-16); }
.hero .display { margin-bottom: var(--space-6); }

.app-index { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-10) 0 0; padding: 0; list-style: none; }
.app-index a {
  display: inline-flex; align-items: center; gap: var(--space-3);
  height: 52px; padding: 0 var(--space-5) 0 var(--space-2); border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px;
}
.app-index a:hover { background: var(--surface-2); }
.app-index img { width: 36px; height: 36px; border-radius: 9px; }

/* ── App feature block (home) ───────────────────────────────────────────── */
.app-block {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: var(--space-12); align-items: center;
  padding: var(--space-16) 0; border-top: 1px solid var(--line);
}
.app-block:nth-of-type(even) .app-copy { order: 2; }

.app-id { display: flex; align-items: center; gap: var(--space-4); margin-bottom: var(--space-6); }
.app-icon { width: 64px; height: 64px; border-radius: 15px; box-shadow: 0 0 0 1px var(--line); }
.app-id .title { font-size: 26px; }
.app-id .platforms { margin: 2px 0 0; font-size: var(--fs-small); color: var(--ink-muted); }

.app-copy .headline { margin-bottom: var(--space-4); max-width: 18ch; }
.app-copy .headline em { font-style: normal; color: var(--accent-text); }
.app-copy > p { color: var(--ink-muted); max-width: 46ch; }
.app-copy .actions { margin-top: var(--space-8); }

.more-link { font-weight: 600; font-size: 15px; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.more-link:hover { text-decoration: underline; }

@media (max-width: 860px) {
  .app-block { grid-template-columns: 1fr; gap: var(--space-10); padding: var(--space-12) 0; }
  .app-block:nth-of-type(even) .app-copy { order: 0; }
}

/* ── Screenshots ────────────────────────────────────────────────────────── */
.shots { display: flex; gap: var(--space-4); justify-content: center; }
.shot {
  margin: 0; flex: 1 1 0; min-width: 0; max-width: 240px;
  border-radius: 11% / 5%; overflow: hidden;
  box-shadow: 0 0 0 1px var(--line), 0 24px 48px -24px rgba(0, 0, 0, 0.35);
  background: var(--surface-2);
}
.shot img { width: 100%; aspect-ratio: 600 / 1304; object-fit: cover; }
.shots.fan .shot:nth-child(2) { transform: translateY(var(--space-8)); }
.shots.fan { padding-bottom: var(--space-8); }

.shot-rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr);
  gap: var(--space-5); overflow-x: auto; scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter); /* snap to the gutter, not the screen edge */
  padding: var(--space-2) var(--gutter) var(--space-8);
  margin: 0 calc(-1 * var(--gutter));
  scrollbar-width: thin;
}
.shot-rail .shot { max-width: none; scroll-snap-align: start; }
.shot-rail figcaption {
  padding: var(--space-3) var(--space-1) 0; font-size: var(--fs-small); color: var(--ink-muted);
  background: var(--bg);
}
.shot-rail figure { margin: 0; scroll-snap-align: start; }
.shot-rail figure .shot { margin-bottom: 0; }

/* ── App page ───────────────────────────────────────────────────────────── */
.app-hero { padding: var(--space-16) 0 var(--space-12); }
.app-hero .app-id { margin-bottom: var(--space-8); }
.app-hero .app-icon { width: 88px; height: 88px; border-radius: 20px; }
.app-hero .display { max-width: 18ch; margin-bottom: var(--space-5); }
.app-hero .lead { margin-bottom: var(--space-8); max-width: 46ch; }

.section { padding: var(--space-16) 0; border-top: 1px solid var(--line); }
.section > .wrap > .headline, .section-head { margin-bottom: var(--space-8); }

.features {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-8) var(--space-10); margin: 0; padding: 0; list-style: none;
}
.features h3 { font-size: 17px; letter-spacing: -0.01em; margin-bottom: var(--space-2); }
.features h3::before {
  content: ""; display: block; width: 24px; height: 3px; border-radius: 2px;
  background: var(--accent); margin-bottom: var(--space-4);
}
.features p { color: var(--ink-muted); font-size: 16px; margin: 0; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-4); margin: 0; }
.facts div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--space-5); }
.facts dt { font-size: var(--fs-label); font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: var(--space-2); }
.facts dd { margin: 0; font-weight: 550; }
.facts dd a { font-weight: 600; }

.note { font-size: var(--fs-small); color: var(--ink-faint); margin-top: var(--space-8); max-width: 70ch; }

/* ── Cards (support / privacy) ──────────────────────────────────────────── */
.page-head { padding: var(--space-16) 0 var(--space-10); }
.page-head .display { margin-bottom: var(--space-5); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--space-5); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-4);
}
.card .app-id { margin: 0; }
.card .app-icon { width: 48px; height: 48px; border-radius: 11px; }
.card .app-id .title { font-size: 20px; }
.card p { margin: 0; color: var(--ink-muted); font-size: 16px; }
.card ul { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--space-2); font-size: 16px; }
.card .actions { margin-top: auto; padding-top: var(--space-2); }

.prose-block h2 { font-size: var(--fs-title); margin: var(--space-12) 0 var(--space-3); }
.prose-block h2:first-child { margin-top: 0; }
.prose-block p, .prose-block li { color: var(--ink-muted); }
.prose-block strong { color: var(--ink); font-weight: 600; }
.prose-block ul { padding-left: 1.2em; margin: 0 0 var(--space-4); }
.prose-block li { margin-bottom: var(--space-2); }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--line); margin-top: var(--space-16); padding: var(--space-10) 0 var(--space-12); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: var(--space-6) var(--space-12); justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); }
.site-footer a { color: var(--ink-muted); text-decoration: none; font-size: var(--fs-small); }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }
.site-footer small { color: var(--ink-faint); font-size: var(--fs-small); }
.site-footer .wordmark { font-size: 16px; }

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

/* Spacing utilities — used instead of inline styles, which the CSP forbids. */
.mt-12 { margin-top: var(--space-12); }
.mt-16 { margin-top: var(--space-16); }
