/* ============================================================
   COLOURS: Oh Yass Life Edits brand
   Main colour: Amber. Second colour: see the three lines marked SECOND.
   Change them here and the whole site updates.
   ============================================================ */
:root {
  --bg: #FAFAFA;            /* page background (soft off-white, chosen 2026-10-05) */
  --card: #FFFFFF;          /* answer boxes and typing boxes: pure white, so they lift off the page */
  --ink: #1A1A1A;           /* brand ink: all main writing */
  --muted: #5B5B5B;         /* softer writing */
  --line: #EAE4DA;          /* card borders */

  --amber: #C4903A;         /* brand amber (Roxy's gold): borders, glows */
  --amber-light: #EBCB7E;   /* the light part of the gold shine */
  --amber-deep: #A97A2C;    /* the dark part of the gold shine */
  --gold: linear-gradient(135deg, var(--amber-light) 0%, var(--amber) 55%, var(--amber-deep) 100%);
  --amber-soft: #FBF3E4;    /* pale gold boxes */

  --second: #13B8AE;        /* SECOND colour: sparkles, lines (brand turquoise) */
  --second-strong: #0A7F78; /* SECOND colour: writing, links, chosen answers (darker turquoise, easy to read) */
  --second-soft: #E4F7F5;   /* SECOND colour: pale tint behind chosen answers */

  --font-heading: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Four-point sparkle shape, coloured by whatever background colour it's given. */
  --sparkle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0C13 8 16 11 24 12C16 13 13 16 12 24C11 16 8 13 0 12C8 11 11 8 12 0Z'/%3E%3C/svg%3E");
}

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

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

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.6;
  background-color: var(--bg);
  overflow-x: hidden;
}


.app {
  position: relative;
  max-width: 36rem;
  margin: 0 auto;
  padding: 1.25rem max(1rem, env(safe-area-inset-left)) 3rem max(1rem, env(safe-area-inset-right));
  min-height: 100vh;
}

