/* Tally's website (Phase 8). Tokens from docs/DESIGN.md: board and chalk, one teal accent, red only for "live".
   Dark first; light follows the visitor's setting. System fonts only (Phase 8 Q5). */

:root {
  color-scheme: dark light;
  --bg: #0e0f11;
  --card: #1a1b1f;
  --ink: #f7f5ef;
  --ink2: #9a9890;
  --sep: rgba(247, 245, 239, 0.09);
  --fill: rgba(247, 245, 239, 0.11);
  --teal: #4597b2;
  --accent: #6fb8cf;
  --live: #ff5a4e;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  --rounded: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --text: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: 16px;
  --max: 1080px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f5ef;
    --card: #ffffff;
    --ink: #0e0f11;
    --ink2: #5e5b54;
    --sep: rgba(14, 15, 17, 0.08);
    --fill: rgba(14, 15, 17, 0.07);
    --accent: #2b6f86;
    --live: #d63a2f;
    --shadow: 0 30px 70px rgba(14, 15, 17, 0.16);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.55 var(--text);
  -webkit-font-smoothing: antialiased;
}

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

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

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

.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--gutter); top: 12px; background: var(--card); padding: 8px 12px; z-index: 10; }

/* Header: mark + lowercase wordmark */
header.site {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 22px; padding-bottom: 22px;
}
.lockup { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.lockup svg { width: 34px; height: auto; }
.wordmark { font: 800 28px/1 var(--rounded); letter-spacing: -1px; }
nav.site { display: flex; gap: 22px; font-size: 15px; }
nav.site a { color: var(--ink2); text-decoration: none; }
nav.site a:hover, nav.site a[aria-current="page"] { color: var(--ink); }

/* Hero */
.hero { text-align: center; padding-top: 64px; padding-bottom: 80px; }
.hero .mark { width: 96px; margin: 0 auto 18px; }
.hero h1 { font: 800 clamp(44px, 9vw, 76px)/1 var(--rounded); letter-spacing: -2px; margin: 0; }
.hero .tagline { font: 700 clamp(22px, 4vw, 30px)/1.2 var(--rounded); margin: 18px 0 8px; letter-spacing: -0.4px; }
.hero .lede { color: var(--ink2); max-width: 520px; margin: 0 auto; font-size: 19px; }
.visually-hidden, .hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* "Coming soon" and the beta form */
.badge {
  display: inline-flex; align-items: center; gap: 8px; margin: 32px 0 0;
  background: var(--fill); color: var(--ink); font: 600 14px/1 var(--text);
  padding: 9px 14px; border-radius: 999px; letter-spacing: 0.2px;
}
.badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }
@media (prefers-reduced-motion: no-preference) {
  .badge .dot { animation: pulse 2s ease-in-out infinite; }
  @keyframes pulse { 50% { opacity: 0.35; } }
}
.beta {
  display: flex; gap: 10px; justify-content: center; margin: 18px auto 0; max-width: 460px;
}
.beta input[type="email"] {
  flex: 1; min-width: 0; min-height: 50px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--sep); background: var(--card); color: var(--ink); font: 17px var(--text);
}
.beta input[type="email"]::placeholder { color: var(--ink2); }
.beta button {
  min-height: 50px; padding: 0 22px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--teal); color: #0e0f11; font: 700 16px var(--text); white-space: nowrap;
}
.beta button:hover { filter: brightness(1.08); }
.fine { color: var(--ink2); font-size: 14px; margin: 12px auto 0; max-width: 420px; }
@media (max-width: 440px) {
  .beta { flex-direction: column; }
}

/* Phone screens */
.phone {
  width: min(300px, 78vw); margin: 0 auto; border-radius: 44px; overflow: hidden;
  box-shadow: var(--shadow), 0 0 0 1px var(--sep); background: var(--card);
}
.phone img { width: 100%; height: auto; }
.hero .phone { margin-top: 48px; }

/* Feature rows: text beside a screen, alternating on wide screens */
.feature {
  display: grid; gap: 36px; align-items: center; padding: 72px 0;
  border-top: 0.5px solid var(--sep);
}
.feature h2 { font: 800 clamp(28px, 4.5vw, 40px)/1.1 var(--rounded); letter-spacing: -1px; margin: 0 0 14px; }
.feature p { color: var(--ink2); margin: 0 0 12px; max-width: 460px; }
.feature .eyebrow { font: 600 13px/1 var(--text); letter-spacing: 0.6px; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.feature ul { color: var(--ink2); padding-left: 20px; margin: 0; max-width: 460px; }
.feature li { margin: 4px 0; }
.live { color: var(--live); font-weight: 600; }
.live::before { content: "● "; font-size: 0.8em; }

@media (min-width: 820px) {
  .feature { grid-template-columns: 1fr 1fr; gap: 64px; padding: 96px 0; }
  .feature.flip .copy { order: 2; }
}

/* Lock Screen pieces: the Live Activity and the widget */
.stack { display: grid; gap: 22px; justify-items: center; }
.stack img { width: min(420px, 92vw); height: auto; border-radius: 22px; box-shadow: var(--shadow); }

/* Text pages */
.page { max-width: 720px; padding-top: 24px; padding-bottom: 64px; }
.page h1 { font: 800 clamp(36px, 7vw, 52px)/1.05 var(--rounded); letter-spacing: -1.5px; margin: 24px 0 8px; }
.page .updated { color: var(--ink2); margin: 0 0 32px; font-size: 15px; }
.page h2 { font: 700 23px/1.25 var(--rounded); margin: 40px 0 10px; letter-spacing: -0.3px; }
.page p, .page li { color: var(--ink); }
.page ul { padding-left: 22px; }
.page li { margin: 6px 0; }
.card { background: var(--card); border-radius: 20px; padding: 6px 20px; box-shadow: 0 0 0 0.5px var(--sep); }
.card p { color: var(--ink2); }

details { border-top: 0.5px solid var(--sep); padding: 14px 0; }
details:first-child { border-top: 0; }
summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--ink2); font-weight: 400; }
details[open] summary::after { content: "–"; }
details p { margin: 8px 0 0; }

/* Footer */
footer.site { border-top: 0.5px solid var(--sep); padding-top: 28px; padding-bottom: 44px; color: var(--ink2); font-size: 14px; }
footer.site .row { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; }
footer.site a { color: var(--ink2); }
footer.site p { margin: 6px 0 0; }

@media (prefers-reduced-motion: no-preference) {
  .phone, .stack img { transition: transform 0.4s ease; }
  .phone:hover { transform: translateY(-4px); }
}
