/*
 * Little Loops website.
 *
 * Every colour below is mirrored from LittleLoopsKit/Sources/LittleLoopsKit/Palette.swift, which
 * is the only place in the project hex literals are allowed to live. Nothing here is a new brand
 * decision. If a value changes there, change it here.
 *
 * Three rules carried over from docs/DESIGN_SYSTEM.md that a website would otherwise break:
 *
 *   1. There are no borders. A surface separates from what is behind it by lift or by fill,
 *      never by a stroke. The one exception is :focus-visible, which is an accessibility
 *      requirement rather than decoration, and which uses outline rather than border.
 *   2. A category fill is a surface and never a text colour. A category ink is text drawn on
 *      that fill and never a background.
 *   3. Exactly two elevation specs, both deliberately wide and faint.
 *
 * Shape lock: cards 24px, inner media and insight cards 20px, buttons 18px, small tiles 14px,
 * pills full. That is the whole scale and nothing else is used.
 */

:root {
  color-scheme: light dark;

  /* Surfaces */
  --canvas: #f1f2f5;
  --raised: #ffffff;

  /* Interactive tint */
  --accent: #0f7c93;
  --on-accent: #ffffff;
  --accent-subtle: rgb(15 124 147 / 12%);

  /* Text. Secondary is darker than the app's secondaryLabel so it clears AA on --canvas. */
  --text: #1c1c1e;
  --text-secondary: #53535a;

  /* Category fills and the ink that may be drawn on them */
  --feeding-fill: #c3e4dc;
  --feeding-ink: #173029;
  --pump-fill: #cbdff0;
  --pump-ink: #16293a;
  --diaper-fill: #f6dcc8;
  --diaper-ink: #3e2a16;
  --sleep-fill: #d7d3f1;
  --sleep-ink: #252045;
  --growth-fill: #f7dc7c;
  --growth-ink: #3b2f06;
  --medication-fill: #f3d6dc;
  --medication-ink: #3a1d25;
  --routine-fill: #d9e7bd;
  --routine-ink: #2b3a16;

  /* Status, only ever drawn on a raised surface */
  --status-positive: #3a7a50;
  --status-attention: #a06a10;

  /* Text-weight variants, for accent-coloured text sitting directly on --canvas.
   *
   * The app never needs these: in the app the accent is either a fill or sits on the white
   * raised surface, where #0f7c93 measures 4.86:1. On the canvas grey it is 4.34:1, which
   * misses AA. Each value below is its palette colour taken down in Oklab lightness only,
   * far enough to clear 4.5:1 and no further, so the hue and chroma are unchanged and these
   * read as the same colour. Do not use them as fills, and do not use --accent for body text. */
  --accent-text: #077990;
  --status-attention-text: #996400;

  /* Elevation. Wide and faint: at 3am on minimum brightness a hard shadow reads as a smudge. */
  --shadow-card: 0 4px 12px rgb(0 0 0 / 6%);
  --shadow-chip: 0 1px 4px rgb(0 0 0 / 4%);

  /* Shape */
  --r-card: 24px;
  --r-media: 20px;
  --r-button: 18px;
  --r-tile: 14px;

  /* Rhythm. Base unit 4px, as in the app. */
  --gutter: 20px;
  --measure: 65ch;
  --container: 1120px;
  --section-y: clamp(4rem, 9vw, 7.5rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #000000;
    --raised: #1c1c1e;

    --accent: #6fbfbb;
    --on-accent: #10231f;
    --accent-subtle: rgb(111 191 187 / 12%);

    --text: #f2f2f7;
    --text-secondary: #a1a1a8;

    --feeding-fill: #1d3a33;
    --feeding-ink: #96d8c6;
    --pump-fill: #1c3040;
    --pump-ink: #9cc8e8;
    --diaper-fill: #3a2b1c;
    --diaper-ink: #e8ba8c;
    --sleep-fill: #2a2748;
    --sleep-ink: #b9b2e8;
    --growth-fill: #3b3312;
    --growth-ink: #e5cb6e;
    --medication-fill: #3d2730;
    --medication-ink: #eab8c4;
    --routine-fill: #2c3a1b;
    --routine-ink: #c6db9e;

    --status-positive: #6bbf85;
    --status-attention: #e8a83c;

    /* On black the palette values already clear AA comfortably, so there is nothing to adjust. */
    --accent-text: #6fbfbb;
    --status-attention-text: #e8a83c;

    --shadow-card: 0 4px 12px rgb(0 0 0 / 40%);
    --shadow-chip: 0 1px 4px rgb(0 0 0 / 30%);
  }
}

