/* Hallmark · scope: /homecoming/ · genre: playful · macrostructure: Workbench
 * design-system: design.md · theme: custom Calvary forest · mobile: 320/375/414/768
 * pre-emit critique: P4 H5 E5 S5 R5 V4
 */
@font-face {
    font-family: "Bricolage Grotesque";
    font-style: normal;
    font-weight: 600 800;
    font-display: swap;
    src: url("/assets/fonts/bricolage-grotesque-latin.woff2") format("woff2");
}

@font-face {
    font-family: "Geist";
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url("/assets/fonts/geist-latin.woff2") format("woff2");
}

:root {
    --forest: oklch(33% 0.065 177);
    --forest-strong: oklch(38% 0.075 177);
    --forest-deep: oklch(24% 0.046 177);
    --ink: oklch(29% 0.052 174);
    --gold: oklch(80% 0.14 85);
    --gold-ink: oklch(45% 0.105 78);
    --coral: oklch(68% 0.17 35);
    --paper: oklch(99% 0.012 85);
    --paper-soft: oklch(96% 0.018 165);
    --white: oklch(99% 0.006 85);
    --muted: oklch(49% 0.025 170);
    --danger: oklch(49% 0.18 29);
    --line: oklch(36% 0.04 174 / 18%);
    --focus: var(--gold);
    --font-display: "Bricolage Grotesque", "Avenir Next", sans-serif;
    --font-body: "Geist", "Avenir Next", sans-serif;
    --ease-out: cubic-bezier(.16, 1, .3, 1);
    --dur-short: 180ms;
    --radius-control: 5px;
    --radius-panel: 8px;
    --wash-gold: oklch(80% .14 85 / 13%);
    --wash-coral: oklch(68% .17 35 / 8%);
    --header-surface: oklch(24% .046 177 / 97%);
    --header-rule: oklch(99% .006 85 / 10%);
    --progress-track: oklch(99% .006 85 / 22%);
    --photo-label-surface: oklch(24% .046 177 / 88%);
    --shadow-soft: oklch(24% .046 177 / 14%);
    --shadow-medium: oklch(24% .046 177 / 16%);
    --shadow-strong: oklch(24% .046 177 / 18%);
    --shadow-button: 0 7px 0 var(--forest-deep), 0 14px 26px var(--shadow-medium);
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { min-height: 100%; overflow-x: clip; background: var(--forest-deep); }
body { margin: 0; min-width: 320px; min-height: 100%; overflow-x: clip; color: var(--ink); background: var(--paper); font-family: var(--font-body); line-height: 1.5; }
button, input, textarea, select { font: inherit; }
button, label, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }

.typeform-shell {
    min-width: 0;
    min-height: 100svh;
    overflow-x: clip;
    background:
        linear-gradient(110deg, var(--wash-gold), transparent 34%),
        linear-gradient(160deg, transparent 64%, var(--wash-coral)),
        var(--paper);
}

.typeform-header {
    position: fixed;
    z-index: 10;
    inset: 0 0 auto;
    height: calc(70px + var(--safe-top));
    padding: calc(12px + var(--safe-top)) clamp(18px, 4vw, 42px) 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    background: var(--header-surface);
    box-shadow: 0 1px 0 var(--header-rule);
}

.typeform-header img { display: block; width: 150px; height: auto; }
.progress-wrap { width: min(36vw, 240px); height: 5px; overflow: hidden; border-radius: 3px; background: var(--progress-track); }
.progress-bar { display: block; width: 100%; height: 100%; border-radius: inherit; background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease-out); }

.typeform { position: relative; min-height: 100svh; }
.form-step {
    position: absolute;
    inset: 0;
    min-width: 0;
    min-height: 100svh;
    padding: calc(102px + var(--safe-top)) max(22px, env(safe-area-inset-left)) calc(92px + var(--safe-bottom)) max(22px, env(safe-area-inset-right));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    visibility: hidden;
    opacity: 0;
    transform: translateY(26px) scale(.985);
    pointer-events: none;
    overflow-y: auto;
    overflow-x: clip;
}

.form-step.is-active {
    position: relative;
    visibility: visible;
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    animation: step-in .52s var(--ease-out) both;
}
.form-step.is-leaving-up { animation: step-out-up .3s var(--ease-out) both; }
.form-step.is-leaving-down { animation: step-out-down .3s var(--ease-out) both; }
.form-step > * { width: min(100%, 760px); min-width: 0; margin-left: auto; margin-right: auto; }

@keyframes step-in { from { opacity: 0; transform: translateY(28px) scale(.99); } }
@keyframes step-out-up { to { opacity: 0; transform: translateY(-22px) scale(.99); } }
@keyframes step-out-down { to { opacity: 0; transform: translateY(22px) scale(.99); } }

