/* Smartboard: site styles.
   Mirrors the app's design system (DesignSystem/Theme.swift, Palette.swift):
   20pt cards, 34pt shelf, capsule bubbles, rounded type and the category tints. */

:root {
  color-scheme: light dark;

  /* Category tints (Apple system colours, light appearance) */
  --blue: #007aff;
  --purple: #af52de;
  --pink: #ff2d55;
  --teal: #30b0c7;
  --orange: #ff9500;
  --green: #34c759;
  --indigo: #5856d6;
  --gray: #8e8e93;
  --accent: var(--blue);

  /* Surfaces */
  --bg: #e9edf6;
  --text: #1d1d1f;
  --text-2: rgb(29 29 31 / 0.62);
  --text-3: rgb(29 29 31 / 0.38);
  --hairline: rgb(0 0 0 / 0.08);
  --fill-quiet: rgb(0 0 0 / 0.04);
  --key-bg: rgb(255 255 255 / 0.7);

  /* Glass */
  --glass-1: rgb(255 255 255 / 0.52);
  --glass-2: rgb(255 255 255 / 0.2);
  --rim-1: rgb(255 255 255 / 0.95);
  --rim-2: rgb(255 255 255 / 0.3);
  --glass-blur: blur(30px) saturate(190%);
  --glass-shadow: 0 1px 1px rgb(20 30 70 / 0.04), 0 18px 50px -12px rgb(20 30 80 / 0.22);
  --inner-fill: rgb(255 255 255 / 0.38);

  /* Metrics (Theme.Radius / Theme.Spacing) */
  --r-card: 20px;
  --r-shelf: 34px;
  --gutter: 16px;
  --card-w: 212px;
  --card-h: 152px;
  --stage-w: min(1120px, calc(100vw - 2 * var(--gutter)));
  --shelf-h: calc(var(--card-h) + 92px);

  /* Type */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-rounded: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Nunito, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  /* Motion (Theme.Motion) */
  --spring: cubic-bezier(0.34, 1.32, 0.64, 1);
  --snappy: cubic-bezier(0.3, 1.4, 0.6, 1);
  --settle: cubic-bezier(0.2, 0.9, 0.25, 1);
}

@supports (transition-timing-function: linear(0, 1)) {
  :root {
    /* spring(response: 0.55, dampingFraction: 0.78) */
    --spring: linear(0, 0.012 1.1%, 0.05 2.3%, 0.18 4.8%, 0.53 10.5%, 0.79 15.2%, 0.95 19.6%, 1.03 24.4%, 1.055 28.6%, 1.05 33%, 1.02 41%, 1.001 50%, 0.996 60%, 1);
    /* spring(response: 0.28, dampingFraction: 0.72) */
    --snappy: linear(0, 0.06 2.5%, 0.33 8%, 0.75 16%, 1.02 24%, 1.07 30%, 1.04 38%, 1 50%, 0.995 62%, 1);
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --blue: #0a84ff;
    --purple: #bf5af2;
    --pink: #ff375f;
    --teal: #40c8e0;
    --orange: #ff9f0a;
    --green: #30d158;
    --indigo: #5e5ce6;
    --gray: #98989d;

    --bg: #07080e;
    --text: #f5f5f7;
    --text-2: rgb(245 245 247 / 0.64);
    --text-3: rgb(245 245 247 / 0.36);
    --hairline: rgb(255 255 255 / 0.1);
    --fill-quiet: rgb(255 255 255 / 0.05);
    --key-bg: rgb(255 255 255 / 0.1);

    --glass-1: rgb(255 255 255 / 0.11);
    --glass-2: rgb(255 255 255 / 0.03);
    --rim-1: rgb(255 255 255 / 0.4);
    --rim-2: rgb(255 255 255 / 0.06);
    --glass-shadow: 0 1px 1px rgb(0 0 0 / 0.3), 0 24px 60px -16px rgb(0 0 0 / 0.65);
    --inner-fill: rgb(255 255 255 / 0.07);
  }
}

