:root {
  --bg: #f6f3ee;
  --surface: #fffdf9;
  --ink: #1c1917;
  --muted: #6b6560;
  --line: #e5e0d8;
  --red: #d94432;
  --yellow: #e8a820;
  --blue: #2b6cb8;
  --green: #2f8554;
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", monospace;
  --narrow: 40rem;
  --wide: 54rem;
  --radius: 8px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 90% 55% at 100% -10%, rgba(232, 168, 32, 0.11), transparent 55%),
    radial-gradient(ellipse 70% 45% at -5% 30%, rgba(217, 68, 50, 0.05), transparent 50%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(28, 25, 23, 0.015) 2px,
      rgba(28, 25, 23, 0.015) 3px
    );
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--blue);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover { color: var(--red); }

.container {
  width: min(100% - 2rem, var(--narrow));
  margin-inline: auto;
}

.container--wide {
  width: min(100% - 2rem, var(--wide));
}

/* logo */
.logo-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: block;
}

/* header */
.site-header {
  background: rgba(255, 253, 249, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 0;
  max-width: var(--wide);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--ink);
  text-decoration: none;
}

.logo:hover { color: var(--ink); }

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a.active { color: var(--ink); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.65rem;
  margin: -0.4rem -0.4rem -0.4rem 0;
  color: var(--ink);
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}

/* hero */
.hero {
  padding: 2.75rem 0 3rem;
  position: relative;
  overflow: hidden;
}

@media (min-width: 720px) {
  .hero { padding: 3.75rem 0 4.25rem; }
}

.hero-grid {
  display: grid;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 720px) {
  .hero-grid {
    grid-template-columns: 1fr auto;
    gap: 3rem;
  }
}

.hero-brand {
  font-family: var(--display);
  font-size: clamp(2.15rem, 8vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 0.55rem;
  color: var(--ink);
}

.hero-tagline {
  font-size: clamp(1.125rem, 3.5vw, 1.375rem);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin: 0 0 0.85rem;
  color: var(--ink);
}

.hero-lead {
  font-size: 1rem;
  color: var(--muted);
  margin: 0 0 1.5rem;
  max-width: 38ch;
  line-height: 1.55;
}

.hero-features-link {
  display: inline-block;
  margin-top: 1.1rem;
}

.store-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.65rem;
}

.store-badges--center {
  justify-content: center;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 48px;
  padding: 0.55rem 1rem 0.55rem 0.85rem;
  background: var(--ink);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 rgba(28, 25, 23, 0.2);
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
  line-height: 1.15;
}

a.store-badge:hover {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.store-badge svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.store-badge-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.05rem;
}

.store-badge-label {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.75;
}

.store-badge-store {
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.store-badge--soon {
  background: var(--surface);
  color: var(--ink);
  cursor: default;
  user-select: none;
  box-shadow: 3px 3px 0 var(--ink);
}

.store-badge--soon .store-badge-label {
  opacity: 1;
  color: var(--red);
}

.store-badge--compact {
  min-height: 40px;
  padding: 0.4rem 0.75rem;
  box-shadow: none;
  gap: 0.4rem;
}

.store-badge--compact .store-badge-store {
  font-size: 0.8125rem;
}

.store-badge--compact svg {
  width: 16px;
  height: 16px;
}

.app-store-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.15rem;
  min-height: 48px;
  background: var(--ink);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
  transition: background 0.15s;
  border: none;
}

.app-store-btn:hover {
  background: var(--red);
  color: #fff;
}

.app-store-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.app-store-btn--soon {
  background: var(--surface);
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  cursor: default;
  pointer-events: none;
}

.app-store-btn--soon:hover {
  background: var(--surface);
  color: var(--ink);
}

.text-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
}

.text-link:hover { color: var(--ink); text-decoration: underline; }

/* decorative phone mock — desktop only so mobile hero stays brand-first */
.hero-visual {
  display: none;
  width: 200px;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 24px;
  padding: 1rem;
  box-shadow: 6px 6px 0 var(--ink);
}

@media (min-width: 720px) {
  .hero-visual { display: block; }
}

.mock-timer {
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  padding: 1.5rem 0;
  letter-spacing: -0.02em;
}

.mock-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-align: center;
  margin-bottom: 0.75rem;
}

.mock-meta {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  margin-top: 0.75rem;
  line-height: 1.4;
}

/* sections */
.section {
  padding: 3rem 0;
}

