/* Hero: the animated phone. Coordinates come from design/hero-mockup-reference.html. */
.hero .wrap { max-width: 1208px; }
.hero-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 32px 48px; }
.hero-text { flex: 1 1 400px; min-width: 0; max-width: 560px; }
.hero-demo { flex: 1 1 460px; min-width: 0; container-type: inline-size; container-name: stage; }

.pill {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 24px; padding: 7px 14px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--border);
  font-size: 14px; font-weight: 500; color: var(--secondary);
}
.pill-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
/* Changing this size means re-measuring the Bricolage fallback faces in styles.css (see GUARD there). */
.hero h1 { font-size: clamp(46px, 6.2vw, 84px); line-height: 0.96; letter-spacing: -0.035em; max-width: none; }
.squiggle { position: relative; display: inline-block; }
.squiggle svg { position: absolute; left: 0; bottom: -0.1em; width: 100%; height: 0.24em; overflow: visible; }
.hero .lede { margin-top: 24px; max-width: 500px; font-size: clamp(18px, 2vw, 20px); line-height: 1.5; }
.hero .actions { margin-top: 30px; }
.hero .button { min-height: 52px; padding: 0 26px; border-radius: 16px; }
.hero-note { margin-top: 22px; font-size: 14px; color: var(--muted); }

/* Stage */
.stage {
  --k: 1; --sw: 560px; --sx: 140px;
  position: relative; width: 100%; height: calc(672px * var(--k));
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 10%, transparent), rgba(246, 247, 249, 0));
}
.stage-box {
  position: absolute; top: 0; left: max(0px, calc(50% - var(--sw) * var(--k) / 2));
  width: var(--sw); height: 672px; transform: scale(var(--k)); transform-origin: 0 0;
  font-family: var(--font); color: var(--ink);
}
@container stage (min-width: 627px) { .stage { --k: 1.12; } }
@container stage (max-width: 559px) { .stage { --k: 0.86; } }
@container stage (max-width: 479px) { .stage { --sw: 340px; --sx: 30px; --k: 1; } }
@container stage (max-width: 339px) { .stage { --k: 0.9; } }

