/* Chalk landing page. Tokens mirror docs/design.md §3–4; keep them in step with the app. */

@font-face {
  font-family: 'Space Grotesk';
  src: url('/fonts/space-grotesk-latin-wght-normal.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #0a0a0b;
  --surface: #141417;
  --surface-2: #1e1e23;
  --border: #2a2a31;
  --text: #f4f4f5;
  --text-muted: #9a9aa5;
  --text-faint: #5a5a63;
  --accent: #c8ff3d;
  --accent-press: #b2e62e;
  --on-accent: #0a0a0b;

  --display: 'Space Grotesk', system-ui, sans-serif;
  --body: 'Inter', system-ui, sans-serif;

  --gutter: clamp(1rem, 4vw, 3rem);
  --measure: 34rem;
  --page: 76rem;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
ol,
dl,
dd,
figure {
  margin: 0;
}

ol {
  padding: 0;
  list-style: none;
}

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

a {
  color: inherit;
}

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

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

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 0.75rem;
  font-weight: 600;
}
.skip:focus {
  top: 1rem;
}

/* ---------- shared pieces ---------- */

.wordmark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.75rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  line-height: 1;
}
.wordmark span {
  color: var(--accent);
}
.wordmark-small {
  font-size: 1.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.5rem;
  padding: 0 1.75rem;
  border-radius: 1rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.125rem;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}
.btn-primary:hover {
  background: var(--accent-press);
}
.btn-quiet {
  min-height: 3rem;
  padding: 0 1.25rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-quiet:hover {
  border-color: var(--text-muted);
}

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

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--page);
  margin: 0 auto;
  padding: 1.25rem var(--gutter);
}

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

.hero {
  display: grid;
  gap: 3rem;
  max-width: var(--page);
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 5rem) var(--gutter) clamp(4rem, 9vw, 7rem);
}

.hero h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(3.25rem, 13vw, 6rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  white-space: nowrap;
}

.lede {
  max-width: var(--measure);
  margin-top: 1.75rem;
  font-size: clamp(1.125rem, 2.2vw, 1.3125rem);
  line-height: 1.55;
  color: var(--text-muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 2.25rem;
}

.fineprint {
  max-width: 17rem;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--text-muted);
}

@media (min-width: 62rem) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 27rem);
    align-items: center;
    gap: 4rem;
  }
}

/* ---------- the working set row ---------- */

.demo {
  width: 100%;
  max-width: 27rem;
  padding: 1.25rem 0.875rem 0.875rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.75rem;
}

.demo-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  padding: 0 0.5rem 1rem;
}
.demo-head h2 {
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 600;
}
.demo-head p {
  font-size: 0.875rem;
  color: var(--accent);
}

.demo-cols,
.set {
  display: grid;
  grid-template-columns: 1rem 2.25rem minmax(0, 1.35fr) minmax(0, 1fr) 3.5rem;
  align-items: center;
  gap: 0.375rem;
}

.demo-cols {
  padding: 0 0.375rem 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-faint);
}
.demo-cols span:nth-child(3),
.demo-cols span:nth-child(4) {
  text-align: center;
}

.sets {
  display: grid;
  gap: 0.375rem;
}

.set {
  padding: 0.25rem 0.375rem;
  border-radius: 1rem;
}
.set[data-done='true'] {
  background: color-mix(in srgb, var(--accent) 9%, transparent);
}

.set-n {
  font-family: var(--display);
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
}

.set-goal {
  font-size: 0.75rem;
  line-height: 1.25;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.stepper {
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr) 1.75rem;
  align-items: center;
}

.stepper-value {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.125rem, 5.2vw, 1.375rem);
  font-variant-numeric: tabular-nums;
  text-align: center;
  letter-spacing: -0.03em;
}
.set[data-done='true'] .stepper-value {
  color: var(--text-muted);
}

.stepper-btn {
  height: 3.5rem;
  padding: 0;
  border: 0;
  border-radius: 0.625rem;
  background: var(--surface-2);
  color: var(--text);
  font: 500 1.25rem/1 var(--body);
  cursor: pointer;
  touch-action: manipulation;
}
.stepper-btn:active {
  background: var(--border);
}
.stepper-btn:disabled {
  background: transparent;
  color: var(--text-faint);
  cursor: default;
}

.tick {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  padding: 0;
  border: 0;
  border-radius: 1rem;
  background: var(--surface-2);
  color: var(--text-faint);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 120ms ease-out;
}
.tick[aria-pressed='true'] {
  background: var(--accent);
  color: var(--on-accent);
}
.tick:active {
  transform: scale(0.94);
}

.rest {
  margin-top: 0.875rem;
  padding: 0.75rem 0.75rem 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  overflow: hidden;
}

.rest-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.75rem;
}

.rest-time {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.75rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  min-width: 4.25rem;
}
.rest[data-state='idle'] .rest-time {
  color: var(--text-faint);
}

.rest-label {
  flex: 1;
  font-size: 0.8125rem;
  line-height: 1.3;
  color: var(--text-muted);
}

.rest-btn {
  min-height: 2.75rem;
  padding: 0 0.875rem;
  border: 0;
  border-radius: 0.75rem;
  background: var(--bg);
  color: var(--text);
  font: 600 0.875rem/1 var(--body);
  cursor: pointer;
}
.rest[data-state='idle'] .rest-btn {
  display: none;
}

.rest-track {
  height: 4px;
  margin: 0 -0.75rem;
  background: var(--border);
}
.rest-fill {
  height: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 250ms linear;
}

/* ---------- screenshots ---------- */

.rack,
.plain,
.install {
  max-width: var(--page);
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 6rem) var(--gutter);
  border-top: 1px solid var(--border);
}

.rack h2,
.plain h2,
.install h2 {
  max-width: 22ch;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.875rem, 5vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.rack-grid {
  display: grid;
  gap: 3.5rem;
  margin-top: clamp(2.5rem, 6vw, 4rem);
}

.shot {
  display: grid;
  gap: 1.5rem;
  align-content: start;
}

.phone {
  width: min(100%, 19rem);
  padding: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2.5rem;
}
.phone img {
  width: 100%;
  border-radius: 2rem;
}

.shot h3,
.install h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.3125rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.shot p {
  max-width: 30rem;
  margin-top: 0.625rem;
  color: var(--text-muted);
}

@media (min-width: 48rem) {
  .rack-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.5rem;
  }
  /* Stagger the middle phone so the row reads as three phones, not a card grid. */
  .shot:nth-child(2) {
    margin-top: 4rem;
  }
}

/* ---------- plain facts ---------- */

.facts {
  display: grid;
  gap: 2.25rem 4rem;
  margin-top: clamp(2.5rem, 6vw, 4rem);
}

.facts dt {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.3125rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.facts dd {
  max-width: var(--measure);
  margin-top: 0.625rem;
  color: var(--text-muted);
}

@media (min-width: 48rem) {
  .facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- install ---------- */

.install-lede {
  max-width: var(--measure);
  margin-top: 1.25rem;
  color: var(--text-muted);
}

.install-grid {
  display: grid;
  gap: 2.5rem 4rem;
  margin: 2.5rem 0 3rem;
}

.install ol {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
  counter-reset: step;
}

.install li {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: baseline;
  counter-increment: step;
  color: var(--text-muted);
}
.install li::before {
  content: counter(step);
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

@media (min-width: 48rem) {
  .install-grid {
    grid-template-columns: repeat(2, minmax(0, 24rem));
  }
}

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

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--page);
  margin: 0 auto;
  padding: 2rem var(--gutter) calc(2rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9375rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .tick,
  .rest-fill {
    transition: none;
  }
}
