/* ttrk.app landing.
   One bold thing: the logo's week on the first screen, filling up and
   turning approved. Everything else stays quiet: graphite neutrals from the
   app, teal only where something is approved or in focus. */

:root {
  --bg: #faf9f8;          /* app --background 30 8% 98% */
  --surface: #ffffff;
  --ink: #1c1a17;         /* app --foreground 30 8% 10% */
  --muted: #69645d;
  --line: #e6e3df;
  --cell: #2b2926;        /* the mark's graphite */
  --cell-faint: rgb(43 41 38 / 0.14);
  --teal: #1d916c;        /* chart teal, light */
  --button: #2b2926;
  --button-ink: #faf9f8;
  --error: #b42318;
  --shadow: 0 1px 2px rgb(28 26 23 / 0.06), 0 12px 32px -12px rgb(28 26 23 / 0.18);
  --radius: 10px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* a faint tint, not a card: separates alternating sections without a hard line */
  --band: color-mix(in srgb, var(--ink) 4%, var(--bg));
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161413;
    --surface: #1f1d1b;
    --ink: #f3f2f1;
    --muted: #a7a19a;
    --line: #2f2c29;
    --cell: #ecebe9;
    --cell-faint: rgb(236 235 233 / 0.16);
    --teal: #27b084;
    --button: #ecebe9;
    --button-ink: #161413;
    --error: #f97066;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 16px 40px -16px rgb(0 0 0 / 0.6);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #161413;
  --surface: #1f1d1b;
  --ink: #f3f2f1;
  --muted: #a7a19a;
  --line: #2f2c29;
  --cell: #ecebe9;
  --cell-faint: rgb(236 235 233 / 0.16);
  --teal: #27b084;
  --button: #ecebe9;
  --button-ink: #161413;
  --error: #f97066;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 16px 40px -16px rgb(0 0 0 / 0.6);
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}

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

h1, h2, h3 { margin: 0; text-wrap: balance; }
h2 { font-size: clamp(1.75rem, 3vw, 2.4rem); font-weight: 750; letter-spacing: -0.03em; line-height: 1.15; }
h3 { font-size: 1.15rem; font-weight: 650; letter-spacing: -0.01em; line-height: 1.35; }
p { margin: 0; }

a { color: inherit; }

:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: 20px; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip { position: absolute; left: 12px; top: -48px; padding: 8px 12px; background: var(--button); color: var(--button-ink); border-radius: 6px; z-index: 20; }
.skip:focus { top: 12px; }

/* ------------------------------------------------------------------ logo */
/* both lockups are in the markup; the theme picks one */
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark { display: block; }
}

