:root {
  --ink: #090a0e;
  --canvas: #111319;
  --surface: #191b23;
  --muted: #15171d;
  --line: #30333d;
  --line-strong: #484c58;
  --text: #f5f2ec;
  --dim: #a5a7b0;
  --faint: #727580;
  --orange: #ff865c;
  --danger: #ff9d95;
  --tf-h: 172px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--ink); color: var(--text); font-family: Inter, "Segoe UI", sans-serif; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}
#app { min-height: 100%; min-height: 100vh; min-height: 100dvh; }
.shell { height: 100dvh; min-height: 100dvh; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 56px; padding: 6px 16px; flex-shrink: 0; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.brand { display: flex; align-items: center; gap: 8px; font-family: "Inter Tight", Inter, sans-serif; font-weight: 700; letter-spacing: 0.08em; font-size: 14px; }
.brand i { width: 10px; height: 10px; border-radius: 99px; background: var(--orange); display: block; }
.credit { color: var(--dim); font-size: 13px; }
.avatar { width: 44px; height: 44px; min-width: 44px; min-height: 44px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; font-weight: 700; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.segments { display: flex; gap: 6px; margin: 0 16px 12px; padding: 4px; border-radius: 999px; background: var(--muted); align-self: start; justify-self: start; }
.segments button, .tabs button { border: 0; background: transparent; min-height: 44px; border-radius: 999px; padding: 0 14px; color: var(--dim); }
.segments button[aria-selected="true"] { background: var(--surface); color: var(--text); }
.stage { position: relative; flex: 1; min-height: 0; }
.hero { display: none; padding: 8px 16px 12px; background: var(--ink); flex-shrink: 0; }
.hero h1 {
  font-family: "Inter Tight", Inter, sans-serif;
  letter-spacing: -0.04em;
  font-size: 1.25rem;
  line-height: 1.3;
  font-weight: 700;
  margin: 0 0 8px;
  overflow-wrap: break-word;
}
.hero .lede { margin: 0 0 12px; font-size: 0.9375rem; line-height: 1.4; min-height: 1.4em; }
.hero .primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #111318;
  min-height: 44px;
}
.tf-phone-label, .tf-short { display: none; }
.for-you { height: 100%; display: grid; grid-template-columns: 56px 1fr 56px; grid-template-rows: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 0 8px 12px; }
.phone { height: 100%; width: auto; max-width: 100%; aspect-ratio: 9 / 16; margin: 0 auto; border-radius: 28px; overflow: hidden; background: #111 center/cover no-repeat; position: relative; grid-column: 2; grid-row: 1; }
.phone video, .phone img.still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Keep the poster, not the later video, as the largest paint. */
.phone video.preview { inset: 1px; width: calc(100% - 2px); height: calc(100% - 2px); }
.nav-arrow { width: 44px; height: 44px; min-width: 44px; min-height: 44px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); grid-row: 1; }
.for-you .nav-arrow:first-of-type { grid-column: 1; }
.for-you .nav-arrow:last-of-type { grid-column: 3; }
.caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 80px 16px 16px; background: linear-gradient(transparent, rgba(0,0,0,.92)); }
.kicker { margin: 0 0 6px; color: var(--orange); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; }
.caption .kicker {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,.55);
  text-shadow: 0 1px 2px rgba(0,0,0,.9);
}
.caption h2, .panel h1, .sheet h2 { font-family: "Inter Tight", Inter, sans-serif; letter-spacing: -0.04em; margin: 0; }
.caption p { color: #d8dae0; margin: 0; }
.lede { color: var(--dim); }
.row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.primary, .ghost, .danger { min-height: 44px; border-radius: 999px; padding: 0 16px; border: 0; }
.primary { background: var(--text); color: #111318; font-weight: 700; }
.ghost { background: transparent; border: 1px solid var(--line); }
.danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.tabs { display: flex; border-top: 1px solid var(--line); background: var(--canvas); flex-shrink: 0; }
.tabs button { flex: 1; min-height: 56px; }
.tabs button[aria-selected="true"] { color: var(--orange); }
.panel, .library, .account { padding: 8px 16px 24px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 16px; padding: 4px 16px 20px; align-content: start; min-width: 0; }
.card { margin: 0; border-radius: 16px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); position: relative; display: flex; flex-direction: column; min-width: 0; }
.card-hit { display: flex; flex-direction: column; flex: 1; cursor: pointer; color: inherit; text-align: left; }
.card-media { position: relative; }
.card img { width: 100%; max-width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; object-position: 50% 8%; display: block; }
.chip {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,.72);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,.9);
}
.card h3 {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  margin: 8px 10px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card .vibe {
  font-size: 13px;
  line-height: 1.35;
  color: var(--dim);
  margin: 4px 10px 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card > .primary { width: calc(100% - 20px); margin: 0 10px 12px; }
.dots { display: flex; justify-content: center; align-items: center; gap: 6px; padding: 8px 0 0; }
.for-you .dots { grid-column: 2; grid-row: 2; }
.dots span { width: 6px; height: 6px; border-radius: 99px; background: var(--line-strong); display: block; }
.dots span[data-current] { background: var(--text); width: 16px; }
label { display: block; color: var(--dim); font-size: 13px; margin: 14px 0 6px; }
textarea, input[type="text"] { width: 100%; border-radius: 14px; border: 1px solid var(--line); background: var(--muted); padding: 12px; }
textarea { min-height: 96px; resize: vertical; }
.choices { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.choices button { border: 1px solid var(--line); background: var(--muted); border-radius: 14px; padding: 10px 12px; text-align: left; min-width: 180px; min-height: 44px; }
.choices button[aria-pressed="true"] { border-color: var(--orange); }
.check { display: flex; gap: 8px; align-items: flex-start; color: var(--dim); margin: 14px 0; }
.error { color: var(--danger); }
.take video { width: min(420px, 100%); border-radius: 24px; background: #000; }
.sheet-back { position: fixed; inset: 0; background: rgba(0,0,0,.72); display: grid; align-items: end; justify-items: center; z-index: 50; }
.sheet { width: min(520px, 100%); background: var(--canvas); border-radius: 28px 28px 0 0; padding: 18px 18px 28px; max-height: 92dvh; overflow: auto; position: relative; touch-action: pan-y; }
.sheet-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--surface);
  z-index: 1;
}
.sheet-media {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  max-height: 46dvh;
  aspect-ratio: 3 / 4;
  background: #111;
  margin: 0 36px 12px 0;
}
.sheet-media img, .sheet-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}
.sheet-media video.preview { opacity: 0; }
.sheet > .primary { width: 100%; margin-top: 12px; }
.sheet .row .ghost { flex: 1; min-height: 44px; }
.list { display: grid; gap: 10px; }
.list button, .take-row { width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px; min-height: 44px; }
@media (prefers-reduced-motion: no-preference) {
  .sheet { animation: sheet-up 0.2s ease; }
}
@keyframes sheet-up {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .sheet { animation: none; }
}

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 60; max-width: calc(100vw - 32px); transform: translateX(-50%); padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 14px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35); overflow-wrap: anywhere; }

