:root {
  --green: #1d3c33;
  --green-deep: #102e27;
  --green-soft: #dfe7de;
  --gold: #b38b43;
  --gold-bright: #d2aa5d;
  --champagne: #f2eadb;
  --ink: #16251f;
  --muted: #718079;
  --white: #ffffff;
  --line: rgba(29, 60, 51, 0.14);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--white); }

body {
  min-width: 320px;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  background: var(--white);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; }

.app-shell {
  display: flex;
  min-height: 100svh;
  flex-direction: column;
}

.site-header {
  position: relative;
  z-index: 5;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 22px 22px 16px;
  background: var(--white);
  transition: background 550ms var(--ease);
}

.brand-logo { display: block; width: 134px; height: auto; object-fit: contain; }
.brand-logo--white { display: none; }
.header-caption { color: var(--gold); font-size: 10px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; }

body[data-theme="dark"] .site-header { background: var(--green-deep); }
body[data-theme="dark"] .brand-logo--green { display: none; }
body[data-theme="dark"] .brand-logo--white { display: block; }

main { display: flex; flex: 1; flex-direction: column; }

.screen {
  position: relative;
  display: flex;
  width: 100%;
  flex: 1;
  flex-direction: column;
  min-height: calc(100svh - 82px);
  padding: 38px 22px 34px;
  isolation: isolate;
}

.screen[hidden] { display: none; }
.screen.is-active { animation: screenIn 620ms var(--ease) both; }

.screen--welcome {
  overflow: hidden;
  justify-content: space-between;
  background: var(--white);
}

.welcome-copy { position: relative; z-index: 1; max-width: 520px; }

.eyebrow {
  margin: 0 0 18px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 1.4;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }

h1, h2 {
  color: var(--green);
  font-family: "Iowan Old Style", "Baskerville", Georgia, serif;
  font-weight: 400;
  letter-spacing: -0.045em;
}

h1 {
  max-width: 360px;
  margin-bottom: 20px;
  font-size: clamp(3rem, 13vw, 5.7rem);
  line-height: 0.98;
}

h1 em, h2 em { color: var(--gold); font-style: italic; }

.intro-copy {
  max-width: 315px;
  margin-bottom: 30px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 220ms ease, background 220ms ease, color 220ms ease, border-color 220ms ease, opacity 220ms ease;
  -webkit-tap-highlight-color: transparent;
}

.button span { margin-left: 13px; font-size: 17px; line-height: 1; }
.button:hover:not(:disabled) { transform: translateY(-2px); }
.button:active:not(:disabled) { transform: translateY(0); }
.button:focus-visible, .answer:focus-visible { outline: 3px solid rgba(179, 139, 67, 0.45); outline-offset: 4px; }
.button:disabled { cursor: not-allowed; opacity: 0.42; }

.button--primary { padding: 0 23px; background: var(--green); color: var(--white); box-shadow: 0 12px 28px rgba(29, 60, 51, 0.14); }
.button--primary:hover:not(:disabled) { background: var(--green-deep); }
.button--light { padding: 0 24px; background: var(--white); color: var(--green); }
.button--light:hover:not(:disabled) { background: var(--champagne); }
.button--outline { align-self: flex-start; padding: 0 22px; border-color: var(--line); background: transparent; color: var(--green); }
.button--outline:hover:not(:disabled) { border-color: var(--green); background: var(--green); color: var(--white); }
.button--text { min-height: 44px; padding: 0 4px; border-radius: 0; color: var(--muted); }
.button--text:hover:not(:disabled) { color: var(--green); transform: none; }

.card-scene {
  position: relative;
  width: min(100%, 355px);
  height: 265px;
  align-self: center;
  margin: 24px auto 12px;
  transform: translateX(10px);
}

.playing-card {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  width: 132px;
  height: 188px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  box-shadow: 0 20px 38px rgba(16, 46, 39, 0.14);
}

.playing-card--back { background: var(--green); color: var(--gold-bright); transform: translate(-50%, -50%) rotate(-12deg) translate(-32px, 4px); }
.playing-card--front { border: 1px solid rgba(179, 139, 67, 0.35); background: var(--champagne); color: var(--green); transform: translate(-50%, -50%) rotate(8deg) translate(30px, -8px); }
.card-mark { font-size: 38px; }
.card-word { position: absolute; bottom: 18px; font-family: Georgia, serif; font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; }
.card-number { position: absolute; top: 13px; left: 14px; font-family: Georgia, serif; font-size: 11px; }
.card-number--bottom { top: auto; right: 14px; bottom: 13px; left: auto; transform: rotate(180deg); }
.card-symbol { color: var(--gold); font-size: 45px; }

.orbit { position: absolute; top: 50%; left: 50%; border: 1px solid rgba(179, 139, 67, 0.25); border-radius: 50%; transform: translate(-50%, -50%) rotate(-25deg); }
.orbit--one { width: 266px; height: 102px; }
.orbit--two { width: 240px; height: 72px; border-color: rgba(29, 60, 51, 0.13); transform: translate(-50%, -50%) rotate(35deg); }
.spark { position: absolute; color: var(--gold); font-family: Georgia, serif; }
.spark--one { top: 18px; right: 31px; font-size: 19px; animation: sparkle 2.8s ease-in-out infinite; }
.spark--two { top: 75px; left: 27px; font-size: 28px; animation: sparkle 2.3s 0.5s ease-in-out infinite; }
.spark--three { right: 51px; bottom: 15px; font-size: 10px; animation: sparkle 3.2s 0.2s ease-in-out infinite; }

