/* Photocode public home — adaptive web / mobile / kiosk */

:root {
    --teal: #0f766e;
    --teal-deep: #115e59;
    --teal-soft: #ccfbf1;
    --ink: #0f172a;
    --muted: #475569;
    --line: #cbd5e1;
    --bg: #f1f5f9;
    --card: #ffffff;
    --ok: #047857;
    --warn: #b45309;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --touch: 52px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
    margin: 0;
    padding: 0;
}

body.home-body {
    font-family: "DM Sans", system-ui, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(1000px 520px at 8% -8%, rgba(15, 118, 110, .16), transparent 55%),
        radial-gradient(800px 420px at 100% 0%, rgba(15, 23, 42, .06), transparent 50%),
        linear-gradient(180deg, #f8fafc 0%, var(--bg) 100%);
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-tap-highlight-color: transparent;
}

img { max-width: 100%; display: block; }

.wrap {
    width: min(1120px, calc(100% - 2rem));
    margin: 0 auto;
}

/* —— Nav —— */
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
}

.brand {
    font-family: Fraunces, Georgia, serif;
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: -.02em;
    color: var(--teal-deep);
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: .85rem;
}

.nav-links a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
    font-size: .9rem;
}

.nav-links a:hover { color: var(--teal); }

.nav-links .hide-sm,
.nav-links .hide-md { display: none; }

.hero-top {
    position: relative;
    z-index: 3;
}

.nav-on-hero .brand {
    color: #fff;
}

.nav-on-hero .nav-links a {
    color: rgba(241, 245, 249, .82);
}

.nav-on-hero .nav-links a:hover {
    color: #fff;
}

/* —— Buttons —— */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    min-height: var(--touch);
    padding: .85rem 1.35rem;
    border-radius: 14px;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    font-family: inherit;
    transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.btn:active { transform: scale(.98); }

.btn-primary {
    background: var(--teal);
    color: #fff;
}

.btn-primary:hover { background: var(--teal-deep); }

.btn-ghost {
    background: #fff;
    color: var(--ink);
    border-color: var(--line);
}

.btn-ghost:hover {
    border-color: var(--teal);
    color: var(--teal-deep);
}

.btn-xl {
    min-height: 64px;
    padding: 1.05rem 1.6rem;
    font-size: 1.15rem;
    width: 100%;
    border-radius: 16px;
}

.btn-block { width: 100%; }

/* —— Hero (web / mobile) —— */
.hero-band {
    position: relative;
    width: 100%;
    min-height: 0;
    display: grid;
    grid-template-rows: auto 1fr;
    align-items: stretch;
    overflow: hidden;
    color: #fff;
    background:
        linear-gradient(160deg, #0f766e 0%, #115e59 38%, #0f172a 100%);
    isolation: isolate;
}

.hero-band::before {
    content: "";
    position: absolute;
    inset: -25%;
    background:
        radial-gradient(circle at 28% 30%, rgba(204, 251, 241, .32), transparent 42%),
        radial-gradient(circle at 78% 65%, rgba(255, 255, 255, .12), transparent 38%);
    animation: drift 14s ease-in-out infinite alternate;
    z-index: 0;
}

.hero-band::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(15, 23, 42, .08) 0%, rgba(15, 23, 42, .55) 100%);
    z-index: 1;
}

.hero-web {
    position: relative;
    z-index: 2;
    width: min(1120px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1.35rem 0 2rem;
    display: grid;
    gap: 1.15rem;
    align-content: center;
    align-self: stretch;
}

.hero-copy { display: grid; gap: .7rem; align-content: center; max-width: 34rem; }

.eyebrow {
    margin: 0;
    font-size: .72rem;
    letter-spacing: .22em;
    text-transform: uppercase;
    font-weight: 800;
    color: var(--teal);
}

.hero-copy .eyebrow {
    color: #99f6e4;
}

.hero-copy h1 {
    margin: 0;
    font-family: Fraunces, Georgia, serif;
    font-size: clamp(2.45rem, 9vw, 3.6rem);
    line-height: .96;
    letter-spacing: -.03em;
    color: #fff;
}

.lead {
    margin: 0;
    max-width: 34rem;
    font-size: 1.05rem;
    line-height: 1.5;
    color: var(--muted);
}

.hero-copy .lead {
    color: rgba(241, 245, 249, .88);
    max-width: 28rem;
    font-size: 1.02rem;
}

.cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: .7rem;
    margin-top: .45rem;
}

