/* Cal For Me — shared site styles
   Dark-first: :root carries the dark palette, light overrides follow. */

:root {
  /* Ground & surface — warm charcoal lifted from the app icon */
  --ground:       #14161A;
  --ground-deep:  #0C0E11;
  --surface:      #1B1E24;
  --surface-2:    #22262D;
  --line:         #2E333C;
  --line-soft:    #262A31;

  /* Ink */
  --ink:          #ECEAE4;
  --ink-dim:      #A2A9B4;
  --ink-faint:    #737B87;

  /* Accent — the crown */
  --gold:         #E8C15A;
  --gold-deep:    #C79E3A;
  --gold-wash:    rgba(232, 193, 90, 0.10);

  /* Semantic, borrowed from the app's own scoreboard */
  --gain:         #35C75F;
  --loss:         #F2565B;

  --shadow:       0 24px 60px -20px rgba(0, 0, 0, 0.65);
  --radius:       14px;

  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-body:    "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --measure:      66ch;
  --pad:          clamp(20px, 5vw, 48px);
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --ground:      #F6F4EF;
    --ground-deep: #EDEAE2;
    --surface:     #FFFFFF;
    --surface-2:   #F1EEE7;
    --line:        #DCD7CB;
    --line-soft:   #E7E3DA;
    --ink:         #16181C;
    --ink-dim:     #575D67;
    --ink-faint:   #838A95;
    --gold:        #9A7412;
    --gold-deep:   #7C5D0C;
    --gold-wash:   rgba(154, 116, 18, 0.09);
    --gain:        #1B8F41;
    --loss:        #C62B31;
    --shadow:      0 20px 48px -22px rgba(29, 25, 15, 0.35);
    color-scheme: light;
  }
}

:root[data-theme="light"] {
  --ground:      #F6F4EF;
  --ground-deep: #EDEAE2;
  --surface:     #FFFFFF;
  --surface-2:   #F1EEE7;
  --line:        #DCD7CB;
  --line-soft:   #E7E3DA;
  --ink:         #16181C;
  --ink-dim:     #575D67;
  --ink-faint:   #838A95;
  --gold:        #9A7412;
  --gold-deep:   #7C5D0C;
  --gold-wash:   rgba(154, 116, 18, 0.09);
  --gain:        #1B8F41;
  --loss:        #C62B31;
  --shadow:      0 20px 48px -22px rgba(29, 25, 15, 0.35);
  color-scheme: light;
}

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--gold); text-decoration-color: color-mix(in srgb, var(--gold) 45%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--gold); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.08; letter-spacing: -0.022em; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2.4rem, 6.2vw, 4.1rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); }
h3 { font-size: 1.14rem; letter-spacing: -0.012em; }
p  { margin: 0; }

.wrap { width: min(1120px, 100% - var(--pad) * 2); margin-inline: auto; }
.narrow { width: min(var(--measure), 100% - var(--pad) * 2); margin-inline: auto; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0;
}

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

