/* Public Speech Generator: styles
   Theme: Sunrise on white. Orange accent, navy text, three tile tints. */

:root{
  --bg:#fff;--surface:#fff;--ink:#1C2340;--muted:#5A6079;--line:#ECE5DC;--line-2:#DDD0C0;
  --accent:#EA580C;--accent-h:#D24A07;--on-accent:#fff;--accent-ink:#C2410C;--accent-soft:#FFE7D3;
  /* subscribe button: uses the main accent color */
  --cta:var(--accent);--cta-h:var(--accent-h);--cta-ink:var(--on-accent);
  /* three tile tints: orange, blue, green */
  --c1-bg:#FFE2C7;--c1-fg:#D9480F;
  --c2-bg:#DCE7FF;--c2-fg:#1D4ED8;
  --c3-bg:#D3F2DD;--c3-fg:#15803D;
  --danger:#B42318;
  --r:14px;--r-lg:22px;--r-btn:999px;
  --f-display:'Plus Jakarta Sans',system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
  --f-body:'Plus Jakarta Sans',system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
  --dw:800;--dt:-.03em;
  --sh:0 1px 2px rgba(28,35,64,.06),0 18px 38px -20px rgba(28,35,64,.28);
}

/* ---------- base ---------- */
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  margin:0;min-height:100vh;min-height:100dvh;display:flex;flex-direction:column;
  color:var(--ink);font:400 16px/1.5 var(--f-body);-webkit-font-smoothing:antialiased;
  background:var(--bg);
}
h1,h2,p,ol,ul{margin:0;padding:0}
a{color:inherit;text-decoration:none}
button,textarea{font:inherit;color:inherit}
button{cursor:pointer}
fieldset{border:0;padding:0;margin:0;min-width:0}
legend{padding:0}
[hidden]{display:none!important}
:focus-visible{outline:3px solid var(--accent);outline-offset:3px}
h1:focus{outline:none}
.skip{position:absolute;left:12px;top:-60px;z-index:100;background:var(--ink);color:#fff;padding:10px 16px;border-radius:10px;font-weight:700}
.skip:focus{top:12px}

/* ---------- header ---------- */
.hd-wrap{position:relative;z-index:30}
.hd{display:flex;align-items:center;gap:18px;max-width:1280px;margin:0 auto;padding:16px 40px}
.logo{display:flex;align-items:center;gap:10px;font-family:var(--f-display);font-weight:800;font-size:19px;letter-spacing:-.02em;white-space:nowrap}
.logo svg{width:38px;height:38px;flex:none}
.logo .g{color:var(--accent-ink)}
.punch{margin-left:auto;display:flex;align-items:center;gap:8px;color:var(--muted);font-weight:600;font-size:15px}
.punch i{color:var(--accent);font-size:18px}
.burger{display:none;width:42px;height:42px;flex:none;border-radius:var(--r);background:var(--surface);border:1px solid var(--line-2);color:var(--ink);font-size:22px;place-items:center;padding:0}
.menu{position:absolute;left:0;right:0;top:100%;display:flex;flex-direction:column;background:var(--surface);border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:6px 16px 12px;box-shadow:0 24px 36px -18px rgba(20,24,40,.4)}
.menu-punch{font-family:var(--f-display);font-weight:700;color:var(--accent-ink);padding:10px 0;font-size:15px;display:flex;gap:8px;align-items:center}
.menu a{padding:12px 0;border-top:1px solid var(--line);font-weight:600;font-size:16px;display:flex;justify-content:space-between;align-items:center}
.menu a i{color:var(--muted);font-size:15px}
.menu{max-height:calc(100vh - 66px);max-height:calc(100dvh - 66px);overflow-y:auto;overscroll-behavior:contain}
.menu-label{font-family:var(--f-display);font-size:12px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:var(--muted);padding:12px 0 3px;border-top:1px solid var(--line)}
.menu-topics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 14px;padding-bottom:8px}
.menu .menu-topics a{display:block;padding:7px 0;border-top:0;font-size:14.5px}

