/* ==========================================================
   Home (src/pages/index.astro)
   The hero's phone is drawn by the "@illustration" sections and
   played by js/home.js.
   ========================================================== */

/* ---------- Hero: words ---------- */
.hm-hero { padding-block: var(--space-fluid-2) var(--space-fluid-4); }
.hm-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); align-items: center; gap: var(--space-fluid-2); }
.hm-copy { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0, 1fr); justify-items: start; gap: var(--space-22); }
.hm-copy .wl { width: 100%; max-width: 480px; }
.hm-copy h1 { font-size: var(--fs-display); line-height: 1.02; }
.hm-copy .lede { max-width: 28em; }
@media (max-width: 960px) {
  /* tablets, and phones held sideways: still two columns, with the button under the field */
  .hm-hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-16); }
  .hm-copy { gap: var(--space-18); }
  .hm-copy .wl-row { flex-direction: column; }
  .hm-copy .hero-facts { flex-direction: column; }
}
@media (max-width: 760px) {
  /* phones: one centred column. The words, then the phone drawing, then the form: .hm-copy's parts join the page's
     own column (display: contents) so the form can come after the drawing. */
  .hm-hero { padding-top: var(--space-16); }
  .hm-hero-grid { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: var(--space-14); text-align: center; }
  .hm-copy { display: contents; }
  .hm-copy .eyebrow { justify-content: center; }
  .hm-copy .lede { max-width: 24em; }
  .hp { order: 1; width: 100%; }
  .hm-copy .wl { order: 2; }
  .hm-copy .wl-row { flex-direction: row; }
  .hm-copy .wl-note { text-align: center; }
  .hm-copy .hero-facts { order: 3; flex-direction: row; justify-content: center; margin-top: var(--space-8); }
}
@media (max-width: 420px) {
  .hm-copy .wl-row { flex-direction: column; }
}

