/* FlareDays site layout (option C · Peek inside): Dusk hero with the app on a phone, Calm light steps,
   Dusk closing band; plus the privacy notice, leave and 404 pages at the end. */

:root {
  --font-heading: var(--font-sans);
  --heading-weight: 800;
  --heading-tracking: -0.02em;
}

body {
  background: radial-gradient(900px 600px at 80% 0%, var(--glow) 0%, rgba(42, 37, 87, 0) 70%) no-repeat, var(--bg);
}

.container {
  max-width: 72rem;
  margin-inline: auto;
}

[data-theme="light"] {
  background: var(--bg);
  color: var(--ink);
}

h2 {
  font-size: clamp(1.625rem, 1.35rem + 1.2vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.015em;
}

/* ---------- Header ---------- */

.site-header { padding-top: 20px; }

/* ---------- Hero ---------- */

/* 16px on phones keeps the field and button above the fold (launch addendum 1.5). */
.hero { padding-top: 16px; }

.hero-text { max-width: 36rem; }

.hero h1 {
  margin-top: 16px;
  font-size: clamp(2.25rem, 1.6rem + 3vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.line-accent { color: var(--accent); }

.hero .lead { margin-top: 16px; }

.hero .signup { margin-top: 32px; }

/* The phone is cropped by the bottom edge of the hero. */
.phone-crop {
  /* 312px, or narrower on very small screens so the frame ring isn't cut off. */
  --pw: min(312px, calc(100vw - 40px));
  display: flex;
  justify-content: center;
  align-items: flex-start;
  height: 420px;
  margin: 48px calc(-1 * var(--gutter)) 0;
  padding: 12px 24px 0;
  overflow: hidden;
  background: radial-gradient(closest-side, rgba(255, 179, 138, .10), transparent) 50% 50% / 420px 420px no-repeat;
}

/* Phones only: a small peek at the Today screen above the headline, so the first screen
   shows the app. Decorative (aria-hidden); the full phone below the form has the label. */
.phone-peek {
  --pw: 232px;
  display: flex;
  justify-content: center;
  height: 132px;
  margin-bottom: 12px;
  padding: 10px 12px 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 62%, transparent);
  mask-image: linear-gradient(to bottom, #000 62%, transparent);
}

/* No drop shadow here: the crop would cut it into a hard-edged box. */
.phone-peek .phone {
  align-self: flex-start;
  box-shadow: 0 0 0 8px #0b0c18, 0 0 0 9px #3a3f72;
}

@media (min-width: 600px) {
  .phone-peek { display: none; }
}

/* ---------- The phone (Today screen, made-up data) ---------- */

.phone {
  flex: none;
  width: var(--pw);
  aspect-ratio: 390 / 844;
  /* 1em = 16px on a 390px-wide screen, so everything inside scales with the phone. */
  font-size: calc(var(--pw) / 24.375);
  line-height: 1.35;
  letter-spacing: 0;
  word-spacing: normal;
  padding: 0 1.1em;
  border-radius: 3em;
  background: #15172c;
  color: var(--ink);
  box-shadow: 0 0 0 8px #0b0c18, 0 0 0 9px #3a3f72, 0 30px 90px rgba(0, 0, 0, .55);
  overflow: hidden;
  user-select: none;
}

.ph-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 2.6em;
  padding: 0 .4em;
}

.ph-time { font-size: .9em; font-weight: 700; }

.ph-sys { display: flex; gap: .2em; }
.ph-sys .icon { width: 1em; height: 1em; }

.ph-day {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: .4em;
}

.ph-today {
  display: block;
  font-size: 1.9em;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.ph-weekday {
  display: block;
  font-size: .875em;
  font-weight: 600;
  color: var(--ink-2);
}

.ph-gear {
  display: grid;
  place-items: center;
  width: 2.75em;
  height: 2.75em;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
}

.ph-gear .icon { width: 1.35em; height: 1.35em; }

.ph-card {
  margin-top: .75em;
  padding: 1em;
  border-radius: 1.25em;
  background: var(--surface);
  border: 1px solid var(--line);
}

.ph-label {
  display: block;
  font-size: .8em;
  font-weight: 800;
  color: var(--ink-2);
}

.ph-etop {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: .6em;
  margin-top: .2em;
}

.ph-left { display: flex; align-items: baseline; gap: .25em; }

.ph-big {
  font-size: 3em;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}

.ph-of { font-size: .95em; font-weight: 700; color: var(--ink-2); }

.ph-eside {
  display: grid;
  text-align: right;
  font-size: .8em;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink-2);
}

.ph-eside b { font-size: 1.1875em; font-weight: 800; color: var(--ink); }

/* Energy cells (phone and the light-theme plan snippet) */

.cells {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: .25em;
}

.cell { display: block; border-radius: .375em; }
.cells .cell { height: 1.375em; }
.cell.used { background: var(--cell-used); }
.cell.planned {
  background: repeating-linear-gradient(45deg, var(--plan) 0 3px, transparent 3px 7px);
  box-shadow: inset 0 0 0 1.5px var(--plan);
}
.cell.spare { background: var(--rest); }

.ph-energy .cells { margin-top: .75em; }

.ph-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .4em 1.1em;
  margin-top: .6em;
  font-size: .75em;
  font-weight: 700;
  color: var(--ink-2);
}

.ph-legend span { display: inline-flex; align-items: center; gap: .4em; }
.ph-legend .cell { width: 1em; height: 1em; border-radius: .3em; }

.ph-msg {
  display: flex;
  align-items: center;
  gap: .45em;
  margin-top: .75em;
  font-size: .85em;
  font-weight: 700;
}

.ph-msg .icon { width: 1.3em; height: 1.3em; color: var(--success); }

.ph-ask {
  margin-top: .75em;
  padding: 1em;
  border-radius: 1.25em;
  background: var(--surface);
  border: 1.5px dashed var(--line);
}

.ph-askq { display: flex; align-items: flex-start; gap: .6em; }
.ph-askq > .icon { width: 1.5em; height: 1.5em; color: var(--care); }
.ph-askq b { display: block; font-size: .95em; font-weight: 800; }
.ph-askq span { display: block; font-size: .8em; font-weight: 600; color: var(--ink-2); margin-top: .1em; }

.ph-chips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .45em;
  margin-top: .8em;
}

