/* Stash landing — tokens & layout (see site/LANDING-GUIDE.md) */

/* Self-hosted variable fonts (fontsource, OFL-1.1). Licenses: site/fonts/*-OFL.txt. */
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url("fonts/dm-sans-latin-opsz-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("fonts/newsreader-latin-opsz-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url("fonts/newsreader-latin-opsz-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}

:root {
  --bg: #ffffff;
  --surface: #f7f7f7;
  --ink: #222222;
  --muted: #6a6a6a;
  --line: #e6e6e6;
  --accent: #ff385c;
  --accent-soft: #fff5f7;
  --bezel: #111111;

  --font-display: "Newsreader", Georgia, "Times New Roman", serif;
  --font-body: "DM Sans", system-ui, sans-serif;

  --shadow-heavy: 0 2px 8px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.08),
    0 16px 40px rgba(0, 0, 0, 0.12);
  --shadow-light: 0 2px 6px rgba(0, 0, 0, 0.04);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out-x: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-in: cubic-bezier(0.4, 0, 0.7, 0.2);

  --content-max: 68rem;
  --header-height: 4rem;
  --pad-x: clamp(1.25rem, 5vw, 2.5rem);

  --phone-w: min(72vw, 17.5rem, calc((100dvh - 11rem) * 0.46));
  --intro-phone-w: var(--phone-w);
  --m-card: #ffffff;

  /* Intro durations — cue times live in main.js (T). */
  --d-phone-in: 720ms;
  --d-phone-rise: 1000ms;
  --d-word: 200ms;
  --d-grow: 340ms;
  --d-ring: 600ms;
  --d-insert: 820ms;
  --d-swap: 540ms;
  --d-pulse: 1000ms;
  --d-scrim: 520ms;
  --d-sheet: 900ms;
  --d-sheet-out: 660ms;
  --d-part: 500ms;
  --d-part-rise: 760ms;
  --d-banner: 860ms;
  --d-banner-out: 460ms;
  --d-agent: 880ms;
  --d-cap: 600ms;
  --d-cap-rise: 860ms;
  --d-cap-out: 300ms;
  --d-flip: 1200ms;
  --d-land: 480ms;
  --d-handoff: 760ms;
  --d-fade: 260ms;

  color-scheme: light;
}

@media (min-width: 56rem) {
  :root {
    --phone-w: min(28vw, 19rem, calc((100dvh - 11rem) * 0.46));
    /* Larger while it is the only subject; the FLIP scales it down to --phone-w. */
    --intro-phone-w: min(24rem, calc((100dvh - 10rem) * 0.46));
  }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --m-card: #1c1c1e;
    --bg: #111111;
    --surface: #1c1c1e;
    --ink: #f2f2f2;
    --muted: #98989f;
    --line: #2c2c2e;
    --accent-soft: #3d2228;
    --bezel: #000000;
    --shadow-heavy: 0 2px 8px rgba(0, 0, 0, 0.1), 0 8px 24px rgba(0, 0, 0, 0.2),
      0 16px 40px rgba(0, 0, 0, 0.3);
    --shadow-light: 0 2px 6px rgba(0, 0, 0, 0.2);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --m-card: #1c1c1e;
  --bg: #111111;
  --surface: #1c1c1e;
  --ink: #f2f2f2;
  --muted: #98989f;
  --line: #2c2c2e;
  --accent-soft: #3d2228;
  --bezel: #000000;
  --shadow-heavy: 0 2px 8px rgba(0, 0, 0, 0.1), 0 8px 24px rgba(0, 0, 0, 0.2),
    0 16px 40px rgba(0, 0, 0, 0.3);
  --shadow-light: 0 2px 6px rgba(0, 0, 0, 0.2);
  color-scheme: dark;
}

:root[data-theme="light"] {
  color-scheme: light;
}

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

html {
  scroll-behavior: auto;
  overflow-x: clip;
}

html.is-intro {
  overflow: hidden;
}

body {
  margin: 0;
  min-height: 100dvh;
  overflow-x: clip;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 120ms;
}

a:hover {
  color: var(--accent);
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--pad-x);
  z-index: 1000;
  padding: 0.5rem 0.75rem;
  background: var(--ink);
  color: var(--bg);
  border-radius: 0.5rem;
  text-decoration: none;
}