.hero-band .cta-row .btn {
    min-height: 48px;
    padding: .8rem 1.25rem;
}

.hero-band .cta-row .btn-primary {
    min-width: 10.5rem;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .22);
}

.hero-band .btn-primary {
    background: #fff;
    color: var(--teal-deep);
}

.hero-band .btn-primary:hover {
    background: #f0fdfa;
}

.hero-band .btn-ghost {
    background: rgba(255, 255, 255, .1);
    color: #fff;
    border-color: rgba(255, 255, 255, .35);
}

.hero-band .btn-ghost:hover {
    border-color: #fff;
    color: #fff;
    background: rgba(255, 255, 255, .16);
}

/* —— Hero passport live preview —— */
.passport-preview {
    position: absolute;
    z-index: 2;
    right: max(1.25rem, calc((100vw - 1120px) / 2));
    top: auto;
    bottom: 1.35rem;
    transform: none;
    display: none;
    width: min(148px, 13.5vw);
    pointer-events: auto;
}

.passport-preview-card {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    width: 100%;
    filter: drop-shadow(0 16px 28px rgba(15, 23, 42, .32));
}

.passport-preview-frame {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 35 / 45;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background:
        linear-gradient(165deg, rgba(255, 255, 255, .22), rgba(15, 23, 42, .35)),
        #0f766e;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .5);
    isolation: isolate;
}

.passport-preview-frame:focus-visible {
    outline: 3px solid #99f6e4;
    outline-offset: 3px;
}

.passport-preview-glow {
    position: absolute;
    inset: -20%;
    z-index: 0;
    background: radial-gradient(circle at 50% 35%, rgba(204, 251, 241, .45), transparent 55%);
    animation: pulse-ring 2.8s ease-in-out infinite;
    pointer-events: none;
}

.passport-preview.is-nudge .passport-preview-card {
    animation: preview-nudge 1.6s ease-in-out 2;
}

.passport-preview-video,
.passport-preview-idle {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.passport-preview-video {
    object-fit: cover;
    transform: scaleX(-1);
    opacity: 0;
    filter: blur(0);
    transition: opacity .45s ease, filter .7s ease;
}

.passport-preview.is-live .passport-preview-video {
    opacity: 1;
}

.passport-preview.is-blurred .passport-preview-video {
    filter: blur(10px) saturate(1.05);
}

.passport-preview-idle {
    display: grid;
    place-items: end center;
    background:
        radial-gradient(ellipse 70% 55% at 50% 38%, rgba(255, 255, 255, .2), transparent 70%),
        linear-gradient(180deg, #14b8a6 0%, #0f766e 48%, #115e59 100%);
    transition: opacity .4s ease;
}

.passport-preview.is-live .passport-preview-idle {
    opacity: 0;
    pointer-events: none;
}

.passport-preview-silhouette {
    width: 62%;
    height: 58%;
    margin-bottom: 8%;
    border-radius: 50% 50% 42% 42% / 55% 55% 40% 40%;
    background:
        radial-gradient(circle at 50% 28%, rgba(255, 255, 255, .55) 0 18%, transparent 19%),
        linear-gradient(180deg, rgba(241, 245, 249, .92) 0%, rgba(226, 232, 240, .75) 42%, rgba(148, 163, 184, .35) 100%);
    box-shadow: inset 0 -12px 20px rgba(15, 23, 42, .12);
    animation: silhouette-breathe 3.2s ease-in-out infinite;
}

.passport-preview-scan {
    position: absolute;
    left: 8%;
    right: 8%;
    height: 18%;
    top: 12%;
    border-radius: 999px;
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .35), transparent);
    animation: scan-sweep 2.6s ease-in-out infinite;
    pointer-events: none;
}

.passport-preview-vignette {
    position: absolute;
    inset: 0;
    z-index: 2;
    background:
        linear-gradient(180deg, rgba(15, 23, 42, .12) 0%, transparent 28%, transparent 62%, rgba(15, 23, 42, .28) 100%);
    pointer-events: none;
}

