/* ════════════════════════════════════════════════════════════════════════
   landing.css — the tirolog.app front page (store/index.html)

   Mobile first; from 900px wide each block puts text and picture side by
   side. Colours, radii and type follow the app (css/main/design-tokens.css):
   the landing only exists in the app's dark look, which is the brand's.
   ⛔ Nothing is loaded from another domain (tests/unit-landing.test.js): the
   type is the app's (Oswald and Inter), served from store/fonts/.
   Motion is decoration only and stops under prefers-reduced-motion.
   ════════════════════════════════════════════════════════════════════════ */

/* The app's two typefaces, served from here (store/fonts/README.txt). */
@font-face {
  font-family: "Oswald"; font-style: normal; font-weight: 200 700; font-display: swap;
  src: url("fonts/oswald-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2");
}

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

:root {
  --bg: #0d0d0d;
  --surface: #161616;
  --surface-2: #1d1d1d;
  --gold: #c8a84b;
  --gold-dim: #a8893a;
  --gold-glow: rgba(200, 168, 75, 0.16);
  --gold-line: rgba(200, 168, 75, 0.22);
  --accent-fg: #0d0d0d;
  --text: #f0ede8;
  /* Same as --text on purpose (design-tokens.css: halation on dark). The
     secondary colour below is for small print only and measures 7.6:1. */
  --text-dim: #f0ede8;
  --muted: #b3aea6;
  --border: rgba(255, 255, 255, 0.08);
  /* Effects, as tokens so the light theme can swap them all at once. */
  --gold-light: #ecd593;
  --gold-soft: rgba(200, 168, 75, 0.08);
  --btn-shadow: rgba(200, 168, 75, 0.55);
  --header-bg: rgba(13, 13, 13, 0.82);
  --ring: rgba(200, 168, 75, 0.07);
  --edge-hi: rgba(200, 168, 75, 0.45);
  --edge-lo: rgba(255, 255, 255, 0.06);
  --shadow: rgba(0, 0, 0, 0.85);
  /* Device frames and their screens stay dark in both themes: they are phones. */
  --frame-a: #2a2a2a;
  --frame-b: #121212;
  --frame-edge: rgba(255, 255, 255, 0.1);
  --screen: #161616;
  --radius: 14px;
  --radius-sm: 10px;
  --content: 1120px;
  --font-head: "Oswald", "Bahnschrift", "Roboto Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --z-base: 1;
  --z-sticky: 10;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ── Light theme (the header's sun button) — the app's light values
   (css/main/design-tokens.css). Dark stays the default: it is the brand. ── */
:root[data-theme="light"] {
  --bg: #f5f3ee;
  --surface: #ffffff;
  --surface-2: #faf8f3;
  --gold: #846b1e;
  --gold-dim: #6f5918;
  --gold-glow: rgba(132, 107, 30, 0.12);
  --gold-line: rgba(132, 107, 30, 0.35);
  --accent-fg: #ffffff;
  --text: #1a1a1a;
  --text-dim: #2b2824;
  --muted: #4a453e;
  --border: rgba(0, 0, 0, 0.10);
  --gold-light: #b8962f;
  --gold-soft: rgba(132, 107, 30, 0.08);
  --btn-shadow: rgba(132, 107, 30, 0.35);
  --header-bg: rgba(245, 243, 238, 0.86);
  --ring: rgba(132, 107, 30, 0.10);
  --edge-hi: rgba(132, 107, 30, 0.45);
  --edge-lo: rgba(0, 0, 0, 0.06);
  --shadow: rgba(0, 0, 0, 0.28);
  --frame-edge: rgba(0, 0, 0, 0.25);
}

/* Theme switch: sun and moon, the active one lit. */
.theme-switch { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.theme-switch button {
  width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent;
  display: grid; place-items: center; color: var(--muted); cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.theme-switch button svg { width: 18px; height: 18px; }
.theme-switch button[aria-pressed="true"] { background: var(--gold); color: var(--accent-fg); }
.theme-switch button:hover:not([aria-pressed="true"]) { color: var(--gold); }
.top-right { display: flex; align-items: center; gap: 8px; }
@media (pointer: coarse) { .theme-switch button { width: 44px; height: 44px; } }
/* Language picker: same pill as the theme switch, a native select inside so
   phones get their own list. */
.lang-switch {
  position: relative; display: inline-flex; align-items: center; height: 48px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  color: var(--muted); cursor: pointer;
}
.lang-switch svg { position: absolute; left: 12px; width: 18px; height: 18px; pointer-events: none; }
.lang-switch select {
  appearance: none; -webkit-appearance: none; border: 0; background: transparent;
  height: 100%; padding: 0 16px 0 36px; border-radius: 999px;
  font: 600 14px/1 var(--font-body); letter-spacing: .04em; color: var(--text); cursor: pointer;
}
.lang-switch:hover { color: var(--gold); }
.lang-switch select:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.lang-switch select option { color: var(--text); background: var(--surface); }
@media (pointer: coarse) { .lang-switch { height: 52px; } .lang-switch select { font-size: 16px; } }

html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
img[hidden] { display: none; }
a { color: var(--gold); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--content); margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Type ───────────────────────────────────────────────────────────── */
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; letter-spacing: .01em; line-height: 1.15; }
h1 { font-size: clamp(28px, 7vw, 50px); }
h2 { font-size: clamp(24px, 5vw, 36px); margin-bottom: 14px; }
h3 { font-size: 20px; }
.eyebrow {
  font-family: var(--font-head);
  font-size: 13px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}
.lead { font-size: clamp(16px, 2.4vw, 19px); color: var(--text-dim); max-width: 36em; }
.gold-text {
  background: linear-gradient(100deg, var(--gold) 0%, var(--gold-light) 45%, var(--gold) 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ── Buttons (same shape as the app's .btn-primary) ────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--gold);
  color: var(--accent-fg);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .05em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 14px 30px;
  min-height: 48px;
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 24px -8px var(--btn-shadow);
  transition: background .2s ease, box-shadow .2s ease;
  cursor: pointer;
}
.btn:hover { background: var(--gold-dim); box-shadow: 0 8px 28px -8px var(--btn-shadow); }

/* ── Header ─────────────────────────────────────────────────────────── */
/* Sticky, translucent header: the section links stay at hand while reading. */
.top {
  position: sticky; top: 0; z-index: var(--z-sticky);
  padding: 12px 0;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.top-nav { display: none; gap: 4px; }
.top-nav a {
  color: var(--muted); text-decoration: none; font-size: 15px;
  padding: 10px 12px; min-height: 44px; display: inline-flex; align-items: center; border-radius: 8px;
  transition: color .2s ease, background .2s ease;
}
.top-nav a:hover { color: var(--gold); background: var(--gold-soft); }
section[id] { scroll-margin-top: 76px; }
@media (min-width: 900px) { .top-nav { display: flex; } }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand img { width: 36px; height: 36px; }
.brand span { font-family: var(--font-head); font-size: 22px; font-weight: 600; letter-spacing: .03em; }

/* ── Hero ───────────────────────────────────────────────────────────── */
.hero { position: relative; padding: 8px 0 36px; overflow: hidden; }
/* The target: soft gold glow and faint concentric rings behind the phone. */
.hero::before {
  content: "";
  /* Anchored to the CONTENT, not the window: a plain -30% of the window's width
     pushed the rings off-screen on a wide maximized window. On narrow windows
     both terms agree; on wide ones the second keeps them behind the phone. */
  position: absolute; top: -20%; bottom: auto; left: auto;
  right: max(-30%, calc((100% - var(--content)) / 2 - 200px));
  width: 760px; height: 760px;
  background:
    radial-gradient(circle, var(--gold-glow) 0%, transparent 60%),
    repeating-radial-gradient(circle, transparent 0 46px, var(--ring) 46px 47px);
  mask-image: radial-gradient(circle, #000 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(circle, #000 30%, transparent 70%);
  pointer-events: none;
}
.hero-grid { position: relative; display: grid; gap: 36px; align-items: center; }
.hero h1 { margin: 6px 0 16px; }
.hero .lead { margin-bottom: 26px; }
.support { margin-top: 18px; font-size: 14px; color: var(--muted); }
.support a { display: inline-block; padding: 12px 4px; min-height: 44px; text-decoration: none; }
.support a:hover { text-decoration: underline; }

/* The install block that was already here: only its look (the logic stays in
   the page script). What is offered depends on body.m-*. */
.install { max-width: 420px; }
.acc { display: none; }
body.m-movil .acc-movil, body.m-pc .acc-pc, body.m-abrir .acc-abrir, body.m-pronto .acc-pronto { display: block; }
.acc-pc { display: none; }
body.m-pc .acc-pc { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
/* Already installed here: «Open» first, and below it the QR to install it on
   another device (Santi, 2026-10-12: a club's computer, then the phone). */
body.m-abrir .acc-pc { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-top: 22px; }
/* Its label is long: it wraps instead of widening the page on a phone. */
.acc-abrir .btn { white-space: normal; text-align: center; line-height: 1.3; max-width: 100%; }
.acc-pc .qr-otro, body.m-abrir .acc-pc .qr-nuevo, body.m-abrir .acc-pc .btn { display: none; }
body.m-abrir .acc-pc .qr-otro { display: block; margin-bottom: 0; }
.acc-pc .qr { width: 132px; height: 132px; flex: none; background: #fff; border-radius: var(--radius-sm); padding: 8px; }
.acc-pc .qr svg { width: 100%; height: 100%; display: block; }
.acc-pc .qr-side { flex: 1 1 200px; }
.acc-pc p { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.acc-pronto { color: var(--gold); font-weight: 500; }

/* ── Device frames: generic, drawn here, no brand shapes ───────────── */
.device {
  position: relative;
  margin: 0 auto;
  background: linear-gradient(145deg, var(--frame-a), var(--frame-b) 60%);
  border: 1px solid var(--frame-edge);
  box-shadow: 0 30px 60px -20px var(--shadow), 0 0 0 1px var(--gold-soft), inset 0 1px 0 rgba(255, 255, 255, .08);
}
/* The SCREEN carries the proportion, not the frame: the captures are 9:16
   (819×1456) and a 9:19 frame cut their sides —the totals of the
   classification came out halved— (2026-09-30). */
.phone { width: min(280px, 78vw); border-radius: 38px; padding: 10px; }
.screen {
  position: relative; width: 100%; aspect-ratio: 819 / 1456;
  border-radius: 29px; overflow: hidden;
  background: var(--screen);
}
.screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }
/* Placeholder until the real picture is in place (see the page script). */
.shot-label {
  position: absolute; inset: 12px;
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--gold-line); border-radius: 12px;
  font-family: var(--font-head); letter-spacing: .12em; color: #c8a84b; /* on the dark screen in both themes */ font-size: 15px;
}
/* The hero phone rises once into place (no endless motion: it distracts). */
.hero .device { animation: rise .9s var(--ease) both .15s; }
@keyframes rise { from { opacity: 0; transform: translateY(24px) rotate(-2deg); } to { opacity: 1; transform: none; } }

/* ── Sections ───────────────────────────────────────────────────────── */
/* Phone: about 75px between the end of one section and the next; the
   separator line sits a little nearer the block that starts. */
.section { padding: 28px 0 44px; position: relative; }
.section + .section { border-top: 1px solid var(--border); }
.split { display: grid; gap: 28px; align-items: center; }
.split > .text { max-width: 560px; }
.points { list-style: none; margin-top: 18px; display: grid; gap: 12px; }
.points li { position: relative; padding-left: 30px; color: var(--text-dim); }
.points li::before {
  content: ""; position: absolute; left: 0; top: .5em;
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--gold);
  box-shadow: inset 0 0 0 3px var(--bg), inset 0 0 0 7px var(--gold);
}

/* Three pillars */
.pillars { display: grid; gap: 14px; }
.pillar {
  position: relative;
  background: linear-gradient(var(--surface), var(--surface)) padding-box,
              linear-gradient(140deg, var(--edge-hi), var(--edge-lo) 45%, var(--edge-lo)) border-box;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 22px 20px;
  display: flex; gap: 16px; align-items: flex-start;
  transition: background .25s ease;
}
.pillar:hover { background: linear-gradient(var(--surface-2), var(--surface-2)) padding-box,
  linear-gradient(140deg, var(--gold), var(--edge-lo) 45%, var(--edge-lo)) border-box; }
.pillar svg { flex: none; width: 28px; height: 28px; color: var(--gold); }
.pillar h3 { margin-bottom: 4px; }
.pillar p { color: var(--muted); font-size: 15px; }

/* Before / during / after: a step marker over each block */
.step-mark {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-head); color: var(--gold); letter-spacing: .14em; text-transform: uppercase; font-size: 13px;
  margin-bottom: 10px;
}
.step-mark b {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--gold-line); background: var(--gold-glow); font-weight: 600; letter-spacing: 0;
}

/* Closing call */
.closing { text-align: center; }
.closing .card {
  max-width: 640px; margin: 0 auto;
  background: radial-gradient(120% 90% at 50% 0%, var(--gold-glow), transparent 70%), var(--surface);
  border: 1px solid var(--gold-line); border-radius: var(--radius);
  padding: 40px 22px;
}
.closing .install { margin: 22px auto 0; }
body.m-pc .closing .acc-pc, body.m-abrir .closing .acc-pc { justify-content: center; text-align: left; }

/* Footer */
.foot { padding: 28px 0 40px; border-top: 1px solid var(--border); font-size: 14px; color: var(--muted); }
.foot nav { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-bottom: 8px; }
.foot a { color: var(--muted); text-decoration: none; display: inline-block; padding: 12px 10px; min-height: 44px; }
.foot a:hover { color: var(--gold); }

/* ── Reveal on scroll: only when the script is running (html.js) ────── */
html.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
html.js .reveal.in { opacity: 1; transform: none; }

/* ── Wider screens ──────────────────────────────────────────────────── */
@media (min-width: 900px) {
  .top { padding: 26px 0; }
  .hero { padding: 24px 0 48px; }
  .hero-grid { grid-template-columns: 1.1fr .9fr; gap: 56px; }
  .section { padding: 64px 0; }
  .split { grid-template-columns: 1fr 1fr; gap: 64px; }
  .split.flip > .text { order: 2; }
  .split.wide { grid-template-columns: .8fr 1.2fr; }
  .split.wide.flip { grid-template-columns: 1.2fr .8fr; }
  .pillars { grid-template-columns: repeat(3, 1fr); gap: 18px; }
  .pillar { flex-direction: column; padding: 26px 24px; }
}

@media (pointer: coarse) { .support a, .foot a { padding: 12px 12px; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero .device { animation: none; }
  html.js .reveal { opacity: 1; transform: none; transition: none; }
  * { transition: none !important; }
}

/* Closing lead centred; hero phone smaller on phones so it starts showing on
   the first screen, under the install button. */
.closing .lead { margin: 0 auto; }
@media (max-width: 899px) { .hero .phone { width: min(230px, 64vw); } }
.install { max-width: 480px; }
.btn { white-space: nowrap; }