.site-about, .site-footer {
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 24px;
  color: var(--dim);
}
.site-about h2 {
  font-family: "Inter Tight", Inter, sans-serif;
  letter-spacing: -0.04em;
  color: var(--text);
  margin: 28px 0 12px;
  font-size: 1.15rem;
}
.site-about > h2:first-child { margin: 0 0 16px; font-size: clamp(28px, 5vw, 40px); }
.site-about h3 { margin: 20px 0 8px; font-size: 1rem; color: var(--text); font-family: "Inter Tight", Inter, sans-serif; letter-spacing: -0.04em; }
.site-about p, .site-about li { line-height: 1.55; }
.site-about ol { padding-left: 1.2em; }
.site-about a, .site-footer a { color: var(--orange); }
.site-footer { padding-top: 8px; padding-bottom: 48px; font-size: 14px; }
body[data-screen]:not([data-screen="cast"]) .site-about { display: none; }

.testflight {
  min-height: var(--tf-h);
  display: grid;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  font-family: "Segoe UI", system-ui, sans-serif;
  flex-shrink: 0;
}
.testflight-copy p { margin: 0; }
.testflight-copy p:last-child {
  color: var(--dim);
  font-size: 14px;
  line-height: 1.4;
  margin-top: 4px;
}
.testflight-cta {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: flex-start;
}
.testflight-cta .primary,
.site-about a.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #111318;
}
.testflight-cta p {
  margin: 0;
  font-size: 13px;
  color: var(--dim);
  overflow-wrap: anywhere;
}
.testflight a:not(.primary) { color: var(--orange); }