/* ---------- buttons ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:9px;border-radius:var(--r-btn);padding:0 24px;height:52px;font-family:var(--f-display);font-weight:700;font-size:17px;border:1px solid transparent;white-space:nowrap;transition:background .15s,transform .15s,box-shadow .15s,border-color .15s}
.btn:active{transform:translateY(1px)}
.btn-primary{background:var(--accent);color:var(--on-accent);box-shadow:0 10px 20px -10px var(--accent)}
.btn-primary:hover{background:var(--accent-h)}
.btn-ghost{background:var(--surface);color:var(--ink);border-color:var(--line-2)}
.btn-ghost:hover{border-color:var(--ink)}
.btn-sm{height:40px;padding:0 17px;font-size:15px}
.btn-cta{background:var(--cta);color:var(--cta-ink);height:62px;font-size:20px;width:100%;max-width:400px;box-shadow:0 14px 26px -12px var(--cta)}
.btn-cta:hover{background:var(--cta-h)}
/* arrow at the right edge of the subscribe button, nudging to the right and back */
.btn-cta{position:relative}
.btn-cta .arr{position:absolute;right:22px;top:0;bottom:0;display:flex;align-items:center;font-size:23px;animation:cta-nudge 1.1s ease-in-out infinite}
@keyframes cta-nudge{0%,100%{transform:translateX(0)}50%{transform:translateX(8px)}}
.btn[disabled]{opacity:.7;cursor:progress}

/* ---------- layout, steps, hero ---------- */
main{flex:1;display:flex;flex-direction:column}
.view{width:100%;max-width:1240px;margin:0 auto;padding:22px 40px 64px;animation:view-in .3s ease both}
.view.narrow{max-width:800px}
@keyframes view-in{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}

.steps{display:flex;justify-content:center;align-items:center;gap:10px;list-style:none;font-family:var(--f-display);font-size:14px;font-weight:600;color:var(--muted)}
.steps li,.steps li a{display:flex;align-items:center;gap:8px}
.steps li+li::before{content:"";width:30px;height:2px;background:var(--line-2);border-radius:2px;margin-right:2px}
.steps .n{width:27px;height:27px;border-radius:50%;display:grid;place-items:center;background:var(--surface);border:1px solid var(--line-2);font-size:13px;font-weight:700;color:var(--muted)}
.steps .on{color:var(--ink)}
.steps .on .n{background:var(--accent);color:var(--on-accent);border-color:transparent}
.steps .done .n{background:var(--c3-bg);color:var(--c3-fg);border-color:transparent}
.steps a:hover .sl{color:var(--ink);text-decoration:underline}

.hero{text-align:center;margin:30px auto 34px;max-width:840px}
.hero h1{font-family:var(--f-display);font-weight:var(--dw);font-size:clamp(34px,7vw,56px);line-height:1.05;letter-spacing:var(--dt);text-wrap:balance}
.hero.sm h1{font-size:clamp(28px,3.6vw,44px);line-height:1.1}
.hero .sub{margin:18px auto 0;font-size:clamp(16px,1.5vw,19px);color:var(--muted);max-width:640px;text-wrap:pretty}
.hero.sm .sub{margin-top:12px;max-width:600px}
.hero h1 em{font-style:normal;color:var(--accent)}
/* benefits: on phones and tablets one quiet line of short labels with small accent icons
   (no tinted badges, so it does not compete with the tiles); a full list with badges on desktop */
.perks{list-style:none;display:flex;flex-wrap:wrap;justify-content:center;gap:6px 10px;margin:16px auto 0;font-family:var(--f-display);font-weight:600;font-size:12px;line-height:1.3}
.perks li{display:flex;align-items:center;gap:4px;white-space:nowrap}
.perks .pk{display:grid;place-items:center;font-size:15px;color:var(--accent);flex:none}
.perks .pf,.sub-short{display:none}
/* topic pages: two short proof lines under the subtitle */
.proofs{list-style:none;display:flex;flex-direction:column;align-items:center;gap:6px;margin:16px auto 0;font-family:var(--f-display);font-weight:600;font-size:14.5px;line-height:1.35}
.proofs li{display:flex;align-items:center;gap:7px;text-align:left}
.proofs i{font-size:18px;color:var(--accent);flex:none}
.pick{text-align:center;font-family:var(--f-display);font-weight:700;font-size:13px;line-height:1.5;letter-spacing:.12em;text-transform:uppercase;color:var(--accent-ink);margin-bottom:14px}
.col-r{width:100%;max-width:760px;margin:0 auto}

/* ---------- occasion tiles ---------- */
.grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-auto-rows:1fr;gap:14px}
.tile{--tb:var(--c1-bg);--tf:var(--c1-fg);background:var(--tb);border:2px solid transparent;border-radius:var(--r-lg);color:var(--ink);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;min-height:150px;padding:22px 10px 18px;text-align:center;font-family:var(--f-display);font-weight:700;font-size:16.5px;line-height:1.25;letter-spacing:-.01em;transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease}
.tile.c2{--tb:var(--c2-bg);--tf:var(--c2-fg)}
.tile.c3{--tb:var(--c3-bg);--tf:var(--c3-fg)}
.tile .ic{width:62px;height:62px;border-radius:19px;background:var(--surface);color:var(--tf);display:grid;place-items:center;font-size:33px;flex:none;box-shadow:0 1px 2px rgba(20,24,40,.08);transition:transform .16s ease}
.tile:hover{transform:translateY(-4px);border-color:var(--tf);box-shadow:0 18px 28px -18px rgba(20,24,40,.45)}
.tile:hover .ic{transform:scale(1.06) rotate(-3deg)}
.tile:active{transform:translateY(-1px)}