.skip-link:focus {
  top: 0.75rem;
}

/* ── Intro ── */
.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.m-ico {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* The demo lives in the hero phone. It is not a full-page gate. */
.intro {
  position: relative;
  z-index: 1;
  background: none;
  pointer-events: none;
}

.intro.is-fading {
  opacity: 0;
  transition: opacity var(--d-fade) var(--ease-in);
}

.intro-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.intro-phone-wrap {
  position: relative;
  width: var(--phone-w);
  margin: 0 auto;
  aspect-ratio: 1206 / 2622;
  flex: none;
}

/* The phone frame stays put. The screen plays; nothing tilts or follows the pointer.
   isolation keeps the screen's z-index inside the bezel, so the agent card paints over it. */
.intro-phone.device,
.intro-phone.is-on,
.intro-stage.is-agent .intro-phone,
.intro-phone.is-flipping,
.intro-stage.is-agent .intro-phone.is-flipping,
.hero-phone .intro-phone.is-settled {
  width: 100%;
  height: 100%;
  opacity: 1;
  transform: none;
  isolation: isolate;
  transition: none;
}

/* ── Mock app screen (sizes in container units so it scales with the phone) ── */
.device-screen.m-screen {
  container-type: size;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.3;
  text-align: left;
}

.m-status {
  position: absolute;
  inset: 0 0 auto;
  height: 17cqw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8cqw 0 10cqw;
  font-size: 4.1cqw;
  font-weight: 600;
  z-index: 6;
}

.m-status-icons {
  display: inline-flex;
  align-items: center;
  gap: 1.6cqw;
}

.m-signal {
  width: 4.4cqw;
  fill: currentColor;
}

.m-battery {
  position: relative;
  width: 6.4cqw;
  height: 3.1cqw;
  border: 0.35cqw solid currentColor;
  border-radius: 1cqw;
  opacity: 0.9;
}

.m-battery span {
  position: absolute;
  inset: 0.4cqw;
  right: 1.2cqw;
  border-radius: 0.4cqw;
  background: currentColor;
}

.m-home {
  position: absolute;
  inset: 17cqw 0 0;
  padding: 0 6cqw;
}

.m-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 12cqw;
}

.m-wordmark {
  font-size: 7.4cqw;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.m-head-icons {
  display: inline-flex;
  gap: 4.6cqw;
  font-size: 5.6cqw;
}

.m-pills {
  display: flex;
  gap: 1.6cqw;
  margin-top: 2.4cqw;
}

.m-pill {
  padding: 1.5cqw 4cqw;
  border-radius: 999px;
  font-size: 3.6cqw;
  font-weight: 600;
}

.m-pill.is-on {
  background: var(--accent);
  color: #fff;
}

.m-label {
  margin: 3.4cqw 0 0.6cqw;
  font-size: 2.9cqw;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.m-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.m-row {
  display: flex;
  align-items: flex-start;
  gap: 3cqw;
  padding: 2.6cqw 0;
  border-radius: 3cqw;
  box-shadow: 0 0 0 0 transparent;
  transition: background-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}

.m-dot {
  flex: none;
  width: 2.4cqw;
  height: 2.4cqw;
  margin-top: 1.7cqw;
  border-radius: 50%;
  background: var(--accent);
}

.m-row-text {
  min-width: 0;
}

.m-row-title {
  display: block;
  font-size: 4.3cqw;
  font-weight: 600;
  line-height: 1.25;
}

.m-row-meta {
  display: block;
  margin-top: 0.8cqw;
  font-size: 3.3cqw;
  color: var(--muted);
  white-space: nowrap;
}

.m-bell {
  display: inline-flex;
  align-items: center;
  gap: 0.8cqw;
  color: var(--accent);
  font-weight: 600;
  vertical-align: bottom;
}

.m-bell .m-ico {
  font-size: 3cqw;
}

/* The new row and its two states (raw → summarized) share one grid cell each. */
.m-row--new .m-row-title,
.m-row--new .m-row-meta {
  display: grid;
}

.m-swap {
  grid-area: 1 / 1;
  transition: opacity var(--d-swap) var(--ease-out), transform var(--d-swap) var(--ease-out);
}

.m-row-title .m-swap--raw {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.m-swap--title {
  opacity: 0;
  transform: translateY(1.2cqw);
}

.m-row--new.is-done .m-swap--raw {
  opacity: 0;
  transform: translateY(-1.2cqw);
}

.m-row--new.is-done .m-swap--title {
  opacity: 1;
  transform: none;
}

.m-row--new.is-summarizing .m-dot {
  animation: dot-pulse var(--d-pulse) var(--ease-out);
}

@keyframes dot-pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 56, 92, 0.45); }
  40% { transform: scale(1.3); }
  100% { transform: scale(1); box-shadow: 0 0 0 2.6cqw rgba(255, 56, 92, 0); }
}