@media (max-width: 959px) {
  :root { --tf-h: 44px; }
  #app { min-height: 0; }
  .shell { height: auto; min-height: 0; }
  .stage { flex: none; min-height: 0; height: auto; }
  .hero { display: block; }
  body[data-screen]:not([data-screen="cast"]) .hero { display: none; }
  .hero .primary { display: none; }
  .testflight {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    height: 44px;
    min-height: 44px;
    max-height: 48px;
    padding: 0 16px;
    overflow: hidden;
  }
  .testflight-copy, .testflight-cta p { display: none; }
  .tf-phone-label {
    display: block;
    margin: 0;
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
  }
  .tf-long { display: none; }
  .tf-short { display: inline; }
  .testflight-cta { margin: 0; flex-shrink: 0; }
  .testflight-cta .primary {
    background: transparent;
    color: var(--orange);
    min-height: 44px;
    height: 44px;
    padding: 0 8px;
  }
  .shell[data-screen="direct"] .stage,
  .shell[data-screen="take"] .stage,
  .shell[data-screen="library"] .stage,
  .shell[data-screen="account"] .stage { display: none; }
  .for-you { height: auto; grid-template-columns: 1fr; grid-template-rows: auto auto; }
  .phone { grid-column: 1; width: min(100%, 380px); height: auto; touch-action: pan-y; }
  .for-you .dots { grid-column: 1; }
  .nav-arrow { display: none; }
  .tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(56px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    z-index: 30;
    background: var(--canvas);
    border-top: 1px solid var(--line);
  }
  .tabs button { min-height: 44px; height: 56px; }
  body { padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 16px); }
  .toast { bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 12px); }
  .site-footer { padding-bottom: 24px; }
  .site-footer nav { display: flex; flex-direction: column; font-size: 0; }
  .site-footer a {
    display: flex;
    align-items: center;
    min-height: 44px;
    font-size: 14px;
  }
  .site-about > p > a[href="/#cast"] {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
}
@media (max-width: 600px) {
  .hero h1 { min-height: 2.6em; }
  .hero .primary { display: inline-flex; }
  .segments { display: none; }
  body:not(.signed-in) .top .avatar { display: none; }
  .grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; padding: 4px 16px 20px; }
  .static-for-you { display: none; }
}
@media (max-width: 340px) {
  .grid { grid-template-columns: 1fr; }
}
@media (min-width: 601px) {
  .static-grid { display: none; }
}
@media (min-width: 960px) {
  :root { --tf-h: 96px; }
  .testflight {
    order: -1;
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 12px 24px;
  }
  .testflight-cta {
    flex-direction: row;
    align-items: center;
  }
  .grid { height: 100%; overflow: auto; grid-auto-rows: max-content; align-content: start; }
  .sheet-back { align-items: center; }
  .sheet { border-radius: 28px; }
  .panel, .library, .account { max-width: 720px; margin: 0 auto; }
}
