/* ============================================================
   Half Five — design tokens ("Tomato Time: Final Cut")
   ============================================================ */
:root {
  --canvas: #FAF8F4;
  --card-bg: #FFFFFF;
  --card-border: rgba(20, 19, 17, 0.1);
  --ink: #141311;
  --ink-muted: #55504A;
  --tomato: #F0492A;
  --tomato-text: #C2320F;
  --tomato-on: #FFFFFF;
  --pea: #1F8A4C;
  --berry: #A0323F;
  --focus-ring: #1D4ED8;

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 19, 17, 0.06), 0 8px 24px rgba(20, 19, 17, 0.08);
  --max-width: 1100px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #0F0E0D;
    --card-bg: #1B1917;
    --card-border: rgba(250, 248, 244, 0.12);
    --ink: #F5F2EC;
    --ink-muted: #B8B2A9;
    --tomato: #FF5E40;
    --tomato-text: #FF8467;
    --tomato-on: #1B1917;
    --pea: #4ADE80;
    --berry: #E0687A;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.4);
  }
}

:root[data-theme="dark"] {
  --canvas: #0F0E0D;
  --card-bg: #1B1917;
  --card-border: rgba(250, 248, 244, 0.12);
  --ink: #F5F2EC;
  --ink-muted: #B8B2A9;
  --tomato: #FF5E40;
  --tomato-text: #FF8467;
  --tomato-on: #1B1917;
  --pea: #4ADE80;
  --berry: #E0687A;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* ============================================================
   Reset & base
   ============================================================ */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.55;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
main { display: block; }

h1, h2, h3, h4 {
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.25rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.25rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; color: var(--ink-muted); }
p:last-child { margin-bottom: 0; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

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

section { padding: 64px 0; }
section + section { border-top: 1px solid var(--card-border); }

.eyebrow {
  color: var(--tomato-text);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  margin-bottom: 0.75em;
  display: block;
}

/* ============================================================
   Buttons / App Store badge
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1rem;
  padding: 14px 22px;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary {
  background: var(--tomato);
  color: var(--tomato-on);
}
.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--card-border);
}

.appstore-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--ink);
  color: var(--canvas);
  padding: 10px 18px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  line-height: 1.2;
}
.appstore-badge svg { flex: none; }
.appstore-badge .label {
  display: flex;
  flex-direction: column;
}
.appstore-badge .label small { font-size: 0.65rem; opacity: 0.8; font-weight: 500; }
.appstore-badge .label strong { font-size: 1rem; }

/* ============================================================
   Header
   ============================================================ */
.site-header {
  border-bottom: 1px solid var(--card-border);
  background: var(--canvas);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--ink);
}
.brand .logomark { width: 32px; height: 32px; flex: none; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.main-nav a {
  text-decoration: none;
  font-weight: 600;
  color: var(--ink-muted);
  font-size: 0.95rem;
}
.main-nav a:hover { color: var(--ink); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 8px 10px;
  color: var(--ink);
}

@media (max-width: 760px) {
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--canvas);
    border-bottom: 1px solid var(--card-border);
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px 24px 20px;
  }
  .main-nav.is-open { display: flex; }
  .main-nav a { padding: 10px 0; width: 100%; }
  .nav-toggle { display: inline-flex; }
  .site-header { position: sticky; }
  .header-actions .appstore-badge .label { display: none; }
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  padding: 72px 0 48px;
}
.hero .wrap {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
.hero-copy p.lede {
  font-size: 1.2rem;
  color: var(--ink-muted);
  max-width: 46ch;
}
.hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
  flex-wrap: wrap;
}
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
}

/* ============================================================
   Device frame / screenshot placeholders
   ============================================================ */
.device-frame {
  width: 100%;
  max-width: 260px;
  margin: 0 auto;
  aspect-ratio: 9 / 19.5;
  background: var(--ink);
  border-radius: 34px;
  padding: 10px;
  box-shadow: var(--shadow);
}
.device-screen {
  width: 100%;
  height: 100%;
  border-radius: 24px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: linear-gradient(160deg, var(--tomato) 0%, var(--tomato) 38%, var(--card-bg) 38%, var(--card-bg) 100%);
}
.device-screen .placeholder-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.85);
}
.device-screen .placeholder-body {
  background: var(--card-bg);
  padding: 14px 14px 20px;
}
.device-screen .placeholder-body .bar {
  height: 10px;
  border-radius: 6px;
  background: var(--card-border);
  margin-bottom: 8px;
}
.device-screen .placeholder-body .bar.short { width: 55%; }
.device-screen .placeholder-body .bar.accent { background: var(--pea); width: 40%; }