.m-row.is-press {
  background: var(--surface);
  box-shadow: 0 0 0 2cqw var(--surface);
}

/* Rows wait one row-height up; inserting the new row pushes them down into place. */
.m-list > .m-row:not(.m-row--new) {
  transform: translateY(calc(-1 * var(--row-shift, 0px)));
}

.m-row--new {
  opacity: 0;
  transform: translateY(-3cqw);
}

.m-list.has-new > .m-row {
  transform: none;
  transition: transform var(--d-insert) var(--ease-out-x);
}

.m-list.has-new > .m-row--new {
  opacity: 1;
  transition:
    opacity var(--d-swap) var(--ease-out) 120ms,
    transform var(--d-insert) var(--ease-out-x),
    background-color 160ms var(--ease-out),
    box-shadow 160ms var(--ease-out);
}

.m-scrim {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: rgba(0, 0, 0, 0.26);
  opacity: 0;
  transition: opacity var(--d-scrim) var(--ease-out);
}

.m-scrim.is-on {
  opacity: 1;
}

/* Compose card: laid out at the full note's height, clipped to what has been typed. */
.m-compose {
  --clip: 0px;
  position: absolute;
  left: 4.5cqw;
  right: 4.5cqw;
  bottom: 5cqw;
  z-index: 3;
  filter: drop-shadow(0 1.4cqw 3.6cqw rgba(0, 0, 0, 0.12));
}

.m-compose-card {
  position: absolute;
  inset: 0;
  background: var(--m-card);
  border-radius: 5.5cqw;
  clip-path: inset(var(--clip) 0 0 0 round 5.5cqw);
  transition: clip-path var(--d-grow) var(--ease-out);
}

.m-compose-inner {
  position: relative;
  padding: 4.6cqw 4.6cqw 3.6cqw;
}

.m-compose-field {
  display: grid;
  margin-bottom: 3.6cqw;
  font-size: 4.3cqw;
  line-height: 1.45;
}

.m-sizer,
.m-live {
  grid-area: 1 / 1;
  align-self: start;
}

.m-sizer {
  visibility: hidden;
}

.m-live {
  transform: translateY(var(--clip));
  transition: transform var(--d-grow) var(--ease-out);
}

.m-placeholder {
  color: var(--muted);
}

.m-compose.has-text .m-placeholder {
  display: none;
}

.m-word {
  display: none;
}

.m-word.is-on {
  display: inline;
  animation: word-in var(--d-word) var(--ease-out);
}

.m-compose.is-sent:not(.has-text) .m-typed {
  display: none;
}

.m-compose.is-sent .m-placeholder {
  animation: word-in var(--d-swap) var(--ease-out);
}

@keyframes word-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.m-caret {
  display: none;
  width: 0.55cqw;
  height: 1.15em;
  margin-left: 0.3cqw;
  vertical-align: text-bottom;
  border-radius: 1px;
  background: var(--accent);
}

.m-compose.is-focus .m-caret {
  display: inline-block;
}

.m-compose-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.m-addimg {
  display: inline-flex;
  align-items: center;
  gap: 1.6cqw;
  padding: 2cqw 3.4cqw;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 3.5cqw;
  font-weight: 600;
}