.phone {
  position: absolute; left: calc(var(--sx) - 10px); top: 16px; width: 300px; height: 640px; border-radius: 48px;
  background: #14171F;
  box-shadow: 0 2px 0 1px #2A2F3A inset, 0 40px 80px rgba(20, 23, 31, 0.22), 0 12px 28px rgba(20, 23, 31, 0.14);
}
.screen {
  position: absolute; left: var(--sx); top: 26px; width: 280px; height: 620px; border-radius: 38px;
  overflow: hidden; background: var(--bg); font-size: 13px; line-height: 1.3;
}
.island { position: absolute; left: 102px; top: 11px; width: 76px; height: 22px; border-radius: 11px; background: #14171F; }
.scr { position: absolute; inset: 0; opacity: 0; }
.scr > * { position: absolute; }
.display-s { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.035em; line-height: 1.02; }
.scr .h { left: 20px; top: 50px; font-size: 28px; }
.scr .sub { left: 20px; top: 88px; font-size: 13px; color: var(--muted); }

/* Capture */
.cap-title { left: 0; right: 0; top: 44px; text-align: center; font-size: 14px; font-weight: 600; }
.cap-cancel { left: 18px; top: 44px; font-size: 14px; color: var(--muted); }
.cap-h { left: 18px; width: 244px; top: 80px; font-size: 27px; }
.cap-card {
  left: 16px; top: 154px; width: 248px; height: 262px; padding: 14px 14px 14px 15px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  font-size: 15px; line-height: 1.62;
}
/* Each phrase keeps its final width from the start, so typing never reflows the card (no layout shift). */
.ph { position: relative; display: inline-block; box-sizing: content-box; padding-right: 9px; white-space: nowrap; vertical-align: bottom; }
.phrase { display: inline-block; max-width: 0; overflow: hidden; white-space: nowrap; vertical-align: bottom; }
.caret {
  position: absolute; left: 1px; top: 50%; width: 2px; height: 1.15em; margin-top: -0.575em; border-radius: 1px;
  background: var(--accent); visibility: hidden; animation: ovblink 1s steps(1) infinite;
}
@keyframes ovblink { 50% { opacity: 0; } }
.cap-tools { left: 16px; top: 430px; display: flex; align-items: center; gap: 10px; color: var(--muted); }
.cap-tools .round {
  width: 40px; height: 40px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.cap-btn {
  left: 16px; top: 548px; width: 248px; height: 50px; border-radius: 16px; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 600;
}
/* Untangling */
.unt-h { left: 20px; top: 52px; font-size: 28px; }
.shimmer {
  background: linear-gradient(90deg, #14171F 0%, #14171F 38%, #A3AABA 50%, #14171F 62%, #14171F 100%);
  background-size: 260% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: ovshimmer 1.5s linear infinite;
}
@keyframes ovshimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.unt-sub { left: 20px; top: 90px; font-size: 13px; color: var(--muted); }
/* Sorted */
.card {
  left: 16px; width: 248px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 1px 2px rgba(20, 23, 31, 0.04); opacity: 0;
}
.card-h { height: 40px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-bottom: 1px solid var(--subtle); }
.card-h .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--spool); }
.card-h .name { font-size: 14px; font-weight: 600; }
.card-h .count { margin-left: auto; font-size: 12px; color: var(--muted); }
/* Today */
.subs { left: 20px; top: 88px; width: 240px; height: 18px; font-size: 13px; color: var(--muted); }
.subs span { position: absolute; left: 0; top: 0; white-space: nowrap; }
.sub2 { opacity: 0; }
.day { left: 0; top: 0; }
.day path { fill: none; stroke: var(--accent); stroke-linecap: round; }
.day-seg0, .day-rest { stroke-width: 2.4; opacity: 0.45; stroke-dasharray: 1; stroke-dashoffset: 1; }
.day-solid { stroke-width: 3.2; stroke-dasharray: 1; stroke-dashoffset: 1; }
.day-rings { opacity: 0; }
.day-rings .ring { fill: #fff; stroke-width: 2.4; }
.day-rings .checkin { fill: #fff; stroke: #A3AABA; stroke-width: 1.8; stroke-dasharray: 3 3; }
.day-fill { fill: var(--accent); stroke: none; opacity: 0; }
.tm { left: 6px; width: 40px; text-align: center; font-family: var(--font-mono); font-size: 11px; font-weight: 500; color: var(--muted); }
.tm.dim { color: #A3AABA; }
.checkin-l { left: 80px; top: 511px; font-size: 13px; color: var(--muted); }
.today-bar {
  left: 16px; top: 556px; width: 248px; height: 44px; padding: 0 6px 0 14px; display: flex; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; font-size: 13px; color: var(--muted);
}
.today-bar .plus {
  margin-left: auto; width: 32px; height: 32px; border-radius: 10px; background: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
/* Reminder banner */
.banner {
  position: absolute; left: 8px; top: 8px; width: 264px; padding: 12px; border-radius: 22px;
  background: rgba(255, 255, 255, 0.97); border: 1px solid var(--border); box-shadow: 0 14px 34px rgba(20, 23, 31, 0.18);
  transform: translateY(-150px);
}
.banner-h { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); height: 16px; }
.banner-h .app { width: 16px; height: 16px; border-radius: 5px; background: var(--accent); }
.banner-h .brand-s { font-weight: 600; color: var(--secondary); letter-spacing: 0.02em; }
.banner-h .now { margin-left: auto; }
.banner-t { margin-top: 8px; font-size: 14px; font-weight: 600; line-height: 18px; }
.banner-b { font-size: 12px; line-height: 16px; color: var(--secondary); }
.banner-acts { display: flex; gap: 6px; margin-top: 10px; }
.banner-acts span {
  flex: 1; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 9px;
  background: var(--subtle); color: var(--secondary); font-size: 12px; font-weight: 600;
}
.banner-acts .done { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); }

/* Main thread and chips, outside the clipped screen */
.thread { position: absolute; left: 0; top: 0; overflow: visible; }
.thread path { fill: none; stroke-linecap: round; opacity: 0; }
.th-g { stroke: var(--secondary); stroke-width: 2; stroke-dasharray: 1; stroke-dashoffset: 1; }
.th-a { stroke: var(--accent); stroke-width: 2.8; stroke-dasharray: 1; stroke-dashoffset: 1; }
.th-knots { fill: #fff; stroke: var(--accent); stroke-width: 2.4; }
.chip {
  position: absolute; left: 0; top: 0; display: inline-flex; align-items: center; white-space: nowrap;
  padding: 6px 11px 6px 9px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border-strong);
  box-shadow: 0 1px 2px rgba(20, 23, 31, 0.06), 0 6px 16px rgba(20, 23, 31, 0.08);
  font-size: 13px; font-weight: 500; line-height: 15px; color: var(--ink); opacity: 0; will-change: transform, opacity;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; margin-right: 7px; flex: none; background: #C7CCD5; transition: background-color 0.3s; }
.chip .txt { position: relative; }
.chip .strike {
  position: absolute; left: -2px; right: -2px; top: 52%; height: 1.5px; border-radius: 1px; background: var(--muted);
  transform: scaleX(0); transform-origin: 0 50%;
}
.ripple, .tap {
  position: absolute; left: 0; top: 0; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; opacity: 0;
}
.ripple { border: 2px solid var(--accent); }
.tap { background: rgba(20, 23, 31, 0.16); border: 2px solid rgba(255, 255, 255, 0.95); box-shadow: 0 3px 12px rgba(20, 23, 31, 0.25); }

/* Static finished frame: shown without JS and before the script starts */
.is-static .scr-today, .is-static .day-rings, .is-static .day-fill, .is-static .sub2 { opacity: 1; }
.is-static .sub1, .is-static .day-seg0 { opacity: 0; }
.is-static .day-rest, .is-static .day-solid { stroke-dashoffset: 0; }
.is-static .chip .dot { background: var(--spool); }
.is-static .chip[data-slot] { opacity: 1; transform: translate(calc(var(--sx) + 80px), calc(11.5px + var(--row) * 1px)); }
.is-static .chip[data-slot="0"] { opacity: 0.55; }
.is-static .chip[data-slot="0"] .strike { transform: scaleX(1); }

/* Act tabs, caption, pause */
.acts { margin: 8px auto 0; max-width: 560px; }
.acts-steps { position: relative; }
.acts-line { position: absolute; left: 12.5%; right: 12.5%; top: 9px; height: 2px; border-radius: 2px; background: var(--border); }
.acts-fill { height: 2px; width: 0; border-radius: 2px; background: var(--accent); }
.acts-tabs { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.acts-tab {
  display: flex; flex-direction: column; align-items: center; gap: 8px; background: none; border: 0; padding: 0 0 4px;
  cursor: pointer; font: inherit; min-height: 44px; color: var(--muted);
}
.acts-tab .knot {
  width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border-strong); background: #fff;
  transition: background-color 0.3s, border-color 0.3s;
}
.acts-tab.is-done .knot { background: var(--accent); border-color: var(--accent); }
.acts-tab[aria-current="step"] { color: var(--ink); }
.acts-tab .lbl { font-size: 13px; font-weight: 600; text-align: center; transition: color 0.3s; }
.acts-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.acts-cap { flex: 1 1 auto; min-width: 0; font-size: 14px; line-height: 1.45; color: var(--secondary); }
.acts-play {
  flex: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border-radius: 14px; border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; color: var(--ink); padding: 0;
}
.acts-play .ic-pause, .acts.is-playing .acts-play .ic-play { display: none; }
.acts.is-playing .acts-play .ic-pause { display: block; }

@media (prefers-reduced-motion: reduce) {
  .caret, .shimmer { animation: none; }
  .chip .dot, .acts-tab .knot, .acts-tab .lbl { transition: none; }
}
