/* Toad in the Hole: one page in the app's own visual language (sky haze, the hour's skies and sands).
   System fonts only (SF Pro Rounded for headings on Apple devices), no outside requests. Light and dark follow the
   device. Every text colour passes WCAG AA on what it sits on (ratios noted beside each). */

:root {
  --canvas: #F3F7FB;
  --card: #FFFFFF;
  --card-line: #DCE5EE;
  --ink: #1D2430;          /* 14.5:1 on canvas */
  --ink-2: #4F5B68;        /* 6.4:1 on canvas, 6.9:1 on card */
  --accent: #1E6AA6;       /* 5.3:1 on canvas; white on it 5.7:1 */
  --on-accent: #FFFFFF;
  --attention: #A34A1F;
  --success: #3F7A52;
  --cream: #FFF8EA;        /* on the deep sky: >= 5.0:1 */
  /* The deep sky holds every word (cream on #1E6AA6 is 5.4:1); the glow lives only in the last 5rem, under the text. */
  --sky: linear-gradient(180deg, #0B3B75 0%, #1E6AA6 calc(100% - 5rem), #5E9FD0 calc(100% - 2.4rem), #8FCBEF 100%);
  --sand: linear-gradient(180deg, #E9CF9D 0%, #DDB57E 45%, #CD955A 100%);
  --on-sand: #2A2118;      /* 10.2:1 on the sand's darkest stop */
  --on-sand-2: #4A3A28;    /* 5.4:1 on #CD955A */
  --horizon: rgba(155, 101, 52, 0.45);
  --shadow: 28, 42, 60;    /* cool slate */
  --round: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --measure: 34rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #0F1622;
    --card: #1A2433;
    --card-line: #263244;
    --ink: #EAF0F6;        /* 15.8:1 on canvas */
    --ink-2: #A9B6C4;      /* 8.8:1 on canvas */
    --accent: #4FA8E0;     /* 6.9:1 on canvas */
    --on-accent: #0F1622;  /* 7.0:1 on the accent */
    --attention: #E08A50;
    --success: #7FBF95;
    --sky: linear-gradient(180deg, #071B36 0%, #0A2C57 calc(100% - 5rem), #1B5C9E calc(100% - 2.4rem), #6FA7D6 100%);
    --sand: linear-gradient(180deg, #7A6446 0%, #5E4A33 45%, #4A3A28 100%);
    --on-sand: #FFF8EA;    /* 6.4:1 on #7A6446, 11:1 on #4A3A28 */
    --on-sand-2: #EADFC9;  /* 5.2:1 on #7A6446 */
    --horizon: rgba(0, 0, 0, 0.4);
    --shadow: 0, 0, 0;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--text);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 0.18em; }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 999px; }

/* The top bar: the mark and a quiet Download. */
.top {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 72rem; margin: 0 auto; padding: 1.25rem 1.5rem 0.75rem;
}
.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--ink); text-decoration: none;
  font: 650 1.25rem/1 var(--round); letter-spacing: -0.01em; }
.brand img { border-radius: 7px; }
.top-download { font: 600 0.95rem/1 var(--round); text-decoration: none; padding: 0.6rem 1rem; border-radius: 999px;
  border: 1px solid var(--card-line); background: var(--card); color: var(--ink); }
.top-download:hover { border-color: var(--accent); }

main { max-width: 72rem; margin: 0 auto; padding: 0 1.5rem; }