.device-screen-photo {
  background: var(--card-bg);
}
.device-screen-photo picture,
.device-screen-photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  margin-top: 40px;
}
.showcase-item { text-align: center; }
.showcase-item .device-frame { max-width: 200px; }
.showcase-item figcaption {
  margin-top: 16px;
  font-weight: 700;
  font-size: 1rem;
}
.showcase-note {
  margin-top: 24px;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

/* ============================================================
   How it works
   ============================================================ */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-top: 40px;
  counter-reset: step;
}
.step {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 24px;
}
.step .step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--tomato);
  color: var(--tomato-on);
  font-weight: 800;
  margin-bottom: 16px;
}
.step h3 { margin-bottom: 8px; }
.step p { margin: 0; font-size: 0.95rem; }

/* ============================================================
   Cards / grids
   ============================================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-top: 40px;
}
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}
.card h3 { margin-bottom: 10px; }
.card p { font-size: 0.95rem; margin-bottom: 0; }
.card .note {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--card-border);
  font-size: 0.85rem;
  color: var(--berry);
  font-weight: 600;
}

.trust-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}
.trust-card h3 { font-size: 1.4rem; }
.trust-list {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  display: grid;
  gap: 14px;
}
.trust-list li {
  padding-left: 28px;
  position: relative;
  color: var(--ink-muted);
}
.trust-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--pea);
}
.trust-list li.warn::before { background: var(--berry); }

/* ============================================================
   Pricing
   ============================================================ */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 40px;
  align-items: stretch;
}
.price-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.price-card.is-primary {
  border-color: var(--tomato);
  box-shadow: var(--shadow);
  position: relative;
}
.price-card.is-primary::before {
  content: "Free week included";
  position: absolute;
  top: -13px;
  left: 24px;
  background: var(--tomato);
  color: var(--tomato-on);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}
.price-card .amount { font-size: 2.2rem; font-weight: 800; }
.price-card .amount span { font-size: 1rem; font-weight: 600; color: var(--ink-muted); }
.price-card ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.price-card ul li { padding-left: 24px; position: relative; font-size: 0.95rem; color: var(--ink-muted); }
.price-card ul li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--pea);
  font-weight: 800;
}
.pricing-footnote {
  margin-top: 28px;
  font-size: 0.9rem;
}
.pricing-footnote p { margin-bottom: 8px; }

/* ============================================================
   FAQ
   ============================================================ */
.faq-list { margin-top: 32px; display: grid; gap: 12px; }
.faq-item {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 4px 24px;
}
.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  padding: 18px 0;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--tomato-text);
  flex: none;
}
.faq-item[open] summary::after { content: "\2212"; }
.faq-item p { padding-bottom: 20px; margin: 0; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--card-border);
  padding: 48px 0;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  align-items: center;
}
.footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-links a { text-decoration: none; font-weight: 600; font-size: 0.9rem; color: var(--ink-muted); }
.footer-links a:hover { color: var(--ink); }
.footer-meta {
  width: 100%;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--card-border);
  font-size: 0.85rem;
  color: var(--ink-muted);
}

/* ============================================================
   Legal / content pages
   ============================================================ */
.legal-page .wrap { max-width: 780px; }
.legal-page h1 { margin-bottom: 0.25em; }
.legal-updated { color: var(--ink-muted); font-size: 0.9rem; margin-bottom: 2.5em; }
.legal-page h2 { margin-top: 2em; }
.legal-page h3 { margin-top: 1.5em; }
.legal-page table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.92rem;
}
.legal-page th, .legal-page td {
  border: 1px solid var(--card-border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}
.legal-page th { background: var(--card-bg); }
.legal-page ul, .legal-page ol { color: var(--ink-muted); }
.legal-page a { color: var(--tomato-text); font-weight: 600; }
.legal-page code { background: var(--card-bg); border: 1px solid var(--card-border); padding: 1px 6px; border-radius: 6px; font-size: 0.85em; }
.placeholder-flag {
  background: var(--berry);
  color: #fff;
  padding: 0 4px;
  border-radius: 4px;
  font-weight: 700;
}

.simple-page .wrap { max-width: 640px; text-align: center; padding-top: 100px; padding-bottom: 100px; }