/* ---------- step 2: details ---------- */
.occ{--tb:var(--c1-bg);--tf:var(--c1-fg);width:64px;height:64px;border-radius:20px;background:var(--tb);color:var(--tf);font-size:34px;display:grid;place-items:center;margin:0 auto 16px}
.occ.c2{--tb:var(--c2-bg);--tf:var(--c2-fg)}
.occ.c3,.occ.ok{--tb:var(--c3-bg);--tf:var(--c3-fg)}
/* step 2: the badge sits inline, right before the title text */
h1 .occ{display:inline-grid;width:1.2em;height:1.2em;border-radius:.36em;margin:0 .26em 0 0;font-size:1em;vertical-align:middle;position:relative;top:-.07em}
h1 .occ i{font-size:.62em}
.card{position:relative;background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);box-shadow:var(--sh);padding:28px}
.field+.field{margin-top:26px}
.lbl{display:block;font-family:var(--f-display);font-weight:700;font-size:17px;margin-bottom:10px}
.lens{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.len{border:2px solid var(--line-2);border-radius:var(--r);padding:14px 16px;background:var(--surface);display:flex;flex-direction:column;gap:3px;position:relative;cursor:pointer;transition:border-color .15s,background .15s}
.len input{position:absolute;opacity:0;pointer-events:none}
.len .lt{font-family:var(--f-display);font-weight:700;font-size:16.5px;display:flex;gap:8px;align-items:center}
.len .lt i{font-size:21px}
.len:nth-child(1) .lt i{color:var(--c1-fg)}
.len:nth-child(2) .lt i{color:var(--c2-fg)}
.len:nth-child(3) .lt i{color:var(--c3-fg)}
.len .ld{font-size:14.5px;color:var(--muted)}
.ld-short{display:none}
.len:hover{border-color:var(--accent)}
.len.on{border-color:var(--accent);background:var(--accent-soft)}
.len.on::after{content:"\2713";position:absolute;top:10px;right:10px;width:22px;height:22px;border-radius:50%;background:var(--accent);color:var(--on-accent);font-size:13px;font-weight:800;display:grid;place-items:center}
.len:focus-within{outline:3px solid var(--accent);outline-offset:3px}
textarea{display:block;width:100%;min-height:120px;border:2px solid var(--line-2);border-radius:var(--r);padding:14px 16px;background:var(--surface);color:var(--ink);line-height:1.5;resize:vertical;transition:border-color .15s,box-shadow .15s}
textarea::placeholder{color:var(--muted);opacity:.8}
textarea:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 4px var(--accent-soft)}
textarea[aria-invalid="true"]{border-color:var(--danger)}
.error{color:var(--danger);font-size:14px;font-weight:600;margin-top:8px;display:flex;gap:6px;align-items:center}
.error i{font-size:17px}
.field-foot{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;margin-top:8px}
.hint{font-size:13.5px;color:var(--muted)}
.count{font-size:13px;color:var(--muted);white-space:nowrap;font-variant-numeric:tabular-nums}
.actions{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-top:28px}
.go-wrap{display:flex;flex-direction:column;align-items:center;gap:9px}
.note{font-size:13px;color:var(--muted);display:flex;gap:6px;align-items:center}
.busy{position:absolute;inset:0;z-index:5;border-radius:inherit;background:rgba(255,255,255,.94);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;padding:20px;text-align:center;font-family:var(--f-display);font-weight:700;font-size:19px}
.spinner{width:48px;height:48px;border-radius:50%;border:5px solid var(--accent-soft);border-top-color:var(--accent);animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}