/* ---------- Reset and base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* `height: auto` is load bearing. Every screenshot carries width and height attributes for CLS,
 * and those attributes are presentational hints: overriding only `width` in CSS leaves the height
 * hint in force, so the image renders 300px wide and still 1284px tall. Letting height resolve
 * from the intrinsic aspect ratio is what makes the attributes reserve space without also
 * fixing the size. */
img,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* The UA sheet gives [hidden] display:none at element specificity, which any class rule beats.
   The success state hides .signup-row, and that is display:flex. */
[hidden] {
  display: none !important;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 600;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: var(--accent-text);
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Layout ---------- */

.wrap {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

section {
  padding-block: var(--section-y);
}

/* The nav is sticky and 64px tall, so a fragment jump would otherwise put the top of the target
   section underneath it. */
section[id] {
  scroll-margin-top: 5rem;
}

.lede {
  color: var(--text-secondary);
  font-size: 1.125rem;
  max-width: var(--measure);
}

.eyebrow {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--accent-text);
  margin-bottom: 0.75rem;
}

h2 {
  font-size: clamp(1.75rem, 3.6vw, 2.5rem);
}

h3 {
  font-size: 1.1875rem;
  font-weight: 600;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  border: 0;
  border-radius: var(--r-button);
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: var(--shadow-card);
}

.btn-soft {
  background: var(--raised);
  color: var(--accent-text);
  box-shadow: var(--shadow-chip);
}

.btn:active {
  transform: translateY(1px);
}

@media (prefers-reduced-motion: reduce) {
  .btn {
    transition: none;
  }
}

/* ---------- Navigation ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 64px;
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--canvas) 88%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.wordmark svg,
.wordmark img {
  width: 38px;
  height: auto;
}

.nav .btn {
  padding: 0.625rem 1.125rem;
}

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

.hero {
  padding-top: clamp(2rem, 4vw, 3.5rem);
  padding-bottom: clamp(3rem, 6vw, 5rem);
}

.hero .wrap {
  display: grid;
  gap: clamp(2.5rem, 5vw, 4rem);
  align-items: center;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .hero .wrap {
    grid-template-columns: 1.05fr 0.95fr;
  }
}

.hero h1 {
  font-size: clamp(2.125rem, 4.6vw, 3.25rem);
  font-weight: 700;
}

.hero .lede {
  margin-top: 1.25rem;
  font-size: 1.25rem;
}

/* Constrained by height rather than width, because the source is a full phone screenshot at
 * roughly 1:2.2. At a fixed 320px wide it stands 700px tall, which pushed the headline into the
 * middle of the viewport and the signup form below the fold. The hero has to fit on one screen. */
.hero-shot {
  justify-self: center;
  width: auto;
  max-width: min(300px, 100%);
  max-height: min(56vh, 600px);
  border-radius: var(--r-media);
  box-shadow: var(--shadow-card);
}

/* Stacked, there is no competing column, so the image can be a little larger. */
@media (max-width: 899px) {
  .hero-shot {
    max-height: 70vh;
  }
}

/* ---------- Waitlist form ---------- */

.signup {
  margin-top: 2rem;
  max-width: 30rem;
}

.signup label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.signup-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}

.signup input[type="email"] {
  flex: 1 1 14rem;
  min-width: 0;
  padding: 0.875rem 1rem;
  border: 0;
  border-radius: var(--r-button);
  background: var(--raised);
  color: var(--text);
  font: inherit;
  box-shadow: var(--shadow-chip);
}

