/* Layout measured against the supplied 1536 x 1024 reference.
   The unchanged local image supplies only clipped decorative photography.
   All headings, controls, counters and navigation remain live HTML. */
:root {
  --night: #0b0b17;
  --surface: #181622;
  --gold: #f0c275;
  --ink-muted: #c4bfce;
  --serif: "Times New Roman", "Iowan Old Style", Georgia, serif;
}
body { background: radial-gradient(ellipse at 95% 12%, #201929 0, transparent 55%), #0b0b17; }
.app-shell { position: relative; z-index: 1; max-width: 1536px; padding: 0 6.64%; }
.reference-scene, .reference-edge { display: none; }
body:has(#setup-screen:not([hidden])) :is(.reference-scene, .reference-edge) {
  display: block; position: absolute; inset: 0 auto auto 50%; transform: translateX(-50%);
  width: min(100%, 1536px); height: min(66.667vw, 1024px);
  background: url("assets/homepage-reference.png") center top / 100% auto no-repeat;
  /* Exclude every baked-in UI/text region, retaining photography + art lettering. */
  clip-path: polygon(0 7%, 8.6% 7%, 8.6% 64%, 46% 64%, 46% 7%, 54% 7%, 54% 100%, 0 100%);
  mask-image: linear-gradient(to right, #000 6%, transparent 8.6%), linear-gradient(to right, transparent 46%, #000 49%, #000 52%, transparent 54%), linear-gradient(to bottom, transparent 64%, #000 68%);
  pointer-events: none;
}
body:has(#setup-screen:not([hidden])) .reference-edge {
  clip-path: inset(7% 0 0 94%);
  mask-image: linear-gradient(to right, transparent 94%, #000 98%);
}
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.topbar { min-height: 70px; gap: 24px; border: 0; }
.brand { font: bold 30px var(--serif); letter-spacing: -1px; gap: 14px; white-space: nowrap; }
.brand-mark { width: 28px; height: auto; background: none; color: var(--gold); font-size: 38px; }
.brand-tagline { margin: 0 auto 0 0; padding-left: 24px; border-left: 1px solid #514650; font-size: 14px; white-space: nowrap; color: #ddd5df; }
.header-nav { display: flex; gap: 40px; margin-left: auto; }
.header-nav a { display: inline-flex; align-items: center; min-height: 44px; color: #ddd5df; text-decoration: none; font-size: 14px; white-space: nowrap; }
.header-nav a:hover { color: var(--gold); }
#reset-button { flex-shrink: 0; white-space: nowrap; min-width: 126px; height: 48px; color: #ffda92; border-color: #806c56; font-size: 16px; margin-left: 34px; }
body:not(:has(#setup-screen:not([hidden]))) .header-nav { display: none; }
.setup-screen { padding: 34px 0 50px; }
.setup-layout { max-width: none; grid-template-columns: minmax(0, .906fr) minmax(0, 1fr); gap: 10.57%; padding-left: 3.52%; }
.setup-copy { position: relative; top: auto; min-height: 0; padding: 35px 0 0; background: none; border-radius: 0; }
.setup-copy > * { width: 100%; }
.setup-copy .eyebrow { font-size: 13px; letter-spacing: 1.5px; margin: 0 0 19px; line-height: 18px; }
#setup-title { font-family: var(--serif); margin: 0 0 28px; max-width: none; font-size: clamp(48px, 4.69vw, 72px); font-weight: 400; line-height: .94; letter-spacing: -2.3px; text-wrap: initial; }
#setup-title span, #setup-title em { display: block; white-space: nowrap; }
#setup-title em { color: var(--gold); font-weight: 400; letter-spacing: -2.8px; }
.setup-copy .intro { max-width: 465px; margin: 0 0 38px; font-size: 21px; line-height: 1.38; }
.preview-benefits { display: grid; grid-template-columns: 1fr 1fr 1.25fr; gap: 26px; max-width: 535px; }
.benefit-icon { display: grid; place-items: center; width: 50px; height: 50px; border: 1px solid #86694d; border-radius: 20px; color: var(--gold); }
.benefit-icon svg { width: 23px; height: 23px; }
.preview-benefits p { font-size: 16px; line-height: 1.5; margin: 7px 0 0; white-space: nowrap; }
.visually-hidden, .field-meta > span:first-child { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.setup-card { width: 100%; max-width: none; padding: 29px 44px 34px 51px; border-radius: 30px; border-color: #3c3548; background: linear-gradient(120deg, #171421, #1a1723 60%, #16131f); box-shadow: none; }
.step-heading { margin-bottom: 25px; gap: 10px; font: bold 32px var(--serif); letter-spacing: -.5px; }
.step-count { padding: 9px 14px; font: 600 13px/16px "Segoe UI", sans-serif; letter-spacing: .6px; white-space: nowrap; background: #2c2630; border-color: #453b44; }
.setup-card .field-group { margin-bottom: 22px; }
.setup-card label { font-size: 16px; line-height: 22px; margin-bottom: 6px; font-weight: 600; }
.setup-card input, .setup-card textarea { min-height: 46px; height: 46px; padding: 10px 13px; border-color: #504656; border-radius: 12px; background: #14111f; font-size: 15px; line-height: 24px; }
.setup-card input::placeholder, .setup-card textarea::placeholder { color: #b3aabb; }
.name-input-wrap, .age-input-wrap { position: relative; }
.setup-card .name-input-wrap input, .setup-card .age-input-wrap input { padding-left: 58px; }
.input-icon { position: absolute; z-index: 1; left: 9px; top: 3px; width: 40px; height: 40px; padding: 10px; border-radius: 10px; color: #e7d9dd; background: #ffffff06; pointer-events: none; }
.age-input-wrap .input-icon { color: var(--gold); }
.age-input-wrap > span { right: 20px; font-size: 15px; }
.setup-card .compact-field { max-width: 313px; margin-bottom: 28px; }
.setup-card .field-hint { font-size: 14px; line-height: 20px; margin-top: 6px; color: #b4aaba; }
.setup-card .field-error:empty { display: none; }
.memories-fieldset { position: relative; margin-top: 0; padding: 18px 0 0; border: 0; }
.memories-fieldset::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: #3a3040; }
.memories-fieldset legend { float: left; width: 100%; font: bold 27px/32px var(--serif); letter-spacing: -.4px; margin: 0 0 6px; }
.fieldset-hint { clear: both; margin: 0 0 16px; font-size: 14px; line-height: 20px; color: #c0b6c6; }
.memory-field { grid-template-columns: 35px minmax(0, 1fr); gap: 15px; }
.memory-number { width: 35px; height: 35px; margin-top: 2px; background: #332a29; border-color: #463a36; font: 600 17px "Segoe UI", sans-serif; }
.memory-field .field-group { margin-bottom: 10px; }
.memory-field label { margin-bottom: 4px; }
.setup-card textarea { display: block; height: 44px; min-height: 44px; padding: 9px 13px; resize: vertical; }
.field-meta { justify-content: flex-end; margin-top: 3px; font-size: 13px; line-height: 18px; }
.setup-card .primary-button { position: relative; min-height: 56px; margin-top: 8px; border: 1px solid #efc884; border-radius: 999px; background: linear-gradient(105deg, #edbd70, #f3cb82 60%, #e5b365); font: bold 22px var(--serif); box-shadow: 0 6px 25px #e7ae5720; }
.setup-card .primary-button span:last-child { position: absolute; right: 25px; margin: 0; font: 32px/1 "Segoe UI", sans-serif; }
.setup-card .form-footnote { margin-top: 14px; font-size: 13px; line-height: 20px; color: #b3a8bb; }
.form-footnote svg { width: 12px; height: 14px; color: var(--gold); vertical-align: -2px; margin-right: 5px; }
body:has(#setup-screen:not([hidden])) footer { display: none; }
.question-card, .result-card { background: linear-gradient(120deg, #171421, #1a1723); }
@media (min-width: 1537px) { .app-shell { padding-left: 102px; padding-right: 102px; } }
@media (min-width: 981px) and (max-width: 1399px) {
  .brand-tagline { display: none; }
  body:has(#setup-screen:not([hidden])) :is(.reference-scene, .reference-edge) { display: none; }
  .setup-copy { padding-bottom: 260px; }
  .setup-copy::after { content: ""; position: absolute; left: -30px; right: -30px; bottom: 0; height: 235px; background: url("assets/homepage-reference.png") left bottom / 960px 640px no-repeat; mask-image: linear-gradient(transparent, #000 18%, #000 85%, transparent); pointer-events: none; }
  .setup-card textarea { height: 70px; }
}
@media (max-width: 1250px) and (min-width: 981px) {
  .brand-tagline { font-size: 12px; padding-left: 16px; }
  .topbar { gap: 16px; }
  .header-nav { gap: 20px; }
  #reset-button { margin-left: 0; min-width: 105px; }
  .setup-layout { gap: 7%; padding-left: 0; }
  .setup-card { padding: 28px; }
  .step-heading { font-size: 27px; }
  .setup-copy .intro { font-size: 18px; }
  .preview-benefits { gap: 12px; }
  .preview-benefits p { font-size: 13px; }
  .memories-fieldset legend { font-size: 24px; }
}
@media (max-width: 980px) {
  .app-shell { padding: 0 24px; }
  .topbar { gap: 12px; flex-wrap: wrap; padding: 12px 0; }
  .brand { font-size: 26px; }
  .brand-tagline { display: none; }
  .header-nav { gap: 22px; }
  #reset-button { margin-left: 8px; min-width: 112px; }
  .setup-screen { padding-top: 24px; }
  .setup-layout { display: block; padding: 0; max-width: 660px; margin: auto; }
  .setup-copy { padding: 0 0 245px; }
  #setup-title { font-size: 64px; line-height: 1; margin: 0 0 25px; }
  .setup-copy .intro { max-width: 470px; font-size: 19px; margin-bottom: 28px; }
  .preview-benefits { max-width: 530px; gap: 15px; }
  body:has(#setup-screen:not([hidden])) :is(.reference-scene, .reference-edge) { display: none; }
  .setup-copy::after { content: ""; position: absolute; left: -24px; right: -24px; bottom: 0; height: 220px; background: url("assets/homepage-reference.png") left bottom / 900px 600px no-repeat; mask-image: linear-gradient(transparent, #000 18%, #000 85%, transparent); pointer-events: none; }
  .setup-card { padding: 30px; }
}
@media (max-width: 640px) {
  .app-shell { padding: 0 20px; }
  .topbar { gap: 4px 12px; justify-content: space-between; }
  .brand { font-size: 25px; gap: 8px; }
  .brand-mark { font-size: 30px; width: 24px; }
  #reset-button { min-width: 105px; height: 44px; font-size: 14px; margin: 0; }
  .header-nav { order: 3; justify-content: space-between; width: 100%; margin: 0; }
  .header-nav a { min-height: 44px; font-size: 13px; }
  .setup-screen { padding: 20px 0 32px; }
  .setup-copy { padding-bottom: 220px; }
  .setup-copy .eyebrow { font-size: 10px; letter-spacing: 1.1px; margin-bottom: 18px; }
  #setup-title { font-size: clamp(32px, 9.7vw, 60px); line-height: 1.02; letter-spacing: -1px; margin-bottom: 23px; }
  #setup-title em { letter-spacing: -1.5px; }
  .setup-copy .intro { font-size: 16px; line-height: 1.5; margin-bottom: 24px; }
  .preview-benefits { gap: 12px; grid-template-columns: 1fr 1fr 1.15fr; }
  .benefit-icon { width: 42px; height: 42px; border-radius: 16px; }
  .preview-benefits p { font-size: 12px; line-height: 1.5; white-space: normal; }
  .setup-copy::after { left: -20px; right: -20px; height: 188px; background-size: 768px 512px; }
  .setup-card { padding: 24px 20px; border-radius: 24px; }
  .step-heading { font-size: 27px; flex-wrap: wrap; margin-bottom: 25px; }
  .step-count { font-size: 10px; padding: 6px 9px; }
  .setup-card label { font-size: 14px; }
  .setup-card input, .setup-card textarea { font-size: 16px; }
  .setup-card .compact-field { max-width: 100%; }
  .memories-fieldset legend { font-size: 25px; line-height: 1.1; }
  .fieldset-hint { font-size: 13px; }
  .memory-field { grid-template-columns: 28px minmax(0, 1fr); gap: 10px; }
  .memory-number { width: 28px; height: 28px; font-size: 15px; }
  .setup-card textarea { height: 76px; line-height: 23px; }
  .setup-card .primary-button { font-size: 21px; }
  .setup-card .form-footnote { font-size: 11px; }
}
@media (max-width: 360px) {
  .setup-card textarea { height: 94px; }
  .setup-card .primary-button { gap: 8px; font-size: 19px; }
  .setup-card .primary-button span:last-child { position: static; font-size: 25px; }
}
