/* WristTales — one shared stylesheet for wristtales.com.
   Loaded by BOTH pages:
     /index.html        → this file only
     /binder/index.html → this file + binder/styles.css (deltas only)
   Everything below is common ground: tokens, base type, the shared header
   (brand + product switch + lang/theme), buttons, figures, CTA, footer. */

:root {
  --bg: #faf9f7;
  --ink: #161513;
  --muted: #6f6b63;
  --faint: #8f8b83;
  --line: #e7e4de;
  --accent: #D4842A;
  --card: #ffffff;
  --cta-bg: #0A0E16;
  --cta-ink: #ffffff;
  --cta-muted: #8B94A6;
  --shadow: 0 1px 2px rgba(22, 21, 19, .04), 0 24px 48px -24px rgba(22, 21, 19, .18);

  --font: "Archivo", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --font-accent: "Instrument Serif", "Iowan Old Style", Georgia, "Times New Roman", serif;
  /* legacy aliases used by binder/styles.css */
  --sans: var(--font);
  --serif-font: var(--font-accent);

  --wrap: 1120px;
  --gutter: 24px;
}

/* Dark by system preference (no explicit choice stored) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A0E16;
    --ink: #ffffff;
    --muted: #8B94A6;
    --faint: #5C6577;
    --line: rgba(255, 255, 255, .09);
    --accent: #E9A23B;
    --card: #161B26;
    --cta-bg: #161B26;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 24px 48px -24px rgba(0, 0, 0, .7);
  }
}

/* Explicit choice always wins, in both directions */
:root[data-theme="dark"] {
  --bg: #0A0E16;
  --ink: #ffffff;
  --muted: #8B94A6;
  --faint: #5C6577;
  --line: rgba(255, 255, 255, .09);
  --accent: #E9A23B;
  --card: #161B26;
  --cta-bg: #161B26;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 24px 48px -24px rgba(0, 0, 0, .7);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: #E9A23B; color: #161513; }

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

a { color: inherit; }

h1, h2, h3 { font-weight: 600; letter-spacing: -.02em; line-height: 1.08; margin: 0; }

p { margin: 0; }

/* .accent (iOS page) and .serif (Binder page) are the same display italic */
.accent, .serif {
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -.01em;
  color: var(--accent);
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--card); color: var(--ink);
  padding: 12px 18px; border-radius: 0 0 10px 0; text-decoration: none;
}
.skip:focus { left: 0; }

:where(a, button):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* no-JS: both pages ship rendered in Czech; hide the controls that cannot work */
html.no-js .js-only { display: none; }

/* ---------- shared header ---------- */

.site-head {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(150%) blur(12px);
  -webkit-backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.head-inner {
  display: flex; align-items: center; gap: 16px;
  min-height: 68px; flex-wrap: wrap;
  padding-block: 10px;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; flex: 0 0 auto;
}
.brand-mark { width: 30px; height: 30px; border-radius: 8px; }
.brand-text { font-size: 15px; letter-spacing: -.01em; white-space: nowrap; }
.brand-text strong, .brand-text b { font-weight: 600; }
.brand-by { color: var(--faint); font-weight: 400; }

/* the two-app switch — the one control that says "there are two of us" */
.switch {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 3px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--card);
  flex: 0 0 auto;
}
.switch a {
  display: inline-flex; align-items: center;
  padding: 5px 13px; border-radius: 999px;
  font-size: 13px; font-weight: 500; letter-spacing: -.01em;
  color: var(--muted); text-decoration: none; white-space: nowrap;
  transition: background .18s ease, color .18s ease;
}
.switch a:hover { color: var(--ink); }
.switch a[aria-current="page"] {
  background: var(--ink); color: var(--bg);
}

.nav { display: flex; gap: 22px; font-size: 14.5px; margin-left: auto; }
.nav a { color: var(--muted); text-decoration: none; transition: color .18s ease; }
.nav a:hover { color: var(--ink); }

.head-tools { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }

.pill {
  display: inline-flex; align-items: center;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 2px; background: var(--card); flex: 0 0 auto;
}
.pill-btn {
  appearance: none; border: 0; background: transparent;
  font: inherit; font-size: 12px; font-weight: 500; letter-spacing: .04em;
  color: var(--faint); cursor: pointer;
  padding: 4px 9px; border-radius: 999px;
  transition: background .18s ease, color .18s ease;
}
.pill-btn:hover { color: var(--ink); }
.pill-btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

