/* Juggle marketing site. Brand tokens match src/theme.ts in the app. */

@font-face { font-family: "Outfit"; font-weight: 600; font-display: swap; src: url("/fonts/Outfit_600SemiBold.ttf") format("truetype"); }
@font-face { font-family: "Outfit"; font-weight: 700; font-display: swap; src: url("/fonts/Outfit_700Bold.ttf") format("truetype"); }
@font-face { font-family: "Nunito"; font-weight: 400; font-display: swap; src: url("/fonts/Nunito_400Regular.ttf") format("truetype"); }
@font-face { font-family: "Nunito"; font-weight: 500; font-display: swap; src: url("/fonts/Nunito_500Medium.ttf") format("truetype"); }
@font-face { font-family: "Nunito"; font-weight: 700; font-display: swap; src: url("/fonts/Nunito_700Bold.ttf") format("truetype"); }

:root {
  /* Palette */
  --navy: #1E2A44;
  --navy-raised: #26355A;
  --cream: #FFF7E6;
  --marigold: #F2B134;
  --teal: #58C4A8;
  --coral: #FF8A5B;
  --slate: #4B5570;
  --sky: #9FB3D1;
  --rose: #B4452E;
  --rose-bg: #FBE9E4;
  --green: #1F5A4A;
  --green-bg: #DDF3EC;
  --coral-ink: #8C3A1D;
  --coral-bg: #FFE4D6;

  /* Light scheme */
  --ground: var(--cream);
  --ink: var(--navy);
  --body: var(--slate);
  --label: var(--slate);
  --border: rgba(30, 42, 68, 0.14);
  --card: rgba(255, 255, 255, 0.55);
  --alt: rgba(30, 42, 68, 0.04);
  --focus: var(--navy);
  --band: var(--navy);
  --band-border: transparent;
  --phone: var(--navy);
  --phone-border: transparent;
  --pill-bg: rgba(30, 42, 68, 0.08);
  --input-bg: #FFFFFF;
  --shadow: 0 24px 60px -24px rgba(30, 42, 68, 0.45);

  /* Driver colors on the sample board */
  --c-jenny: var(--marigold);
  --c-chris: var(--teal);
  --c-grandma: var(--coral);

  --font-brand: "Outfit", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, sans-serif;
  --radius: 18px;
  --gutter: 16px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: var(--navy);
    --ink: var(--cream);
    --body: var(--sky);
    --label: var(--sky);
    --border: rgba(159, 179, 209, 0.22);
    --card: rgba(159, 179, 209, 0.07);
    --alt: rgba(0, 0, 0, 0.16);
    --focus: var(--marigold);
    --band: var(--navy-raised);
    --band-border: rgba(159, 179, 209, 0.22);
    --phone: var(--navy-raised);
    --phone-border: rgba(159, 179, 209, 0.28);
    --pill-bg: rgba(159, 179, 209, 0.14);
    --input-bg: var(--navy);
    --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: var(--navy);
  --ink: var(--cream);
  --body: var(--sky);
  --label: var(--sky);
  --border: rgba(159, 179, 209, 0.22);
  --card: rgba(159, 179, 209, 0.07);
  --alt: rgba(0, 0, 0, 0.16);
  --focus: var(--marigold);
  --band: var(--navy-raised);
  --band-border: rgba(159, 179, 209, 0.22);
  --phone: var(--navy-raised);
  --phone-border: rgba(159, 179, 209, 0.28);
  --pill-bg: rgba(159, 179, 209, 0.14);
  --input-bg: var(--navy);
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--ground);
  color: var(--body);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  overflow-x: hidden;
}
img, svg { display: block; }
h1, h2, h3 { font-family: var(--font-brand); color: var(--ink); margin: 0; letter-spacing: -0.02em; text-wrap: balance; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: var(--ink); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
a:hover { text-decoration-color: var(--marigold); }
strong { color: var(--ink); font-weight: 700; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }

[hidden] { display: none !important; }
.sprite { position: absolute; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: var(--gutter); top: -100px; z-index: 10; background: var(--marigold); color: var(--navy); padding: 12px 16px; border-radius: 10px; font-weight: 700; }
.skip:focus { top: 12px; }
.nowrap { white-space: nowrap; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 640px) { :root { --gutter: 32px; } }

/* Labels: 11 to 12 px, 700, wide tracking, uppercase */
.label { font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--label); margin-bottom: 12px; }
.label-sky { color: var(--sky); }
.label-rose { color: var(--rose); margin-bottom: 4px; }