/* The hero: the app's sky card. Words on the deep sky, the toad and the Download pill on the sand. */
.hero {
  position: relative;
  margin-top: 0.75rem;
  border-radius: 28px;
  box-shadow: 0 1px 1px rgba(var(--shadow), 0.07), 0 24px 40px -12px rgba(var(--shadow), 0.28);
}
.sky {
  position: relative;
  overflow: hidden;
  border-radius: 28px 28px 0 0;
  background: var(--sky);
  padding: clamp(7rem, 11vw, 8.5rem) clamp(1.5rem, 5vw, 4rem) clamp(4rem, 8vw, 6rem);
  color: var(--cream);
}
.sky h1 {
  position: relative;
  margin: 0;
  max-width: 14ch;
  font: 700 clamp(2.4rem, 6.2vw, 4.4rem)/1.04 var(--round);
  letter-spacing: -0.025em;
}
.lede { position: relative; margin: 1rem 0 0; max-width: var(--measure); font-size: clamp(1.05rem, 1.6vw, 1.22rem); line-height: 1.5; }
.sun {
  position: absolute; left: 6%; bottom: -1.4rem;  /* setting on the horizon, low on the left: the shadows rake right */
  width: clamp(2rem, 4vw, 3rem); aspect-ratio: 1; border-radius: 50%;
  background: #FFE6AE; box-shadow: 0 0 40px 18px rgba(255, 219, 140, 0.35);
}
@media (prefers-color-scheme: dark) {
  .sun { left: auto; right: 13%; bottom: auto; top: 50%; background: #F4EEDC; box-shadow: 0 0 36px 10px rgba(244, 238, 220, 0.18); }
}
.sand {
  position: relative;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem;
  border-radius: 0 0 28px 28px;
  background: var(--sand);
  border-top: 2px solid var(--horizon);
  padding: 0 clamp(1.5rem, 5vw, 4rem) clamp(1.5rem, 3vw, 2.25rem);
  min-height: 9rem;
}
.cta { padding-top: 1.75rem; }
.download {
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.95rem 1.6rem; border-radius: 999px;
  background: var(--accent); color: var(--on-accent);
  font: 650 1.08rem/1 var(--round); text-decoration: none;
  box-shadow: 0 1px 1px rgba(var(--shadow), 0.1), 0 14px 24px -10px rgba(11, 59, 117, 0.55);
  transition: transform 160ms ease-out, box-shadow 160ms ease-out;
}
.download:hover { transform: translateY(-1px); }
.download .apple { margin-top: -2px; }
.sand .fine { color: var(--on-sand-2); }
.fine { margin: 0.65rem 0 0 0.25rem; font: 600 0.85rem/1.3 var(--round); color: var(--ink-2); letter-spacing: 0.01em; }
.hero-toad { flex: 0 1 26rem; margin: -5.2rem 0 -0.6rem; }
.hero-toad img { width: 100%; }

/* Clouds: our own, cream, one drifted out of the card (the app's escaped cloud). Still with Reduce Motion. */
.cloud { position: absolute; pointer-events: none; }
.cloud-far { width: 7rem; top: 12.5rem; right: 22%; opacity: 0.9; }
.cloud-escaped { width: 9.5rem; top: 4.5rem; right: -2.6rem; animation: drift 34s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(-14px); } }
@media (prefers-reduced-motion: reduce) { .cloud-escaped { animation: none; } .download { transition: none; } }

/* The sections: words and one drawing, alternating sides. */
.feature {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: clamp(1.5rem, 5vw, 4rem);
  padding: clamp(3rem, 7vw, 5.5rem) clamp(0rem, 3vw, 2rem) 0;
}
.feature.flip .words { order: 2; }
.feature h2 { margin: 0 0 0.75rem; font: 700 clamp(1.7rem, 3.2vw, 2.35rem)/1.12 var(--round); letter-spacing: -0.02em; }
.feature p { margin: 0 0 0.9rem; max-width: var(--measure); color: var(--ink-2); }
.feature .aside { font: 600 0.98rem/1.45 var(--round); color: var(--ink); }
.art { justify-self: center; width: min(100%, 28rem); }
.art.small { width: min(100%, 19rem); }
.art img { width: 100%; }