.theme-btn {
  appearance: none; cursor: pointer;
  width: 32px; height: 32px; flex: 0 0 32px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card);
  color: var(--muted); font-size: 14px; line-height: 1;
  display: grid; place-items: center;
  transition: color .18s ease, border-color .18s ease;
}
.theme-btn:hover { color: var(--ink); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: 999px;
  border: 1px solid transparent;
  background: var(--ink); color: var(--bg);
  font-size: 15px; font-weight: 500; letter-spacing: -.01em;
  text-decoration: none; white-space: nowrap;
  transition: transform .18s ease, opacity .18s ease, color .18s ease, border-color .18s ease;
}
.btn:hover { transform: translateY(-1px); opacity: .9; }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-sm { padding: 8px 15px; font-size: 13.5px; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--muted); }
.btn-gold { background: var(--accent); color: #161513; }

.actions, .hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* ---------- hero ---------- */

.hero { padding-block: clamp(48px, 8vw, 104px) clamp(40px, 6vw, 72px); }

.hero-grid {
  display: grid; grid-template-columns: 1fr; gap: clamp(40px, 6vw, 72px);
  align-items: center;
}
.hero-copy { min-width: 0; }

.kicker {
  font-size: 12.5px; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--faint); margin-bottom: 24px;
}

h1 {
  font-size: clamp(38px, 8.2vw, 62px);
  max-width: 15ch;
}
h1 .accent, h1 .serif { font-size: 1.08em; }

.lede {
  margin-top: 24px; max-width: 46ch;
  font-size: clamp(16px, 2.2vw, 18.5px);
  color: var(--muted);
}

.note, .hero-note { margin-top: 16px; font-size: 13.5px; color: var(--faint); }

/* ---------- device frame + screenshot placeholder (iOS page) ---------- */

.shot { margin: 0; }

.phone {
  position: relative;
  width: 100%; max-width: 300px;
  margin-inline: auto;
  aspect-ratio: 1170 / 2532;
  border-radius: 40px;
  padding: 9px;
  background: linear-gradient(160deg, var(--line), color-mix(in srgb, var(--line) 45%, var(--card)));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.phone-island {
  position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
  width: 30%; height: 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 78%, transparent);
  z-index: 2;
}

.phone-screen {
  position: relative; overflow: hidden;
  width: 100%; height: 100%;
  border-radius: 32px;
  background:
    radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    var(--card);
}

/* the real screenshot sits on top of the placeholder; JS hides it if the file is absent */
.shot-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 1;
  font-size: 13px; color: var(--muted); /* readable if the file is missing and JS is off */
}
.shot-img.is-missing { display: none; }

.shot-ph {
  position: absolute; inset: 0; z-index: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
  text-align: center; padding: 20px;
}
.shot-ph-mark {
  font-family: var(--font-accent); font-style: italic;
  font-size: 40px; line-height: 1; color: var(--accent); opacity: .75;
}
.shot-ph-text {
  font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--faint);
}

.shot figcaption {
  margin-top: 16px; text-align: center;
  font-size: 14px; color: var(--muted);
}

.hero-shot .phone { max-width: 320px; }

/* ---------- flat screenshot frame (Binder shots, and the bridge on /) ---------- */

.frame {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--card);
  box-shadow: 0 30px 70px -34px rgba(10, 14, 22, .55);
}
.frame img { display: block; width: 100%; }

.hero-shot figure { margin: 0; }
.hero-shot figcaption {
  margin-top: 16px; font-size: 13px; color: var(--faint); max-width: 62ch;
}

/* ---------- techs strip ---------- */

.techs { border-block: 1px solid var(--line); }
.techs-inner {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px;
  padding-block: 18px;
  font-size: 13.5px;
}
.techs-label {
  font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
  font-size: 11.5px; color: var(--faint);
}
.techs-list { color: var(--muted); }

/* ---------- bands / sections ---------- */

.band { padding-block: clamp(56px, 9vw, 112px); }
.band-alt { background: color-mix(in srgb, var(--ink) 3%, var(--bg)); border-block: 1px solid var(--line); }

.eyebrow {
  font-size: 12px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--faint); margin-bottom: 18px;
}
.eyebrow b { color: var(--accent); font-weight: 500; }

.section-title {
  font-size: clamp(28px, 5vw, 44px);
  max-width: 18ch;
  margin-bottom: clamp(36px, 5vw, 60px);
}
.section-title .accent, .section-title .serif { font-size: 1.08em; }

.steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 32px;
  grid-template-columns: 1fr;
}
.step { border-top: 1px solid var(--line); padding-top: 20px; }
.step-num, .step .num {
  font-family: var(--font-accent); font-style: italic;
  font-size: 22px; color: var(--accent); margin-bottom: 8px;
}
.step h3 { font-size: 19px; margin-bottom: 10px; }
.step p { color: var(--muted); font-size: 15.5px; }

.feats {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 28px 48px;
  grid-template-columns: 1fr;
}
.feats li { border-top: 1px solid var(--line); padding-top: 18px; }
.feats h3 { font-size: 17.5px; margin-bottom: 8px; }
.feats p { color: var(--muted); font-size: 15.5px; }

.shots {
  display: grid; gap: 36px 24px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.shots .phone { max-width: 240px; }

.crosslink { margin-top: clamp(28px, 4vw, 40px); font-size: 15px; }
.crosslink a {
  color: var(--muted); text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: color .18s ease, border-color .18s ease;
}
.crosslink a:hover { color: var(--ink); border-color: var(--accent); }

.duo { display: grid; gap: 24px; grid-template-columns: 1fr; }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 20px; padding: 28px;
}
.card h3 { font-size: 19px; margin-bottom: 12px; }
.card p { color: var(--muted); font-size: 15.5px; }

/* ---------- the bridge to the other app ---------- */

.bridge-grid {
  display: grid; grid-template-columns: 1fr; gap: clamp(32px, 5vw, 56px);
  align-items: center;
}
.bridge-copy { min-width: 0; }
.bridge-copy .section-title { margin-bottom: 24px; }
.bridge-copy p { color: var(--muted); font-size: 16.5px; max-width: 48ch; }
.bridge-shot figure { margin: 0; }
.bridge-shot figcaption {
  margin-top: 14px; font-size: 13px; color: var(--faint);
}

/* ---------- CTA ---------- */

.cta { background: var(--cta-bg); color: var(--cta-ink); }
.cta-inner { padding-block: clamp(64px, 10vw, 128px); text-align: center; }
.cta-mark { width: 52px; height: 52px; border-radius: 14px; margin: 0 auto 28px; }
.cta-title { font-size: clamp(30px, 6vw, 52px); max-width: 16ch; margin-inline: auto; }
.cta-title .accent, .cta-title .serif { color: var(--accent); font-size: 1.08em; }
.cta-lede { margin-top: 20px; color: var(--cta-muted); font-size: 16.5px; }
.cta .actions { justify-content: center; }
.cta-note { margin-top: 18px; font-size: 13px; color: var(--cta-muted); }

/* the reverse bridge line inside a dark CTA */
.cta-bridge { margin-top: 22px; font-size: 15px; }
.cta-bridge a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
  text-underline-offset: 4px;
  transition: text-decoration-color .18s ease;
}
.cta-bridge a:hover { text-decoration-color: var(--accent); }

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

.site-foot { border-top: 1px solid var(--line); }
.foot-inner {
  display: flex; flex-wrap: wrap; gap: 12px 28px;
  align-items: center; justify-content: space-between;
  padding-block: 32px;
  font-size: 13.5px; color: var(--faint);
}
.foot-nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.foot-nav a { color: var(--muted); text-decoration: none; }
.foot-nav a:hover { color: var(--ink); }

/* ---------- responsive ---------- */

@media (min-width: 700px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
  .feats { grid-template-columns: repeat(2, 1fr); }
  .duo { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 940px) {
  .hero-grid { grid-template-columns: 1.05fr .95fr; }
  .hero-shot { justify-self: end; width: 100%; }
  .bridge-grid { grid-template-columns: .95fr 1.05fr; }
}

@media (max-width: 760px) {
  .head-inner { row-gap: 10px; }
  .switch { order: 2; }
  .nav {
    order: 3; width: 100%; margin-left: 0; gap: 16px;
    overflow-x: auto; padding-bottom: 2px;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .head-tools { margin-left: auto; }
}

@media (max-width: 620px) {
  .brand-by { display: none; }
  /* the hero and the closing band both carry the same CTA — drop the header copy */
  .head-tools .btn-sm { display: none; }
}

@media (max-width: 420px) {
  :root { --gutter: 20px; }
  .head-inner { gap: 10px; }
  .head-tools { gap: 8px; }
  .brand-text { font-size: 14px; }
  .switch { order: 2; width: 100%; justify-content: center; }
  .switch a { flex: 1 1 0; justify-content: center; padding-inline: 8px; }
  .actions .btn, .hero-actions .btn { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .btn:hover { transform: none; }
}