/* ---------- Base ---------- */

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3 { font-family: var(--font-rounded); margin: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
  width: 1em;
  height: 1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sprite .fill { fill: currentColor; stroke: none; }
.sprite .knock { stroke: white; stroke-width: 2.2; }

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

kbd {
  font-family: var(--font-rounded);
  font-weight: 600;
}

.key {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 9px;
  background: var(--key-bg);
  box-shadow: inset 0 0 0 0.5px var(--hairline), 0 1px 0 var(--hairline), inset 0 1px 0 var(--rim-2);
  font-size: 14px;
  color: var(--text);
}
.key.small {
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 6px;
  font-size: 13px;
  vertical-align: 1px;
}

/* ---------- Glass ---------- */

.glass {
  position: relative;
  background: linear-gradient(150deg, var(--glass-1), var(--glass-2));
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow:
    inset 0 1px 0 var(--rim-1),
    inset 0 0 0 0.5px var(--rim-2),
    inset 0 -1px 1px var(--rim-2),
    var(--glass-shadow);
}

/* Specular rim: bright on the top-left edge, fading around the shape. */
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(155deg, var(--rim-1), transparent 32%, transparent 68%, var(--rim-2));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* ---------- Wallpaper ---------- */

.wallpaper {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--bg);
}

.wallpaper::after {
  /* Fine grain, so the gradients feel like a real surface. */
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.blob {
  position: absolute;
  width: 70vmax;
  height: 70vmax;
  border-radius: 50%;
  background: radial-gradient(circle at center, var(--c) 0%, transparent 62%);
  opacity: var(--o, 0.7);
  animation: drift var(--t, 34s) ease-in-out infinite alternate;
  will-change: transform;
}
.b1 { --c: #7fb2ff; top: -32vmax; left: -22vmax; --t: 38s; }
.b2 { --c: #cfa2ff; top: -20vmax; right: -30vmax; --t: 42s; animation-delay: -8s; }
.b3 { --c: #ffa3c4; top: 40vh; left: -30vmax; --t: 36s; animation-delay: -14s; --o: 0.55; }
.b4 { --c: #ffc98a; bottom: -36vmax; right: -24vmax; --t: 40s; animation-delay: -20s; --o: 0.6; }
.b5 { --c: #8fe3ec; top: 30vh; right: 10vw; --t: 46s; animation-delay: -4s; --o: 0.45; width: 50vmax; height: 50vmax; }

@media (prefers-color-scheme: dark) {
  .b1 { --c: #1e5bff; --o: 0.5; }
  .b2 { --c: #8a3dff; --o: 0.42; }
  .b3 { --c: #ff2d6f; --o: 0.3; }
  .b4 { --c: #ff8a00; --o: 0.32; }
  .b5 { --c: #00b5c8; --o: 0.28; }
  .wallpaper::after { opacity: 0.07; }
}

@keyframes drift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(6vmax, 4vmax, 0) scale(1.08); }
  100% { transform: translate3d(-4vmax, 7vmax, 0) scale(0.96); }
}

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

main {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 var(--gutter);
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}

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

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: clamp(56px, 11vh, 120px);
  padding-bottom: clamp(40px, 6vh, 64px);
  max-width: 760px;
}

.app-icon {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background:
    linear-gradient(150deg, color-mix(in srgb, var(--accent) 22%, var(--glass-1)), color-mix(in srgb, var(--accent) 10%, var(--glass-2)));
  color: var(--accent);
  font-size: 46px;
  margin-bottom: 28px;
  animation: rise 0.9s var(--settle) both;
}
.app-icon .icon { stroke-width: 1.6; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 12px;
  border-radius: 999px;
  font-family: var(--font-rounded);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 18px;
  animation: rise 0.9s 0.06s var(--settle) both;
}
.eyebrow .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(180deg, color-mix(in srgb, var(--green) 70%, white), var(--green));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 18%, transparent);
}

h1 {
  font-size: clamp(56px, 10vw, 112px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  background: linear-gradient(180deg, var(--text) 35%, color-mix(in srgb, var(--text) 62%, transparent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-bottom: 0.08em;
  animation: rise 0.9s 0.12s var(--settle) both;
}

.tagline {
  margin-top: 10px;
  font-family: var(--font-rounded);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-2);
  animation: rise 0.9s 0.18s var(--settle) both;
}

.lede {
  margin-top: 18px;
  max-width: 34em;
  font-size: clamp(16px, 1.6vw, 19px);
  color: var(--text-2);
  text-wrap: balance;
  animation: rise 0.9s 0.24s var(--settle) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: none; }
}

/* ---------- Shelf demo ---------- */

.stage {
  width: var(--stage-w);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.shelf {
  width: 210px;
  height: 42px;
  border-radius: 21px;
  overflow: hidden;
  isolation: isolate;
  transition:
    width 0.55s var(--spring),
    height 0.55s var(--spring),
    border-radius 0.55s var(--spring),
    margin-bottom 0.55s var(--spring),
    box-shadow 0.4s ease;
  /* Reserve the open height below the pill so the page doesn't jump. */
  margin-bottom: calc(var(--shelf-h) - 42px);
}
.shelf[data-phase="open"] {
  width: 100%;
  height: var(--shelf-h);
  border-radius: var(--r-shelf);
  margin-bottom: 0;
}
.shelf[data-phase="confirming"] {
  width: min(320px, 100%);
  height: 48px;
  border-radius: 24px;
  margin-bottom: calc(var(--shelf-h) - 48px);
  transition-duration: 0.42s;
  transition-timing-function: var(--settle);
}

/* The three faces of the shelf: closed pill, open slab, "Copied" confirmation. */
.shelf-pill,
.shelf-confirm,
.shelf-content {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.45s var(--spring);
}

.shelf-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 210px;
  height: 42px;
  border: 0;
  background: none;
  cursor: pointer;
  font-family: var(--font-rounded);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
}
.shelf-pill .icon { font-size: 17px; color: var(--accent); }
.shelf-pill kbd {
  font-size: 12px;
  color: var(--text-3);
  padding: 2px 7px;
  border-radius: 7px;
  background: var(--fill-quiet);
}
.shelf[data-phase="closed"] .shelf-pill { opacity: 1; pointer-events: auto; }

.shelf-confirm {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(320px, 100%);
  height: 48px;
  padding: 0 18px;
  font-family: var(--font-rounded);
  font-size: 14px;
  white-space: nowrap;
  transform: translateX(-50%) scale(0.9);
}
.shelf-confirm .check { font-size: 19px; color: var(--confirm-tint, var(--green)); }
.shelf-confirm .confirm-summary { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; }
.shelf[data-phase="confirming"] .shelf-confirm { opacity: 1; transform: translateX(-50%) scale(1); }
.shelf[data-phase="confirming"] .check { animation: bounce 0.5s var(--snappy); }

@keyframes bounce {
  0% { transform: scale(0.6); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.shelf-content {
  width: var(--stage-w);
  height: var(--shelf-h);
  display: flex;
  flex-direction: column;
  padding-top: 14px;
  transform: translateX(-50%) scale(0.97);
  transform-origin: top center;
}
.shelf[data-phase="open"] .shelf-content {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) scale(1);
  transition-delay: 0.08s, 0s;
}

/* Top bar: label · bubble bar · hints */
.shelf-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  height: 40px;
  padding: 0 24px;
}

.shelf-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-rounded);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
}
.shelf-label .icon { font-size: 15px; }

.shelf-hint {
  justify-self: end;
  font-family: var(--font-rounded);
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
  margin-right: 44px;
}
.shelf-button {
  position: absolute;
  right: 22px;
  top: 18px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--inner-fill);
  box-shadow: inset 0 0 0 0.5px var(--hairline), inset 0 1px 0 var(--rim-2);
  color: var(--text-2);
  font-size: 15px;
}

.bubbles {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px 2px;
}
.bubbles::-webkit-scrollbar { display: none; }

.bubble {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 7px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--inner-fill);
  box-shadow: inset 0 0 0 0.5px var(--hairline), inset 0 1px 0 var(--rim-2);
  font-family: var(--font-rounded);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  color: var(--text-2);
  cursor: pointer;
  transition: background-color 0.3s var(--snappy), color 0.2s ease, transform 0.3s var(--snappy), box-shadow 0.3s ease;
}
.bubble i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tint) 70%, white), var(--tint));
}
.bubble:hover { transform: scale(1.04); }
.bubble:active { transform: scale(0.96); }
.bubble.is-selected {
  background: color-mix(in srgb, var(--tint) 45%, var(--inner-fill));
  color: var(--text);
  box-shadow: inset 0 0 0 0.5px color-mix(in srgb, var(--tint) 50%, transparent), inset 0 1px 0 var(--rim-1), 0 4px 12px -4px color-mix(in srgb, var(--tint) 60%, transparent);
}
.bubble.is-quiet { padding: 7px 9px; }
.bubble.is-quiet i {
  background: none;
  border: 1.2px dashed var(--text-2);
}

