/*
 * baseline-app.dv.ie
 *
 * The app's own system, DESIGN.md, carried onto the web: Archivo at three
 * weights, zero radius, 2px rules doing the organising, flush-left labels, and
 * the two grounds split by function — paper for reading, ink wherever the
 * board itself is shown. One accent, and it is never decoration.
 */

@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-600.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-800.woff2") format("woff2");
  font-weight: 800; font-style: normal; font-display: swap;
}

:root {
  /* Paper: the printed scoresheet. */
  --paper: #F3F2F2;
  --paper-surface: #EAE8E8;
  --paper-ink: #201E1D;
  --paper-muted: #6B6664;
  --paper-rule-soft: #CFCBCA;
  --paper-accent-text: #9E200D;   /* signal red, darkened to read as type */

  /* Ink: the board. */
  --ink: #1B1918;
  --ink-raised: #2D2B2B;
  --ink-pressed: #535151;
  --digits: #F3F2F2;
  --digit-label: rgba(243, 242, 242, 0.62);
  --board-rule: rgba(243, 242, 242, 0.30);
  --home-on-ink: #FF563C;

  --signal: #EC3013;
  --signal-pressed: #C22810;
  --running: #4ADE80;

  /* What the current ground resolves to. Paper by default. */
  --bg: var(--paper);
  --surface: var(--paper-surface);
  --text: var(--paper-ink);
  --muted: var(--paper-muted);
  --rule: var(--paper-ink);
  --rule-soft: var(--paper-rule-soft);
  --accent-text: var(--paper-accent-text);
  --mark-rule: var(--signal);

  --gutter: clamp(16px, 4vw, 40px);
  --max: 72rem;
}

/* The ink ground, wherever the board is shown. */
.ink {
  --bg: var(--ink);
  --surface: var(--ink-raised);
  --text: var(--digits);
  --muted: var(--digit-label);
  --rule: var(--board-rule);
  --rule-soft: rgba(243, 242, 242, 0.16);
  --accent-text: var(--home-on-ink);
  --mark-rule: var(--home-on-ink);
  background: var(--bg);
  color: var(--text);
}

/*
 * Dark mode. Paper becomes a warm near-black one step up from the board, so
 * the ink bands still read as a separate ground rather than disappearing into
 * the page: the tonal step does the work, as it does on the board itself.
 */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #242120;
    --surface: #2F2B2A;
    --text: #F3F2F2;
    --muted: #ADA8A6;
    --rule: rgba(243, 242, 242, 0.55);
    --rule-soft: rgba(243, 242, 242, 0.16);
    --accent-text: var(--home-on-ink);
    --mark-rule: var(--home-on-ink);
  }
  .ink { --bg: #161413; }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex; flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.6 Archivo, "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

main { flex: 1 0 auto; }

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

a { color: var(--accent-text); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; }

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--signal); color: #fff; padding: .75rem 1rem; z-index: 10;
  font-weight: 600;
}
.skip:focus { left: var(--gutter); }

/* Tracked uppercase label: FOULS, SHOT, RULE PRESET. */
.label, .kicker {
  font-size: .78rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1rem;
}
.kicker a { color: inherit; }

h1, h2, h3 { font-weight: 800; line-height: 1.05; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 7vw, 5.25rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.9rem, 4.2vw, 3rem); letter-spacing: -0.025em; }
h3 { font-size: 1.2rem; letter-spacing: -0.01em; }

.lede { font-size: clamp(1.1rem, 1.8vw, 1.3rem); line-height: 1.5; max-width: 40rem; color: var(--text); }

/* --- masthead ------------------------------------------------------------ */

.masthead {
  position: sticky; top: 0; z-index: 5;
  background: var(--bg);
  border-bottom: 2px solid var(--rule);
}
.masthead-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 4rem;
}
.brand { display: block; color: var(--text); padding: .5rem 0; }
.brand svg { display: block; height: 1.15rem; width: auto; }
.mark-rule { fill: var(--mark-rule); }