.site-head {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--ground) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.site-head > div {
  display: flex; align-items: center; gap: 14px;
  padding-block: 13px;
}
.brand { display: flex; align-items: center; gap: 11px; font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; letter-spacing: -0.015em; color: var(--ink); text-decoration: none; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.site-nav { margin-left: auto; display: flex; gap: clamp(14px, 3vw, 28px); font-size: 0.93rem; }
.site-nav a { color: var(--ink-dim); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }

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

.hero { padding-block: clamp(56px, 9vw, 104px) clamp(40px, 6vw, 72px); position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -30% 0 auto 50%;
  width: 900px; height: 700px; transform: translateX(-50%);
  background: radial-gradient(closest-side, var(--gold-wash), transparent 72%);
  pointer-events: none;
}
.hero > div { position: relative; display: grid; gap: clamp(36px, 5vw, 60px); align-items: center; grid-template-columns: 1fr; }
@media (min-width: 900px) { .hero > div { grid-template-columns: 1.05fr 0.95fr; } }

.hero p.lede { color: var(--ink-dim); font-size: clamp(1.05rem, 1.6vw, 1.2rem); max-width: 46ch; margin-top: 20px; }
.hero .eyebrow { margin-bottom: 18px; }

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 30px; }
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-body); font-weight: 600; font-size: 0.96rem;
  padding: 12px 20px; border-radius: 999px; text-decoration: none;
  border: 1px solid transparent; transition: transform .15s ease, background .15s ease;
}
.btn-primary { background: var(--gold); color: #16130A; }
.btn-primary:hover { transform: translateY(-1px); background: color-mix(in srgb, var(--gold) 88%, #fff); }
.btn-ghost { border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--gold); }
.note { font-size: 0.85rem; color: var(--ink-faint); margin-top: 14px; }

/* ---------- scoreboard motif ---------- */

.board {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.board-head {
  display: flex; align-items: baseline; gap: 10px;
  padding: 15px 18px; border-bottom: 1px solid var(--line-soft);
  background: var(--surface-2);
}
.board-head strong { font-family: var(--font-display); font-size: 0.98rem; font-weight: 700; }
.board-head span { font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-faint); margin-left: auto; }
.board-scroll { overflow-x: auto; }
table.score { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 0.86rem; font-variant-numeric: tabular-nums; }
table.score th, table.score td { padding: 11px 14px; text-align: right; white-space: nowrap; }
table.score thead th { color: var(--ink-faint); font-weight: 500; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; border-bottom: 1px solid var(--line-soft); }
table.score tbody th, table.score th:first-child, table.score td:first-child { text-align: left; }
table.score tbody th { color: var(--ink-dim); font-weight: 500; }
table.score tbody tr + tr td, table.score tbody tr + tr th { border-top: 1px solid var(--line-soft); }
table.score tr.total th, table.score tr.total td { border-top: 1px solid var(--line); font-weight: 600; color: var(--ink); background: var(--gold-wash); }
.up { color: var(--gain); }
.down { color: var(--loss); }
.crown { color: var(--gold); }

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

section.band { padding-block: clamp(52px, 8vw, 92px); border-top: 1px solid var(--line-soft); }
section.band > .wrap > header { max-width: 56ch; margin-bottom: clamp(30px, 4vw, 46px); }
section.band > .wrap > header p { color: var(--ink-dim); margin-top: 14px; }
section.band > .wrap > header .eyebrow { margin-bottom: 14px; }

/* two-step flow */
.steps { display: grid; gap: clamp(24px, 3.4vw, 40px); grid-template-columns: 1fr; }
@media (min-width: 760px) { .steps { grid-template-columns: 1fr 1fr; } }
.step { margin: 0; display: grid; gap: 20px; align-content: start; }
.step figcaption { color: var(--ink-dim); font-size: 0.96rem; }
.step figcaption em { color: var(--ink); font-style: normal; font-weight: 600; }

/* Store screenshots arrive with their own dark ground and caption baked in, so
   they get depth and a radius but no frame — a light border would vanish
   against the image in dark mode and outline a dark slab in light mode. */
.shot { border-radius: 16px; box-shadow: var(--shadow); display: block; width: 100%; height: auto; }

/* feature grid */
.features { display: grid; gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; grid-template-columns: 1fr; }
@media (min-width: 620px) { .features { grid-template-columns: 1fr 1fr; } }
@media (min-width: 940px) { .features { grid-template-columns: repeat(3, 1fr); } }
.feature { background: var(--ground); padding: 26px 24px 28px; }
.feature h3 { margin-bottom: 9px; }
.feature p { color: var(--ink-dim); font-size: 0.94rem; }
.feature .k { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); display: block; margin-bottom: 12px; }

/* gallery */
.gallery { display: grid; gap: clamp(16px, 2.4vw, 30px); grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) { .gallery { grid-template-columns: repeat(3, 1fr); } }

/* faq */
.faq { display: grid; gap: 0; border-top: 1px solid var(--line-soft); }
.faq details { border-bottom: 1px solid var(--line-soft); }
.faq summary { cursor: pointer; padding: 19px 34px 19px 0; font-family: var(--font-display); font-weight: 600; font-size: 1.04rem; letter-spacing: -0.01em; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 17px; font-family: var(--font-mono); color: var(--gold); font-size: 1.2rem; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--ink-dim); font-size: 0.96rem; padding-bottom: 20px; max-width: var(--measure); }

/* ---------- document pages ---------- */

.doc { padding-block: clamp(44px, 6vw, 76px) clamp(56px, 8vw, 96px); }
.doc h1 { font-size: clamp(2rem, 4.6vw, 2.9rem); }
.doc .updated { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-faint); letter-spacing: 0.05em; margin-top: 16px; }
.doc h2 { font-size: 1.32rem; margin-top: 46px; margin-bottom: 12px; scroll-margin-top: 84px; }
.doc h3 { margin-top: 26px; margin-bottom: 8px; }
.doc p, .doc li { color: var(--ink-dim); font-size: 1rem; }
.doc p + p, .doc ul + p, .doc ol + p, .doc p + ul, .doc p + ol { margin-top: 14px; }
.doc ul, .doc ol { margin: 14px 0 0; padding-left: 22px; display: grid; gap: 9px; }
.doc strong { color: var(--ink); font-weight: 600; }
.doc hr { border: 0; border-top: 1px solid var(--line-soft); margin: 42px 0; }

.callout {
  background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 4px var(--radius) var(--radius) 4px;
  padding: 22px 24px; margin-top: 30px;
}
.callout h2 { margin-top: 0; font-size: 1.05rem; }
.callout ul { margin-top: 12px; }
.callout li { font-size: 0.95rem; }

.toc { margin-top: 34px; padding: 20px 22px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--surface); }
.toc p { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.13em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 12px; }
.toc ol { margin: 0; padding-left: 20px; gap: 6px; }
.toc a { font-size: 0.94rem; }

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

.site-foot { border-top: 1px solid var(--line-soft); padding-block: 40px 52px; background: var(--ground-deep); }
.site-foot > div { display: flex; flex-wrap: wrap; gap: 20px 30px; align-items: center; }
.site-foot p { color: var(--ink-faint); font-size: 0.87rem; }
.site-foot nav { margin-left: auto; display: flex; flex-wrap: wrap; gap: 20px; font-size: 0.9rem; }
.site-foot nav a { color: var(--ink-dim); text-decoration: none; }
.site-foot nav a:hover { color: var(--gold); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