.section--alt {
  background: var(--surface);
  border-block: 1px solid var(--line);
}

.section-head {
  margin-bottom: 1.75rem;
}

.section-head h2 {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  letter-spacing: -0.025em;
}

.section-head p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--muted);
}

.feature-grid {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

@media (min-width: 600px) {
  .feature-grid { grid-template-columns: 1fr 1fr; }
}

.feature-item {
  background: var(--surface);
  padding: 1.25rem 1.35rem;
}

.feature-item h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  margin: 0 0 0.3rem;
}

.feature-item p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.5;
}

/* pricing */
.pricing-grid {
  display: grid;
  gap: 0.75rem;
}

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

.pricing-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.pricing-card--highlight {
  border-color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}

.pricing-card h3 {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pricing-card .price {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
}

.pricing-card p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.45;
}

.pricing-note {
  margin: 1.25rem 0 0;
  font-size: 0.8125rem;
  color: var(--muted);
}

/* mid-page app promo — kraft paper, not solid black */
.promo-band {
  padding: 2.75rem 0;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(232, 168, 32, 0.08), transparent 60%),
    var(--surface);
  border-block: 1px solid var(--line);
  color: var(--ink);
}

.promo-band h2 {
  font-family: var(--display);
  font-size: clamp(1.35rem, 4vw, 1.65rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 0.5rem;
}

.promo-band p {
  margin: 0 0 1.35rem;
  font-size: 0.9375rem;
  color: var(--muted);
  max-width: 36ch;
  margin-inline: auto;
}

/* cta */
.cta-band {
  padding: 3rem 0;
  text-align: center;
}

.cta-band p {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 1.25rem;
  letter-spacing: -0.02em;
}

/* sticky mobile store bar — single App Store CTA */
.mobile-store-bar {
  display: none;
}

@media (max-width: 640px) {
  .mobile-store-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    padding: 0.7rem 1rem calc(0.7rem + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 253, 249, 0.96);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--line);
    box-shadow: 0 -6px 20px rgba(28, 25, 23, 0.07);
  }

  .mobile-store-bar-label {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ink);
    line-height: 1.3;
    flex: 1;
    min-width: 0;
  }

  .mobile-store-bar .store-badge--compact {
    flex-shrink: 0;
    box-shadow: 2px 2px 0 rgba(28, 25, 23, 0.18);
  }

  body {
    padding-bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
  }

  .site-footer {
    padding-bottom: 2rem;
  }
}

/* legal / support pages */
.page-hero {
  padding: 2.5rem 0 2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.page-hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 800;
  margin: 0 0 0.35rem;
  letter-spacing: -0.03em;
}

.page-hero .meta {
  font-size: 0.8125rem;
  color: var(--muted);
}

.prose {
  padding: 2.5rem 0 4rem;
}

.prose h2 {
  font-size: 1.0625rem;
  font-weight: 700;
  margin: 2.25rem 0 0.6rem;
  color: var(--ink);
}

.prose h2:first-child { margin-top: 0; }

.prose h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  margin: 1.5rem 0 0.4rem;
}

.prose p,
.prose li {
  font-size: 0.9375rem;
  color: var(--muted);
  line-height: 1.7;
}

.prose ul { padding-left: 1.25rem; }
.prose li { margin-bottom: 0.35rem; }
.prose strong { color: var(--ink); }

.contact-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.35rem;
  margin: 1.25rem 0;
}

.contact-box a {
  font-weight: 600;
  text-decoration: none;
}

.contact-box a:hover { text-decoration: underline; }

.faq-list { margin: 0; padding: 0; list-style: none; }

.faq-list li {
  border-bottom: 1px solid var(--line);
  padding: 1.15rem 0;
}

.faq-list li:first-child { border-top: 1px solid var(--line); }

.faq-list h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  color: var(--ink);
}

.faq-list p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
}

/* 404 */
.error-page {
  padding: 5rem 0;
  text-align: center;
}

.error-page h1 {
  font-size: 4rem;
  font-weight: 800;
  margin: 0 0 0.5rem;
  letter-spacing: -0.04em;
}

.error-page p {
  color: var(--muted);
  margin: 0 0 1.5rem;
}

/* download redirect / soft landing */
.download-page {
  padding: 2.5rem 0 4rem;
  min-height: 50vh;
}

.download-status {
  text-align: center;
  color: var(--muted);
  font-size: 0.9375rem;
  margin: 3rem 0;
}