.eyebrow { margin: 0 0 10px; color: var(--gold-ink); font-size: .82rem; font-weight: 800; text-transform: uppercase; }
h1, h2, .form-step > label, legend { color: var(--forest-deep); font-family: var(--font-display); font-weight: 750; letter-spacing: 0; overflow-wrap: anywhere; }
h1 { max-width: 13ch; margin: 0; font-size: clamp(2.45rem, 8vw, 5.4rem); line-height: .98; }
h2 { margin: 8px 0 16px; font-size: clamp(2rem, 7vw, 4rem); line-height: 1.04; }
.lead { max-width: 36rem; margin: 20px 0 24px; font-size: clamp(1.1rem, 3vw, 1.35rem); line-height: 1.55; }
.question-count { margin-bottom: 14px; color: var(--gold-ink); font-size: .9rem; font-weight: 800; }
.question-count span { color: var(--muted); font-weight: 600; }
.form-step > label, legend { display: block; margin: 0 0 18px; font-size: clamp(1.75rem, 6vw, 3.6rem); line-height: 1.08; }
fieldset { min-width: 0; border: 0; padding: 0; margin: 0 auto; }
legend { width: 100%; padding: 0; }
.question-help { margin-top: -6px; margin-bottom: 22px; color: var(--muted); font-size: 1rem; line-height: 1.5; }

.form-step > input[type="text"], .form-step > input[type="email"] {
    appearance: none;
    display: block;
    min-height: 62px;
    padding: 8px 2px;
    border: 0;
    border-bottom: 3px solid color-mix(in oklch, var(--forest) 28%, transparent);
    border-radius: 0;
    outline: 2px solid transparent;
    outline-offset: 1px;
    color: var(--forest-deep);
    background: transparent;
    font-size: clamp(1.45rem, 5vw, 2.5rem);
    transition: border-color var(--dur-short) var(--ease-out), box-shadow var(--dur-short) var(--ease-out);
}
.form-step > textarea, .form-step fieldset + textarea {
    width: min(100%, 760px); min-height: 132px; margin-left: auto; margin-right: auto; padding: 14px;
    border: 2px solid color-mix(in oklch, var(--forest) 30%, transparent); border-radius: var(--radius-control); outline: 2px solid transparent; outline-offset: 1px; color: var(--ink); background: color-mix(in oklch, var(--white) 82%, transparent); font-size: 1.08rem; line-height: 1.5; resize: vertical;
}
.form-step > textarea:focus-visible, .form-step fieldset + textarea:focus-visible { border-color: var(--forest); outline-color: var(--focus); }
.form-step > input:focus-visible { border-color: var(--coral); outline-color: var(--focus); }
.form-step > input::placeholder { color: color-mix(in oklch, var(--muted) 72%, transparent); opacity: 1; }
.form-step.has-error > input { border-bottom-color: var(--danger); }
.form-step.has-error fieldset { border-radius: var(--radius-panel); outline: 2px solid color-mix(in oklch, var(--danger) 68%, transparent); outline-offset: 8px; }
.form-step.is-valid > input { border-bottom-color: var(--forest-strong); }

.choice { display: block; min-width: 0; margin: 10px 0; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
    min-width: 0;
    min-height: 58px;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 2px solid color-mix(in oklch, var(--forest) 23%, transparent);
    border-radius: 6px;
    background: color-mix(in oklch, var(--white) 74%, transparent);
    color: var(--ink);
    font-size: 1.03rem;
    font-weight: 700;
    overflow-wrap: anywhere;
    transition: transform var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out), background-color var(--dur-short) var(--ease-out), box-shadow var(--dur-short) var(--ease-out);
}
.choice b { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid currentColor; border-radius: 4px; font-size: .8rem; }
.choice input:checked + span { border-color: var(--forest); background: var(--paper-soft); box-shadow: 0 0 0 3px color-mix(in oklch, var(--forest) 12%, transparent); transform: translateX(4px); }
.choice input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.choice.multi input { pointer-events: auto; }
.choice.multi input:checked + span::after { content: "✓"; margin-left: auto; }
.rating-row { display: grid; grid-template-columns: repeat(5, minmax(44px, 1fr)); gap: 8px; }
.choice.rating { margin: 0; }
.choice.rating span { justify-content: center; padding: 8px; font-size: 1.25rem; }

