/* Every colour comes from tokens.css, generated from the @callback/ui design tokens. */

@font-face {
  font-family: 'Inter Tight';
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/inter-tight-latin-700-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/inter-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/inter-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2');
}

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

/* Display rules below (grid, flex) would otherwise show elements the script hides. */
[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family:
    'Inter',
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-underline-offset: 2px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

h1,
h2 {
  font-family: 'Inter Tight', 'Inter', system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(30px, 7vw, 38px);
  line-height: 1.15;
  margin: 0 0 16px;
}

h2 {
  font-size: 20px;
  line-height: 1.3;
  margin: 0 0 8px;
}

code,
pre {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
}

p code,
li code {
  font-size: 0.9em;
  background: var(--surface-muted);
  border-radius: 6px;
  padding: 1px 5px;
}

.muted {
  color: var(--text-muted);
}

/* Layout */

.top,
main,
.footer {
  max-width: 1040px;
  margin: 0 auto;
  padding-left: var(--screen-padding);
  padding-right: var(--screen-padding);
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 16px;
  padding-bottom: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--touch-target);
  color: var(--text);
  font-family: 'Inter Tight', 'Inter', system-ui, sans-serif;
  font-weight: 700;
  font-size: 20px;
  text-decoration: none;
}

.brand-mark {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  color: var(--accent);
}

.top-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-target);
  font-weight: 600;
}

main {
  display: grid;
  /* minmax(0, …): wide code lines scroll inside their block instead of widening the page. */
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  padding-bottom: 40px;
}

/* The privacy notice keeps a readable line length. */
.prose {
  width: 100%;
  max-width: 680px;
  justify-self: center;
}

/*
 * Cards that span the page: text on the left and the part you use on the right, stacked on
 * phones. The puzzle, Review the AI and the waitlist share it, so every section is as wide.
 */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

@media (min-width: 760px) {
  .split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 40px;
    align-items: start;
  }
}

.hero {
  display: grid;
  gap: 32px;
  padding: 24px 0 8px;
}

.hero-text {
  max-width: 640px;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}

.free-note {
  margin: 0;
  font-weight: 600;
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 64px;
    align-items: center;
    padding-top: 40px;
  }
}

.eyebrow,
.label {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.lead {
  color: var(--text-muted);
  font-size: 17px;
  margin: 0 0 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-milestone);
  padding: 20px;
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-target);
  padding: 12px 20px;
  border: 0;
  border-radius: var(--radius-primary-button);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  background: var(--accent);
  color: var(--on-accent);
}

.button:disabled {
  opacity: 0.7;
  cursor: progress;
}

/* Puzzle */

.puzzle-prompt {
  margin: 0 0 16px;
}

.code {
  margin: 0 0 16px;
  padding: 16px;
  overflow-x: auto;
  background: var(--code-background);
  color: var(--code-text);
  border-radius: var(--radius-code);
  font-size: 14px;
  line-height: 1.5;
}

.c-text {
  color: var(--code-text);
}
.c-keyword {
  color: var(--code-keyword);
}
.c-number {
  color: var(--code-number);
}
.c-function {
  color: var(--code-function);
}

.options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 8px 12px;
  background: var(--surface-muted);
  color: var(--text);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-button);
  font: inherit;
  font-size: 16px;
  cursor: pointer;
}

.option code {
  font-size: 16px;
}

.option.is-chosen {
  border-color: var(--accent);
}

/* Shape as well as colour: the right answer gets a tick once the visitor has answered. */
.option.is-correct {
  border-color: var(--success);
}
.option.is-correct::after {
  content: '✓';
  color: var(--text);
  font-weight: 600;
}

.puzzle-result {
  margin-top: 16px;
}

.puzzle-result p {
  margin: 0 0 8px;
}

.verdict {
  font-weight: 600;
  color: var(--text);
}

.verdict.is-correct {
  color: var(--success);
}

.puzzle-cta {
  font-weight: 600;
}

/* App mock-up: the Today screen inside a phone outline */

.phone {
  justify-self: center;
  width: min(100%, 300px);
  margin: 0;
  border: 10px solid var(--code-background);
  border-radius: 44px;
  background: var(--code-background);
  box-shadow: 0 0 0 1px var(--border-strong);
}

.phone-screen {
  display: grid;
  gap: 10px;
  padding: 10px 14px 0;
  overflow: hidden;
  background: var(--background);
  border-radius: 34px;
  font-size: 12px;
  line-height: 1.35;
}

.phone-screen p {
  margin: 0;
}

.app-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 8px 4px;
  font-size: 11px;
  font-weight: 600;
}

.app-status-dots {
  width: 30px;
  height: 10px;
  border-radius: var(--radius-pill);
  background: var(--text);
}

.app-head,
.app-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.app-title {
  font-family: 'Inter Tight', 'Inter', system-ui, sans-serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
}

.app-small {
  color: var(--text-muted);
  font-size: 11px;
}

.app-streak {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--accent-tint);
  font-weight: 700;
}

.app-streak svg {
  color: var(--accent);
}