/* ---------------------------------------------------------------- header */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top-row { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.brand { flex: none; }
.brand .logo { height: 28px; width: auto; }
.top-nav { display: flex; gap: 22px; margin-right: auto; font-size: 15px; }
.top-nav a { text-decoration: none; color: var(--muted); }
.top-nav a:hover { color: var(--ink); }
.controls { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.nav-toggle { display: none; }

.lang select {
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 28px 6px 10px;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

.theme { display: flex; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: var(--surface); }
.theme button {
  display: grid; place-items: center;
  width: 30px; height: 28px;
  border: 0; border-radius: 6px;
  background: none; color: var(--muted);
  cursor: pointer;
}
.theme button:hover { color: var(--ink); }
.theme button[aria-checked="true"] { background: var(--line); color: var(--ink); }
.theme svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-weight: 600; font-size: 16px;
  padding: 12px 20px;
  border: 0; border-radius: 8px;
  background: var(--button); color: var(--button-ink);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-small { font-size: 14px; padding: 7px 14px; }

/* ------------------------------------------------------------------ hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: center;
  gap: 48px;
  padding-block: clamp(48px, 9vw, 112px) clamp(40px, 6vw, 72px);
}
.hero h1 {
  font-size: clamp(2.2rem, 4.4vw, 3.6rem);
  font-weight: 780;
  letter-spacing: -0.04em;
  line-height: 1.05;
  max-width: 20ch;
}
.lead { margin-top: 24px; font-size: 19px; color: var(--muted); max-width: 54ch; }
.hero-actions { margin-top: 32px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; }
.link { color: var(--muted); font-weight: 500; text-underline-offset: 4px; }
.link:hover { color: var(--ink); }

/* The week from the logo: 3x3 on an 8-unit square, cell 2u, gap 1u. Columns
   fill 1-2-3 like hours over a week; the last cell turns approved. */
.week {
  --size: clamp(160px, 21vw, 260px);
  width: var(--size);
  aspect-ratio: 1;
  justify-self: center;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: calc(var(--size) / 8);
}
.cell { border-radius: 22%; background: var(--cell-faint); }
.cell.fill { animation: fill 0.45s ease-out both; animation-delay: calc(0.35s + var(--i) * 0.22s); }
.cell.mark { animation: approve 0.6s ease-out both; animation-delay: calc(0.35s + var(--i) * 0.22s); }
/* fill order, set here rather than inline so a strict CSP can forbid style attributes */
.d0 { --i: 0; } .d1 { --i: 1; } .d2 { --i: 2; } .d3 { --i: 3; } .d4 { --i: 4; } .d5 { --i: 5; }
@keyframes fill {
  from { background: var(--cell-faint); transform: scale(0.86); }
  to { background: var(--cell); transform: scale(1); }
}
@keyframes approve {
  0% { background: var(--cell-faint); transform: scale(0.86); }
  60% { background: var(--teal); transform: scale(1.06); }
  100% { background: var(--teal); transform: scale(1); }
}

.shot-hero { margin: 0 auto; padding-bottom: clamp(64px, 9vw, 120px); }

/* -------------------------------------------------------------- shots */
.shot {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.shot-phone { max-width: 270px; border-radius: 28px; justify-self: center; }

/* the tinted sections: edge to edge, not just within .wrap */
.band { background: var(--band); }

/* ------------------------------------------------------------ browser frame */
/* a fake browser chrome around a screenshot: signals "this is the real
   product", not a mockup, without needing a live demo embed */
.browser-frame {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.browser-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.b-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.b-dot.r { background: #e5685f; }
.b-dot.y { background: #e6b54a; }
.b-dot.g { background: #5fb56a; }
.browser-url {
  margin-left: 10px;
  font-size: 13px; color: var(--muted);
  background: var(--band);
  border-radius: 6px;
  padding: 3px 10px;
}
.browser-frame .shot { border: 0; border-radius: 0; box-shadow: none; }

.phone-frame {
  display: grid; justify-items: center;
  padding-block: 8px;
}
.phone-frame[hidden] { display: none; }
.phone-frame .shot-phone { box-shadow: var(--shadow); }

/* -------------------------------------------------------- section headers */
.kicker {
  display: inline-block;
  font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--teal);
}
.section-head { display: grid; gap: 12px; max-width: 64ch; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head p { font-size: 18px; color: var(--muted); }

/* --------------------------------------------------------------- features */
.features { padding-block: clamp(48px, 7vw, 96px); border-top: 1px solid var(--line); }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.feature-card {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.feature-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 9px; background: var(--band); color: var(--teal); }
.feature-icon svg { width: 22px; height: 22px; }
.feature-card h3 { font-size: 1.05rem; }
.feature-card p { color: var(--muted); font-size: 15.5px; }

/* --------------------------------------------------------------------- how */
.how { padding-block: clamp(48px, 7vw, 96px); border-top: 1px solid var(--line); }
.steps { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: start; gap: 16px; }
.step { display: grid; gap: 8px; align-content: start; }
.step-num { font-size: 14px; font-weight: 700; color: var(--teal); letter-spacing: 0.04em; }
.step p { color: var(--muted); }
.step-arrow { display: grid; place-items: center; color: var(--line); padding-top: 28px; }
.step-arrow svg { width: 40px; height: 14px; }

/* -------------------------------------------------------------------- shots */
.shots { padding-block: clamp(48px, 7vw, 96px); border-top: 1px solid var(--line); }
.shot-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.shot-tab {
  font: inherit; font-size: 14px; font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
}
.shot-tab:hover { color: var(--ink); }
.shot-tab.active { background: var(--button); color: var(--button-ink); border-color: var(--button); }
.shot-display { display: grid; }

/* ---------------------------------------------------------------- contact */
.contact { padding-block: clamp(56px, 8vw, 112px); border-top: 1px solid var(--line); }
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: clamp(28px, 5vw, 72px);
}
.contact-intro { display: grid; gap: 14px; align-content: start; }
.contact-intro p { color: var(--muted); max-width: 36ch; }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field label { font-size: 14px; font-weight: 600; }
.field input, .field textarea {
  font: inherit; font-size: 16px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  width: 100%;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); opacity: 0.8; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--teal); outline-offset: 0; border-color: transparent; }
.field [aria-invalid="true"] { border-color: var(--error); }
.error { font-size: 13px; color: var(--error); min-height: 1em; }
.error:empty { display: none; }
.form-end { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.form-status { font-size: 15px; color: var(--muted); }
.form-status.ok { color: var(--teal); }

/* ----------------------------------------------------------------- footer */
.foot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-block: 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}
.foot .logo { height: 22px; width: auto; }

/* ------------------------------------------------------------------ phone */
@media (max-width: 900px) {
  .top-nav { display: none; }
  .nav-toggle {
    display: grid; place-items: center;
    width: 36px; height: 36px; flex: none;
    border: 1px solid var(--line); border-radius: 8px;
    background: var(--surface); color: var(--ink);
    cursor: pointer;
  }
  .nav-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
  .mobile-nav { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
  .mobile-nav[hidden] { display: none; }
  .mobile-nav a {
    padding: 14px 0; text-decoration: none; color: var(--ink); font-size: 15px;
    border-bottom: 1px solid var(--line);
  }
  .mobile-nav a:last-child { border-bottom: 0; }
  /* language and theme move here from the header row at narrow widths (see
     wireMobileControls in app.js), so give them their own breathing room */
  .mobile-nav .lang, .mobile-nav .theme { margin-top: 14px; }
  .mobile-nav .lang select { width: 100%; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .week { justify-self: start; --size: clamp(150px, 42vw, 220px); }
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .step-arrow { display: none; }
  .contact-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .top-row { gap: 12px; }
  .brand .logo { height: 24px; }
  .controls { display: none; }
  .form { grid-template-columns: minmax(0, 1fr); }
  .lead { font-size: 17px; }
  .feature-grid { grid-template-columns: minmax(0, 1fr); }
  .shot-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cell.fill, .cell.mark { animation: none; }
  .cell.fill { background: var(--cell); }
  .cell.mark { background: var(--teal); }
  .btn { transition: none; }
}