/* ---------- step 3: paywall ---------- */
.preview{position:relative;background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);box-shadow:var(--sh);overflow:hidden}
.preview-bar{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:14px 24px;border-bottom:1px solid var(--line);font-size:14.5px}
.pv-title{font-family:var(--f-display);font-weight:700;display:flex;gap:8px;align-items:center;min-width:0}
.pv-title i{font-size:19px;color:var(--accent-ink);flex:none}
.pv-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pv-meta{color:var(--muted);font-weight:600;white-space:nowrap}
.doc-wrap{position:relative;height:250px;overflow:hidden;padding:24px 30px}
.doc{filter:blur(5px);-webkit-user-select:none;user-select:none;pointer-events:none;font-size:16px;line-height:1.7}
.doc p+p{margin-top:12px}
.doc-wrap::after{content:"";position:absolute;left:0;right:0;bottom:0;height:110px;background:linear-gradient(rgba(255,255,255,0),var(--surface))}
.lock-stack{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);z-index:2;display:flex;flex-direction:column;align-items:center;gap:14px}
.lock-stack .occ{margin:0;box-shadow:0 0 0 6px var(--surface),0 14px 30px -10px rgba(20,24,40,.35)}
.pay{text-align:center;margin-top:26px}
.wallet-buttons{display:flex;justify-content:center;flex-wrap:wrap;gap:12px;margin-top:14px}
.speech-apple-pay{width:164px;height:40px;border-radius:4px}
.terms-note{font-size:14px;color:var(--muted);max-width:560px;margin:0 auto 16px;line-height:1.5}
.checkout-status{font-size:13px;font-weight:600;color:var(--danger)}
.checkout-status:not(:empty){margin-top:12px}
.info-copy p+p,.info-copy h2{margin-top:16px}
.info-copy a{text-decoration:underline}
.info-copy .terms-subparagraph{padding-left:clamp(12px,4vw,36px)}
.speech-history{margin-top:20px}
.speech-history-list{list-style:none;padding:0;margin:0}
.speech-history-list li{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;padding:12px 0;border-bottom:1px solid var(--line)}
.speech-history-list .hint{margin:4px 0 0}
.speech-history-list + .btn{margin-top:14px}
.small{font-size:11.5px;color:var(--muted);max-width:690px;margin:76px auto 0;line-height:1.6}
.small a{text-decoration:underline}
.result-wrap{padding:30px 34px}
.result-text{font-size:16px;line-height:1.75;overflow-wrap:anywhere;white-space:pre-wrap}
.result-text p+p{margin-top:15px}
#result-status:not(:empty){margin-top:12px}
.result-actions{display:flex;justify-content:flex-end;gap:10px;padding:15px 24px;border-top:1px solid var(--line)}
.result-actions .btn{height:42px;font-size:14px;padding:0 17px}
@media(max-width:720px){
  .result-wrap{padding:21px 19px}
  .result-text{font-size:15px}
  .result-actions{padding:13px 18px}
  .result-actions .btn{flex:1}
}

/* ---------- footer ---------- */
.ft{border-top:1px solid var(--line);padding:22px 40px 26px;text-align:center}
.ft-links{display:flex;flex-wrap:wrap;justify-content:center;gap:6px 28px;font-size:14.5px;font-weight:600}
.ft-links a:hover,.ft-topics a:hover{color:var(--accent-ink);text-decoration:underline}
.ft-topics{display:flex;flex-wrap:wrap;justify-content:center;gap:6px 24px;max-width:1040px;margin:0 auto 18px;padding-bottom:18px;border-bottom:1px solid var(--line);font-size:14.5px;font-weight:600}
.ft-topics a[aria-current="page"],.menu-topics a[aria-current="page"]{color:var(--accent-ink)}
.ft-label{flex-basis:100%;margin-bottom:4px;font-family:var(--f-display);font-size:12px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:var(--accent-ink)}
.disc{font-size:12px;color:var(--muted);max-width:780px;margin:14px auto 0;line-height:1.5}

/* ---------- desktop: split home ---------- */
@media (min-width:960px){
  .home{flex:1;display:grid;grid-template-columns:minmax(0,5fr) minmax(0,7fr);gap:48px;align-items:center;align-content:center;padding-top:32px;padding-bottom:72px}
  .home .steps{justify-content:flex-start}
  .home .hero{text-align:left;margin:30px 0 0;max-width:none}
  .home .hero h1{font-size:clamp(38px,4.1vw,54px)}
  .home .hero .sub{margin-left:0}
  .home .perks{flex-direction:column;flex-wrap:nowrap;gap:12px;margin:26px 0 0;font-family:var(--f-body);font-size:15.5px;line-height:1.5}
  .home .perks li{gap:12px;white-space:normal}
  .home .perks .pk{width:36px;height:36px;border-radius:11px;font-size:20px}
  .home .perks li:nth-child(1) .pk{background:var(--c1-bg);color:var(--c1-fg)}
  .home .perks li:nth-child(2) .pk{background:var(--c2-bg);color:var(--c2-fg)}
  .home .perks li:nth-child(3) .pk{background:var(--c3-bg);color:var(--c3-fg)}
  .home .perks .pf{display:inline}
  .home .perks .ps{display:none}
  .home .pick{text-align:left}
  .home .col-r{max-width:none}
}
@media (min-width:721px){
  .menu{display:none!important}
  /* step 2 on desktop: slightly tighter, so the Generate button stays on the first screen */
  #view-details .hero{margin:22px auto 26px}
  #view-details .field+.field{margin-top:22px}
  #view-details .actions{margin-top:22px}
}
/* shorter laptop screens: tighten step 3 so the subscribe button stays in view */
@media (min-width:721px) and (max-height:840px){
  #view-ready .hero{margin-top:20px;margin-bottom:26px}
  .doc-wrap{height:206px}
}