nav { display: flex; align-items: center; gap: clamp(.75rem, 2.5vw, 2rem); }
nav a {
  color: var(--text); text-decoration: none;
  font-size: .8rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  padding: .5rem 0;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
nav a:hover, nav a[aria-current="page"] { border-bottom-color: currentColor; }

/* The one filled accent action on every page. */
.nav-get, .nav-get:hover {
  background: var(--signal); color: #fff;
  padding: .7rem 1rem; border: 0;
}
.nav-get:hover { background: var(--signal-pressed); }

@media (max-width: 34rem) {
  .brand svg { height: .95rem; }
  nav { gap: .9rem; }
  nav a { font-size: .72rem; letter-spacing: .08em; }
  .nav-get { padding: .6rem .7rem; }
}
/* Support is in the footer of every page; the header keeps what fits. */
@media (max-width: 30rem) {
  nav a[href="/support.html"] { display: none; }
}

/* --- landing ------------------------------------------------------------- */

.band { padding: clamp(4rem, 9vw, 7.5rem) 0; }
.band + .band:not(.ink) { border-top: 2px solid var(--rule); }

.hero { padding: clamp(3.5rem, 8vw, 6.5rem) 0 0; overflow: hidden; }
.hero h1 { max-width: 14ch; }
.hero .lede { margin: 1.75rem 0 2.25rem; color: var(--text); }
.hero .kicker { color: var(--digit-label); }

.stores { display: flex; flex-wrap: wrap; gap: .75rem 1rem; }

/*
 * The official store badges, unaltered apart from Google's clear space, which
 * is trimmed so the two stand at one height as both guidelines ask. The
 * height is the board's 56px button row; the 64px tap floor is kept by
 * padding the link rather than enlarging the badge.
 */
.stores { align-items: center; }
.badge { display: block; padding: 4px 0; }
.badge img { height: 56px; width: auto; }
/* Side by side on a phone rather than stacked; the link keeps its 64px floor. */
@media (max-width: 30rem) {
  .stores { gap: .75rem; }
  .badge { padding: 10px 0; }
  .badge img { height: 44px; }   /* Apple's floor is 40 */
}
.badge:focus-visible { outline-offset: 2px; }

.facts {
  list-style: none; padding: 0; margin: 1.5rem 0 0;
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem;
  font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--digit-label);
}
.facts li { display: flex; align-items: center; gap: .55rem; }
/* The 9px square pip, filled: the board's mark for "yes". */
.facts li::before { content: ""; width: 9px; height: 9px; background: var(--running); flex: none; }

.hero-shot {
  margin-top: clamp(3rem, 7vw, 5rem);
  border: 2px solid var(--board-rule);
  border-bottom: 0;
}

.section-head { margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head h2 { max-width: 22ch; }
.section-head .lede { margin-top: 1.25rem; }

/* Ruled columns, never cards: the rule does the organising. */
.ruled-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  border-top: 2px solid var(--rule);
}
.ruled-grid > div { padding: 1.5rem 1.75rem 0 0; }
.ruled-grid > div + div { border-left: 2px solid var(--rule); padding-left: 1.75rem; }
@media (max-width: 52rem) {
  .ruled-grid { grid-template-columns: 1fr; }
  .ruled-grid > div { padding: 1.5rem 0 1rem; }
  .ruled-grid > div + div { border-left: 0; border-top: 2px solid var(--rule); padding-left: 0; }
}
.ruled-grid ul, .plan ul { list-style: none; padding: 0; margin: 1.25rem 0 0; }
.ruled-grid li, .plan li {
  padding: .7rem 0; border-top: 1px solid var(--rule-soft);
  line-height: 1.45;
}
.more { margin: 1.5rem 0 0; font-weight: 600; }

.split-grid {
  display: grid; align-items: center;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 5vw, 4.5rem);
}
.split-grid.flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.split-grid.flip .split-text { order: 2; }
.split-text h2 { margin-bottom: 1.5rem; }
.split-text p { max-width: 34rem; }
.split-shot { border: 2px solid var(--rule); }
.split-shot.phone { max-width: 22rem; justify-self: center; }
@media (max-width: 52rem) {
  .split-grid, .split-grid.flip { grid-template-columns: 1fr; }
  .split-grid.flip .split-text { order: 0; }
}

