@font-face {
    font-family: Bricolage;
    src: url('fonts/bricolage.woff2') format('woff2');
    font-weight: 400 800;
    font-display: swap;
}

@font-face {
    font-family: 'DM Sans';
    src: url('fonts/dm-sans.woff2') format('woff2');
    font-weight: 400 800;
    font-display: swap;
}

:root {
    color-scheme: light;
    --ink: #201335;
    --subtle: #534767;
    --violet: #6229df;
    --violet-deep: #4c1cb8;
    --lilac: #ddcffd;
    --soft-lilac: #efe6ff;
    --mint: #8ff1dc;
    --pink: #ffb7e0;
    --sun: #ffe374;
    --paper: #fff;
    --ground: #faf7ff;
    --line: #ddd1ed;
    --display: Bricolage, 'DM Sans', system-ui, sans-serif;
    --body: 'DM Sans', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 1rem/1.5 var(--body); }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { font-family: var(--display); line-height: 1.05; }
a { color: inherit; }
img { display: block; max-width: 100%; }
button, input, select { font: inherit; }
button { color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
.icon { display: inline-block; flex: none; width: 1.25em; height: 1.25em; vertical-align: -.23em; }
.wrap { width: min(1216px, calc(100% - clamp(2.5rem, 10vw, 10rem))); margin-inline: auto; }
.mobile-only { display: none; }
[data-device='mobile'] .desktop-only { display: none; }
[data-device='mobile'] .mobile-only { display: flex; }

.site-header { min-height: 98px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-block; flex: none; border-radius: .5rem; max-width: min(174px, 100%); }
.brand img { width: 100%; height: auto; }
.text-link { font-weight: 750; color: var(--violet-deep); text-decoration-thickness: .1em; text-underline-offset: .24em; }
.text-link:hover { color: var(--ink); }
.nav-how { text-decoration: none; }
.nav-how:hover { text-decoration: underline; }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5em;
    min-height: 49px;
    padding: .65em 1.23em;
    border: 2px solid transparent;
    border-radius: 999px;
    text-decoration: none;
    text-align: center;
    font-weight: 800;
    line-height: 1.26;
    cursor: pointer;
    transition: transform 130ms ease, background-color 130ms ease, box-shadow 130ms ease;
}
.button:hover { transform: translateY(-2px); }
.button:active { transform: translateY(1px); }
.button:disabled { cursor: wait; opacity: .65; transform: none; }
.button-primary { background: var(--violet); color: #fff; border-color: var(--violet); box-shadow: 0 4px 0 var(--violet-deep); }
.button-primary:hover { background: var(--violet-deep); }
.button-outline { background: var(--paper); border-color: var(--ink); }
.button-outline:hover { background: var(--soft-lilac); }

.hero { display: grid; grid-template-columns: minmax(0, 1.06fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 5.2rem); align-items: center; padding: 1rem 0 2.75rem; }
.hero-copy { padding-block: 1.2rem; }
.language-tag { display: inline-flex; align-items: center; gap: .42em; border-radius: 999px; padding: .32em .78em; background: var(--mint); font-weight: 800; font-size: .91rem; color: var(--ink); }
.language-tag .icon { width: 1em; height: 1em; stroke-width: 1.1; }
.hero h1 { margin-top: .26em; font-size: clamp(2.6rem, 5.3vw, 5.55rem); letter-spacing: -.048em; line-height: .98; font-weight: 780; }
.hero h1 span { display: block; }
.hero .headline-accent { display: inline-block; color: var(--violet); position: relative; isolation: isolate; }
.headline-accent::after { content: ''; position: absolute; z-index: -1; height: .14em; bottom: .06em; right: -.04em; left: .025em; border-radius: 75% 30% 70% 40%; background: var(--sun); transform: rotate(-3deg); }
.hero-summary { max-width: 27.5rem; margin-top: 1.3rem; font-size: clamp(1rem, 1.37vw, 1.21rem); color: var(--subtle); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-top: 1.4rem; }

.scene {
    position: relative;
    isolation: isolate;
    min-width: 0;
    min-height: 405px;
    aspect-ratio: 1.18;
    overflow: hidden;
    display: grid;
    place-items: center;
    border: 1.5px solid #b695f4;
    border-radius: 2.55rem;
    background: radial-gradient(circle, #a787e6 1px, transparent 1.25px) 7px 7px / 18px 18px, #d8c6fb;
}
.scene::after { content: ''; position: absolute; z-index: -1; bottom: -35%; left: -10%; width: 121%; height: 61%; border-radius: 50% 50% 0 0; background: #c5aaf7; transform: rotate(-11deg); }
.scene-ring { position: absolute; width: 64%; aspect-ratio: 1; border: 2px dashed #9e78e8; border-radius: 50%; transform: rotate(-17deg); opacity: .7; }
.scene-spark { position: absolute; display: grid; place-items: center; z-index: 2; pointer-events: none; }
.scene-spark .icon { width: 100%; height: 100%; stroke: var(--ink); stroke-width: 1; }
.spark-sun { width: 15%; top: 10%; left: 9%; color: var(--sun); transform: rotate(17deg); }
.spark-mint { width: 13%; bottom: 12%; right: 8%; color: var(--mint); transform: rotate(12deg); }
.spark-small { width: 7%; right: 11%; top: 12%; color: var(--pink); transform: rotate(-14deg); }
.scene-paper {
    position: absolute;
    width: 45%;
    height: 76%;
    left: 16%;
    top: 13%;
    transform: rotate(-12deg);
    background: #fffef8;
    border: 2px solid var(--ink);
    border-radius: 1.45rem;
    box-shadow: -5px 8px 0 #7040bd55;
    padding: 7% 5% 3%;
    overflow: hidden;
}
.scene-paper::before { content: ''; position: absolute; z-index: -1; inset: 0 0 auto; height: 39%; background: #ffe4f2; }
.scene-brand { width: 58%; margin-bottom: 10%; }
.scene-paper b, .phone-paper b { display: block; font: 800 clamp(.94rem, 1.78vw, 1.65rem)/1.01 var(--display); letter-spacing: -.05em; }
.scene-qr { width: min(91%, 140px); margin: 6% auto 0 0; image-rendering: pixelated; }
.scene-phone {
    position: absolute;
    width: 39%;
    height: 82%;
    right: 15%;
    top: 9%;
    padding: 1.45%;
    border-radius: 1.9rem;
    transform: rotate(10deg);
    background: var(--ink);
    box-shadow: 7px 8px 0 #6a40a77d;
    animation: phone-in 420ms cubic-bezier(.18, .75, .26, 1) both;
}
@keyframes phone-in { from { opacity: 0; translate: 0 14px; } }
.phone-screen { height: 100%; overflow: hidden; border-radius: 1.5rem; background: #ceb6fa; position: relative; display: grid; place-items: center; }
.phone-notch { position: absolute; z-index: 1; width: 27%; height: 3.5%; left: 36.5%; top: 3%; background: var(--ink); border-radius: 999px; }
.phone-paper { width: 77%; padding: 9% 8% 8%; transform: rotate(-8deg); border: 1.5px solid #8c63ce; border-radius: .7rem; background: linear-gradient(#ffe4f2 0 40%, #fffef8 40%); box-shadow: 3px 4px 0 #8c63ce55; }
.phone-paper b { font-size: clamp(.7rem, 1.34vw, 1.24rem); }
.phone-paper img { width: 100%; aspect-ratio: 1; margin-top: 8%; object-fit: contain; outline: 2px solid var(--mint); outline-offset: -2px; }
.phone-close { position: absolute; top: 10%; left: 7%; width: 17%; display: grid; place-items: center; aspect-ratio: 1; color: white; background: #201335c9; border-radius: 50%; font-size: .7rem; }
.code-paper { width: min(74%, 346px); max-height: calc(100% - 2rem); padding: 1.1rem 1.35rem; background: white; text-align: center; border: 2px solid var(--ink); border-radius: 1.5rem; box-shadow: 0 6px 0 #7040bd65; }
.code-paper h2 { font-size: clamp(1.25rem, 2.6vw, 2.25rem); overflow-wrap: anywhere; }
.poster-qr { display: block; width: min(100%, 236px); height: auto; aspect-ratio: 1; margin: .35rem auto; }
.code-paper p { font-weight: 750; }

.how { padding-top: 1.2rem; padding-bottom: 2.55rem; scroll-margin-top: 1rem; }
.how h2 { font-size: clamp(1.7rem, 3vw, 2.65rem); font-weight: 800; letter-spacing: -.045em; margin-bottom: .85rem; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; list-style: none; padding: 0; margin: 0; }
.steps li { display: flex; align-items: center; gap: .8rem; background: #fff; border: 1px solid var(--line); border-radius: 1.2rem; padding: .95rem; }
.step-icon { display: grid; place-items: center; width: 49px; height: 49px; flex-shrink: 0; border-radius: .9rem; font-size: 1.18rem; }
.step-lilac { background: var(--lilac); }
.step-mint { background: var(--mint); }
.step-pink { background: var(--pink); }
.steps h3 { font-size: 1.2rem; font-weight: 800; margin-bottom: .25rem; }
.steps p { color: var(--subtle); font-size: .94rem; line-height: 1.31; }
.demo-download { margin: -1rem 0 2rem; }

.mobile-home, .camera-gate {
    min-height: 100vh;
    min-height: 100dvh;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.1rem;
    padding: max(1.4rem, env(safe-area-inset-top)) max(1.25rem, env(safe-area-inset-right)) max(1.4rem, env(safe-area-inset-bottom)) max(1.25rem, env(safe-area-inset-left));
    text-align: center;
    background: radial-gradient(ellipse at 50% 55%, #faf7ff 0, #efe6ff 75%);
}
.mobile-home p { font-size: 1.28rem; font-weight: 800; font-family: var(--display); line-height: 1.22; }
.gate-actions { width: min(100%, 335px); display: grid; gap: .88rem; }
.button-camera { min-height: 66px; font-size: 1.3rem; }
.gate-error { font-size: .95rem; color: var(--ink); }
.is-scanning { overflow: hidden; background: #171221; }
.camera-stage { position: fixed; inset: 0; width: 100%; height: 100vh; height: 100dvh; overflow: hidden; isolation: isolate; background: #171221; color: #fff; }
.camera-feed { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.overlay-panel { position: absolute; top: 0; left: 0; width: 256px; height: 256px; transform-origin: top left; will-change: transform; background: #171221; }
.overlay-panel video { display: block; width: 100%; height: 100%; object-fit: contain; }
.camera-exit, .camera-status { position: absolute; }
.camera-exit { display: grid; place-items: center; width: 44px; height: 44px; z-index: 2; background: #191224d9; border: 1px solid #ffffff80; border-radius: 50%; color: #fff; cursor: pointer; }
.camera-exit .icon { width: 21px; height: 21px; }
.camera-exit:focus-visible, .camera-fallback:focus-visible { outline-color: #fff; }
.camera-exit[data-corner^='top'] { top: max(11px, env(safe-area-inset-top)); }
.camera-exit[data-corner^='bottom'] { bottom: max(14px, env(safe-area-inset-bottom)); }
.camera-exit[data-corner$='left'] { left: max(11px, env(safe-area-inset-left)); }
.camera-exit[data-corner$='right'] { right: max(11px, env(safe-area-inset-right)); }
.camera-guidance, .camera-caption { position: absolute; left: 50%; bottom: max(2rem, calc(env(safe-area-inset-bottom) + 1rem)); transform: translateX(-50%); z-index: 1; width: max-content; max-width: calc(100% - 1.5rem); padding: .54rem .95rem; border-radius: 1.08rem; background: #191224e8; text-align: center; font-weight: 700; }
.camera-caption { max-width: min(86%, 30rem); white-space: pre-line; }
.camera-caption[data-side='top'] { top: max(2rem, calc(env(safe-area-inset-top) + 1rem)); bottom: auto; }
.camera-fallback { display: inline-flex; align-items: center; min-height: 44px; text-underline-offset: .21em; }

.standalone { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: 1.25rem; }
.notice-card { width: min(100%, 520px); padding: clamp(1.4rem, 5vw, 2.5rem); background: #fff; border: 1px solid var(--line); border-radius: 1.5rem; text-align: center; }
.notice-card h1 { font-size: clamp(1.6rem, 6vw, 2.65rem); margin: .75em 0; letter-spacing: -.035em; }
.notice-card p + .button { margin-top: 1rem; }
.watch { width: min(840px, calc(100% - 2rem)); padding-bottom: 3rem; }
.watch h1 { font-size: clamp(1.85rem, 6vw, 3.4rem); letter-spacing: -.042em; overflow-wrap: anywhere; margin: .6em 0 .45em; }
.video-player { display: block; width: 100%; max-height: min(72vh, 620px); background: #171221; border-radius: 1.15rem; object-fit: contain; }
.video-credit { margin-top: .8rem; color: var(--subtle); font-size: .92rem; }
.video-credit a { color: var(--violet-deep); text-underline-offset: .16em; }

@media (max-width: 930px) {
    .wrap { width: min(100% - 2.4rem, 1216px); }
    .hero { gap: 1.7rem; }
    .hero h1 { font-size: clamp(2.5rem, 5.7vw, 4.1rem); }
    .scene { min-height: 330px; }
    .steps li { align-items: flex-start; }
}

@media (max-width: 660px) {
    .site-header { min-height: 78px; }
    .brand { max-width: 146px; }
    .hero { grid-template-columns: 1fr; gap: 1rem; }
    .hero h1 { font-size: clamp(2.75rem, 10vw, 4.4rem); }
    .scene { min-height: 310px; border-radius: 1.8rem; }
    .scene-paper b { font-size: 1.18rem; }
    .phone-paper b { font-size: .9rem; }
    .steps { grid-template-columns: 1fr; }
    .watch { width: calc(100% - 2rem); }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .button { transition: none; }
    .button:hover, .button:active { transform: none; }
    .scene-phone { animation: none; }
}