.scroll-note { margin: 0; color: var(--muted); font-size: 12px; letter-spacing: 0.08em; text-align: center; text-transform: uppercase; }
.scroll-note span { display: inline-block; margin-left: 7px; color: var(--gold); font-size: 17px; transform: translateY(2px); }

.screen--quiz { justify-content: space-between; padding-top: 20px; }
.quiz-progress { width: 100%; }
.quiz-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; }
.progress-track { height: 2px; margin-top: 12px; overflow: hidden; background: var(--green-soft); }
.progress-track span { display: block; width: 33.333%; height: 100%; background: var(--gold); transition: width 500ms var(--ease); }
.quiz-content { padding: 54px 0 30px; }
.quiz-content h2 { max-width: 530px; margin-bottom: 12px; font-size: clamp(2.4rem, 10vw, 4.9rem); line-height: 1.03; }
.question-hint { margin-bottom: 28px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.answer-list { display: grid; gap: 10px; }
.answer { display: flex; width: 100%; min-height: 58px; align-items: center; justify-content: space-between; padding: 14px 17px; border: 1px solid var(--line); border-radius: 4px; background: var(--white); color: var(--green); cursor: pointer; font-size: 16px; text-align: left; transition: background 220ms ease, border-color 220ms ease, color 220ms ease, transform 220ms ease; }
.answer:hover { border-color: rgba(29, 60, 51, 0.38); transform: translateX(3px); }
.answer::after { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; border: 1px solid rgba(29, 60, 51, 0.2); border-radius: 50%; color: transparent; content: "✓"; font-size: 12px; transition: all 220ms ease; }
.answer.is-selected { border-color: var(--green); background: var(--green); color: var(--white); }
.answer.is-selected::after { border-color: var(--gold-bright); background: var(--gold-bright); color: var(--green); }
.quiz-actions { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding-top: 20px; border-top: 1px solid var(--line); }

.screen--lead { justify-content: space-between; }
.lead-copy h2 { max-width: 530px; margin-bottom: 16px; font-size: clamp(2.8rem, 12vw, 5.3rem); line-height: 1.02; }
.lead-intro { max-width: 330px; margin-bottom: 0; color: var(--muted); font-size: 16px; line-height: 1.55; }
.lead-form { display: grid; gap: 19px; margin-top: 44px; }
.form-field { display: grid; gap: 8px; }
.form-field label { color: var(--green); font-size: 13px; font-weight: 700; letter-spacing: 0.04em; }
.field-input { width: 100%; min-height: 54px; padding: 0 15px; border: 1px solid var(--line); border-radius: 4px; outline: none; background: var(--white); color: var(--green); font: inherit; font-size: 16px; transition: border-color 200ms ease, box-shadow 200ms ease; }
.field-input::placeholder { color: #a1aaa5; }
.field-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(179, 139, 67, 0.12); }
.field-input.has-error { border-color: #a95143; }
.field-error { min-height: 16px; color: #a95143; font-size: 12px; }
.lead-actions { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding-top: 8px; }
.lead-actions .button--primary { flex: 1; }

.screen--trick { overflow: hidden; justify-content: space-between; background: var(--green-deep); color: var(--white); }
.hat-scene { position: relative; display: flex; min-height: 230px; align-items: center; justify-content: center; }
.magic-hat { position: relative; width: 220px; height: 190px; animation: hatFloat 2.2s ease-in-out infinite; }
.hat-crown { position: absolute; bottom: 54px; left: 45px; width: 130px; height: 105px; border: 1px solid rgba(210, 170, 93, 0.6); border-bottom: 0; border-radius: 10px 10px 4px 4px; background: linear-gradient(110deg, #152f29 0%, #214c3e 58%, #10251f 100%); box-shadow: inset 9px 0 17px rgba(255, 255, 255, 0.04), 0 18px 35px rgba(0, 0, 0, 0.22); }
.hat-band { position: absolute; right: 0; bottom: 18px; left: 0; height: 21px; border-top: 1px solid rgba(210, 170, 93, 0.55); border-bottom: 1px solid rgba(210, 170, 93, 0.55); background: rgba(179, 139, 67, 0.12); }
.hat-brim { position: absolute; bottom: 31px; left: 7px; width: 207px; height: 42px; border: 1px solid rgba(210, 170, 93, 0.62); border-radius: 50%; background: linear-gradient(180deg, #214c3e 0%, #10251f 85%); box-shadow: 0 18px 28px rgba(0, 0, 0, 0.25); }
.hat-spark { position: absolute; z-index: 1; color: var(--gold-bright); font-family: Georgia, serif; }
.hat-spark--one { top: 26px; right: 23%; font-size: 24px; animation: sparkle 2.2s ease-in-out infinite; }
.hat-spark--two { top: 78px; left: 22%; font-size: 12px; animation: sparkle 2.8s 0.4s ease-in-out infinite; }
.hat-spark--three { right: 28%; bottom: 31px; font-size: 27px; animation: sparkle 2.5s 0.6s ease-in-out infinite; }
.trick-copy { position: relative; z-index: 1; }
.eyebrow--light { color: var(--gold-bright); }
.trick-copy h2 { margin-bottom: 17px; color: var(--white); font-size: clamp(2.7rem, 11vw, 5.2rem); line-height: 1.02; }
.trick-copy p:not(.eyebrow) { margin-bottom: 25px; color: rgba(255, 255, 255, 0.66); font-size: 16px; }
.coupon-panel { position: relative; display: grid; gap: 13px; margin: 7px 0 25px; padding: 19px 20px 18px; overflow: hidden; border: 1px solid rgba(179, 139, 67, 0.55); background: var(--champagne); color: var(--green); opacity: 0; transform: translateY(18px) scale(0.98); transition: opacity 650ms var(--ease), transform 650ms var(--ease); }
.coupon-panel[hidden] { display: none; }
.coupon-panel.is-visible { opacity: 1; transform: translateY(0) scale(1); }
.coupon-panel::before, .coupon-panel::after { position: absolute; top: 50%; width: 26px; height: 26px; border-radius: 50%; background: var(--green-deep); content: ""; transform: translateY(-50%); }
.coupon-panel::before { left: -14px; }
.coupon-panel::after { right: -14px; }
.coupon-topline { display: flex; justify-content: space-between; color: var(--gold); font-size: 9px; font-weight: 700; letter-spacing: 0.14em; }
.coupon-mark { color: var(--gold); font-size: 31px; line-height: 1; }
.coupon-label { margin: 0; color: var(--gold); font-size: 10px; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; }
.coupon-panel h3 { margin: 0; font-family: Georgia, serif; font-size: 28px; font-weight: 400; letter-spacing: -0.03em; }
.coupon-recipient { margin: 0; color: rgba(29, 60, 51, 0.7); font-size: 14px; }
.coupon-recipient strong { color: var(--green); font-weight: 700; }
.coupon-rule { width: 100%; height: 1px; background: rgba(179, 139, 67, 0.45); }
.coupon-note { max-width: 280px; margin: 0; color: rgba(29, 60, 51, 0.72); font-size: 12px; line-height: 1.45; }
.coupon-code { justify-self: end; color: var(--gold); font-size: 10px; font-weight: 700; letter-spacing: 0.18em; }

.site-footer { display: flex; justify-content: space-between; padding: 13px 22px 20px; color: #99a49f; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
body[data-theme="dark"] .site-footer { background: var(--green-deep); color: rgba(255, 255, 255, 0.46); }

@keyframes screenIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes sparkle { 0%, 100% { opacity: 0.35; transform: scale(0.8) rotate(0); } 50% { opacity: 1; transform: scale(1.2) rotate(12deg); } }
@keyframes hatFloat { 0%, 100% { transform: translateY(5px) rotate(-1deg); } 50% { transform: translateY(-8px) rotate(1deg); } }

@media (min-width: 700px) {
  .site-header { padding: 30px 54px 18px; }
  .brand-logo { width: 160px; }
  .screen { min-height: calc(100svh - 104px); padding: 70px 54px 48px; }
  .screen--welcome { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 0.8fr); grid-template-rows: 1fr auto; align-items: center; gap: 25px 60px; }
  .welcome-copy { align-self: center; }
  .card-scene { grid-column: 2; grid-row: 1 / span 2; width: 390px; height: 390px; margin: 0 auto; transform: none; }
  .playing-card { width: 174px; height: 246px; }
  .playing-card--back { transform: translate(-50%, -50%) rotate(-12deg) translate(-42px, 4px); }
  .playing-card--front { transform: translate(-50%, -50%) rotate(8deg) translate(40px, -8px); }
  .orbit--one { width: 360px; height: 140px; }
  .orbit--two { width: 320px; height: 100px; }
  .scroll-note { align-self: start; text-align: left; }
  .screen--quiz, .screen--lead { max-width: 900px; margin: 0 auto; width: 100%; }
  .quiz-content { padding-top: 80px; }
  .answer-list { max-width: 650px; }
  .screen--lead { padding-top: 80px; padding-bottom: 80px; }
  .lead-form { max-width: 650px; margin-top: 70px; }
  .screen--trick { max-width: none; margin: 0; padding-right: max(54px, calc((100vw - 900px) / 2)); padding-left: max(54px, calc((100vw - 900px) / 2)); }
  .screen--trick { display: grid; grid-template-columns: 0.9fr 1.1fr; align-items: center; gap: 38px 70px; }
  .hat-scene { grid-row: 1 / span 3; min-height: 400px; }
  .trick-copy, .coupon-panel, .screen--trick > #restart-button { grid-column: 2; }
  .coupon-panel { width: 100%; max-width: 570px; margin: 0; }
  .screen--trick > #restart-button { justify-self: start; }
  .site-footer { padding-right: 54px; padding-left: 54px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