.passport-preview-oval {
    position: absolute;
    z-index: 3;
    left: 50%;
    top: 16%;
    width: 68%;
    height: 42%;
    transform: translateX(-50%);
    border: 2px dashed rgba(255, 255, 255, .72);
    border-radius: 50% / 48%;
    box-shadow: 0 0 0 999px rgba(15, 23, 42, .22);
    pointer-events: none;
}

.passport-preview-oval::after {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, .35);
    animation: oval-pulse 2.8s ease-in-out infinite;
    pointer-events: none;
}

.passport-preview-hint {
    position: absolute;
    z-index: 4;
    left: 50%;
    bottom: .5rem;
    transform: translateX(-50%);
    width: max-content;
    max-width: calc(100% - .5rem);
    padding: .22rem .45rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, .55);
    color: #fff;
    font-size: .58rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
    backdrop-filter: blur(6px);
    pointer-events: none;
}

.passport-preview.is-live .passport-preview-hint {
    background: rgba(15, 118, 110, .72);
}

.passport-preview.is-loading .passport-preview-hint {
    animation: pulse-ring 1.2s ease-in-out infinite;
}

.passport-preview-start {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .3rem;
    min-height: 36px;
    padding: .4rem .55rem;
    border-radius: 10px;
    background: #fff;
    color: var(--teal-deep);
    font-weight: 800;
    font-size: .72rem;
    text-decoration: none;
    transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}

.passport-preview-start:hover {
    background: #f0fdfa;
    transform: translateY(-1px);
}

.passport-preview.is-live .passport-preview-start {
    box-shadow: 0 0 0 2px rgba(153, 246, 228, .75);
}

/* —— Utility strip: open photo —— */
.utility {
    padding: 1.75rem 0 2rem;
}

.utility-panel .paths {
    grid-template-columns: 1fr;
}

.utility-panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 1.15rem 1.2rem 1.25rem;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .05);
}

.utility-panel h2 {
    margin: 0 0 .35rem;
    font-size: 1.15rem;
    font-family: Fraunces, Georgia, serif;
    letter-spacing: -.01em;
}

.utility-panel p {
    margin: 0 0 1rem;
    color: var(--muted);
    font-size: .92rem;
    line-height: 1.45;
}

.code-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .65rem;
}

.code-form input {
    min-height: var(--touch);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: .75rem 1rem;
    font-size: 1.05rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: .08em;
    text-transform: uppercase;
    background: #fff;
    color: var(--ink);
}

.code-form input:focus {
    outline: 2px solid rgba(15, 118, 110, .35);
    border-color: var(--teal);
}

.code-form .btn { min-width: 7.5rem; }

.code-error {
    display: none;
    margin: .65rem 0 0;
    color: #b91c1c;
    font-weight: 600;
    font-size: .88rem;
}

.code-error.is-visible { display: block; }

/* —— Sections —— */
.section {
    padding: 2.75rem 0;
    border-top: 1px solid rgba(203, 213, 225, .85);
}

.section h2 {
    margin: 0 0 .4rem;
    font-family: Fraunces, Georgia, serif;
    font-size: clamp(1.55rem, 3vw, 2rem);
    letter-spacing: -.02em;
}

.section .sub {
    margin: 0 0 1.35rem;
    color: var(--muted);
    max-width: 36rem;
    line-height: 1.5;
}

.steps {
    display: grid;
    gap: .85rem;
    grid-template-columns: 1fr;
    counter-reset: step;
}

.step {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .85rem;
    align-items: start;
    padding: .15rem 0;
}