.m-addimg .m-ico {
  font-size: 4.2cqw;
}

.m-send {
  display: grid;
  place-items: center;
  width: 9.6cqw;
  height: 9.6cqw;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 4.6cqw;
  opacity: 0.35;
  transition: opacity 200ms var(--ease-out) 240ms, transform 160ms var(--ease-out);
}

.m-compose.has-text .m-send {
  opacity: 1;
  transition: opacity 200ms var(--ease-out), transform 160ms var(--ease-out);
}

.m-send.is-press {
  transform: scale(0.88);
  transition: transform 90ms var(--ease-out);
}

.m-compose.is-sent .m-send {
  animation: send-ring var(--d-ring) var(--ease-out);
}

@keyframes send-ring {
  from { box-shadow: 0 0 0 0 rgba(255, 56, 92, 0.4); }
  to { box-shadow: 0 0 0 3.4cqw rgba(255, 56, 92, 0); }
}

/* Sheets */
.m-sheet {
  position: absolute;
  inset: 15cqw 0 0;
  z-index: 4;
  padding: 4.4cqw 5.4cqw;
  background: var(--m-card);
  border-radius: 7cqw 7cqw 0 0;
  box-shadow: 0 -1cqw 6cqw rgba(0, 0, 0, 0.1);
  transform: translateY(104%);
  transition: transform var(--d-sheet-out) var(--ease-in-out);
}

.m-sheet.is-on {
  transform: none;
  transition: transform var(--d-sheet) var(--ease-out-x);
}

.m-sheet::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--d-sheet) var(--ease-out);
}

.m-note.is-on.is-behind {
  transform: translateY(-2.4cqw) scale(0.93);
}

.m-note.is-behind::after {
  opacity: 0.14;
}

.m-sheet-head {
  display: grid;
  grid-template-columns: 10cqw 1fr 10cqw;
  align-items: center;
  gap: 2cqw;
}

.m-circle {
  display: grid;
  place-items: center;
  width: 10cqw;
  height: 10cqw;
  border-radius: 50%;
  background: var(--surface);
  font-size: 4.6cqw;
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out);
}

.m-circle--ghost {
  visibility: hidden;
}

.m-share-btn.is-press {
  background: var(--accent-soft);
  color: var(--accent);
  animation: send-ring var(--d-ring) var(--ease-out);
}

.m-note-title,
.m-share-title {
  margin: 0;
  font-size: 4.3cqw;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-wrap: balance;
}

.m-note .m-part {
  opacity: 0;
  transform: translateY(2.4cqw);
  transition: opacity 200ms var(--ease-in);
}

.m-note.is-on .m-part {
  opacity: 1;
  transform: none;
  transition:
    opacity var(--d-part) var(--ease-out),
    transform var(--d-part-rise) var(--ease-out-x);
  transition-delay: calc(140ms + var(--pi, 0) * 70ms);
}

.m-note.is-reopen.is-on .m-part {
  transition-delay: 0ms;
}

.m-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 1.8cqw;
  margin: 4.4cqw 0 3.6cqw;
}

.m-tag {
  padding: 1.5cqw 3.2cqw;
  border-radius: 999px;
  background: var(--surface);
  font-size: 3.5cqw;
}

.m-card {
  display: flex;
  align-items: center;
  gap: 3cqw;
  padding: 3.4cqw 3.6cqw;
  border: 1px solid var(--line);
  border-radius: 3.8cqw;
  background: var(--surface);
}

.m-card-ico {
  font-size: 5.4cqw;
}

.m-card-text {
  flex: 1;
  min-width: 0;
}

.m-card-title {
  display: block;
  font-size: 4cqw;
  font-weight: 600;
}

.m-card-sub {
  display: block;
  margin-top: 0.6cqw;
  font-size: 3.3cqw;
  line-height: 1.35;
  color: var(--muted);
}

.m-chev {
  font-size: 4.4cqw;
  color: var(--muted);
}

.m-summary {
  margin: 3.6cqw 0 0;
  font-size: 3.9cqw;
  line-height: 1.5;
  color: var(--muted);
}