/* ---------- mobile ---------- */
@media (max-width:720px){
  .hd{padding:12px 16px;gap:8px}
  .logo{font-size:15px;gap:8px}
  .logo svg{width:34px;height:34px}
  .wm{display:flex;flex-direction:column;line-height:1.08}
  .punch{display:none}
  .signin{margin-left:auto}
  .burger{display:grid}
  .view{padding:10px 16px 40px}
  .steps{font-size:13px;gap:6px}
  .steps li+li::before{width:16px}
  .steps li:not(.on) .sl{display:none}
  .hero{margin:22px auto 24px}
  /* home on phones: short subtitle and tighter spacing, so the benefits row fits above the tiles */
  .home .hero{margin:16px auto 22px}
  .home .hero .sub{margin-top:10px;font-size:15.5px;line-height:1.45}
  .sub-full{display:none}
  .sub-short{display:inline}
  .perks{margin-top:18px}
  .grid{gap:10px}
  .tile{min-height:0;padding:14px 4px 12px;font-size:13px;gap:9px;border-radius:var(--r)}
  .tile .ic{width:46px;height:46px;border-radius:14px;font-size:25px}
  /* topic pages on phones: the same spacing in both products */
  #view-details .hero{margin:16px auto 18px}
  #view-details .hero .sub{margin-top:10px;font-size:15.5px;line-height:1.45}
  .proofs{margin-top:14px;gap:6px;font-size:12.5px}
  .proofs i{font-size:15px}
  .card{padding:16px}
  .lbl{margin-bottom:8px}
  .field+.field{margin-top:16px}
  .actions{margin-top:16px}
  /* length options in one row on phones, like the gender options in Daily Affirmations */
  .lens{gap:8px}
  .len{align-items:center;text-align:center;padding:7px 4px;gap:2px}
  .len .lt{font-size:15.5px;gap:6px}
  .len .ld{font-size:11.5px;white-space:nowrap}
  .ld-full,.hint-full{display:none}
  .ld-short{display:inline}
  .len.on::after{display:none}
  /* a shorter description field that grows as the visitor types; the hint moves into its placeholder (see app.js) */
  textarea{min-height:0;height:104px}
  .field-foot{display:none}
  .actions{flex-direction:column-reverse;align-items:stretch}
  .actions .btn{width:100%}
  /* step 3 is kept compact so the subscribe button sits above the fold on base iPhones */
  #view-ready .hero{margin:14px auto}
  .hero.sm h1{font-size:24px}
  h1 .occ{width:1.5em;height:1.5em;border-radius:.42em;margin-right:.36em;top:-.05em}
  h1 .occ i{font-size:.86em}
  #view-ready .hero .sub{margin-top:8px;font-size:15px;line-height:1.4}
  .preview-bar{padding:10px 14px;font-size:13.5px}
  .pv-desc{display:none}
  .doc-wrap{padding:14px 16px;height:180px}
  .doc{font-size:15px;line-height:1.6}
  .lock-stack{gap:10px}
  .lock-stack .occ{width:52px;height:52px;border-radius:16px;font-size:28px;box-shadow:0 0 0 5px var(--surface),0 12px 26px -10px rgba(20,24,40,.35)}
  .pay{margin-top:14px}
  .terms-note{font-size:13px;line-height:1.4;margin-bottom:12px}
  .btn-cta{height:56px;font-size:19px}
  .small{margin-top:56px}
  .ft{padding:18px 16px 22px}
  .ft-links,.ft-topics{display:none}
  .disc{margin-top:0}
}
@media (max-width:360px){
  .perks{gap:6px 7px;font-size:11.5px}
  .perks .pk{font-size:14px}
  .btn-cta{font-size:18px}
  .btn-cta .arr{right:13px;font-size:20px}
  .tile{font-size:12px}
}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important}
  .btn-cta .arr{animation:none}
}
