/* Interactive flow preview — the phone frame + the 18 template styles.
 *
 * Port of the writer kit's render_html.py CSS onto the app's locked
 * Foundation tokens (design-system.md sections 2-3), sized to the app's
 * 390x844 logical frame. Palette hexes are MIRRORED here for the console
 * only; the canonical values live in the Figma variables and the Flutter
 * app's resource system (lib/) — never treat this file as the source of
 * truth for a token value.
 *
 * Type mapping (per the flow render rules):
 *   kicker     Source Sans 3 overline, caps, Text/Tertiary
 *   statement  Fraunces 32, SOFT/WONK via font-variation-settings
 *   title      Source Serif 4 22 semibold
 *   body       Source Serif 4 18
 *   verse      Source Serif 4 italic (quotes are written into the value)
 *   prayer     Source Serif 4 italic
 *   orange     ONLY for echoed reader words ({{tokens}}) and the CTA
 */

:root {
  /* Foundation palette (mirror; canonical in Figma / Flutter lib). */
  --brand-orange: #E0603A;      /* Brand/Secondary — flow accent + CTA */
  --ui-0: #FFFFFF;
  --ui-50: #FFFDFA;
  --ui-100: #FAF4EA;
  --ui-150: #F3EBDD;
  --ui-200: #ECE1D2;
  --ui-300: #DDD0BD;
  --text-primary: #2A1E14;
  --text-secondary: #6B5A4A;
  --text-tertiary: #9A8E86;
}

/* ---- stage: one phone visible at a time (tap-through) ---- */

.preview-app {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.preview-app .stage {
  position: relative;
  width: 390px;
  height: 844px;
}

.preview-app .phone {
  position: absolute;
  inset: 0;
  display: none;
}

.preview-app .phone.active {
  display: flex;
}

.preview-hint {
  color: var(--text-tertiary);
  font-size: 13px;
  text-align: center;
  margin: 14px auto 0;
  font-variant-numeric: tabular-nums;
}

.preview-empty {
  color: var(--text-tertiary);
  font-size: 14px;
}

/* ---- phone chrome ---- */

.phone {
  width: 390px;
  height: 844px;
  background: var(--ui-100);
  border-radius: 38px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.25);
  border: 1px solid var(--ui-200);
}

.phone .head {
  padding: 18px 22px 0;
}

.phone .hrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.phone .ft {
  font-family: "Source Sans 3", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.phone .rsp {
  width: 18px;
}

.phone .back {
  background: none;
  border: 0;
  color: var(--text-tertiary);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 18px;
  text-align: left;
}

.phone .bar {
  height: 2px;
  background: var(--ui-200);
  border-radius: 2px;
  margin: 12px auto 0;
  width: 174px;
}

.phone .fill {
  height: 2px;
  background: var(--text-tertiary);
  border-radius: 2px;
}

.phone .content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 34px;
  transform: translateY(-14px);
}

.phone .content > * {
  margin: 6px 0;
}

.phone .foot {
  padding: 0 24px 32px;
  text-align: center;
}

/* ---- slot styles ---- */

.phone .kicker {
  font-family: "Source Sans 3", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.phone .statement {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: 32px;
  line-height: 35px;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  font-variation-settings: "SOFT" 100, "WONK" 1;
}

.phone .title {
  font-family: "Source Serif 4", Georgia, serif;
  font-weight: 600;
  font-size: 22px;
  line-height: 29px;
  color: var(--text-primary);
}

.phone .body {
  font-family: "Source Serif 4", Georgia, serif;
  font-weight: 400;
  font-size: 18px;
  line-height: 27px;
  color: var(--text-secondary);
}

.phone .verse {
  font-family: "Source Serif 4", Georgia, serif;
  font-style: italic;
  font-weight: 600;
  font-size: 20px;
  line-height: 26px;
  color: var(--text-primary);
}

.phone .prayer {
  font-family: "Source Serif 4", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 18px;
  line-height: 27px;
  color: var(--text-primary);
  /* The morning prayer (card 31) is authored as short line-broken lines that
     must "breathe"; pre-line renders its \n as breaks. Evening prayers are
     single-line and collapse whitespace as before, so this is a no-op for
     them. */
  white-space: pre-line;
}

.phone .ref {
  font-family: "Source Sans 3", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.phone .caption {
  font-family: "Source Sans 3", system-ui, sans-serif;
  font-size: 12px;
  color: var(--text-tertiary);
}

.phone .left {
  text-align: left;
}

.phone .center {
  text-align: center;
}

/* Orange is reserved for echoed reader words and the CTA. */
.phone .orange {
  color: var(--brand-orange);
}

.phone .token.filled {
  font-style: normal;
}

.phone em {
  font-style: italic;
}

.phone .hl {
  background: var(--ui-200);
  border-radius: 4px;
  padding: 0 4px;
}

/* ---- images ---- */

.phone .art {
  width: 96px;
  height: 96px;
  object-fit: contain;
  margin-bottom: 16px;
}

/* ---- cards (testimonial / quote) on UI/150 ---- */

.phone .card {
  background: var(--ui-150);
  border: 1px solid var(--ui-200);
  border-radius: 16px;
  padding: 20px 22px;
  text-align: left;
  width: 100%;
}

.phone .card.center {
  text-align: center;
}

.phone .card > * {
  margin: 6px 0;
}

.phone .card .body {
  font-size: 17px;
  line-height: 25px;
}

.phone .q-italic {
  font-family: "Source Serif 4", Georgia, serif;
  font-style: italic;
  font-size: 17px;
  line-height: 25px;
  color: var(--text-secondary);
}

/* ---- prompt input ---- */

.phone .capture {
  width: 100%;
  border: 1px solid var(--ui-300);
  border-radius: 12px;
  padding: 15px;
  color: var(--text-primary);
  font-size: 15px;
  background: var(--ui-50);
  font-family: "Source Sans 3", system-ui, sans-serif;
  resize: none;
  outline: none;
}

.phone .capture:focus {
  border-color: var(--brand-orange);
}

/* ---- CTAs ---- */

.phone .cta {
  background: none;
  border: 0;
  font-family: "Source Sans 3", system-ui, sans-serif;
  font-weight: 600;
  font-size: 18px;
  text-decoration: underline;
  color: var(--brand-orange);
  cursor: pointer;
  user-select: none;
}

.phone .btn {
  background: var(--brand-orange);
  color: var(--ui-0);
  border: 0;
  border-radius: 999px;
  padding: 15px 0;
  width: 100%;
  font-family: "Source Sans 3", system-ui, sans-serif;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  user-select: none;
}