/* "How a job goes": FLOW's words, one line each, each with its colour's meaning. */
.steps {
  list-style: none; margin: 0; padding: 0.5rem; justify-self: center; width: min(100%, 26rem);
  background: var(--card); border: 1px solid var(--card-line); border-radius: 18px;
  box-shadow: 0 1px 1px rgba(var(--shadow), 0.07), 0 18px 30px -14px rgba(var(--shadow), 0.3);
}
.steps li { display: flex; align-items: center; gap: 0.75rem; padding: 0.9rem 1rem; font: 600 1rem/1.3 var(--round); }
.steps li + li { border-top: 1px solid var(--card-line); }
.dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; flex: none; }
.dot.working { background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.dot.needs { background: var(--attention); }
.dot.done { background: var(--success); }

.again { text-align: center; padding: clamp(3.5rem, 8vw, 6rem) 0 1rem; }
.again .fine { margin-left: 0; }

.foot {
  max-width: 72rem; margin: 3rem auto 0; padding: 1.75rem 1.5rem 2.5rem;
  border-top: 1px solid var(--card-line);
  display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; justify-content: space-between;
  color: var(--ink-2); font-size: 0.92rem;
}
.foot p { margin: 0; }

/* The notch, as the app draws it while an agent speaks (docs/ux-system.md, the island): one black form grown out of
   the top edge (curved shoulders, continuous corners: an SVG, so every edge is smooth at any size), the cerulean
   meter, one caption in white, and the horizon glowing along its foot. Its proportions never change. */
.notch {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: min(25rem, 88%); aspect-ratio: 400 / 84;
  display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; align-content: start;
  padding: 0.7rem 2.1rem 0; color: #FFFFFF;
}
.notch-shape { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.42)); }
.notch .meter, .notch .caption { position: relative; }
.notch .meter { grid-column: 2; }
.notch .caption {
  grid-column: 1 / -1; padding-top: 0.2rem; text-align: center; white-space: nowrap;
  font: 600 1rem/1.3 var(--round); letter-spacing: -0.005em;
}

/* The voice meter: five cerulean bars, moving as the voice does. Still bars with Reduce Motion. */
.meter { display: inline-flex; align-items: center; gap: 3px; height: 16px; }
.meter i { width: 3px; height: 16px; border-radius: 2px; background: #4FA8E0; transform-origin: center;
  animation: talk 1.1s ease-in-out infinite alternate; }
.meter i:nth-child(1) { animation-delay: -0.9s; }
.meter i:nth-child(2) { animation-delay: -0.3s; }
.meter i:nth-child(3) { animation-delay: -0.6s; }
.meter i:nth-child(4) { animation-delay: -0.1s; }
.meter i:nth-child(5) { animation-delay: -0.75s; }
.meter.small { height: 12px; }
.meter.small i { height: 12px; }
@keyframes talk { 0% { transform: scaleY(0.3); } 50% { transform: scaleY(1); } 100% { transform: scaleY(0.55); } }

/* What talking is like: three short points, and a call in lines (yours on the right, the agent's on the left). */
.points { list-style: none; margin: 1.1rem 0 0; padding: 0; max-width: var(--measure); }
.points li { position: relative; padding-left: 1.2rem; margin-bottom: 0.55rem; font: 600 0.98rem/1.45 var(--round); }
.points li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 0.45rem; height: 0.45rem;
  border-radius: 50%; background: var(--accent); }
.call {
  justify-self: center; width: min(100%, 27rem); padding: 1rem;
  background: var(--card); border: 1px solid var(--card-line); border-radius: 22px;
  box-shadow: 0 1px 1px rgba(var(--shadow), 0.07), 0 18px 30px -14px rgba(var(--shadow), 0.3);
}
.feature .call-head { display: flex; align-items: center; gap: 0.6rem; margin: 0 0 0.85rem; padding: 0.15rem 0.35rem;
  font: 650 0.9rem/1.2 var(--round); color: var(--ink-2); }
.call-head .meter i { background: var(--accent); }
.lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.lines li { max-width: 86%; padding: 0.55rem 0.85rem 0.6rem; border-radius: 16px; font-size: 0.98rem; line-height: 1.4; }
.lines .who { display: block; margin-bottom: 0.1rem; font: 650 0.76rem/1.3 var(--round); letter-spacing: 0.02em; }
.lines .bot { align-self: flex-start; background: var(--canvas); color: var(--ink); border-bottom-left-radius: 6px; }
.lines .bot .who { color: var(--ink-2); }
.lines .you { align-self: flex-end; background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 6px; }
.lines .who em { font-style: normal; margin-left: 0.3rem; padding: 0.05rem 0.45rem; border-radius: 999px;
  background: color-mix(in srgb, var(--on-accent) 22%, transparent); }