.m-note .m-label {
  margin-top: 4cqw;
}

.m-index {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 3.8cqw;
  line-height: 1.6;
}

.m-index li::before {
  content: "·";
  display: inline-block;
  width: 3.4cqw;
  color: var(--muted);
}

.m-index li {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.m-body-h {
  margin: 1.6cqw 0 1.2cqw;
  font-size: 4.8cqw;
  font-weight: 700;
}

.m-body {
  margin: 0;
  font-size: 3.8cqw;
  line-height: 1.5;
}

.m-body + .m-body-h {
  margin-top: 4cqw;
}

/* Notification banner — title is the reminder label, body is the note title (server/src/cron.ts). */
.m-banner {
  position: absolute;
  top: 13.5cqw;
  left: 3.2cqw;
  right: 3.2cqw;
  z-index: 5;
  display: flex;
  align-items: flex-start;
  gap: 3cqw;
  padding: 3.4cqw 3.6cqw;
  border-radius: 6cqw;
  background: var(--m-card);
  box-shadow: 0 2cqw 7cqw rgba(0, 0, 0, 0.16);
  opacity: 0;
  transform: translateY(-140%);
  transition: transform var(--d-banner-out) var(--ease-in), opacity var(--d-banner-out) var(--ease-in);
}

.m-banner.is-on {
  opacity: 1;
  transform: none;
  transition: transform var(--d-banner) var(--ease-out-x), opacity 300ms var(--ease-out);
}

.m-banner.is-on.is-press {
  transform: scale(0.97);
  transition: transform 120ms var(--ease-out);
}

.m-banner-icon {
  flex: none;
  width: 9.4cqw;
  height: 9.4cqw;
  border-radius: 2.2cqw;
}

.m-banner-text {
  flex: 1;
  min-width: 0;
}

.m-banner-top {
  display: flex;
  justify-content: space-between;
  font-size: 3.2cqw;
  font-weight: 600;
}

.m-banner-now {
  font-weight: 400;
  color: var(--muted);
}

.m-banner-title {
  display: block;
  margin-top: 0.4cqw;
  font-size: 3.8cqw;
  font-weight: 600;
  line-height: 1.3;
}

.m-banner-body {
  display: block;
  margin-top: 0.4cqw;
  font-size: 3.6cqw;
  line-height: 1.3;
}

/* Share sheet — mirrors app/share-link/[id].tsx. */
.m-sharesheet {
  inset: 22cqw 0 0;
  z-index: 5;
  text-align: center;
}

.m-qr {
  width: 58cqw;
  margin: 6cqw auto 4cqw;
  padding: 2.4cqw;
  border-radius: 4cqw;
  /* Dark-on-light in both themes: inverted codes fail on many scanners. */
  background: #fff;
}

.m-qr img {
  width: 100%;
  height: auto;
  image-rendering: pixelated;
}

.m-share-meta {
  margin: 0;
  font-size: 3.6cqw;
  color: var(--muted);
}

.m-share-url {
  margin: 1.2cqw 0 4.6cqw;
  font-size: 3.2cqw;
  color: var(--muted);
}

.m-share-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3cqw;
}

.m-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.8cqw;
  padding: 3.2cqw;
  border-radius: 3.4cqw;
  background: var(--surface);
  font-size: 3.8cqw;
  font-weight: 600;
}

.m-btn--primary {
  background: var(--accent);
  color: #fff;
}

.m-veil {
  position: absolute;
  inset: 0;
  z-index: 7;
  background: var(--bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms var(--ease-out);
}

.intro-stage.is-agent .m-veil {
  opacity: 0.5;
}

.m-screen.is-reset .m-veil {
  opacity: 1;
  transition: opacity 280ms var(--ease-out);
}

/* ── Agent panel — Claude Code over the Stash MCP (Stash Pro) ── */
.intro-agent {
  --agent-w: min(22rem, 92vw);
  position: absolute;
  left: 50%;
  bottom: 5%;
  z-index: 4;
  width: var(--agent-w);
  padding: 0.9rem 1.05rem 1rem;
  border-radius: 16px;
  background: var(--m-card);
  box-shadow: var(--shadow-heavy);
  color: var(--ink);
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.5;
  text-align: left;
  opacity: 0;
  transform: translate(-50%, 1.25rem);
}

.intro-agent.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
  transition:
    opacity var(--d-part) var(--ease-out),
    transform var(--d-agent) var(--ease-out-x);
}