.ph-chip {
  display: grid;
  place-items: center;
  min-height: 3.235em; /* 2.75em of the phone, in the chip's own 0.85em */
  border-radius: .882em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: .85em;
  font-weight: 800;
  white-space: nowrap;
}

.ph-chip.is-on { background: var(--care); border-color: var(--care); color: var(--on-care); }

.ph-hour {
  display: flex;
  align-items: center;
  gap: .6em;
  margin-top: 1.1em;
  font-size: .7em;
  font-weight: 700;
  color: var(--ink-2);
}

.ph-hour::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, .08);
}

.ph-hour-next { margin-top: 2.4em; }

.ph-blk {
  display: flex;
  align-items: center;
  gap: .6em;
  min-height: 4.2em;
  margin: .5em 0 0 3.2em;
  padding: .6em .9em;
  border-radius: .875em;
  background: var(--blk-rest);
  border-left: 4px solid var(--rest);
  font-size: .9em;
}

.ph-blk .icon { width: 1.4em; height: 1.4em; color: var(--rest); }
.ph-blk b { font-weight: 800; }

/* ---------- How it works (Calm light) ---------- */

.how { padding-top: 64px; padding-bottom: 64px; }

.step-cards {
  list-style: none;
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.step-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  border-radius: 24px;
  background: var(--surface);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
}

.snippet {
  display: grid;
  place-items: center;
  min-height: 120px;
  padding: 14px;
  border-radius: 16px;
  background: var(--surface-2);
  letter-spacing: 0;
  word-spacing: normal;
}

.snippet > * { width: 100%; }

.snippet-quick { container-type: inline-size; }

.step-label {
  margin-top: 16px;
  font-size: var(--text-small);
  font-weight: 800;
  line-height: 1.4;
  color: var(--ink-2);
}

.step-card h3 { margin-top: 4px; }

.step-text {
  margin-top: 8px;
  color: var(--ink-2);
}

/* Snippet 1: quick buttons */

.quick {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
}

.quick-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 60px;
  padding: 6px 4px;
  border-radius: 16px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
}

.quick-tile .icon { width: 22px; height: 22px; }

.q-symptom { background: var(--coral); }
.q-meds { background: var(--lilac); }
.q-food { background: var(--home); }
.q-activity { background: var(--work); }
.q-rest { background: var(--rest); }

/* Five tiles in a row need 320px: the longest label ("Symptom") is 52px at 11px, plus 4px
   padding on each side. When the snippet is narrower (phones, and the three-column cards
   from 960px), the tiles go in two rows: three, then two. */
@container (max-width: 319.98px) {
  .quick { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
  .quick-tile { grid-column: span 2; min-height: 54px; }
  .q-activity, .q-rest { grid-column: span 3; }
}

/* Snippet 2: patterns */

.mini-patterns {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: var(--surface);
}

.mini-row + .mini-row {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1.5px solid;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
}

.badge-often { color: var(--plan); border-color: var(--plan); }
.badge-learning { color: var(--ink-2); border-color: var(--field-line); border-style: dashed; }

.mini-text {
  display: block;
  margin-top: 6px;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
}

.mini-count {
  display: block;
  margin-top: 2px;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink-2);
}

/* Snippet 3: plan */

.mini-plan .cells { font-size: 12px; margin-top: 8px; }

.mini-energy { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.mini-elabel { font-size: 0.8125rem; font-weight: 800; color: var(--ink-2); }
.mini-enum { font-size: 1.25rem; font-weight: 800; line-height: 1.1; color: var(--ink); }

.mini-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 12px;
  background: transparent;
  border: 1.5px dashed var(--plan);
  border-left: 4px solid var(--work);
  line-height: 1.35;
}

.mini-block b { display: block; font-size: 0.875rem; font-weight: 800; color: var(--ink); }
.mini-block b + span { display: block; font-size: 0.8125rem; font-weight: 600; color: var(--ink-2); }