.screen {
  overflow-wrap: anywhere;
  word-break: normal;
  animation: appear 0.3s ease-out;
}
@keyframes appear {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Sparkles ----------
   Gem-coloured stars (gold melting into turquoise, like oh-yass.com)
   that softly fade in, then gently brighten and dim forever.
   Most stars are gold or turquoise. A few small ones are fuchsia or emerald. */
:root {
  --gem-gold: linear-gradient(135deg, #E7B45A 0%, #C4903A 55%, #13B8AE 100%);
  --gem-turq: linear-gradient(135deg, #3FD3C9 0%, #13B8AE 60%, #C4903A 100%);
  --gem-pink: linear-gradient(135deg, #E94FA1 0%, #CB2D87 60%, #C4903A 100%);
  --gem-emerald: linear-gradient(135deg, #2FA37F 0%, #0B7A5C 60%, #C4903A 100%);
}
.spark,
.oh-shit::before,
.life-edit::before {
  -webkit-mask: var(--sparkle) center / contain no-repeat;
  mask: var(--sparkle) center / contain no-repeat;
}

.sparkles { position: absolute; inset: 0; pointer-events: none; }
.spark {
  position: absolute;
  width: var(--size, 1.5rem);
  height: var(--size, 1.5rem);
  background: var(--gem-gold);
  animation: twinkle 3.5s ease-in-out var(--delay, 0s) infinite backwards;
}
.spark.turq { background: var(--gem-turq); }
.spark.pink { background: var(--gem-pink); }
.spark.emerald { background: var(--gem-emerald); }
.opening-set .s2, .opening-set .s4, .corner-set .s1 { animation: twinkle 3.5s ease-in-out var(--delay, 0s) infinite backwards, float 6s ease-in-out infinite; }

@keyframes twinkle {
  0%, 100% { opacity: 0.35; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.1); }
}
@keyframes float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -6px; }
}

/* ---------- Transitions ----------
   "arrive": the reward screens fade in slowly, like lights coming up.
   "interlude": the drumroll. A quiet screen where five stars drift in
   and gather in the middle before the result or Life Edit appears. */
.screen.arrive { animation: arrive 0.9s ease-out both; }
@keyframes arrive {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.screen.interlude {
  min-height: 70vh;
  animation: none;
}
.sparkles.gather-set {
  inset: auto;
  top: 50%;
  left: 50%;
  width: 7rem;
  height: 6rem;
  transform: translate(-50%, -50%);
}
.gather-set .spark { animation: gather 0.7s ease-out var(--delay, 0s) both; }
.gather-set .s1 { --size: 2.4rem; top: 1.8rem; left: 2.3rem; --from: 0, -2.5rem; --delay: 0s; }
.gather-set .s2 { --size: 1.1rem; top: 0.4rem; left: 0.6rem; --from: -2rem, -1.5rem; --delay: 0.1s; }
.gather-set .s3 { --size: 0.8rem; top: 4.6rem; left: 1.2rem; --from: -2rem, 1.5rem; --delay: 0.2s; }
.gather-set .s4 { --size: 1.3rem; top: 0.9rem; left: 5.3rem; --from: 2rem, -1.5rem; --delay: 0.15s; }
.gather-set .s5 { --size: 0.9rem; top: 4.3rem; left: 5rem; --from: 2rem, 1.5rem; --delay: 0.25s; }
@keyframes gather {
  from { opacity: 0; transform: translate(var(--from)) scale(0.3); }
  to { opacity: 1; transform: none; }
}

/* Opening: a cluster of five around the title. */
.sparkles.opening-set .s1 { --size: 2.2rem; top: 0.1rem; left: 0; --delay: 0.1s; }
.sparkles.opening-set .s2 { --size: 1rem; top: -0.2rem; left: 2.7rem; --delay: 0.35s; }
.sparkles.opening-set .s3 { --size: 0.7rem; top: 2.1rem; left: 3.3rem; --delay: 0.6s; }
.sparkles.opening-set .s4 { --size: 1.4rem; top: 0.4rem; right: 0.6rem; --delay: 0.5s; }
.sparkles.opening-set .s5 { --size: 0.75rem; top: 1.9rem; right: 2.9rem; --delay: 0.8s; }

/* Result and Life Edit screens: a little burst in the top corner. */
.screen { position: relative; }
.sparkles.corner-set { left: auto; bottom: auto; width: 7rem; height: 4rem; }
.sparkles.corner-set .s1 { --size: 1.6rem; top: 0.6rem; right: 0.5rem; --delay: 0.2s; }
.sparkles.corner-set .s2 { --size: 0.9rem; top: 0.1rem; right: 2.7rem; --delay: 0.45s; }
.sparkles.corner-set .s3 { --size: 0.6rem; top: 2.3rem; right: 2.5rem; --delay: 0.7s; }

/* ---------- Type ---------- */
h1, h2, h3 { font-family: var(--font-heading); line-height: 1.2; margin: 1.5rem 0 0.75rem; }
h1 { font-size: clamp(1.9rem, 7vw, 2.5rem); margin-top: 0.5rem; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.35rem, 5vw, 1.6rem); }
h3 { font-size: 1.2rem; }
h1:focus { outline: none; }
h1:focus-visible { outline: 3px solid var(--second-strong); outline-offset: 4px; }
p { margin: 0 0 0.9rem; }
a { color: var(--second-strong); }

/* Opening screen: title with a little cluster of sparkles. */
.opening { position: relative; padding-top: 2.5rem; }
.opening h1 { position: relative; font-size: clamp(2.3rem, 10.5vw, 3.3rem); margin-top: 0.75rem; }
.subtitle {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.35rem;
  color: var(--second-strong);
  margin-bottom: 2rem;
}
.lead { font-size: 1.25rem; }

/* "Oh shit. There it is." moments get a gold sparkle. */
.oh-shit {
  position: relative;
  font-size: 1.3rem;
  color: var(--second-strong);
  margin: 1.75rem 0;
  padding-left: 2rem;
}
.oh-shit::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.2rem;
  width: 1.4rem;
  height: 1.4rem;
  background: var(--gem-gold);
  animation: twinkle 3.5s ease-in-out 0.3s infinite backwards;
}

blockquote {
  margin: 1rem 0 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--amber-soft);
  border-left: 4px solid var(--second);
  border-radius: 0 14px 14px 0;
  font-size: 1.25rem;
}

/* ---------- Answers ---------- */
/* Big gap between the blurb and the question, so the question stands on its own. */
fieldset { border: 0; padding: 0; margin: 3rem 0 0; min-width: 0; }
.question {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(1.5rem, 5.8vw, 1.8rem);
  line-height: 1.25;
  padding: 0;
  margin-bottom: 1.25rem;
}