@media (min-width: 56rem) {
  .intro-agent {
    --agent-w: 23rem;
    top: 50%;
    bottom: auto;
    font-size: 0.8125rem;
    transform: translate(-50%, calc(-50% + 1.25rem));
  }

  .intro-agent.is-on {
    transform: translate(-50%, -50%);
  }
}

.agent-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-body);
  font-size: 0.8125rem;
}

.agent-name {
  font-weight: 600;
}

.agent-conn {
  color: var(--muted);
}

.agent-pro {
  margin-left: auto;
  padding: 0.2em 0.6em;
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.6875rem;
  font-weight: 600;
  white-space: nowrap;
}

.agent-line {
  margin: 0 0 0.35rem;
  opacity: 0;
  transform: translateY(4px);
}

.agent-line.is-on {
  opacity: 1;
  transform: none;
  transition: opacity var(--d-part) var(--ease-out), transform var(--d-part) var(--ease-out);
}

.agent-gt,
.agent-tool,
.agent-result {
  color: var(--muted);
}

.agent-result {
  padding-left: 1rem;
}

.agent-answer {
  margin-top: 0.55rem;
}

.a-word {
  opacity: 0;
}

.a-word.is-on {
  opacity: 1;
  transition: opacity var(--d-word) var(--ease-out);
}

.agent-bullet {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.55rem;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: 0.05em;
}

.agent-bullet--ink {
  background: var(--ink);
}

.agent-ref {
  margin: 0.5rem 0 0;
  color: var(--muted);
}

.agent-chip {
  padding: 0.2em 0.6em;
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
}

/* ── Captions: Capture → Summarize → Recall → Share ── */
.intro-caption {
  order: -1;
  position: relative;
  width: min(100%, 92vw, 28rem);
  height: 3.4em;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 0.6vw + 1rem, 1.5rem);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-align: center;
  text-wrap: balance;
  transition: opacity var(--d-cap-out) var(--ease-in);
}

.cap {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity var(--d-cap-out) var(--ease-in),
    transform 0s linear var(--d-cap-out);
}

.cap.is-on {
  opacity: 1;
  transform: none;
  transition:
    opacity var(--d-cap) var(--ease-out) 120ms,
    transform var(--d-cap-rise) var(--ease-out-x) 120ms;
}

.cap--share.is-on {
  transform: none;
  transition: opacity 0s;
}

.cap--share .w {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.3em);
}

.cap--share .w.is-on {
  opacity: 1;
  transform: none;
  transition:
    opacity var(--d-cap) var(--ease-out),
    transform var(--d-cap-rise) var(--ease-out-x);
  transition-delay: calc(var(--wi, 0) * 55ms);
}

.intro-stage.is-outro .intro-caption {
  opacity: 0;
  transition: opacity var(--d-cap-out) var(--ease-in);
}

.intro-stage.is-outro .intro-agent {
  opacity: 0;
  transition: opacity 180ms var(--ease-out);
}

/* Mobile: the share line is the large one, still above the phone. */
@media (max-width: 55.99rem) {
  .intro-stage {
    gap: 0.65rem;
  }

  .intro-caption {
    width: min(92vw, 22rem);
    height: 3.5em;
    margin: 0;
    font-size: clamp(1.7rem, 6.6vw, 2.15rem);
    font-weight: 600;
    line-height: 1.12;
    letter-spacing: -0.025em;
  }
}

/* ── Page shell ── */
.page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  opacity: 1;
}

html[data-intro="handoff"] .page,
html[data-intro="done"] .page,
html[data-intro="skipped"] .page,
html:not(.js) .page {
  opacity: 1;
}

html[data-intro="handoff"] .page,
html[data-intro="done"] .page {
  transition: opacity var(--d-handoff) var(--ease-out);
}