/* Wordmark: lowercase Outfit Bold, -0.05em tracking, one marigold dot at a fixed height */
.wm { display: inline-flex; align-items: flex-start; font-family: var(--font-brand); font-weight: 700; line-height: 1.26; color: var(--ink); text-transform: lowercase; }
.wm-l { position: relative; display: inline-block; margin-right: -0.05em; }
.wm-l:last-child { margin-right: 0; }
.wm-dot::after {
  content: ""; position: absolute; left: 50%; width: 0.17em; height: 0.17em; margin-left: -0.085em;
  top: calc(0.29em - 0.085em); border-radius: 50%; background: var(--marigold);
}
.wm-inline { font-size: 1em; }
.wm-mark { font-size: 40px; }

/* Buttons: 44 px minimum target */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px; border-radius: 999px; border: 2px solid transparent;
  font: 700 16px/1.2 var(--font-body); text-decoration: none; cursor: pointer;
  transition: transform 120ms ease, background-color 160ms ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--marigold); color: var(--navy); }
.btn-primary:hover { background: #F5BE55; }
.btn-ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--pill-bg); }
.btn-small { min-height: 44px; padding: 8px 18px; font-size: 15px; }
.btn-block { width: 100%; }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } .btn:active { transform: none; } }

/* Header */
.site-header { position: sticky; top: 0; z-index: 5; background: var(--ground); border-bottom: 1px solid var(--border); }
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; min-height: 44px; }
.brand-icon { width: 32px; height: 32px; color: var(--ink); }
.brand .wm { font-size: 30px; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a:not(.btn) { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; font-weight: 700; font-size: 15px; text-decoration: none; }
.nav a:not(.btn):hover { text-decoration: underline; text-decoration-color: var(--marigold); }
.nav-hide { display: none; }
@media (min-width: 820px) { .nav-hide { display: block; } }

/* Hero */
.hero { padding: 48px 0 64px; }
.hero-grid { display: grid; gap: 48px; align-items: center; }
@media (min-width: 920px) { .hero { padding: 80px 0 96px; } .hero-grid { grid-template-columns: 1.1fr 0.9fr; gap: 64px; } }
h1 { font-size: clamp(40px, 9vw, 68px); line-height: 1.02; font-weight: 700; letter-spacing: -0.035em; }
.lede { font-size: 19px; margin-top: 20px; max-width: 34em; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.fine { font-size: 14px; margin-top: 16px; }
.fine-sky { color: var(--sky); text-align: center; }

/* Sample phone */
.phone { margin: 0 auto; width: 100%; max-width: 340px; padding: 10px; border-radius: 40px; background: var(--phone); border: 1px solid var(--phone-border); box-shadow: var(--shadow); }
@media (min-width: 920px) { .phone { max-width: 360px; transform: rotate(1.5deg); } }
@media (prefers-reduced-motion: reduce) { .phone { transform: none; } }
.screen { background: var(--cream); border-radius: 31px; padding: 22px 16px 18px; color: var(--slate); }
.screen strong, .screen .leg-title, .screen .time, .screen .screen-title { color: var(--navy); }
.screen .label-sky { color: var(--slate); margin-bottom: 2px; }
.screen-title { font: 700 28px/1.2 var(--font-brand); letter-spacing: -0.02em; margin-bottom: 14px; }
.banner { display: flex; gap: 10px; align-items: center; background: var(--rose-bg); border-radius: 14px; padding: 12px; margin-bottom: 12px; }
.banner strong { color: var(--rose); font-size: 15px; line-height: 1.35; }
.banner .ring { color: var(--rose); }
.legs { display: grid; gap: 8px; }
.leg { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: #FFFFFF; border: 1px solid rgba(30, 42, 68, 0.1); }
.time { font: 600 15px/1.2 var(--font-brand); color: var(--navy); min-width: 38px; }
.leg-body { flex: 1; display: grid; min-width: 0; }
.leg-title { font: 600 16px/1.3 var(--font-brand); color: var(--navy); }
.leg-sub { font-size: 14px; line-height: 1.35; color: var(--slate); }
.leg-open { background: var(--rose-bg); border-color: transparent; }
.leg-open .leg-sub { color: var(--rose); font-weight: 700; }
.flag { justify-self: start; margin-top: 4px; font-size: 12px; font-weight: 700; color: var(--rose); background: var(--rose-bg); border-radius: 6px; padding: 2px 8px; }
.ring { width: 28px; height: 28px; flex: none; }
.ring-open { color: var(--rose); }
.c-jenny { color: var(--c-jenny); }
.c-chris { color: var(--c-chris); }
.c-grandma { color: var(--c-grandma); }

/* Sections */
.section { padding: 72px 0; }
@media (min-width: 920px) { .section { padding: 104px 0; } }
.section-alt { background: var(--alt); }
h2 { font-size: clamp(30px, 5.4vw, 44px); line-height: 1.1; font-weight: 700; max-width: 20em; }
.section-lede { font-size: 18px; margin-top: 16px; max-width: 38em; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }

/* Steps */
.steps { display: grid; gap: 56px; margin-top: 48px; counter-reset: step; }
.step { display: grid; gap: 24px; align-items: center; }
@media (min-width: 820px) {
  .step { grid-template-columns: 1fr 1fr; gap: 56px; }
  .step:nth-child(even) .step-copy { order: 2; }
}
.step-num { font: 700 14px/1 var(--font-brand); color: var(--navy); background: var(--marigold); width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 16px; }
.step h3 { font-size: 26px; line-height: 1.2; font-weight: 600; margin-bottom: 12px; }
.step h3 .wm { font-weight: 700; }
.demo { padding: 20px; display: grid; gap: 16px; max-width: 440px; width: 100%; justify-self: center; }
.demo .leg { background: #FFFFFF; }
:root[data-theme="dark"] .demo .leg { background: var(--cream); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .demo .leg { background: var(--cream); } }

/* Dibs demo */
.dibs-ring { width: 40px; height: 40px; }
.dibs-ring circle { stroke: var(--rose); transition: stroke 300ms ease; }
.dibs-check { stroke: var(--c-jenny); stroke-dasharray: 48; stroke-dashoffset: 48; transition: stroke-dashoffset 360ms ease 120ms; }
[data-claimed="true"] .dibs-ring circle { stroke: var(--c-jenny); }
[data-claimed="true"] .dibs-check { stroke-dashoffset: 0; }
[data-claimed="true"] .leg-demo { background: var(--green-bg); }
[data-claimed="true"] .leg-demo .leg-sub { color: var(--green); font-weight: 700; }
.leg-demo .leg-sub { color: var(--rose); font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .dibs-ring circle, .dibs-check { transition: none; } }

/* Conflict demo */
.conflict { background: var(--rose-bg); border-radius: 14px; padding: 14px; }
.conflict-title { font: 600 17px/1.3 var(--font-brand); color: var(--navy); }
.conflict-body { font-size: 15px; color: var(--slate); margin-top: 4px; }
.badge { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--green); background: var(--green-bg); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }

/* Me / Everyone demo */
.segmented { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 999px; background: var(--pill-bg); }
.segmented button { min-height: 44px; border: 0; border-radius: 999px; background: transparent; color: var(--ink); font: 700 15px/1 var(--font-body); cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--marigold); color: var(--navy); }
.legs-compact .leg { padding: 10px 12px; }
.status { font-size: 12px; font-weight: 700; color: var(--green); background: var(--green-bg); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }

/* Week demo */
.week { overflow: hidden; }
.week-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.day { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--label); text-align: center; padding-bottom: 4px; }
.chip { font-size: 12px; font-weight: 700; text-align: center; border-radius: 8px; padding: 10px 2px; color: var(--navy); overflow: hidden; text-overflow: ellipsis; }
.c-jenny-bg { background: var(--marigold); }
.c-chris-bg { background: var(--teal); }
.c-grandma-bg { background: var(--coral); }
.chip-open { background: var(--rose-bg); color: var(--rose); outline: 2px dashed var(--rose); outline-offset: -2px; }
.chip.empty { background: transparent; border: 1px dashed var(--border); }

.helper { margin-top: 56px; padding: 20px 24px; max-width: 760px; }

/* Marks */
.marks { display: grid; gap: 16px; margin-top: 40px; }
@media (min-width: 760px) { .marks { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
.mark { padding: 28px 24px; }
.mark-icon { width: 56px; height: 56px; margin-bottom: 12px; }
.t-dibs { color: var(--marigold); }
.t-peck { color: var(--teal); }
.t-tally { color: var(--coral); }
.mark h3 { line-height: 1; }
.pill { display: inline-block; margin: 8px 0 12px; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink); background: var(--pill-bg); border-radius: 999px; padding: 4px 10px; }
.pill-now { color: var(--green); background: var(--green-bg); }

/* Privacy */
.privacy-grid { display: grid; gap: 32px; }
@media (min-width: 920px) { .privacy-grid { grid-template-columns: 0.9fr 1.1fr; gap: 64px; } .privacy-links { grid-column: 2; } }
.trust { display: grid; gap: 18px; }
.trust li { padding-left: 32px; position: relative; }
.trust li::before { content: ""; position: absolute; left: 4px; top: 0.5em; width: 12px; height: 12px; border-radius: 50%; background: var(--marigold); }
.privacy-links a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }

/* Join */
.section-navy { background: var(--band); color: var(--sky); border-top: 1px solid var(--band-border); border-bottom: 1px solid var(--band-border); }
.section-navy h2, .section-navy strong { color: var(--cream); }
.section-navy a { color: var(--cream); }
.section-navy :focus-visible { outline-color: var(--marigold); }
.join-grid { display: grid; gap: 40px; align-items: start; }
@media (min-width: 920px) { .join-grid { grid-template-columns: 1fr 1fr; gap: 64px; } }
.already { margin-top: 24px; }
.already a { font-weight: 700; display: inline-flex; align-items: center; min-height: 44px; }
.join-form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; font-size: 15px; color: var(--cream); }
.optional { font-weight: 400; color: var(--sky); }
.field input, .field textarea {
  min-height: 48px; width: 100%; padding: 12px 14px; border-radius: 12px;
  border: 2px solid rgba(159, 179, 209, 0.5); background: var(--cream); color: var(--navy);
  font: 400 17px/1.4 var(--font-body);
}
.field textarea { resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #6B7590; }
.field input:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--marigold); outline-offset: 2px; border-color: var(--navy); }
.field [aria-invalid="true"] { border-color: var(--rose); box-shadow: 0 0 0 2px var(--rose-bg); }
.form-error { color: var(--navy); background: var(--rose-bg); border-radius: 10px; padding: 0 12px; font-weight: 700; font-size: 15px; }
.form-error:not(:empty) { padding: 10px 12px; border-left: 4px solid var(--rose); }
.join-form .btn[disabled] { opacity: 0.7; cursor: progress; }
.join-done { padding: 28px; background: var(--green-bg); border: 0; color: var(--green); }
.join-done:focus { outline: none; }
.ring-done { width: 44px; height: 44px; color: var(--green); margin-bottom: 12px; }
.done-title { font: 700 24px/1.2 var(--font-brand); color: var(--green); margin-bottom: 6px; }

/* Footer */
.site-footer { padding: 48px 0 40px; border-top: 1px solid var(--border); }
.footer-grid { display: grid; gap: 24px; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1fr auto; align-items: start; } .copyright { grid-column: 1 / -1; } }
.footer-tag { margin-top: 4px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }
.copyright { font-size: 14px; }
