/* Faceless Story — a white studio, black type, pill buttons; color lives in the stories people make. */
:root {
  --bg: #ffffff;
  --bg-soft: #f7f7f6;
  --bg-hover: #f2f2f1;
  --ink: #0c0c0d;
  --ink-2: #4f4f55;
  --ink-3: #74747b;
  --line: rgba(12, 12, 13, 0.08);
  --line-2: rgba(12, 12, 13, 0.14);
  --line-3: rgba(12, 12, 13, 0.28);
  --ember: #e4572e; /* lamp light: used only for "playing / making now" */
  --red: #c4321f;
  --sans: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --serif: 'Newsreader', Georgia, serif; /* story words only */
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --r-pill: 999px;
  --r-field: 12px;
  --r-card: 20px;
  --shadow-1: 0 1px 2px rgba(12, 12, 13, 0.05);
  --shadow-2: 0 1px 2px rgba(12, 12, 13, 0.04), 0 12px 32px rgba(12, 12, 13, 0.07);
  /* tints for story previews */
  --t-sand: #f6ead8;
  --t-sky: #e3eef8;
  --t-leaf: #e6f0e1;
  --t-rose: #f7e4e4;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/22px var(--sans);
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit;
}
img,
svg,
canvas,
video {
  display: block;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
[hidden] {
  display: none !important;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.num {
  font-variant-numeric: tabular-nums;
}
.muted {
  color: var(--ink-3);
}
.small {
  font-size: 13px;
  line-height: 20px;
}

/* ---------- type ---------- */
.display {
  font: 500 clamp(40px, 6vw, 76px) / 1.02 var(--sans);
  letter-spacing: -0.035em;
  margin: 0;
  text-wrap: balance;
}
.h1 {
  font: 500 28px/34px var(--sans);
  letter-spacing: -0.02em;
  margin: 0;
}
.h2 {
  font: 500 20px/28px var(--sans);
  letter-spacing: -0.01em;
  margin: 0;
}
.h3 {
  font: 500 16px/24px var(--sans);
  margin: 0;
}
.lede {
  font-size: 18px;
  line-height: 28px;
  color: var(--ink-2);
  max-width: 36rem;
  margin: 0;
}
.eyebrow {
  font-size: 13px;
  line-height: 20px;
  font-weight: 500;
  color: var(--ink-3);
}
.story-text {
  font: 400 21px/1.5 var(--serif);
  color: var(--ink);
}

/* ---------- buttons: pills ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn:disabled {
  cursor: default;
  opacity: 0.4;
}
.btn-primary {
  background: var(--ink);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: #2a2a2e;
}
.btn-secondary {
  background: var(--bg);
  border-color: var(--line-2);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
}
.btn-ghost {
  background: transparent;
  color: var(--ink-2);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--ink);
}
.btn-text {
  background: none;
  height: auto;
  padding: 0;
  border: 0;
  color: var(--ink-2);
}
.btn-text:hover {
  color: var(--ink);
}
.btn-sm {
  height: 32px;
  padding: 0 14px;
  font-size: 13px;
}
.btn-lg {
  height: 48px;
  padding: 0 24px;
  font-size: 15px;
}
.btn-block {
  width: 100%;
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  background: var(--bg);
  color: var(--ink-2);
  cursor: pointer;
}
.icon-btn:hover {
  background: var(--bg-hover);
  color: var(--ink);
}

/* ---------- fields ---------- */
.field {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: var(--r-field);
}
.field:hover {
  border-color: var(--line-3);
}
.field:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(12, 12, 13, 0.06);
}
.form-error {
  color: var(--red);
  font-size: 14px;
  margin: 0;
}
.badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  background: var(--bg-hover);
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* ---------- shared story previews (landing + app home) ---------- */
.art {
  position: relative;
  overflow: hidden;
  background: var(--t-sand);
}
.art svg {
  width: 100%;
  height: 100%;
}
.art path,
.art circle {
  fill: none;
  stroke: #2b2622;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.art .fill-sun {
  fill: #f2c46d;
  stroke: none;
}
.art .fill-sea {
  fill: #9cc7e4;
  stroke: none;
}
.art .fill-sand {
  fill: #ecd3a8;
  stroke: none;
}
.art .fill-castle {
  fill: #f4e2c2;
}
.art.line .fill-sun,
.art.line .fill-sea,
.art.line .fill-sand {
  fill: none;
}
.art.line .fill-castle {
  fill: #fff;
}
.art.line {
  background: #fff;
}

.spread {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-2);
  overflow: hidden;
  aspect-ratio: 3 / 2;
}
.spread .art {
  border-right: 1px solid var(--line);
}
.spread .words {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10% 12%;
}
.spread .words .folio {
  position: absolute;
  bottom: 16px;
  right: 20px;
  font: 400 11px/16px var(--mono);
  color: var(--ink-3);
}

.frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #111;
  box-shadow: var(--shadow-2);
}
.frame .art {
  position: absolute;
  inset: 0;
}
.frame .caption {
  position: absolute;
  left: 50%;
  bottom: 14%;
  transform: translateX(-50%);
  max-width: 80%;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(12, 12, 13, 0.62);
  color: #fff;
  font-size: 14px;
  line-height: 20px;
  text-align: center;
}
.frame .bar {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font: 400 11px/16px var(--mono);
}
.frame .bar .track {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.3);
  overflow: hidden;
}
.frame .bar .track i {
  display: block;
  height: 100%;
  width: 38%;
  background: var(--ember);
}
.frame .play {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
}

/* ---------- sign-in ---------- */
.doorway {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  background: var(--bg-soft);
}
.doorway .wordmark {
  position: fixed;
  top: 20px;
  left: 28px;
}
.signin-sheet {
  position: relative;
  width: min(400px, 100%);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-2);
  padding: 36px 32px 32px;
}
.signin-sheet form {
  display: grid;
  gap: 12px;
}
.signin-sheet .h2 {
  margin-bottom: 4px;
}
.signin-sheet .folio {
  display: none;
}
.or {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--ink-3);
  margin: 4px 0;
}
.or::before,
.or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}
.dev-link {
  display: block;
  word-break: break-all;
  font: 400 12px/16px var(--mono);
  background: var(--bg-soft);
  padding: 10px;
  border-radius: 8px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--r-pill);
  font-size: 14px;
  max-width: calc(100vw - 32px);
  z-index: 100;
  box-shadow: var(--shadow-2);
}

/* ---------- segmented tabs ---------- */
.tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: var(--r-pill);
  background: var(--bg-hover);
}
.tabs button {
  height: 34px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--ink-3);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.tabs button:hover {
  color: var(--ink);
}
.tabs button[aria-selected='true'] {
  background: var(--bg);
  color: var(--ink);
  box-shadow: var(--shadow-1);
}

/* ---------- composer: one prompt box for every tool ---------- */
.composer {
  display: grid;
  gap: 4px;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: 24px;
  box-shadow: var(--shadow-2);
}
.composer:focus-within {
  border-color: var(--line-3);
  box-shadow: 0 1px 2px rgba(12, 12, 13, 0.04), 0 16px 40px rgba(12, 12, 13, 0.1);
}
.composer .tabs {
  justify-self: start;
}
.composer textarea {
  width: 100%;
  min-height: 84px;
  padding: 12px 8px 4px;
  border: 0;
  background: transparent;
  resize: none;
  font-size: 17px;
  line-height: 26px;
}
.composer textarea:focus {
  outline: none;
}
.composer textarea::placeholder,
.cx-hero input::placeholder {
  color: var(--ink-3);
}
.cx-hero {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 4px;
  padding: 4px 4px 4px 12px;
  border-radius: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
}
.cx-hero-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.cx-hero input {
  flex: 1;
  min-width: 0;
  height: 32px;
  border: 0;
  background: transparent;
  font-size: 14px;
}
.cx-hero input:focus {
  outline: none;
}
.cx-x {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
}
.cx-x:hover {
  background: var(--bg-hover);
  color: var(--ink);
}
.cx-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0 0 4px;
}
.cx-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.cx-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.cx-actions .icon-btn {
  width: 40px;
  height: 40px;
}
.chip,
.chip-select select {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  background: var(--bg);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.chip:hover,
.chip-select select:hover {
  background: var(--bg-hover);
  color: var(--ink);
}
.chip-select select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M2 3.5 5 6.5 8 3.5' fill='none' stroke='%2374747b' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
}
.chip-select select:hover {
  background-color: var(--bg-hover);
}
@media (max-width: 600px) {
  .composer {
    padding: 8px;
    border-radius: 20px;
  }
  .cx-foot {
    flex-direction: column;
    align-items: stretch;
  }
  .cx-actions .btn {
    flex: 1;
  }
  .cx-hero-label span,
  .cx-hero-label {
    font-size: 12px;
  }
}