.cut-off { color: var(--ink-2); }

/* The apps: everyday asks with the apps they touch, then every app you can connect. */
.apps { padding: clamp(3rem, 7vw, 5.5rem) clamp(0rem, 3vw, 2rem) 0; }
.apps-head { max-width: 38rem; margin: 0 auto; text-align: center; }
.apps-head h2 { margin: 0 0 0.75rem; font: 700 clamp(1.7rem, 3.2vw, 2.35rem)/1.12 var(--round); letter-spacing: -0.02em; }
.apps-head p { margin: 0 auto; color: var(--ink-2); }
.asks { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem; }
.asks li { display: flex; flex-direction: column; justify-content: space-between; gap: 0.9rem; padding: 1.1rem 1.2rem;
  background: var(--card); border: 1px solid var(--card-line); border-radius: 18px;
  box-shadow: 0 1px 1px rgba(var(--shadow), 0.05), 0 12px 22px -16px rgba(var(--shadow), 0.3); }
.asks p { margin: 0; font: 600 1.02rem/1.4 var(--round); color: var(--ink); }
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tags span { padding: 0.36rem 0.62rem; border-radius: 999px; font: 600 0.8rem/1 var(--round); color: var(--ink-2);
  background: var(--canvas); border: 1px solid var(--card-line); }
.chips-label { margin: 2.75rem 0 0.9rem; text-align: center; font: 650 0.95rem/1.3 var(--round); color: var(--ink-2); }
.chips { list-style: none; margin: 0 auto; padding: 0; max-width: 54rem; display: flex; flex-wrap: wrap;
  justify-content: center; gap: 0.5rem; }
.chips li { padding: 0.6rem 0.95rem; border-radius: 999px; font: 600 0.95rem/1 var(--round); color: var(--ink);
  background: var(--card); border: 1px solid var(--card-line); }
.fine.center { margin: 1.1rem 0 0; text-align: center; font-weight: 500; }

@media (prefers-reduced-motion: reduce) {
  .meter i { animation: none; }
  .meter i:nth-child(1) { transform: scaleY(0.45); } .meter i:nth-child(2) { transform: scaleY(0.85); }
  .meter i:nth-child(3) { transform: scaleY(1); } .meter i:nth-child(4) { transform: scaleY(0.6); }
  .meter i:nth-child(5) { transform: scaleY(0.35); }
}
@media (max-width: 1000px) { .asks { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Phones: one column, the toad under the words, the Download pill full width. */
@media (max-width: 760px) {
  .top { padding: 1rem 1.25rem 0.5rem; }
  main { padding: 0 1rem; }
  .hero, .sky { border-radius: 22px 22px 0 0; }
  .hero { border-radius: 22px; }
  .sky { padding-bottom: 5.5rem; }
  .sun { left: 8%; right: auto; top: auto; bottom: -1rem; }  /* sun or moon low on the horizon, under the words */
  .cloud-far { display: none; }  /* clouds never cover words: on a phone the words fill the sky */
  .cloud-escaped { display: none; }  /* the notch hangs where it used to peek over the card */
  .art.small { width: min(80%, 16rem); }
  .sand { flex-direction: column-reverse; align-items: stretch; border-radius: 0 0 22px 22px; min-height: 0; }
  .hero-toad { flex: none; margin: -2.3rem auto 0; width: min(100%, 20rem); }  /* the lip on the horizon, eyes on the sky */
  .cta { padding-top: 0.25rem; }
  .download { width: 100%; justify-content: center; }
  .sand .fine { text-align: center; margin-left: 0; }
  .feature, .feature.flip { grid-template-columns: 1fr; padding-top: 3rem; }
  .feature.flip .words { order: 0; }
  .art { width: min(100%, 22rem); }
  .again .download { width: auto; }
  .foot { flex-direction: column; margin-top: 2rem; }
  .sky { padding-top: 7.5rem; }
  .notch { width: 92%; padding: 0.45rem 1.4rem 0; }
  .notch .caption { font-size: 0.86rem; padding-top: 0.05rem; }
  .asks { grid-template-columns: 1fr; }
  .call { width: 100%; }
}