/* Card row */
.cards {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scroll-padding: 0 24px;
  padding: 14px 24px;
  scrollbar-width: none;
  outline: none;
}
.cards::-webkit-scrollbar { display: none; }
.cards:focus-visible { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 60%, transparent); border-radius: var(--r-card); }

.card {
  --tint: var(--blue);
  flex: 0 0 var(--card-w);
  min-width: 0;
  height: var(--card-h);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: var(--r-card);
  background: color-mix(in srgb, var(--tint) 10%, transparent);
  box-shadow: inset 0 0 0 0.5px var(--hairline);
  scroll-snap-align: start;
  cursor: pointer;
  user-select: none;
  transition: transform 0.3s var(--snappy), background-color 0.25s ease, box-shadow 0.3s ease;
}
.card.is-selected {
  background: color-mix(in srgb, var(--tint) 24%, transparent);
  transform: scale(1.035);
  box-shadow:
    inset 0 0 0 2px color-mix(in srgb, var(--tint) 90%, transparent),
    0 6px 14px color-mix(in srgb, var(--tint) 35%, transparent);
}
.card.is-unsorted {
  background: var(--fill-quiet);
  box-shadow: none;
  outline: 1px dashed color-mix(in srgb, var(--text-2) 45%, transparent);
  outline-offset: -1px;
}
.card.is-unsorted.is-selected {
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--tint) 90%, transparent);
}
.card[hidden] { display: none; }