.step-num {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 12px;
    background: var(--teal-soft);
    color: var(--teal-deep);
    font-weight: 800;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.step strong {
    display: block;
    margin-bottom: .2rem;
}

.step span {
    color: var(--muted);
    font-size: .92rem;
    line-height: 1.45;
}

.paths {
    display: grid;
    gap: .85rem;
}

.path {
    display: block;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1.1rem 1.15rem;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.path:hover {
    border-color: var(--teal);
    box-shadow: 0 10px 24px rgba(15, 118, 110, .08);
}

.path strong {
    display: block;
    color: var(--teal-deep);
    margin-bottom: .25rem;
}

.path span {
    color: var(--muted);
    font-size: .92rem;
    line-height: 1.45;
}

.countries {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.chip {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 999px;
    padding: .45rem .85rem;
    font-size: .85rem;
    font-weight: 600;
    color: var(--ink);
}

.chip em {
    font-style: normal;
    color: var(--muted);
    font-weight: 500;
    margin-left: .25rem;
}

footer.site-footer {
    padding: 1.35rem 0 calc(5.5rem + var(--safe-bottom));
    color: var(--muted);
    font-size: .85rem;
    border-top: 1px solid rgba(203, 213, 225, .85);
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

footer.site-footer a {
    color: var(--teal-deep);
    text-decoration: none;
    font-weight: 600;
}

/* —— Mobile sticky bar —— */
.mobile-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    padding: .75rem .9rem calc(.75rem + var(--safe-bottom));
    background: rgba(248, 250, 252, .92);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .55rem;
}

.mobile-bar .btn { min-height: 48px; font-size: .95rem; padding: .7rem 1rem; }

/* —— Kiosk attract mode (hidden by default) —— */
.kiosk-attract {
    display: none;
    min-height: 100vh;
    min-height: 100dvh;
    place-content: center;
    text-align: center;
    gap: 1.1rem;
    padding: 2rem 1.5rem;
    width: min(720px, 100%);
    margin: 0 auto;
}

.kiosk-attract .eyebrow {
    font-size: .85rem;
}

.kiosk-attract h1 {
    margin: 0;
    font-family: Fraunces, Georgia, serif;
    font-size: clamp(2.4rem, 7vw, 4rem);
    line-height: 1.05;
    letter-spacing: -.02em;
}

.kiosk-attract .lead {
    margin: 0 auto;
    max-width: 28rem;
    font-size: 1.15rem;
}

.kiosk-actions {
    display: grid;
    gap: .85rem;
    width: min(420px, 100%);
    margin: .5rem auto 0;
}

.kiosk-hint {
    margin: .5rem 0 0;
    color: var(--muted);
    font-size: .95rem;
    font-weight: 600;
}

.kiosk-attract .btn-xl {
    min-height: 72px;
    font-size: 1.2rem;
    border-radius: 18px;
}

.kiosk-retrieve .code-form {
    grid-template-columns: 1fr;
}

@media (min-width: 480px) {
    .kiosk-retrieve .code-form {
        grid-template-columns: 1fr auto;
    }
}

.kiosk-pulse {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--teal);
    margin: 0 auto;
    box-shadow: 0 0 0 0 rgba(15, 118, 110, .45);
    animation: tap-pulse 1.8s ease-out infinite;
}

.kiosk-staff {
    position: fixed;
    top: 1rem;
    right: 1rem;
    font-size: .85rem;
    font-weight: 700;
    color: var(--muted);
    text-decoration: none;
    padding: .5rem .75rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, .7);
    border: 1px solid var(--line);
}

.kiosk-staff:hover { color: var(--teal-deep); }

.kiosk-retrieve {
    margin-top: .5rem;
    text-align: start;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 1.1rem;
}

.kiosk-retrieve h2 {
    margin: 0 0 .35rem;
    font-size: 1.1rem;
}

.kiosk-retrieve p {
    margin: 0 0 .85rem;
    color: var(--muted);
    font-size: .92rem;
}

/* Mode visibility */
body.mode-kiosk .web-shell { display: none; }
body.mode-kiosk .mobile-bar { display: none; }
body.mode-kiosk .kiosk-attract { display: grid; }
body.mode-kiosk {
    background:
        radial-gradient(900px 500px at 50% 0%, rgba(15, 118, 110, .18), transparent 55%),
        linear-gradient(180deg, #f8fafc, var(--bg));
}

body.mode-web .kiosk-attract { display: none; }

/* —— Motion —— */
@keyframes drift {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to { transform: translate3d(4%, 3%, 0) scale(1.06); }
}

@keyframes pulse-ring {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .25); opacity: 1; }
    50% { box-shadow: 0 0 0 14px rgba(255, 255, 255, 0); opacity: .88; }
}

@keyframes silhouette-breathe {
    0%, 100% { transform: translateY(0) scale(1); opacity: .95; }
    50% { transform: translateY(-3px) scale(1.02); opacity: 1; }
}

