:root {
  --primary: #007a87;   /* turquoise */
  --paper: #f5eee3;     /* soft beige */
  --accent: #ffc48c;    /* apricot: what to press, and free time */
  --ink: #12343b;
  --bubble: #bfede6;
  --muted: #4f6a70;
  --display: "Secular One", "Arial Hebrew", Arial, sans-serif;
  --text: "Assistant", "Arial Hebrew", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--text);
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
}

.wrap { width: min(1080px, 100% - 2.5rem); margin-inline: auto; }

h1, h2 { font-family: var(--display); font-weight: 400; margin: 0; line-height: 1.12; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); }
.h2-sub { display: block; margin-top: 0.5rem; font-size: 0.6em; line-height: 1.3; }

.section-lead { max-width: 60ch; margin: 1rem 0 0; color: var(--muted); }

.btn {
  display: inline-block;
  border: 0;
  border-radius: 10px;
  padding: 0.95rem 1.7rem;
  font: 700 1.1rem/1.2 var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-accent { background: var(--accent); color: var(--ink); }
.btn-primary { background: var(--primary); color: #fff; }

/* ---------- hero ---------- */

.hero { background: var(--primary); color: #fff; padding: 1.5rem 0 clamp(3rem, 8vw, 6rem); }
.hero :focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

.brand {
  margin: 0 0 clamp(2rem, 6vw, 4rem);
  font: 400 1.5rem/1 var(--display);
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.brand-logo { display: block; height: 3.75rem; width: auto; max-width: 100%; }

.hero-grid { display: grid; gap: 2.75rem; align-items: center; }

.hero h1 { font-size: clamp(2.3rem, 5.6vw, 4.2rem); max-width: 15ch; }
.lead { max-width: 46ch; margin: 1.25rem 0 2rem; font-size: 1.25rem; color: #f2fbfa; }

@media (min-width: 880px) {
  .hero-grid { grid-template-columns: 1.15fr 0.85fr; }
}

/* the conversation: the one thing that moves, once, when the page opens */
.phone {
  width: min(360px, 100%);
  justify-self: center;
  background: var(--paper);
  color: var(--ink);
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 40, 48, 0.4);
}
.phone-bar { background: var(--ink); color: #fff; padding: 0.85rem 1.1rem; font: 400 1.05rem/1 var(--display); direction: ltr; text-align: left; }
.chat { list-style: none; margin: 0; padding: 1rem; display: flex; flex-direction: column; gap: 0.6rem; min-height: 21rem; }
.bubble { max-width: 86%; padding: 0.6rem 0.9rem; border-radius: 14px; font-size: 1rem; line-height: 1.45; }
.bubble.me { align-self: flex-start; background: var(--bubble); border-end-start-radius: 4px; }
.bubble.bot { align-self: flex-end; background: #fff; border-end-end-radius: 4px; }

.js .bubble { opacity: 0; transform: translateY(8px); transition: opacity 0.4s ease, transform 0.4s ease; }
.js .bubble.shown { opacity: 1; transform: none; }

/* ---------- the day strip ---------- */

.day { padding: clamp(3rem, 8vw, 6rem) 0 clamp(2rem, 5vw, 3.5rem); }

.strip { display: flex; gap: 3px; height: 76px; margin-top: 2.25rem; }
.seg { flex: var(--m) 1 0; min-width: 0; display: flex; align-items: center; justify-content: center; border-radius: 6px; overflow: hidden; }
.seg span { padding-inline: 0.35rem; font-weight: 700; font-size: 0.95rem; line-height: 1.2; text-align: center; }
.seg.gap { background: transparent; }
.seg.fixed { background: var(--ink); color: #fff; }
.seg.road { background: repeating-linear-gradient(135deg, var(--ink) 0 2px, transparent 2px 7px); opacity: 0.55; }
.seg.free { background: var(--accent); color: var(--ink); }
.seg.free.short { background: transparent; border: 2px solid var(--accent); }  /* a gap too short to plan around: outlined, not filled */
.seg.free.long span { font-size: 1.1rem; }

.ticks { position: relative; height: 1.75rem; margin-top: 0.5rem; font-size: 0.9rem; color: var(--muted); }
.ticks span { position: absolute; right: calc(var(--at) * 1%); transform: translateX(50%); }
.ticks span:first-child { transform: none; }
.ticks span:last-child { transform: translateX(100%); }

.legend { display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; list-style: none; padding: 0; margin: 1.25rem 0 0; font-size: 0.98rem; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 0.5rem; }
.key { width: 1.15rem; height: 1.15rem; border-radius: 4px; display: inline-block; }
.key.fixed { background: var(--ink); }
.key.road { background: repeating-linear-gradient(135deg, var(--ink) 0 2px, transparent 2px 6px); opacity: 0.55; border: 1px solid var(--ink); }
.key.free-short { background: transparent; border: 2px solid var(--accent); }
.key.free { background: var(--accent); }

/* on a phone the day runs top to bottom: labels get room, and a 90-minute basketball is no longer a sliver */
@media (max-width: 640px) {
  .chart { display: grid; grid-template-columns: 3.6rem 1fr; gap: 0.6rem; height: 460px; margin-top: 2rem; }
  .chart .strip { grid-column: 2; flex-direction: column; height: 100%; margin-top: 0; }
  .chart .ticks { grid-column: 1; grid-row: 1; height: 100%; margin-top: 0; }
  .ticks span, .ticks span:first-child, .ticks span:last-child { right: 0; top: calc(var(--at) * 1%); transform: translateY(-50%); }
  .ticks span:first-child { transform: none; }
  .ticks span:last-child { transform: translateY(-100%); }
  .seg span { font-size: 1rem; }
  .seg.free.long span { font-size: 1.15rem; }
}

@media (max-width: 640px) {
  body { font-size: 1.06rem; line-height: 1.6; }
  .hero { padding-bottom: 2.75rem; }
  .brand { margin-bottom: 1.75rem; }
  .lead { font-size: 1.15rem; margin-bottom: 1.5rem; }
  .chat { min-height: 19rem; }
  .btn { width: 100%; text-align: center; }
  .btn.sticky-cta { width: auto; }  /* it is sized by its side offsets, not by 100% */
  .does-list > div { padding: 1.1rem 0; }
}

/* ---------- what it does / what to know ---------- */

.does { background: #fff; padding: clamp(3rem, 8vw, 5.5rem) 0; }
.does-list { margin: 2.25rem 0 0; display: grid; gap: 0; }
.does-list > div { display: grid; gap: 0.25rem 2.5rem; padding: 1.25rem 0; border-top: 2px solid var(--ink); }
.does-list dt { font: 400 1.35rem/1.25 var(--display); }
.does-list dd { margin: 0; max-width: 62ch; color: var(--muted); }

@media (min-width: 760px) {
  .does-list > div { grid-template-columns: 17rem 1fr; align-items: baseline; }
}

.know { padding: clamp(3rem, 8vw, 5rem) 0; }
.know-list { margin: 1.75rem 0 0; padding: 0; list-style: none; display: grid; gap: 0.9rem; max-width: 62ch; }
.know-list li { padding-inline-start: 1.5rem; position: relative; }
.know-list strong { color: var(--ink); }
.know-list li::before { content: ""; position: absolute; inset-inline-start: 0; top: 0.7em; width: 0.7rem; height: 0.7rem; background: var(--primary); border-radius: 2px; }

/* ---------- waitlist ---------- */

.join { background: var(--accent); padding: clamp(3rem, 8vw, 5.5rem) 0; }
.join .section-lead { color: var(--ink); }
.join :focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.join-grid { display: grid; gap: 2.5rem; }

@media (min-width: 880px) {
  .join-grid { grid-template-columns: 1fr 1fr; align-items: start; }
}

#waitlist { display: grid; gap: 1.4rem; }
.field { margin: 0; padding: 0; border: 0; }
.field label, .field legend { display: block; margin-bottom: 0.5rem; padding: 0; font-weight: 700; }

input[type="email"] {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: 1.05rem/1.3 var(--text);
  text-align: left;
}
input[type="email"][aria-invalid="true"] { border-color: #8a1020; }
.hint { margin: -0.15rem 0 0.7rem; color: #4a3416; font-size: 0.98rem; }
.error { margin: 0.5rem 0 0; color: #8a1020; font-weight: 700; }

.chips { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.chips label { position: relative; margin: 0; font-weight: 600; }
.chips input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chips span { display: inline-block; min-width: 3.4rem; text-align: center; padding: 0.6rem 1.1rem; border: 2px solid var(--ink); border-radius: 10px; background: transparent; }
.chips input:checked + span { background: var(--ink); color: #fff; }
.chips input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 3px; }

.after { margin: 0; padding: 1rem 1.1rem; background: #fff; border-radius: 10px; font-weight: 600; }

footer { background: var(--ink); color: #c5dedf; padding: 1.75rem 0; font-size: 0.98rem; }
footer p { margin: 0; }
footer .copy { margin-top: 0.35rem; font-size: 0.9rem; color: #9fb8bb; }

/* a join button that stays in reach on phones: only after the first one has scrolled away, and not over the form itself */
.sticky-cta { display: none; }

@media (max-width: 879px) {
  .sticky-cta {
    display: block;
    position: fixed;
    inset-inline: 1rem;
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    z-index: 10;
    text-align: center;
    box-shadow: 0 10px 28px rgba(0, 40, 48, 0.3);
    transform: translateY(160%);
    transition: transform 0.25s ease;
  }
  .sticky-cta.visible { transform: none; }
  footer { padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px)); }
}

@media (prefers-reduced-motion: reduce) {
  .sticky-cta { transition: none; }
  html { scroll-behavior: auto; }
  .btn { transition: none; }
  .btn:hover { transform: none; }
  .js .bubble { opacity: 1; transform: none; transition: none; }
}