.mini-cost {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex: none;
  padding: 2px 8px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--line);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--ink);
}

.mini-cost .icon { width: 14px; height: 14px; color: var(--plan); }

.how .privacy-line { margin-top: 40px; }

/* ---------- Closing band (Dusk) ---------- */

.closing {
  padding-top: 72px;
  padding-bottom: 72px;
  background: radial-gradient(900px 500px at 50% 100%, var(--glow) 0%, rgba(42, 37, 87, 0) 70%), var(--bg);
}

.closing h2 { margin-bottom: 12px; }

/* ---------- From 600px ---------- */

@media (min-width: 600px) {
  .site-header { padding-top: 28px; }
  .hero { padding-top: 56px; }
  .hero h1 .line { display: block; }
  .hero .lead { margin-top: 20px; }
  .hero .signup { margin-top: 40px; }

  .phone-crop { --pw: 340px; height: 480px; margin-inline: 0; }

  .how { padding-top: 88px; padding-bottom: 88px; }
  .step-cards { margin-top: 32px; }
  .how .privacy-line { margin-inline: auto; width: fit-content; }

  .closing { padding-top: 96px; padding-bottom: 96px; text-align: center; }
  .closing p { margin-inline: auto; }
}

/* ---------- From 960px: text left, phone right; step cards in a row ---------- */

@media (min-width: 960px) {
  .site-header { padding-top: 36px; }

  .hero { padding-top: 48px; }
  .hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 48px;
  }
  .hero-text { align-self: center; padding-bottom: 96px; }
  .phone-crop { --pw: 360px; height: 600px; margin-top: 0; align-self: end; }

  .how { padding-top: 104px; padding-bottom: 104px; }
  .step-cards {
    margin-top: 40px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
  }
  /* Each card spans the same four rows (snippet, label, title, text), so labels and titles line up. */
  .step-card {
    display: grid;
    grid-row: span 4;
    grid-template-rows: subgrid;
    row-gap: 0;
  }

  .closing { padding-top: 112px; padding-bottom: 112px; }
}

/* ---------- Forced colors ---------- */

@supports not (grid-template-rows: subgrid) {
  @media (min-width: 960px) { .snippet { min-height: 240px; } }
}

@media (forced-colors: active) {
  /* The phone and the snippets are pictures of the app: keep their colors, like an image. */
  .phone, .snippet, .phone-peek { forced-color-adjust: none; }
  .cell { border: 1px solid CanvasText; }
  .phone-crop { forced-color-adjust: none; }
}

/* ---------- Text pages: privacy notice, leave the list, 404 ---------- */

.page-h1 {
  font-size: clamp(2rem, 1.6rem + 1.8vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

/* Privacy notice: Dusk top band, Calm light reading band */

.page-top { padding-top: 40px; padding-bottom: 48px; }
.page-top .lead { margin-top: 16px; }

.page-updated {
  margin-top: 12px;
  font-size: var(--text-small);
  line-height: 1.5;
  color: var(--ink-2);
}

.reading { padding-top: 48px; padding-bottom: 48px; }

.prose {
  max-width: 38rem;
  font-size: 1.125rem;
  line-height: 1.65;
}

.prose p + p,
.prose p + ul,
.prose ul + p { margin-top: 12px; }

.prose h2 {
  margin-top: 40px;
  margin-bottom: 12px;
  font-family: var(--font-sans);
  font-size: 1.375rem;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.prose ul { padding-left: 1.25em; list-style: disc; }
.prose li + li { margin-top: 6px; }
.prose li::marker { color: var(--ink-2); }

.short-version {
  padding: 20px 24px;
  background: var(--surface);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: 20px;
}

.short-version h2 { margin-top: 0; }

.prose .btn { margin-top: 20px; }

/* Leave the waiting list: all Dusk, like the home hero without the phone */

.leave { padding-top: 40px; padding-bottom: 72px; }
.leave-text { max-width: 36rem; }
.leave .lead { margin-top: 16px; }
.leave .signup { margin-top: 32px; }
.leave-again { margin-top: 32px; max-width: 34rem; }

/* 404 */

.notfound { padding-top: 56px; padding-bottom: 88px; }
.notfound-text { max-width: 32rem; }
.notfound-text p { margin-top: 16px; color: var(--ink-2); }
.notfound .btn { margin-top: 24px; }

@media (min-width: 600px) {
  .page-top { padding-top: 56px; padding-bottom: 64px; }
  .reading { padding-top: 64px; padding-bottom: 64px; }
  .leave { padding-top: 56px; padding-bottom: 96px; }
  .leave .lead { margin-top: 20px; }
  .leave .signup { margin-top: 40px; }
  .notfound { padding-top: 88px; padding-bottom: 120px; }
  .notfound-text { margin-inline: auto; text-align: center; }
}

@media (min-width: 960px) {
  .page-top { padding-top: 64px; padding-bottom: 72px; }
  .reading { padding-top: 80px; padding-bottom: 80px; }
  .leave { padding-top: 72px; padding-bottom: 104px; }
}