.app-label {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.app-session {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: 16px;
  background: var(--accent-tint);
}

.app-session-title {
  font-family: 'Inter Tight', 'Inter', system-ui, sans-serif;
  font-size: 17px;
  font-weight: 700;
}

.app-start {
  justify-self: start;
  margin-top: 6px;
  padding: 8px 18px;
  border-radius: var(--radius-button);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

.app-card {
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}

.app-card.app-row {
  display: flex;
}

.app-card-title {
  font-weight: 600;
}

.app-bar {
  height: 6px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
}

.app-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.app-bar-fill.is-unit {
  width: 75%;
}

.app-code {
  margin: 5px 0 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--code-background);
  color: var(--code-text);
  font-size: 11px;
}

.app-score {
  font-family: 'Inter Tight', 'Inter', system-ui, sans-serif;
  font-size: 26px;
  font-weight: 700;
}

.app-tabs {
  display: flex;
  justify-content: space-between;
  margin: 2px -14px 0;
  padding: 10px 14px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 10px;
}

.app-tabs .is-active {
  color: var(--text);
  font-weight: 600;
}

/* Features */

.features {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.feature h2 {
  font-size: 17px;
  margin-bottom: 4px;
}

.feature > p,
.feature-text p {
  margin: 0;
  color: var(--text-muted);
}

.feature-text .label {
  margin-bottom: 8px;
}

.feature-review h2 {
  font-size: 20px;
}

@media (min-width: 760px) {
  .features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feature-review {
    grid-column: 1 / -1;
  }
}

/* Review the AI demo: each line of code is a button */

.review-prompt {
  margin: 0 0 12px;
}

.review-code {
  display: grid;
  padding: 8px 0;
}

.code-line {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: var(--touch-target);
  padding: 0 16px 0 13px;
  border: 0;
  border-left: 3px solid transparent;
  background: transparent;
  color: var(--code-text);
  font-family: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.code-line code {
  white-space: pre;
}

.code-line:hover {
  background: color-mix(in srgb, var(--code-text) 8%, transparent);
}

.line-number {
  min-width: 1ch;
  opacity: 0.6;
}

.code-line.is-chosen {
  border-left-color: var(--accent);
  background: color-mix(in srgb, var(--code-text) 8%, transparent);
}

/* Shape as well as colour: the buggy line is marked once the visitor has answered. */
.code-line.is-buggy {
  border-left-color: var(--code-keyword);
}

.code-line.is-buggy::after {
  content: '← bug';
  margin-left: auto;
  padding-left: 12px;
  color: var(--code-keyword);
}

/* Small phones: every line fits without scrolling. */
@media (max-width: 420px) {
  .code-line {
    gap: 10px;
    padding: 0 12px 0 9px;
    font-size: 13px;
  }
}

/* Small visuals above the other two features */

.visual {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  padding: 14px;
  border-radius: var(--radius-card);
  background: var(--surface-muted);
}

.visual p {
  margin: 0;
}

.visual-check {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px;
}

/* Review dates with growing gaps: a line with a dot per review. */
.timeline {
  display: grid;
  grid-template-columns:
    minmax(max-content, 1fr) minmax(max-content, 1.5fr) minmax(max-content, 2.5fr)
    max-content;
  column-gap: 6px;
  background: linear-gradient(var(--border-strong), var(--border-strong)) left 4px top 4px / 100%
    2px no-repeat;
}

.tick {
  position: relative;
  padding-top: 16px;
  color: var(--text-muted);
  font-size: 12px;
}

.tick::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.drill-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.drill-timer {
  padding: 2px 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-family: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
}

.drill-question {
  font-weight: 600;
}

.drill-answer {
  padding: 10px 12px;
  border-radius: 12px 12px 12px 4px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 14px;
}

/* Waitlist */

.waitlist p {
  margin-top: 0;
}

.form {
  display: grid;
  gap: 12px;
}

.fields {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.form label {
  font-weight: 600;
}

.form input[type='email'] {
  min-height: var(--touch-target);
  padding: 10px 14px;
  background: var(--background);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-button);
  font: inherit;
}

.form input[aria-invalid='true'] {
  border-color: var(--accent);
  border-width: 2px;
}

.consent {
  display: flex;
  min-height: var(--touch-target);
  gap: 12px;
  align-items: flex-start;
  font-weight: 400 !important;
  color: var(--text-muted);
  font-size: 14px;
}

/* A 24 px box inside a label row at least 44 px tall: the whole label is the touch target. */
.consent input {
  flex: none;
  width: 24px;
  height: 24px;
  margin: 0;
  accent-color: var(--accent);
}

.status {
  margin: 0;
  min-height: 1.5em;
}

.status.is-error {
  color: var(--text);
  font-weight: 600;
}

.status.is-error::before {
  content: '⚠ ';
  color: var(--accent);
}

.turnstile:empty {
  display: none;
}

.joined:focus {
  outline: none;
}

/* The optional goal question after signup */

.goal {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.goal-fields {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.goal-fields legend {
  padding: 0;
  margin-bottom: 4px;
  font-weight: 600;
}

.goal-options {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.goal-option {
  justify-content: flex-start;
  min-height: var(--touch-target);
  text-align: left;
}

.goal-option.is-chosen::after {
  content: '✓';
  margin-left: auto;
  font-weight: 600;
}

@media (min-width: 520px) {
  .goal-options {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Privacy notice */

.prose {
  display: block;
  padding-top: 8px;
}

.prose h2 {
  margin-top: 28px;
}

.prose ul {
  padding-left: 20px;
}

/* Footer */

.footer {
  padding-top: 24px;
  padding-bottom: 40px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 14px;
}

.footer p {
  margin: 0 0 4px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