/* Pricing */
.plans {
  display: grid; grid-template-columns: 1fr 1fr;
  border-top: 2px solid var(--rule); border-bottom: 2px solid var(--rule);
}
.plan { padding: 2rem 2rem 2rem 0; }
.plan + .plan { border-left: 2px solid var(--rule); padding-left: 2rem; padding-right: 0; }
@media (max-width: 52rem) {
  .plans { grid-template-columns: 1fr; }
  .plan, .plan + .plan { padding: 2rem 0; border-left: 0; }
  .plan + .plan { border-top: 2px solid var(--rule); }
}
.plan-name { font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; margin: 0; color: var(--muted); }
.plan-pro .plan-name { color: var(--accent-text); }
.plan-price { font-size: clamp(2.5rem, 5vw, 3.5rem); font-weight: 800; letter-spacing: -.03em; line-height: 1; margin: .75rem 0 0; }
.plan-price span { font-size: 1rem; font-weight: 600; letter-spacing: 0; color: var(--muted); }
.plan-alt { color: var(--muted); margin: .75rem 0 0; max-width: 26rem; }
.fine { color: var(--muted); font-size: .9rem; margin: 1.25rem 0 0; max-width: 46rem; }

/* Guides teaser */
.guides-teaser {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 5vw, 4.5rem);
}
.guides-teaser h2 { margin-bottom: 1.25rem; }
.guides-teaser header p:last-child { font-weight: 600; }
@media (max-width: 52rem) { .guides-teaser { grid-template-columns: 1fr; } }
.teaser-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--rule); counter-reset: g; }
.teaser-list li { border-bottom: 1px solid var(--rule-soft); counter-increment: g; }
.teaser-list a {
  display: flex; align-items: baseline; gap: 1.25rem;
  min-height: 4rem; padding: 1.1rem 0;
  color: var(--text); text-decoration: none;
  font-weight: 800; font-size: 1.2rem; letter-spacing: -.01em;
}
.teaser-list a::before {
  content: counter(g, decimal-leading-zero);
  font-size: .78rem; font-weight: 600; letter-spacing: .1em; color: var(--muted);
  min-width: 1.5rem;
}
.teaser-list a::after { content: "\2192"; margin-left: auto; color: var(--accent-text); transition: transform 150ms; }
.teaser-list a:hover::after { transform: translateX(4px); }

.closer h2 { margin-bottom: 2rem; }
.closer-note { margin: 2rem 0 0; color: var(--digit-label); }

/* --- guides index ---------------------------------------------------------- */

.page-head { padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(2rem, 4vw, 3rem); }
.page-head .lede { margin-top: 1.5rem; }
.page-head h1::after, .doc h1::after {
  content: ""; display: block; width: 6rem; height: 6px;
  background: var(--signal); margin-top: 1.5rem;
}

.guide-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--rule); }
.guide-list li { border-bottom: 1px solid var(--rule-soft); }
.guide-list a {
  display: grid; align-items: baseline;
  grid-template-columns: 3rem minmax(0, 1fr) auto;
  grid-template-areas: "num title tag" "num summary tag";
  gap: .35rem 1.25rem;
  padding: 1.5rem 0; color: var(--text); text-decoration: none;
}
.guide-list a:hover .guide-title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.guide-num { grid-area: num; font-size: .78rem; font-weight: 600; letter-spacing: .1em; color: var(--muted); }
.guide-title { grid-area: title; font-weight: 800; font-size: clamp(1.3rem, 2.4vw, 1.6rem); letter-spacing: -.015em; line-height: 1.15; }
.guide-summary { grid-area: summary; color: var(--muted); max-width: 42rem; }
.guide-tag {
  grid-area: tag; align-self: center;
  font-size: .7rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  padding: .2rem .45rem; border: 2px solid var(--rule-soft); color: var(--muted);
  white-space: nowrap;
}
.tag-yes, .tag-some { border-color: var(--accent-text); color: var(--accent-text); }
@media (max-width: 40rem) {
  .guide-list a { grid-template-columns: 2.25rem minmax(0, 1fr); grid-template-areas: "num title" "num summary" "num tag"; }
  .guide-tag { justify-self: start; margin-top: .5rem; }
}
.after-list { margin: 2.5rem 0 5rem; color: var(--muted); }