.primary-button {
    width: auto;
    min-height: 54px;
    margin: 26px auto 0 0;
    padding: 13px 19px;
    border: 0;
    border-radius: var(--radius-control);
    color: var(--white);
    background: var(--forest);
    box-shadow: var(--shadow-button);
    font-family: var(--font-display);
    font-weight: 750;
    white-space: nowrap;
    transition: transform var(--dur-short) var(--ease-out), box-shadow var(--dur-short) var(--ease-out), background-color var(--dur-short) var(--ease-out);
}
.primary-button:active { transform: translateY(5px); box-shadow: 0 2px 0 var(--forest-deep); }
.primary-button:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.primary-button[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.primary-button.is-error { background: var(--danger); }
.primary-button.is-success { background: var(--forest-strong); }

.prize-list { list-style: none; padding: 0; margin: 18px 0 2px; counter-reset: prize; }
.prize-list li { counter-increment: prize; display: grid; grid-template-columns: 38px minmax(0, 1fr); column-gap: 11px; margin: 12px 0; }
.prize-list li::before { content: counter(prize); grid-row: 1 / 3; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: var(--forest-deep); background: var(--gold); font-weight: 900; }
.prize-list strong { font-family: var(--font-display); font-size: 1rem; }
.prize-list span { color: var(--muted); font-size: .9rem; line-height: 1.35; }
.welcome-photo { width: 100%; max-width: none; height: 30svh; margin: 36px 0 -92px; overflow: clip; align-self: stretch; background: var(--paper-soft); }
.welcome-photo picture, .welcome-photo img { width: 100%; height: 100%; display: block; }
.welcome-photo img { object-fit: cover; object-position: 50% 44%; }

.survey-intro h1 { max-width: none; margin-left: 0; margin-right: 0; text-align: left; }

.photo-picker { position: relative; min-height: 178px; padding: 22px; display: grid !important; place-items: center; align-content: center; gap: 9px; overflow: clip; border: 2px dashed color-mix(in oklch, var(--forest) 40%, transparent); border-radius: 6px; background: color-mix(in oklch, var(--white) 75%, transparent); color: var(--forest); font-size: 1rem !important; text-align: center; cursor: pointer; transition: border-color var(--dur-short) var(--ease-out), box-shadow var(--dur-short) var(--ease-out); }
.photo-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.photo-picker:focus-within { border-color: var(--forest); box-shadow: 0 0 0 4px color-mix(in oklch, var(--focus) 38%, transparent); }
.has-error .photo-picker { border-color: var(--danger); }
.photo-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; color: var(--white); background: var(--coral); font-size: 1.7rem; transition: transform var(--dur-short) var(--ease-out); }
.photo-picker img { display: none; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-picker.has-photo img { display: block; }
.photo-picker.has-photo::after { content: "Tap to change"; position: absolute; right: 10px; bottom: 10px; padding: 6px 9px; border-radius: 4px; color: var(--white); background: var(--photo-label-surface); font-size: .75rem; font-weight: 800; }
.privacy-note { margin-top: 14px; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.field-error, .submit-error { min-height: 1.3em; margin-top: 10px; color: var(--danger); font-size: .9rem; font-weight: 750; }
.field-error:empty, .submit-error:empty { visibility: hidden; }
.submit-error:empty { display: none; }
.submit-button.is-loading span { display: inline-block; animation: loading-arrow .7s var(--ease-out) infinite alternate; }
@keyframes loading-arrow { to { transform: translateX(7px); opacity: .45; } }

.step-nav { position: fixed; z-index: 11; right: max(14px, env(safe-area-inset-right)); bottom: calc(14px + var(--safe-bottom)); display: flex; overflow: clip; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--white); box-shadow: 0 8px 22px var(--shadow-soft); }
.step-nav button { width: 48px; height: 44px; border: 0; color: var(--forest); background: var(--white); font-weight: 900; }
.step-nav button + button { border-left: 1px solid var(--line); }
.step-nav button:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }

.success-step { gap: 18px; text-align: center; align-items: center; }
.success-step > * { margin-left: auto; margin-right: auto; }
.success-mark { width: 82px; height: 82px; margin-bottom: 8px; display: grid; place-items: center; border-radius: 50%; color: var(--white); background: var(--forest); box-shadow: 0 0 0 12px var(--paper-soft); font-size: 2.5rem; animation: success-pop .52s var(--ease-out) both; }
@keyframes success-pop { from { opacity: 0; transform: scale(.76); } }
.success-step .eyebrow { margin-top: 0; margin-bottom: 0; }
.success-step h2 { margin-top: 0; margin-bottom: 4px; }
.success-step p:not(.eyebrow) { max-width: 34rem; color: var(--muted); line-height: 1.6; }
.kiosk-countdown strong { color: var(--forest); font-size: 1.35em; }

@media (hover: hover) and (pointer: fine) {
    .primary-button:hover { background: var(--forest-strong); transform: translateY(-2px); box-shadow: 0 9px 0 var(--forest-deep), 0 16px 28px var(--shadow-strong); }
    .photo-picker:hover .photo-icon { transform: rotate(90deg) scale(1.06); }
}

@media (min-width: 760px) {
    .form-step { padding-left: 8vw; padding-right: 8vw; }
    .intro-step { display: grid; grid-template-columns: minmax(0, 1fr) minmax(310px, .78fr); gap: 6vw; align-items: center; padding-right: 0; }
    .intro-step .step-copy { width: min(100%, 650px); margin-right: 0; }
    .welcome-photo { width: 100%; height: calc(100svh - 70px); margin: 0; border-radius: 0; align-self: end; }
    .welcome-photo img { object-position: 55% center; }
}

@media (max-width: 430px) {
    .typeform-header { height: calc(62px + var(--safe-top)); }
    .typeform-header img { width: 128px; }
    .form-step { justify-content: flex-start; padding-top: calc(92px + var(--safe-top)); }
    .intro-step { padding-bottom: 70px; }
    .welcome-photo { height: 25svh; min-height: 170px; }
    .primary-button { width: 100%; }
}

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