.card.enter { animation: card-in 0.5s var(--spring) backwards; animation-delay: calc(0.12s + var(--i, 0) * 0.025s); }
@keyframes card-in {
  from { opacity: 0; transform: translateY(-18px) scale(0.92); }
  to { opacity: 1; transform: none; }
}

.card header {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-rounded);
  font-size: 11px;
  font-weight: 600;
  color: var(--tint);
}
.card header .icon { font-size: 13px; stroke-width: 2; }
.card.is-unsorted header .icon { color: var(--text-3); }
.card .spacer { flex: 1; }
.card .cat {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c);
  margin-right: 3px;
}
.card header kbd {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 5px;
  background: var(--fill-quiet);
  box-shadow: inset 0 0 0 0.5px var(--hairline);
  font-size: 10px;
  color: var(--text-2);
}

.card .text,
.card .code {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.38;
  color: var(--text);
}
.card .text { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
.card .text.mono { font-family: var(--font-mono); font-size: 12px; color: var(--text-2); }

.card .code {
  min-width: 0;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  white-space: pre;
  color: var(--text);
  -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
  mask-image: linear-gradient(90deg, #000 85%, transparent);
}
.card .code b { font-weight: 600; color: color-mix(in srgb, var(--pink) 85%, var(--text)); }
.card .code em { font-style: normal; color: color-mix(in srgb, var(--purple) 80%, var(--text)); }
.card .code s { text-decoration: none; color: color-mix(in srgb, var(--orange) 70%, var(--text)); }

.card .link { flex: 1; display: flex; flex-direction: column; gap: 3px; min-height: 0; }
.card .link strong { font-size: 13px; font-weight: 600; line-height: 1.3; }
.card .link span { font-size: 12px; color: var(--tint); }

.card .thumb {
  flex: 1;
  min-height: 0;
  border-radius: 10px;
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 30%, #ffe9a8 0 9%, transparent 10%),
    linear-gradient(180deg, transparent 52%, rgb(0 0 0 / 0.08) 100%),
    linear-gradient(160deg, #ff9ec4 0%, #c39cff 45%, #7cc2ff 100%);
  position: relative;
}
.card .thumb span {
  position: absolute;
  inset: auto 0 0 0;
  height: 55%;
  background:
    radial-gradient(120% 90% at 20% 100%, #6a4bd8 0 55%, transparent 56%),
    radial-gradient(110% 80% at 85% 100%, #4c77e6 0 50%, transparent 51%);
  opacity: 0.85;
}

.card .file { flex: 1; display: flex; align-items: center; gap: 10px; min-height: 0; }
.card .file .icon { font-size: 34px; color: var(--tint); stroke-width: 1.4; }
.card .file div { display: flex; flex-direction: column; min-width: 0; }
.card .file strong { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .file span { font-size: 11px; color: var(--text-2); }

.card footer {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: var(--text-2);
  white-space: nowrap;
}
.card .app {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(160deg, var(--a1), var(--a2));
  box-shadow: inset 0 0 0 0.5px rgb(0 0 0 / 0.12), inset 0 1px 0 rgb(255 255 255 / 0.4);
}

.stage-caption {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 26px;
  font-size: 15px;
  color: var(--text-2);
  text-align: center;
}
.stage-caption span { margin-left: 6px; }

/* ---------- Features ---------- */

.features {
  width: min(1040px, 100%);
  padding-top: clamp(96px, 14vh, 160px);
}

.features h2 {
  font-size: clamp(32px, 4.6vw, 52px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-align: center;
  text-wrap: balance;
  max-width: 16em;
  margin: 0 auto 48px;
}
.soft { color: var(--text-3); }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.feature {
  padding: 28px 28px 30px;
  border-radius: 30px;
  transition: transform 0.45s var(--spring);
}
.feature:hover { transform: translateY(-3px); }

.feature-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  margin-bottom: 18px;
  background: color-mix(in srgb, var(--tint) 16%, transparent);
  box-shadow: inset 0 0 0 0.5px color-mix(in srgb, var(--tint) 30%, transparent), inset 0 1px 0 var(--rim-2);
  color: var(--tint);
  font-size: 22px;
}

.feature h3 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.feature p { color: var(--text-2); font-size: 16px; line-height: 1.55; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
}
.chips li {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tint) 13%, transparent);
  font-family: var(--font-rounded);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.chips li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tint) 70%, white), var(--tint));
}

/* ---------- Foreword ---------- */

.foreword {
  width: min(720px, 100%);
  margin-top: clamp(96px, 14vh, 160px);
  padding: clamp(32px, 6vw, 60px);
  border-radius: var(--r-shelf);
}

.foreword-eyebrow {
  font-family: var(--font-rounded);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 10px;
}

.foreword h2 {
  font-size: clamp(28px, 3.6vw, 38px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.12;
  margin-bottom: 26px;
}

.foreword-body p {
  font-size: clamp(17px, 1.7vw, 19px);
  line-height: 1.68;
  color: color-mix(in srgb, var(--text) 80%, transparent);
  text-wrap: pretty;
}
.foreword-body p + p { margin-top: 1.05em; }

.signature {
  margin-top: 28px;
  font-family: "Snell Roundhand", "Apple Chancery", "Segoe Script", "Brush Script MT", cursive;
  font-size: 34px;
  line-height: 1;
  color: var(--text);
}

/* ---------- Actions ---------- */

.actions {
  width: min(720px, 100%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.action {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px 14px 14px;
  border-radius: 999px;
  transition: transform 0.4s var(--snappy), box-shadow 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}
.action:hover { transform: translateY(-2px) scale(1.01); }
.action:active { transform: scale(0.98); transition-duration: 0.15s; }

.action-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 23px;
}
.action-text { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.25; }
.action-text strong { font-family: var(--font-rounded); font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.action-text span { font-size: 13px; }
.action-arrow, .action-heart { font-size: 20px; flex: none; transition: transform 0.4s var(--snappy); }
.action:hover .action-arrow { transform: translate(2px, -2px); }
.action:hover .action-heart { transform: scale(1.18); }

/* Download: prominent glass, like .glassProminent in the app. */
.action-download {
  color: white;
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--tint) 78%, white) 0%, var(--tint) 55%, color-mix(in srgb, var(--tint) 85%, black) 100%);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.55),
    inset 0 -1px 1px rgb(0 0 0 / 0.12),
    0 14px 34px -10px color-mix(in srgb, var(--tint) 75%, transparent);
}
.action-download::before { background: linear-gradient(155deg, rgb(255 255 255 / 0.85), transparent 35%, transparent 70%, rgb(255 255 255 / 0.3)); }
.action-download .action-icon { background: rgb(255 255 255 / 0.2); box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.4); }
.action-download .action-text span { color: rgb(255 255 255 / 0.8); }
.action-download:hover { box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.55), inset 0 -1px 1px rgb(0 0 0 / 0.12), 0 18px 40px -10px color-mix(in srgb, var(--tint) 85%, transparent); }