/* --- documents: guides, support, privacy ---------------------------------- */

.doc-layout {
  display: grid;
  grid-template-columns: minmax(0, 44rem) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 6rem);
  padding-bottom: 6rem;
}
.page-store .doc-layout { grid-template-columns: minmax(0, 44rem); }
@media (max-width: 60rem) { .doc-layout { grid-template-columns: minmax(0, 1fr); } }

.doc { padding-top: clamp(3rem, 7vw, 5rem); }
.doc .kicker { margin-bottom: 1.25rem; }
.doc h1 { font-size: clamp(2.3rem, 5.5vw, 3.5rem); }
.doc h2 {
  font-size: clamp(1.4rem, 2.6vw, 1.75rem); letter-spacing: -.015em;
  margin: 3.5rem 0 1rem; padding-top: 1.25rem;
  border-top: 2px solid var(--rule);
}
.doc h3 { font-size: 1.1rem; margin: 2.25rem 0 .5rem; }
.doc h1 + p { font-size: 1.2rem; line-height: 1.5; margin-top: 2rem; }
.doc p, .doc li { max-width: 40rem; }
.doc ul, .doc ol { padding-left: 1.25rem; }
.doc li { margin: .45rem 0; }
.doc li::marker { color: var(--muted); font-weight: 600; }
.doc strong { font-weight: 600; }
.doc hr { border: 0; border-top: 2px solid var(--rule); margin: 3rem 0; }
.doc code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em;
  background: var(--surface); padding: .1em .35em;
}
.doc figure { margin: 2.25rem 0; border: 2px solid var(--rule); }
.doc .dates, .doc .footnote { color: var(--muted); font-size: .95rem; }

/* A callout: a Pro note or a tip. A rule on the left, never a box. */
.note {
  margin: 1.75rem 0; padding: .25rem 0 .25rem 1.25rem;
  border-left: 6px solid var(--signal);
  max-width: 40rem;
}
.note p { margin: 0; }

.table { overflow-x: auto; margin: 1.5rem 0; border-top: 2px solid var(--rule); }
.table table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th, .table td { text-align: left; padding: .7rem .75rem .7rem 0; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
.table th { font-weight: 600; text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; color: var(--muted); white-space: nowrap; }

.doc-toc { padding-top: clamp(3rem, 7vw, 5rem); }
.doc-toc > * { position: sticky; }
.doc-toc ol { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--rule); position: sticky; top: 6rem; }
.doc-toc .label { position: sticky; top: 4.75rem; }
.doc-toc li { border-bottom: 1px solid var(--rule-soft); }
.doc-toc a { display: block; padding: .75rem 0; color: var(--text); text-decoration: none; font-weight: 600; font-size: .95rem; }
.doc-toc a:hover { color: var(--accent-text); }
.doc-toc a[aria-current="page"] { color: var(--accent-text); box-shadow: inset 4px 0 0 var(--signal); padding-left: .9rem; }
@media (max-width: 60rem) { .doc-toc { display: none; } }

.next {
  display: flex; flex-direction: column; gap: .35rem;
  margin-top: 4rem; padding: 1.25rem 1.5rem; min-height: 4rem;
  border: 2px solid var(--rule); color: var(--text); text-decoration: none;
  font-weight: 800; font-size: 1.2rem;
}
.next .label { margin: 0; }
.next:hover { background: var(--text); color: var(--bg); }
.next:hover .label { color: inherit; }

.missing { padding-bottom: 8rem; }

/* --- footer -------------------------------------------------------------- */

.footer { border-top: 2px solid var(--rule); padding: 3rem 0 2rem; font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 2rem; }
@media (max-width: 52rem) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 30rem) { .footer-grid { grid-template-columns: 1fr; } }
.footer p { margin: 0; line-height: 1.8; }
.footer .label { margin-bottom: .5rem; }
.footer a { color: var(--text); }
.footer-grid > div:first-child p:last-child { max-width: 20rem; color: var(--muted); line-height: 1.6; }
.footer-foot { margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid var(--rule-soft); color: var(--muted); font-size: .85rem; }
.footer-foot a { color: var(--muted); }

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