/* ---------- posters: video-style example thumbnails ---------- */
.poster {
  position: relative;
  display: block;
  aspect-ratio: 9 / 16;
  border-radius: 16px;
  overflow: hidden;
  isolation: isolate;
  color: #fff;
  background:
    radial-gradient(120% 70% at 70% 18%, var(--pa) 0%, transparent 58%),
    radial-gradient(90% 60% at 10% 90%, var(--pb) 0%, transparent 70%),
    linear-gradient(180deg, var(--pb) 0%, var(--pc) 72%);
}
.po-glow {
  position: absolute;
  inset: -20%;
  background: radial-gradient(40% 30% at 50% 40%, rgba(255, 255, 255, 0.16), transparent 70%);
  z-index: -1;
}
.po-grain {
  position: absolute;
  inset: 0;
  opacity: 0.22;
  mix-blend-mode: overlay;
  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");
}
.po-label {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  font-size: 11px;
  font-weight: 500;
}
.po-len {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 11px;
  font-weight: 500;
  opacity: 0.85;
  font-variant-numeric: tabular-nums;
}
.po-cap {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 56%;
  text-align: center;
  font: 800 clamp(15px, 1.7vw, 21px) / 1.08 var(--sans);
  letter-spacing: -0.01em;
  -webkit-text-stroke: 5px #000;
  paint-order: stroke fill;
  text-wrap: balance;
}
.po-voice {
  position: absolute;
  left: 12px;
  bottom: 22px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 500;
  opacity: 0.9;
}
.po-voice i {
  width: 2px;
  height: 8px;
  border-radius: 1px;
  background: #fff;
}
.po-voice i:nth-child(4) {
  margin-right: 6px;
}
.po-bar {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.25);
}
.po-bar i {
  display: block;
  width: 38%;
  height: 100%;
  border-radius: 2px;
  background: #fff;
}
.poster.sm {
  border-radius: 10px;
}
.poster.sm .po-cap {
  font-size: 10px;
  -webkit-text-stroke: 3px #000;
  left: 6px;
  right: 6px;
}
.poster.sm .po-label,
.poster.sm .po-len,
.poster.sm .po-voice {
  display: none;
}
.poster.sm .po-bar {
  left: 6px;
  right: 6px;
  bottom: 6px;
  height: 2px;
}

/* ---------- motion: sliding tab pill, soft swaps ---------- */
.tabs.has-ind {
  position: relative;
}
.tabs-ind {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 0;
  width: var(--iw, 0);
  border-radius: var(--r-pill);
  background: var(--bg);
  box-shadow: var(--shadow-1);
  transform: translateX(var(--ix, 0));
  opacity: 0;
  pointer-events: none;
}
.tabs.has-ind.is-ready .tabs-ind {
  opacity: 1;
}
.tabs.has-ind button {
  position: relative;
  z-index: 1;
}
.tabs.has-ind.is-ready button[aria-selected='true'] {
  background: transparent;
  box-shadow: none;
}

/* Pointer on everything clickable (website and sign-in). */
a[href],
button,
summary,
select,
label[for],
[role='button'],
.chip {
  cursor: pointer;
}
button:disabled,
[aria-disabled='true'] {
  cursor: not-allowed;
}