.answer {
  position: relative;
  display: block;
  margin: 0 0 0.75rem;
  cursor: pointer;
}
/* The real radio stays in the page (for keyboards and screen readers), just visually hidden. */
.answer input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}
.answer span {
  display: block;
  min-height: 3.25rem;
  padding: 0.85rem 1rem 0.85rem 3rem;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 16px;
  position: relative;
  box-shadow: 0 1px 2px rgba(26, 26, 26, 0.04);
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}
.answer span::before {
  content: "";
  position: absolute;
  left: 1rem;
  top: 1.05rem;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid #8A8A8A;
  border-radius: 50%;
  background: var(--card);
}
.answer input:checked + span {
  border-color: var(--second-strong);
  background: var(--second-soft);
  box-shadow: 0 4px 14px rgba(26, 26, 26, 0.08);
}
.answer input:checked + span::before {
  border-color: var(--second-strong);
  background: var(--second-strong);
  box-shadow: inset 0 0 0 3px var(--card);
}
.answer input:focus-visible + span { outline: 3px solid var(--second-strong); outline-offset: 2px; }
@media (hover: hover) {
  .answer:hover span { border-color: var(--amber); }
}

/* ---------- Custom "What if" ---------- */
.custom { margin-top: 1.5rem; }
.custom-row { display: block; }
.custom-row strong { display: block; margin-bottom: 0.4rem; }
.custom input {
  width: 100%;
  font: inherit;
  font-size: 1.125rem; /* 16px+ stops iPhones zooming in */
  padding: 0.85rem 1rem;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  color: var(--ink);
}
.custom input:focus { border-color: var(--second-strong); outline: 3px solid var(--second-soft); outline-offset: 0; }

/* ---------- Buttons ---------- */
button { font: inherit; }
.primary, .secondary {
  display: block;
  width: 100%;
  min-height: 3.5rem;
  margin: 2rem 0 0;
  padding: 0.9rem 1.25rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  line-height: 1.3;
  cursor: pointer;
  color: var(--ink);
}
/* Gold button. Dark writing, because white on gold is hard to read. */
.primary {
  border: 0;
  /* Gold shine: light at the top, deeper at the bottom. */
  background: linear-gradient(180deg, var(--amber-light) 0%, var(--amber) 60%, var(--amber-deep) 100%);
  box-shadow: 0 6px 18px rgba(196, 144, 58, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
/* A slow shine that sweeps across the gold every few seconds. */
.primary::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 40%;
  z-index: -1;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.45) 50%, rgba(255, 255, 255, 0) 100%);
  transform: translateX(-150%) skewX(-20deg);
  animation: shine 4.5s ease-in-out 1.2s infinite;
  pointer-events: none;
}
@keyframes shine {
  0% { transform: translateX(-150%) skewX(-20deg); }
  35%, 100% { transform: translateX(350%) skewX(-20deg); }
}
.primary:disabled::after { display: none; }
.primary:disabled {
  background: #EFE6D6;
  color: #8A7F6E;
  box-shadow: none;
  cursor: not-allowed;
}
.secondary {
  background: rgba(255, 255, 255, 0.7);
  border: 1.5px solid rgba(196, 144, 58, 0.5);
}
.primary:focus-visible, .secondary:focus-visible, .back:focus-visible, a:focus-visible {
  outline: 3px solid var(--second-strong);
  outline-offset: 3px;
}
@media (hover: hover) {
  .primary:not(:disabled):hover { box-shadow: 0 8px 24px rgba(196, 144, 58, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.4); }
  .secondary:hover { background: var(--amber-soft); }
}

.back {
  background: none;
  border: 0;
  color: var(--muted);
  padding: 0.6rem 0.25rem;
  min-height: 2.75rem;
  cursor: pointer;
  font-size: 1rem;
}

.actions .primary { margin-top: 1.5rem; }
.actions .secondary { margin-top: 0.75rem; }

/* ---------- Life Edit card: the keepsake ---------- */
.life-edit {
  position: relative;
  margin-top: 2.25rem;
  padding: 1.5rem 1.25rem 0.75rem;
  background: linear-gradient(160deg, rgba(251, 243, 228, 0.95), rgba(255, 255, 255, 0.95) 60%, rgba(228, 247, 245, 0.85));
  border: 1px solid rgba(196, 144, 58, 0.3);
  border-radius: 20px;
  box-shadow: 0 12px 40px -8px rgba(196, 144, 58, 0.3), 0 20px 50px -20px rgba(19, 184, 174, 0.22);
}
.life-edit::before {
  content: "";
  position: absolute;
  top: -0.9rem;
  right: 1.25rem;
  width: 1.8rem;
  height: 1.8rem;
  background: var(--gem-pink);
  animation: twinkle 3.5s ease-in-out 0.4s infinite backwards;
}
.life-edit h2 { margin-top: 0; }