.page[inert] {
  pointer-events: none;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--pad-x);
  width: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink);
  text-decoration: none;
}

.brand-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
}

.brand:hover .brand-icon,
.brand:focus-visible .brand-icon {
  animation: brand-pulse 320ms var(--ease-out);
}

@keyframes brand-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 56, 92, 0.3); }
  50% { transform: scale(1.06); box-shadow: 0 0 0 10px rgba(255, 56, 92, 0); }
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  transition: color 200ms, border-color 200ms;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  outline: none;
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-toggle-icon {
  width: 1.125rem;
  height: 1.125rem;
}

.theme-toggle-icon--sun {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle-icon--sun {
    display: block;
  }
  :root:not([data-theme="light"]) .theme-toggle-icon--moon {
    display: none;
  }
}

:root[data-theme="dark"] .theme-toggle-icon--sun {
  display: block;
}
:root[data-theme="dark"] .theme-toggle-icon--moon {
  display: none;
}
:root[data-theme="light"] .theme-toggle-icon--sun {
  display: none;
}
:root[data-theme="light"] .theme-toggle-icon--moon {
  display: block;
}

/* Stage — hero copy + phone: stacked on mobile, two columns on desktop */
.stage {
  flex: 1;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--pad-x) 2rem;
  width: 100%;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.5rem 0 3rem;
  width: 100%;
}

.hero-copy {
  max-width: 30rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-cta {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
}

.hero-phone {
  margin-top: 2rem;
  overflow: visible;
  padding-bottom: 1rem;
}

.hero-title {
  margin: 0 0 1.1rem;
  font-family: var(--font-display);
  font-size: clamp(2.625rem, 2.4vw + 1.6rem, 4.5rem);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.hero-title em {
  font-style: italic;
  font-weight: 400;
}

.h1-w {
  display: inline-block;
}

.hero-lead {
  margin: 0 auto;
  max-width: 24rem;
  font-size: clamp(1.0625rem, 0.4vw + 1rem, 1.25rem);
  line-height: 1.5;
  color: var(--muted);
  text-wrap: pretty;
}

@media (min-width: 56rem) {
  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    column-gap: clamp(2.5rem, 5vw, 5rem);
    align-items: center;
    min-height: calc(100dvh - var(--header-height) - 2rem);
    padding: 1rem 0 3rem;
    text-align: left;
  }

  .hero-copy {
    max-width: 32rem;
    align-items: flex-start;
  }

  .hero-lead {
    margin: 0;
    max-width: 26rem;
  }

  .hero-cta {
    justify-content: flex-start;
    margin-top: 2rem;
  }

  .hero-phone {
    margin: 0;
    padding: 0;
    justify-self: center;
  }
}

/* What is Stash. Sits under the hero, before the closing CTA. */
.how {
  width: 100%;
  max-width: 34rem;
  margin: 0.5rem auto 0;
  padding: 0 0 1.5rem;
}

.how-title {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 1.2vw + 1.1rem, 2.25rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.how-lead {
  margin: 0;
  font-size: clamp(1.0625rem, 0.4vw + 1rem, 1.25rem);
  line-height: 1.5;
  text-wrap: pretty;
}

.how-label {
  margin: 1.75rem 0 0.75rem;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.how-steps {
  margin: 0;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.how-steps li {
  padding-left: 0.25rem;
  line-height: 1.5;
  text-wrap: pretty;
}

.how-steps li::marker {
  color: var(--muted);
  font-weight: 600;
}

.how-line {
  margin: 1.5rem 0 0;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--muted);
  text-wrap: pretty;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 3.25rem;
  padding: 0.5rem 1.25rem 0.5rem 1rem;
  border: none;
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--ink) 62%, transparent);
  color: var(--bg);
  font-family: var(--font-body);
  text-decoration: none;
  cursor: not-allowed;
}

.cta[aria-disabled="true"] {
  pointer-events: none;
}

.cta:not([aria-disabled="true"]) {
  background: var(--ink);
  cursor: pointer;
  transition: transform 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}

.cta:not([aria-disabled="true"]):hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-heavy);
}

.cta-apple {
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
}

.cta-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
}