.signup input::placeholder {
  color: var(--text-secondary);
  opacity: 1;
}

.signup .note,
.signup .msg {
  margin-top: 0.75rem;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.signup .msg[data-state="error"] {
  color: var(--status-attention-text);
  font-weight: 600;
}

.signup .msg[data-state="ok"] {
  color: var(--status-positive);
  font-weight: 600;
}

.signup .msg:empty {
  display: none;
}

/* The honeypot. Bots fill it, people never see it. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Cards and surfaces ---------- */

.card {
  background: var(--raised);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 1.75rem;
}

.shot {
  border-radius: var(--r-media);
  box-shadow: var(--shadow-card);
  width: 100%;
}

/* ---------- Thesis: statement plus real insight cards ---------- */

.thesis-head {
  max-width: 46rem;
}

.thesis-head h2 + p {
  margin-top: 1rem;
}

.insights {
  margin-top: 3rem;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

@media (min-width: 760px) {
  .insights {
    grid-template-columns: repeat(3, 1fr);
  }
}

.insight {
  background: var(--raised);
  border-radius: var(--r-media);
  box-shadow: var(--shadow-card);
  padding: 1.5rem;
}

.insight strong {
  display: block;
  font-size: 1.0625rem;
  margin-bottom: 0.375rem;
}

.insight p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.insight .cat {
  display: inline-block;
  background: var(--cat-fill);
  color: var(--cat-ink);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* ---------- Split sections ---------- */

.split .wrap {
  display: grid;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .split .wrap {
    grid-template-columns: 1fr 1fr;
  }

  .split.image-left .split-media {
    order: -1;
  }
}

.split-body h2 + p,
.split-body p + p {
  margin-top: 1rem;
}

.split-media img {
  width: min(300px, 100%);
  margin-inline: auto;
}

.quiet-list {
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.875rem;
}

.quiet-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: start;
  color: var(--text-secondary);
}

.quiet-list svg {
  width: 20px;
  height: 20px;
  margin-top: 0.2rem;
  color: var(--accent);
  flex: none;
}

.quiet-list b {
  color: var(--text);
  font-weight: 600;
}

/* ---------- Bento ---------- */

.bento {
  margin-top: 3rem;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

@media (min-width: 760px) {
  .bento {
    grid-template-columns: repeat(6, 1fr);
  }

  /* Six items, six cells, deliberately unequal. No empty cell anywhere. */
  .bento > :nth-child(1) {
    grid-column: span 4;
  }
  .bento > :nth-child(2) {
    grid-column: span 2;
  }
  .bento > :nth-child(3) {
    grid-column: span 2;
  }
  .bento > :nth-child(4) {
    grid-column: span 2;
  }
  .bento > :nth-child(5) {
    grid-column: span 2;
  }
  .bento > :nth-child(6) {
    grid-column: span 6;
  }
}

.cell {
  background: var(--raised);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  overflow: hidden;
}

.cell p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

/* Tinted cells carry a category fill as a surface. Text on them uses that category's ink. */
.cell.tinted {
  background: var(--cell-fill);
  color: var(--cell-ink);
}

.cell.tinted p {
  color: var(--cell-ink);
  opacity: 0.82;
}

.cell-wide {
  display: grid;
  gap: 1.5rem;
  align-items: center;
}

@media (min-width: 900px) {
  .cell-wide {
    grid-template-columns: 1fr 1fr;
  }
}

.phrases {
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.phrases li {
  background: var(--canvas);
  color: var(--text);
  border-radius: 999px;
  padding: 0.4375rem 0.875rem;
  font-size: 0.875rem;
}

.cell-shot {
  border-radius: var(--r-media);
  box-shadow: var(--shadow-chip);
  width: 100%;
}

/* ---------- Two column prose ---------- */

.duo {
  margin-top: 2.5rem;
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}

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

.duo h3 + p {
  margin-top: 0.625rem;
}

/* ---------- Privacy statement ---------- */

.statement {
  font-size: clamp(1.375rem, 3vw, 1.875rem);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
  max-width: 34rem;
}

/* ---------- Honest limits ---------- */

.limits {
  margin: 2.5rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 1.25rem;
  max-width: 46rem;
}

.limits li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.875rem;
  align-items: start;
}

.limits svg {
  width: 20px;
  height: 20px;
  margin-top: 0.25rem;
  color: var(--text-secondary);
  flex: none;
}

.limits b {
  font-weight: 600;
}

.limits span {
  color: var(--text-secondary);
}

/* ---------- Note from the maker ---------- */

.from {
  max-width: 38rem;
}

.from h2 + p {
  margin-top: 1.5rem;
}

.from p {
  color: var(--text);
}

.from p + p {
  margin-top: 1.125rem;
}

.from .sig {
  margin-top: 1.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ---------- FAQ ---------- */

.faq {
  margin-top: 2.5rem;
  max-width: 46rem;
  display: grid;
  gap: 0.75rem;
}

.faq details {
  background: var(--raised);
  border-radius: var(--r-media);
  box-shadow: var(--shadow-chip);
  padding: 1.125rem 1.375rem;
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  color: var(--accent-text);
  font-size: 1.375rem;
  line-height: 1;
  flex: none;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Rotated rather than swapped for a dash glyph: the copy rule bans en dashes, and that applies
   to characters used as decoration just as much as to prose. */
.faq details[open] summary::after {
  transform: rotate(45deg);
}

@media (prefers-reduced-motion: reduce) {
  .faq summary::after {
    transition: none;
  }
}

.faq details p {
  margin-top: 0.75rem;
  color: var(--text-secondary);
}

/* ---------- Closing call to action ---------- */

.closing {
  text-align: center;
}

.closing .wrap > * {
  margin-inline: auto;
}

.closing .lede {
  margin-top: 1rem;
}

.closing .signup {
  margin-inline: auto;
  text-align: left;
}

/* ---------- Footer ---------- */

.foot {
  padding-block: 3rem 4rem;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.foot .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
  justify-content: space-between;
}

.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

/* ---------- Motion ----------
 *
 * Two animations, and both are feedback rather than decoration: a button that gives under the
 * press, and a disclosure marker that turns to show it is open. There was a scroll reveal here
 * and it is gone on purpose. Fading each section in as it arrives delays the content to no end,
 * and DESIGN_SYSTEM.md section 9 is explicit that an animation which does not help the reader
 * track what just happened should be removed. Nothing on this page needs tracking.
 */

/* ---------- Prose pages (privacy, terms, join) ----------
 *
 * Same tokens as the marketing page so the site reads as one thing. The measure is narrower
 * than the marketing container because these are read start to finish rather than scanned.
 */

.doc {
  max-width: 44rem;
  padding-block: 3rem 5rem;
}

.doc h1 {
  font-size: clamp(1.875rem, 4vw, 2.25rem);
  font-weight: 700;
}

.doc h2 {
  font-size: 1.25rem;
  margin-top: 2.75rem;
}

.doc p,
.doc ul {
  margin-top: 1rem;
}

.doc .updated {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin-top: 0.5rem;
}

.doc ul {
  padding-left: 1.25rem;
}

.doc li {
  margin: 0.5rem 0;
}

.doc li::marker {
  color: var(--text-secondary);
}

/* The one place a tinted panel is used. It carries the not-medical-advice notice on Terms,
 * which is the only block on the site that needs to stop the eye. Fill, not a stroke. */
.callout {
  background: var(--raised);
  border-radius: var(--r-media);
  box-shadow: var(--shadow-chip);
  padding: 1.25rem 1.5rem;
  margin-top: 1.5rem;
}

.callout p {
  margin-top: 0;
}

/* ---------- Invite redirect ---------- */

.join-page {
  text-align: center;
  max-width: 32rem;
  padding-block: 4rem 5rem;
}

.join-code {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  margin-top: 1.5rem;
}