.status { min-height: 1.5rem; margin: 0.5rem 0 0; text-align: center; color: var(--muted); }

.manual-copy { margin-top: 1rem; }
.manual-copy textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  padding: 0.75rem;
  border: 2px solid var(--second-strong);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  -webkit-user-select: text;
  user-select: text;
}

/* The Substack invite: a soft gold-to-turquoise card, like the Life Edit keepsake. */
.substack {
  margin-top: 2.5rem;
  padding: 2rem 1.25rem 1.5rem;
  text-align: center;
  background: linear-gradient(160deg, rgba(251, 243, 228, 0.95), rgba(255, 255, 255, 0.95) 55%, rgba(228, 247, 245, 0.9));
  border: 1px solid rgba(196, 144, 58, 0.35);
  border-radius: 20px;
  box-shadow: 0 12px 40px -8px rgba(196, 144, 58, 0.3), 0 20px 50px -20px rgba(19, 184, 174, 0.22);
}
.substack p { margin: 0 0 1rem; }
.substack .invite-lead { font-size: 1.3rem; margin-bottom: 1.5rem; }
.substack .pop { color: var(--second-strong); }

/* A few gem sparkles around the Substack button. */
.invite-action { position: relative; padding-top: 0.5rem; }
.invite-action .primary { margin-top: 1rem; }
.sparkles.button-set { inset: -0.5rem -0.25rem; }
.sparkles.button-set .s1 { --size: 1.3rem; top: 0; left: 0.4rem; --delay: 0.1s; }
.sparkles.button-set .s2 { --size: 0.7rem; top: 1rem; left: 2rem; --delay: 0.5s; }
.sparkles.button-set .s3 { --size: 1rem; bottom: -0.2rem; right: 0.6rem; top: auto; --delay: 0.3s; }
.sparkles.button-set .s4 { --size: 0.6rem; top: 0.3rem; right: 2.2rem; --delay: 0.7s; }
.nowrap { white-space: nowrap; }
/* The Substack button is a link dressed as the gold button. */
a.primary {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
}

.footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
}

/* ---------- Reward pages (result, 1%, Life Edit): more breathing room ---------- */
:is([data-step="result"], [data-step="onePercent"], [data-step="final"]) .copy h1 { margin-bottom: 1.5rem; }
:is([data-step="result"], [data-step="onePercent"], [data-step="final"]) .copy p { margin-bottom: 1.3rem; }
:is([data-step="result"], [data-step="onePercent"], [data-step="final"]) .copy h1 + h2 { margin-top: 1.25rem; }
:is([data-step="result"], [data-step="onePercent"], [data-step="final"]) .copy h2 { margin: 3rem 0 1.25rem; }
:is([data-step="result"], [data-step="onePercent"], [data-step="final"]) .oh-shit { margin: 2.75rem 0; }
:is([data-step="result"], [data-step="onePercent"]) fieldset { margin-top: 3rem; }
:is([data-step="result"], [data-step="onePercent"]) .question { margin-bottom: 1.25rem; }
:is([data-step="result"], [data-step="onePercent"]) .answer { margin-bottom: 1rem; }
[data-step="onePercent"] .custom { margin-top: 3rem; }
:is([data-step="result"], [data-step="onePercent"]) .primary { margin-top: 3rem; }

/* Life Edit page extras */
[data-step="final"] blockquote { margin: 1.5rem 0 2.25rem; padding: 1.25rem 1.5rem; }
[data-step="final"] .life-edit { margin-top: 4rem; padding: 2rem 1.5rem 1rem; }
[data-step="final"] .life-edit h2 { margin-bottom: 1.5rem; }
[data-step="final"] .life-edit p { margin-bottom: 1.5rem; }
[data-step="final"] .life-edit strong { display: block; margin-bottom: 0.25rem; }
[data-step="final"] .actions .primary { margin-top: 2.5rem; }
[data-step="final"] .actions .secondary { margin-top: 1rem; }
[data-step="final"] .substack { margin-top: 4.5rem; }
[data-step="final"] .footer { margin-top: 3rem; padding-top: 2.5rem; }
[data-step="final"] .footer p { margin-bottom: 1rem; }

/* Hidden helper used by the copy button. */
.offscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  font-size: 16px;
}

[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