.cta-kicker {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.cta-label {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.cta-note {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  color: var(--muted);
}



/* Device */
.device {
  position: relative;
  aspect-ratio: 1206 / 2622;
  padding: 10px;
  border-radius: 44px;
  background: var(--bezel);
  box-shadow: var(--shadow-heavy), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  transform: none;
}

.device--hero {
  width: var(--phone-w);
  margin: 0 auto;
  opacity: 0;
  transition: opacity var(--d-phone-in) var(--ease-out);
}

.device--hero.is-visible,
html:not(.js) .device--hero {
  opacity: 1;
}

.device-screen {
  position: relative;
  border-radius: 34px;
  overflow: hidden;
  background: var(--device-top, #f2f4f7);
  height: 100%;
  transition: background-color 180ms linear;
}

.device-screen::before {
  content: "";
  position: absolute;
  top: 2.2%;
  left: 35%;
  width: 30%;
  height: 3.4%;
  border-radius: 999px;
  background: #000;
  z-index: 2;
  pointer-events: none;
}

.device-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(
    120% 60% at calc(50% + var(--tilt-x, 0) * 6%) 0%,
    rgba(255, 255, 255, 0.1),
    transparent 60%
  );
  opacity: 0;
}

@media (hover: hover) and (pointer: fine) and (min-width: 56rem) {
  .stage.has-tilt .device-screen::after {
    opacity: 1;
  }
}

.device-screen:has(.device-media)::before {
  /* Full-width mask over baked light status strip in demo.mp4 (~0–3%). */
  top: 0;
  left: 0;
  width: 100%;
  height: 3.75%;
  border-radius: 0;
  background: var(--device-top, #f2f4f7);
  z-index: 2;
}

.device-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  background: transparent;
}



/* Settled landing copy is visible on first paint. The phone demo loops beside it. */
.reveal,
.h1-w {
  opacity: 1;
  transform: none;
}

html[data-intro="handoff"] .reveal,
html[data-intro="done"] .reveal,
html[data-intro="skipped"] .reveal {
  animation: reveal-in 700ms var(--ease-out) forwards;
}

html[data-intro="handoff"] .h1-w,
html[data-intro="done"] .h1-w,
html[data-intro="skipped"] .h1-w {
  animation: reveal-in 900ms var(--ease-out-x) forwards;
  animation-delay: calc(60ms + var(--g, 0) * 140ms);
}

.reveal[data-reveal-order="1"] { animation-delay: 480ms; }
.reveal[data-reveal-order="2"] { animation-delay: 600ms; }
.reveal[data-reveal-order="footer"] {
  animation-delay: 720ms;
  transform: none;
}

.closing .reveal[data-reveal-order="0"] { animation-delay: 0ms; }
.closing .reveal[data-reveal-order="1"] { animation-delay: 120ms; }

html:not(.js) .reveal,
html:not(.js) .h1-w {
  opacity: 1;
  transform: none;
}

html[data-intro="skipped"] .device--hero {
  animation: reveal-phone 700ms var(--ease-out) 160ms both;
}

@keyframes reveal-in {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes reveal-phone {
  from { opacity: 0; transform: translateY(24px) rotateY(-6deg) rotateX(2deg); }
  to { opacity: 1; transform: translateY(0) rotateY(-6deg) rotateX(2deg); }
}

/* Closing */
.closing {
  text-align: center;
  padding: 4rem var(--pad-x) 5rem;
  content-visibility: auto;
}

.closing-title {
  margin: 0 0 1.5rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 2.2vw + 1rem, 3rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.closing-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Footer */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 1.5rem var(--pad-x) 2.5rem;
  width: 100%;
  border-top: 1px solid var(--line);
}

.footer-copy {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-nav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Reduced motion */
html[data-motion="reduced"] .page {
  opacity: 1;
}

html[data-motion="reduced"] .reveal,
html[data-motion="reduced"] .h1-w {
  opacity: 1;
  transform: none;
  animation: none;
}

html[data-motion="reduced"] .device {
  transform: none;
}

html[data-motion="reduced"] .device--hero {
  opacity: 1;
  animation: none;
}


@keyframes page-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