/* Coffee: tinted glass, the same orange as the support pop-up. */
.action-coffee {
  background: linear-gradient(150deg, color-mix(in srgb, var(--tint) 14%, var(--glass-1)), var(--glass-2));
}
.action-coffee .action-icon {
  color: var(--tint);
  background: color-mix(in srgb, var(--tint) 18%, transparent);
  box-shadow: inset 0 0 0 0.5px color-mix(in srgb, var(--tint) 35%, transparent), inset 0 1px 0 var(--rim-2);
}
.action-coffee .action-text span { color: var(--text-2); }
.action-coffee .action-heart { color: var(--pink); }

/* ---------- Footer & toast ---------- */

.site-footer {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: clamp(72px, 12vh, 120px) var(--gutter) calc(36px + env(safe-area-inset-bottom));
  font-size: 13px;
  color: var(--text-3);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 10;
  padding: 11px 20px;
  border-radius: 999px;
  font-family: var(--font-rounded);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  transform: translate(-50%, 0);
  animation: toast-in 0.45s var(--spring) both;
}
.toast[hidden] { display: none; }
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 16px) scale(0.92); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
  .shelf-hint { display: none; }
}

@media (max-width: 760px) {
  :root {
    --gutter: 16px;
    --card-w: 188px;
    --card-h: 148px;
    --r-shelf: 28px;
  }
  .shelf-top { grid-template-columns: minmax(0, 1fr); padding: 0 16px; }
  .shelf-label, .shelf-button { display: none; }
  .bubbles { justify-self: stretch; }
  .cards { padding: 12px 16px; scroll-padding: 0 16px; }
  .feature-grid, .actions { grid-template-columns: minmax(0, 1fr); }
  .feature { padding: 24px; border-radius: 26px; }
  .stage-caption span { flex-basis: 100%; margin: 6px 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
  .blob { animation: none; }
}

/* Browsers without backdrop-filter get a more opaque surface instead. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --glass-1: rgb(255 255 255 / 0.86); --glass-2: rgb(255 255 255 / 0.72); }
  @media (prefers-color-scheme: dark) {
    :root { --glass-1: rgb(40 42 52 / 0.92); --glass-2: rgb(28 30 38 / 0.9); }
  }
}