/* ---------- @illustration: the hero's stage (phone, lanes, the "This morning" card) ---------- */
.hp { position: relative; height: 740px; text-align: left; --hp-s: .8; }
.hp-lanes { position: absolute; left: 34%; top: 50%; width: 1000px; max-width: none; height: 1000px; margin: -500px 0 0 -500px; stroke: var(--surface); pointer-events: none; -webkit-mask: radial-gradient(closest-side, #000 45%, transparent 100%); mask: radial-gradient(closest-side, #000 45%, transparent 100%); }
.hp-scale { position: absolute; left: 34%; top: 50%; width: 390px; height: 844px; margin: -422px 0 0 -195px; transform: scale(var(--hp-s)); perspective: 2600px; }
.hp-rig { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(8deg) rotateY(-24deg); --lift: .25; will-change: transform; }
.hp-ground { position: absolute; inset: 10% 2% 0 6%; border-radius: 90px; background: rgb(var(--shadow-rgb) / .22); filter: blur(60px); transform: translate3d(50px, 70px, -160px); }
.hp-phone { position: absolute; inset: 0; transform-style: preserve-3d; }
.hp-edge { position: absolute; inset: -11px; border-radius: 64px; background: var(--device-edge); }
.hp-edge:nth-child(1) { transform: translateZ(-18px); background: var(--device); }
.hp-edge:nth-child(2) { transform: translateZ(-15px); }
.hp-edge:nth-child(3) { transform: translateZ(-12px); }
.hp-edge:nth-child(4) { transform: translateZ(-9px); }
.hp-edge:nth-child(5) { transform: translateZ(-6px); }
.hp-edge:nth-child(6) { transform: translateZ(-3px); }
.hp-bezel { position: absolute; inset: -11px; border-radius: 64px; background: var(--device); box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / .16); }
.hp-glass { position: absolute; inset: 0; border-radius: 53px; background: var(--ground); }
.hp-island { position: absolute; left: 50%; top: 13px; width: 104px; height: 30px; margin-left: -52px; border-radius: 999px; background: var(--device); transform: translateZ(1px); }
.hp-glare { position: absolute; inset: 0; border-radius: 53px; pointer-events: none; transform: translateZ(2px);
  background: linear-gradient(112deg, rgb(255 255 255 / 0) 32%, rgb(255 255 255 / .26) 46%, rgb(255 255 255 / 0) 60%) var(--glare, 40%) 0 / 260% 100% no-repeat; }
.hp-tap { position: absolute; left: 0; top: 0; width: 56px; height: 56px; margin: -28px; border-radius: 50%; background: rgb(var(--ink-rgb) / .16); box-shadow: 0 0 0 2px rgb(var(--ink-rgb) / .3); opacity: 0; pointer-events: none; }

/* ---------- @illustration: the phone's two screens (sizes are the app's own, in points) ---------- */
.hp-view { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 14px; padding: 58px 22px 24px; transform-style: preserve-3d; color: var(--ink); font-size: 15px; line-height: 1.45; --o: 1; }
.hp-view > * { margin: 0; opacity: calc(var(--o) * var(--a, 1)); transform: translate3d(0, var(--y, 0px), calc(var(--d, 0px) * var(--lift) + var(--pop, 0px))); }
.hp-today { --o: 0; visibility: hidden; }          /* as written, the conversation shows; js/home.js takes over */
.hp-l0 { --d: 0px; } .hp-l1 { --d: 18px; } .hp-l2 { --d: 44px; } .hp-l3 { --d: 76px; } .hp-l4 { --d: 104px; } .hp-l5 { --d: 132px; }
.hp-view .icon { flex: none; width: 18px; height: 18px; }
.hp-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hp-round { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--surface); box-shadow: 0 8px 24px rgb(var(--shadow-rgb) / .12); }
.hp-pill { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border-radius: 999px; background: var(--surface); box-shadow: 0 8px 24px rgb(var(--shadow-rgb) / .12); font-size: 14px; }
.hp-pill .state { font-size: 14px; font-weight: 600; }
.hp-pill-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.hp-date { display: flex; align-items: baseline; justify-content: space-between; }
.hp-date b { font-size: 24px; font-weight: 600; line-height: 1.15; letter-spacing: -.03em; }
.hp-date span { font-size: 12px; font-weight: 500; color: var(--muted); }
.hp-card { padding: 16px 18px; border-radius: 22px; background: var(--surface); box-shadow: 0 calc(var(--lift) * 30px) calc(var(--lift) * 50px) rgb(var(--shadow-rgb) / .16); }
.hp-card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 6px; }
.hp-label { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.hp-card .state { font-size: 13px; font-weight: 600; }
.hp-rows li { display: flex; align-items: center; gap: 12px; height: 40px; border-bottom: 1px solid var(--line); font-size: 14px; }
.hp-rows .icon { color: var(--muted); }
.hp-rows b { margin-left: auto; font-size: 15px; font-weight: 600; }
.hp-rows small { font-size: 12px; font-weight: 400; color: var(--muted); }
.hp-fff { display: flex; justify-content: space-between; gap: 8px; margin: 0; padding-top: 12px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.hp-fff b { font-weight: 600; color: var(--ink); }
.hp-k::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--blue); vertical-align: 2px; }
.hp-k-fat::before { background: var(--plum); }
.hp-k-form::before { background: var(--slate); }
.hp-ses-t { display: flex; align-items: center; gap: 12px; margin: 0; }
.hp-ses-t b { font-size: 22px; font-weight: 600; line-height: 1.1; letter-spacing: -.03em; }
.hp-tile { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--ground); }
.hp-ses-d { margin: 8px 0 12px; font-size: 13px; color: var(--muted); }
.hp-shape { display: flex; align-items: flex-end; gap: 4px; height: 32px; margin: 0; }
.hp-shape i { flex: 1; height: 100%; border-radius: 3px; background: var(--blue); }
.hp-shape-b i { height: 30%; }
.hp-stats { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 12px 0 0; }
.hp-stats > span { display: flex; align-items: center; gap: 6px; }
.hp-stats .icon { width: 16px; height: 16px; color: var(--muted); }
.hp-stats b { font-weight: 600; }
.hp-moved { font-size: 12px; color: var(--muted); }
.hp-chips, .hp-sugg { display: flex; gap: 8px; }
.hp-chip { flex: auto; display: block; height: 44px; padding: 0 13px; line-height: 44px; text-align: center; border-radius: 999px; background: var(--surface); font-size: 14px; font-weight: 500; white-space: nowrap; }
.hp-chip.is-on { box-shadow: inset 0 0 0 1.5px var(--ink); }
.hp-sugg { margin-top: auto; }
.hp-sugg .hp-chip { flex: none; padding: 0 16px; }
.hp-chat { display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 0 6px 0 22px; border-radius: 999px; background: var(--surface); box-shadow: 0 8px 24px rgb(var(--shadow-rgb) / .12); font-size: 16px; color: var(--muted); }
.hp-today .hp-chat { margin-top: auto; }
.hp-send { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--blue); color: var(--on-blue); }
.hp-bubble { align-self: flex-end; }
.hp-bubble > span { display: block; padding: 10px 14px; border-radius: 18px 18px 6px 18px; background: var(--fill); }
.hp-reply { min-height: 66px; }
.hp-reply .is-rest { visibility: hidden; }
.hp-load { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.hp-load .icon { width: 16px; height: 16px; color: var(--muted); }
.hp-load b { font-weight: 600; }
.hp-swap li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.hp-day { flex: none; width: 44px; font-size: 13px; color: var(--muted); }
.hp-swap b { display: block; font-size: 15px; font-weight: 600; line-height: 1.3; }
.hp-swap s { font-size: 13px; color: var(--muted); }
.hp-btns { display: flex; gap: 10px; margin: 8px 0 0; }
.hp-btn { display: grid; place-items: center; height: 48px; border-radius: 14px; font-size: 15px; font-weight: 600; transition: transform .12s, opacity .3s; }
.hp-accept { flex: 1.6; background: var(--blue); color: var(--on-blue); }
.hp-keep { flex: 1; background: var(--fill); }
.hp-acc-b { display: none; }
.hp-accept.is-pressed { transform: scale(.95); }
.hp-prop.is-accepted .hp-acc-a { display: none; }
.hp-prop.is-accepted .hp-acc-b { display: inline; }
.hp-prop.is-accepted .hp-keep { opacity: .45; }
.hp-toast { position: absolute; left: 22px; right: 22px; bottom: 92px; display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 6px 0 14px; border-radius: 999px; background: var(--ink); color: var(--on-ink); font-size: 13px; box-shadow: 0 14px 30px rgb(var(--shadow-rgb) / .25); --a: 0; }
.hp-toast .icon { width: 16px; height: 16px; }
.hp-toast b { margin-left: auto; padding: 8px 12px; border-radius: 999px; background: rgb(var(--on-ink-rgb) / .16); font-weight: 600; }

/* ---------- @illustration: the "This morning" card and the pause button ---------- */
.hp-log { position: absolute; z-index: 2; right: -24px; bottom: 48px; width: 268px; padding: 18px; border-radius: 22px; background: var(--surface); box-shadow: 0 24px 60px rgb(var(--shadow-rgb) / .14); }
.hp-log-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.hp-log-h b { font-size: 15px; font-weight: 600; letter-spacing: -.02em; }
.hp-log-h span { font-size: 11px; color: var(--muted); }
.hp-log-rows li { display: flex; align-items: flex-start; gap: 12px; padding: 7px 0; }
.hp-log-rows i { flex: none; width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--mid); transition: background-color .3s, box-shadow .3s; }
.hp-log-rows b { display: block; font-size: 14px; font-weight: 500; line-height: 1.35; color: var(--muted); transition: color .3s; }
.hp-log-rows small { display: block; font-size: 12px; line-height: 1.35; color: var(--muted); }
.hp-log-rows [data-state="active"] i { box-shadow: inset 0 0 0 2px var(--blue), 0 0 0 4px rgb(var(--blue-rgb) / .16); }
.hp-log-rows [data-state="done"] i { background: var(--blue); box-shadow: none; }
.hp-log-rows [data-state="active"] b, .hp-log-rows [data-state="done"] b { color: var(--ink); }
.hp-pause { left: 0; bottom: 0; }

@media (max-width: 1240px) { .hp { --hp-s: .76; } .hp-log { right: 0; width: 248px; } }
@media (max-width: 1100px) { .hp { --hp-s: .68; height: 640px; } .hp-scale, .hp-lanes { left: 32%; } .hp-log { width: 232px; padding: 16px; } }
@media (max-width: 960px) {
  /* beside the words, smaller, without the "This morning" card (the same story in words) */
  .hp { --hp-s: .62; height: 580px; }
  .hp-scale, .hp-lanes { left: 50%; }
  .hp-log { display: none; }
}
@media (max-width: 760px) {
  /* under the words, centred and facing front (js/home.js turns it only while the layers open);
     smaller rings, so they stay behind the phone and off the words */
  .hp { --hp-s: .7; height: 620px; }
  .hp-rig { transform: none; }
  .hp-ground { transform: translate3d(20px, 60px, -160px); }
  .hp-lanes { width: 680px; height: 680px; margin: -340px 0 0 -340px; }
  .hp-pause { left: auto; right: 0; bottom: 8px; }
}
@media (max-width: 560px) {
  .hp { --hp-s: .68; height: 600px; }
}
@media (max-width: 420px) {
  .hp { --hp-s: .64; height: 566px; }
}