.download-card {
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 5px 5px 0 var(--ink);
  padding: 2rem 1.75rem;
  max-width: 28rem;
  margin: 0 auto;
  text-align: center;
}

.download-eyebrow {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.download-title {
  font-size: clamp(1.5rem, 4vw, 1.875rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 0.5rem;
}

.download-sub {
  font-size: 0.9375rem;
  color: var(--muted);
  margin: 0 0 1.5rem;
  line-height: 1.55;
}

.download-source {
  font-size: 0.75rem;
  color: var(--muted);
  margin: -0.75rem 0 1.25rem;
  letter-spacing: 0.02em;
}

.download-home {
  margin: 1.5rem 0 0;
  font-size: 0.875rem;
}

/* challenge share */
.challenge-page {
  padding: 2.5rem 0 4rem;
  min-height: 50vh;
}

.challenge-loading {
  text-align: center;
  color: var(--muted);
  font-size: 0.9375rem;
}

.challenge-card {
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 5px 5px 0 var(--ink);
  padding: 2rem 1.75rem;
  max-width: 28rem;
  margin: 0 auto;
}

.challenge-card--error {
  border-color: var(--line);
  box-shadow: none;
}

.challenge-eyebrow {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.challenge-title {
  font-size: clamp(1.5rem, 4vw, 1.875rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 0.35rem;
}

.challenge-sub {
  font-size: 0.9375rem;
  color: var(--muted);
  margin: 0 0 1.5rem;
}

.challenge-time {
  font-family: var(--mono);
  font-size: clamp(2.5rem, 10vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 1.5rem;
  line-height: 1;
  color: var(--ink);
}

.challenge-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1rem;
  margin: 0 0 1.5rem;
  font-size: 0.875rem;
}

.challenge-meta dt {
  font-weight: 600;
  color: var(--muted);
  margin: 0;
}

.challenge-meta dd {
  margin: 0;
  font-weight: 600;
}

.challenge-copy {
  font-size: 0.9375rem;
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 1.5rem;
}

.challenge-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.challenge-open {
  text-align: center;
  justify-content: center;
}

.app-store-btn--secondary {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  text-align: center;
}

.app-store-btn--secondary:hover {
  background: var(--bg);
  color: var(--ink);
  border-color: var(--ink);
}

.challenge-card--preview {
  margin-top: 0;
}

.challenge-card--preview .challenge-title {
  font-size: 1.375rem;
}

.challenge-card--preview code {
  font-family: var(--mono);
  font-size: 0.75em;
  background: var(--bg);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

.challenge-note {
  margin: 1rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.45;
}

/* footer */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 2.5rem 0 2rem;
}

.footer-grid {
  display: grid;
  gap: 2rem;
  max-width: var(--wide);
  margin-inline: auto;
  width: min(100% - 2rem, var(--wide));
}

@media (min-width: 600px) {
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; }
}

.footer-brand p {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  color: var(--muted);
  max-width: 22ch;
}

.footer-col h4 {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 0.65rem;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-col li { margin-bottom: 0.35rem; }

.footer-col a {
  font-size: 0.8125rem;
  color: var(--ink);
  text-decoration: none;
}

.footer-col a:hover { color: var(--red); }

.footer-bottom {
  max-width: var(--wide);
  margin: 2rem auto 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  width: min(100% - 2rem, var(--wide));
  font-size: 0.75rem;
  color: var(--muted);
}

@media (max-width: 640px) {
  .nav-toggle { display: inline-flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem 1rem 1rem;
    gap: 0;
  }

  .nav-links.open { display: flex; }

  .nav-links a {
    display: block;
    padding: 0.85rem 0.25rem;
    font-size: 0.9375rem;
    min-height: 44px;
    border-bottom: 1px solid var(--line);
  }

  .nav-links li:last-child a { border-bottom: none; }

  .site-header .container { position: relative; }

  .footer-col a {
    display: inline-block;
    padding: 0.35rem 0;
    min-height: 44px;
    line-height: 1.4;
  }

  .challenge-card {
    padding: 1.5rem 1.15rem;
  }
}

/* light motion — hero + CTAs */
@media (prefers-reduced-motion: no-preference) {
  .hero-copy {
    animation: hero-rise 0.55s ease-out both;
  }

  .hero-visual {
    animation: hero-rise 0.65s ease-out 0.12s both;
  }

  a.store-badge:hover {
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 rgba(28, 25, 23, 0.25);
  }
}

@keyframes hero-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