@keyframes scan-sweep {
    0%, 100% { transform: translateY(0); opacity: .15; }
    50% { transform: translateY(160%); opacity: .55; }
}

@keyframes preview-nudge {
    0%, 100% { transform: translateY(0); }
    35% { transform: translateY(-4px); }
    70% { transform: translateY(2px); }
}

@keyframes oval-pulse {
    0%, 100% { opacity: .55; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.04); }
}

@keyframes tap-pulse {
    0% { box-shadow: 0 0 0 0 rgba(15, 118, 110, .45); }
    70% { box-shadow: 0 0 0 22px rgba(15, 118, 110, 0); }
    100% { box-shadow: 0 0 0 0 rgba(15, 118, 110, 0); }
}

@keyframes rise-in {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

.anim-in {
    animation: rise-in .7s cubic-bezier(.22, 1, .36, 1) both;
}

.anim-in-2 { animation-delay: .12s; }
.anim-in-3 { animation-delay: .24s; }
.anim-in-4 { animation-delay: .36s; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* —— Tablet+ —— */
@media (min-width: 640px) {
    .nav-links .hide-sm { display: inline; }

    .steps {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.1rem;
    }

    .step {
        grid-template-columns: 1fr;
        background: #fff;
        border: 1px solid var(--line);
        border-radius: 16px;
        padding: 1.1rem;
    }

    .paths {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 900px) {
    .nav-links .hide-md { display: inline; }
}

/* —— Desktop —— */
@media (min-width: 900px) {
    .mobile-bar { display: none; }

    footer.site-footer {
        padding-bottom: 2.5rem;
    }

    .hero-band {
        /* Compact conversion band — leave room for utility below */
        min-height: 0;
    }

    .hero-top .nav {
        padding: .85rem 0;
    }

    .hero-web {
        padding: 1.1rem 0 2.75rem;
        width: min(1120px, calc(100% - 2rem));
        min-height: 0;
    }

    .hero-copy {
        gap: .55rem;
        max-width: 32rem;
        padding-right: 11.5rem;
    }

    .hero-copy h1 {
        font-size: clamp(2.75rem, 4.2vw, 3.55rem);
    }

    .hero-copy .lead {
        font-size: 1.05rem;
        line-height: 1.45;
    }

    .passport-preview {
        display: block;
        width: min(142px, 12.5vw);
        bottom: 1.5rem;
    }

    .utility {
        padding: 1.5rem 0 2.25rem;
        margin-top: -.85rem;
        position: relative;
        z-index: 2;
    }

    .utility-inner {
        display: grid;
        grid-template-columns: 1.05fr .95fr;
        gap: 1.1rem;
        align-items: stretch;
    }

    .utility-panel {
        height: 100%;
        box-shadow: 0 14px 36px rgba(15, 23, 42, .08);
    }
}

/* —— Large touch / kiosk-like screens ——
   Coarse pointer + tall viewport → attract UI (same language as /kiosk)
*/
@media (min-width: 768px) and (min-height: 700px) and (pointer: coarse) {
    body.home-body:not(.mode-web-forced) .web-shell { display: none; }
    body.home-body:not(.mode-web-forced) .mobile-bar { display: none; }
    body.home-body:not(.mode-web-forced) .kiosk-attract { display: grid; }
    body.home-body:not(.mode-web-forced) {
        background:
            radial-gradient(900px 500px at 50% 0%, rgba(15, 118, 110, .18), transparent 55%),
            linear-gradient(180deg, #f8fafc, var(--bg));
    }
}

/* Portrait kiosk tablets */
@media (orientation: portrait) and (min-height: 900px) and (min-width: 700px) and (hover: none) {
    body.home-body:not(.mode-web-forced) .web-shell { display: none; }
    body.home-body:not(.mode-web-forced) .mobile-bar { display: none; }
    body.home-body:not(.mode-web-forced) .kiosk-attract { display: grid; }
}

/* Very large desktop still stays web unless coarse pointer */
@media (min-width: 1200px) and (hover: hover) and (pointer: fine) {
    body.home-body:not(.mode-kiosk) .web-shell { display: block; }
    body.home-body:not(.mode-kiosk) .kiosk-attract { display: none; }
}
