/* FABULOUS QR — clean black & white */

@font-face {
    font-family: "Geist";
    src: url("../fonts/geist.woff2") format("woff2");
    font-weight: 100 900;
    font-display: swap;
}
@font-face {
    font-family: "Geist Mono";
    src: url("../fonts/geist-mono.woff2") format("woff2");
    font-weight: 100 900;
    font-display: swap;
}

:root {
    --black: #0a0a0a;
    --ink: #171717;
    --muted: #6b6b6b;
    --faint: #a3a3a3;
    --line: #e7e7e7;
    --line-strong: #d4d4d4;
    --soft: #f5f5f5;
    --white: #ffffff;
    --warn: #b45309;
    --radius: 14px;
    --radius-sm: 10px;
    --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
    margin: 0;
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--white);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--black); outline-offset: 2px; }
::selection { background: var(--black); color: var(--white); }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--black); color: var(--white); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 44px; padding: 0 20px;
    border-radius: 999px; border: 1px solid transparent;
    font-size: 15px; font-weight: 500; letter-spacing: -.01em;
    text-decoration: none; white-space: nowrap;
    transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.btn:active { transform: scale(.98); }
.btn--sm { height: 36px; padding: 0 16px; font-size: 14px; }
.btn--lg { height: 52px; padding: 0 26px; font-size: 16px; }
.btn--block { width: 100%; }
.btn--dark { background: var(--black); color: var(--white); }
.btn--dark:hover { background: #2a2a2a; }
.btn--ghost { background: var(--white); color: var(--black); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--black); }
.btn.is-done { background: var(--black); color: var(--white); border-color: var(--black); }
.link-btn { background: none; border: 0; padding: 4px 0; color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--black); }

/* ---------- Nav ---------- */
.nav {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255, 255, 255, .82);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color .2s;
}
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--black); }
.brand__name { font-weight: 500; letter-spacing: .02em; font-size: 15px; }
.brand__name b { font-weight: 800; }
/* ---------- Generator ---------- */
.label { margin: 22px 0 10px; font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.panel__body > .label:first-child { margin-top: 0; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip {
    height: 36px; padding: 0 14px; border-radius: 999px;
    border: 1px solid var(--line-strong); background: var(--white);
    font-size: 14px; color: var(--ink); transition: all .15s;
}
.chip:hover { border-color: var(--black); }
.chip.is-active { background: var(--black); border-color: var(--black); color: var(--white); }

.vcard-cta {
    display: flex; align-items: center; gap: 14px; margin: 22px 0 0; padding: 12px 16px;
    border: 1px solid var(--black); border-radius: var(--radius-sm); background: var(--black); color: var(--white);
    text-decoration: none; transition: background .2s var(--ease), transform .2s var(--ease);
}
.vcard-cta:hover { background: #262626; }
.vcard-cta:active { transform: scale(.99); }
.vcard-cta__icon { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,.1); }
.vcard-cta__text { flex: 1; display: grid; line-height: 1.3; min-width: 0; }
.vcard-cta__text strong { font-size: 14px; font-weight: 600; }
.vcard-cta__text small { font-size: 12px; color: #a3a3a3; }
.vcard-cta__arrow { font-size: 18px; transition: transform .2s var(--ease); }
.vcard-cta:hover .vcard-cta__arrow { transform: translate(2px, -2px); }

/* fields */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span, .color > span, .range > span { font-size: 13px; font-weight: 500; color: var(--ink); }
.field input, .field textarea, .field select {
    width: 100%; min-width: 0;
    padding: 11px 14px; border-radius: var(--radius-sm);
    border: 1px solid var(--line-strong); background: var(--white);
    font-size: 15px; transition: border-color .15s, box-shadow .15s;
    -webkit-appearance: none; appearance: none;
}
.field select {
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%;
    background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px;
}
.field textarea { resize: vertical; min-height: 88px; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--black); box-shadow: 0 0 0 3px rgba(10,10,10,.08); }
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }
.field--compact { margin: 18px 0 12px; }
.field--compact input { padding: 9px 12px; font-size: 14px; font-family: var(--mono); }
.grid-2 { display: grid; gap: 0 12px; grid-template-columns: 1fr; }
@media (min-width: 520px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.check { display: inline-flex; align-items: center; gap: 10px; margin: 6px 0 4px; font-size: 14px; cursor: pointer; user-select: none; }
.check input {
    -webkit-appearance: none; appearance: none; margin: 0;
    width: 20px; height: 20px; border-radius: 6px; border: 1px solid var(--line-strong);
    display: grid; place-items: center; background: var(--white); transition: all .15s; cursor: pointer;
}
.check input:checked { background: var(--black); border-color: var(--black); }
.check input:checked::after { content: ""; width: 5px; height: 9px; border: solid var(--white); border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.check--inline { align-self: end; height: 48px; margin: 0 0 14px; }

/* option tiles */
.opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.opts[data-group="cornerSquare"], .opts[data-group="cornerDot"] { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 520px) { .opt { padding: 10px 4px 8px; gap: 6px; font-size: 11px; } .ico { width: 26px; height: 26px; } }
@media (min-width: 560px) { .opts { grid-template-columns: repeat(6, 1fr); } .opts[data-group="cornerSquare"], .opts[data-group="cornerDot"] { grid-template-columns: repeat(4, 1fr); } }
.opt {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 14px 6px 10px; border-radius: var(--radius-sm);
    border: 1px solid var(--line); background: var(--white);
    font-size: 12px; color: var(--muted); transition: all .15s;
}
.opt:hover { border-color: var(--line-strong); color: var(--ink); }
.opt.is-active { border-color: var(--black); color: var(--black); box-shadow: inset 0 0 0 1px var(--black); }
.ico { width: 32px; height: 32px; display: block; color: var(--line-strong); transition: color .15s; }
.opt:hover .ico { color: var(--muted); }
.opt.is-active .ico { color: var(--black); }

/* segmented */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; gap: 4px; background: var(--soft); border-radius: 12px; }
.seg button { height: 36px; border: 0; border-radius: 9px; background: transparent; font-size: 14px; color: var(--muted); transition: all .15s; white-space: nowrap; padding: 0 8px; }
.seg button:hover { color: var(--black); }
.seg button.is-active { background: var(--white); color: var(--black); font-weight: 500; box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 0 0 1px rgba(0,0,0,.04); }
.seg + .grid-2 { margin-top: 16px; }
@media (max-width: 480px) { .seg[data-group="fillMode"] button { font-size: 12px; } }

/* colors */
.color {
    display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
    margin-bottom: 14px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer;
    transition: border-color .15s;
}
.color:hover { border-color: var(--black); }
.color > span { grid-column: 2; font-size: 12px; color: var(--muted); font-weight: 400; }
.color input[type="color"] { grid-row: 1 / span 2; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: none; cursor: pointer; -webkit-appearance: none; appearance: none; }
.color input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 7px; }
.color input[type="color"]::-moz-color-swatch { border: 0; border-radius: 7px; }
.color code { grid-column: 2; font-family: var(--mono); font-size: 14px; color: var(--black); }

.presets { display: flex; flex-wrap: wrap; gap: 8px; }
.preset {
    width: 40px; height: 40px; border-radius: 50%; padding: 0;
    border: 1px solid var(--line-strong); position: relative; overflow: hidden; transition: transform .15s;
}
.preset:hover { transform: scale(1.08); }
.preset.is-active { box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--black); }

/* ranges */
.range { display: grid; gap: 8px; margin: 18px 0 8px; }
.range > span { display: flex; justify-content: space-between; }
.range output { font-family: var(--mono); font-size: 13px; color: var(--muted); font-weight: 400; }
.range input { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; margin: 0; }
.range input::-webkit-slider-runnable-track { height: 3px; background: var(--line-strong); border-radius: 2px; }
.range input::-moz-range-track { height: 3px; background: var(--line-strong); border-radius: 2px; }
.range input::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8.5px; border-radius: 50%; background: var(--black); border: 3px solid var(--white); box-shadow: 0 0 0 1px var(--black); cursor: grab; }
.range input::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--black); border: 3px solid var(--white); box-shadow: 0 0 0 1px var(--black); cursor: grab; }

.hint { margin: 12px 0 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.hint--warn { color: var(--warn); padding: 10px 12px; border: 1px solid #f3d9b5; background: #fffaf2; border-radius: var(--radius-sm); }

/* logo drop */
.drop {
    display: flex; align-items: center; gap: 16px; padding: 18px;
    border: 1.5px dashed var(--line-strong); border-radius: var(--radius); cursor: pointer;
    transition: border-color .15s, background .15s;
}
.drop:hover, .drop.is-over { border-color: var(--black); background: var(--soft); }
.drop__icon { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--soft); color: var(--black); }
.drop__text { flex: 1; font-size: 14px; line-height: 1.45; color: var(--muted); }
.drop__text strong { color: var(--black); font-weight: 600; }
.drop__text small { font-size: 12px; color: var(--faint); }
.drop__preview { width: 48px; height: 48px; object-fit: contain; border-radius: 8px; border: 1px solid var(--line); background: var(--white); padding: 4px; }

.icons { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
@media (min-width: 560px) { .icons { grid-template-columns: repeat(10, 1fr); } }
.icon-btn {
    aspect-ratio: 1; display: grid; place-items: center; padding: 0;
    border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--white); color: var(--black);
    transition: all .15s;
}
.icon-btn:hover { border-color: var(--line-strong); color: var(--brand, var(--black)); }
.icon-btn.is-active { border-color: var(--black); box-shadow: inset 0 0 0 1px var(--black); }
.icon-btn svg { width: 22px; height: 22px; }
#brand-presets .icon-btn svg { width: 20px; height: 20px; }
.logo-settings .check { display: flex; }
.logo-settings { margin-top: 8px; }
.logo-settings .btn { margin-top: 12px; }

/* ---------- App (one-screen layout) ---------- */
.nav__end { display: flex; align-items: center; gap: 10px; }
.nav__tag {
    display: none; align-items: center; gap: 10px; margin: 0; padding: 6px 14px;
    border: 1px solid var(--line-strong); border-radius: 999px;
    font-family: var(--mono); font-size: 12px; color: var(--muted);
}
.nav__tag .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--black); box-shadow: 0 0 0 3px rgba(10,10,10,.12); }
@media (min-width: 720px) { .nav__tag { display: inline-flex; } }

body.page-home { height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
.page-home .nav { position: static; flex: none; border-bottom-color: var(--line); }
.page-home .nav__inner { height: 60px; }
.page-home main { flex: 1; min-height: 0; }
.page-home .footer { flex: none; }

.app {
    height: 100%; display: grid; gap: 28px;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 440px);
    padding-top: 24px; padding-bottom: 24px;
}
.app__controls { display: flex; flex-direction: column; gap: 20px; min-width: 0; min-height: 0; }
.app__intro h1 {
    margin: 0; font-size: clamp(28px, 3.4vw, 46px); line-height: 1.02; font-weight: 700; letter-spacing: -.045em; color: var(--black);
}
.app__intro h1 em { font-style: normal; font-weight: 300; }
.app__intro p { margin: 8px 0 0; color: var(--muted); font-size: 15px; }

.card {
    flex: 1; min-height: 0; min-width: 0; margin: 0; padding: 0;
    display: flex; flex-direction: column;
    border: 1px solid var(--line-strong); border-radius: 20px; background: var(--white); overflow: hidden;
}
.tabs { flex: none; display: flex; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
    flex: 1 0 auto; position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 54px; padding: 0 16px; border: 0; background: none;
    font-size: 14px; font-weight: 500; color: var(--muted); white-space: nowrap; transition: color .15s;
}
.tab:hover { color: var(--black); }
.tab__num {
    display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
    border: 1px solid var(--line-strong); font-family: var(--mono); font-size: 11px; transition: all .15s;
}
.tab.is-active { color: var(--black); }
.tab.is-active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--black); }
.tab.is-active .tab__num { background: var(--black); border-color: var(--black); color: var(--white); }
.card__body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 22px 24px 24px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.panel { margin: 0; padding: 0; border: 0; min-width: 0; }
.panel.is-open { animation: reveal .25s var(--ease); }
@keyframes reveal { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.app__preview { display: flex; min-height: 0; min-width: 0; }
.preview {
    flex: 1; min-height: 0; display: flex; flex-direction: column;
    padding: 18px; border-radius: 20px; background: var(--white);
    border: 1px solid var(--line-strong);
    box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 24px 48px -24px rgba(0,0,0,.18);
}
.preview__stage {
    flex: 1; min-height: 160px; position: relative; display: grid; place-items: center;
    container-type: size; border-radius: 14px; overflow: hidden;
    background-color: var(--soft);
    background-image:
        linear-gradient(45deg, #ececec 25%, transparent 25%), linear-gradient(-45deg, #ececec 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #ececec 75%), linear-gradient(-45deg, transparent 75%, #ececec 75%);
    background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.preview__qr { width: min(86cqw, 86cqh); height: min(86cqw, 86cqh); display: grid; place-items: center; transition: opacity .2s; }
.preview__qr svg, .preview__qr canvas { width: 100% !important; height: 100% !important; border-radius: 4px; }
.preview__qr.is-empty { opacity: .15; }
.preview__data {
    flex: none; margin: 12px 0 0; font-family: var(--mono); font-size: 12px; color: var(--muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; min-height: 18px;
}
.preview .field--compact { flex: none; margin: 12px 0 10px; }
.dl { flex: none; display: grid; gap: 8px; }
.dl__row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.dl__row .btn { padding: 0 6px; font-size: 13px; height: 40px; }
.preview .link-btn { flex: none; display: block; margin: 10px auto 0; }

/* Short desktop screens */
@media (min-width: 960px) and (max-height: 760px) {
    .app { padding-top: 16px; padding-bottom: 16px; gap: 20px; }
    .app__controls { gap: 14px; }
    .app__intro h1 { font-size: 30px; }
    .app__intro p { display: none; }
    .preview .field--compact { display: none; }
}

/* Tablet & mobile: preview on top, controls fill the rest */
@media (max-width: 959px) {
    .page-home .nav__inner { height: 52px; }
    .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 12px; padding-top: 12px; padding-bottom: 12px; }
    .app__preview { order: -1; }
    .app__intro { display: none; }
    .preview { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 14px; padding: 12px; border-radius: 16px; }
    .preview__stage { --s: clamp(112px, 34vw, 200px); grid-row: 1 / span 3; width: var(--s); height: var(--s); min-height: 0; border-radius: 10px; }
    .preview__data { display: none; }
    .preview .field--compact { margin: 0 0 8px; }
    .preview .field--compact > span { display: none; }
    .dl .btn--block { height: 40px; font-size: 14px; }
    .dl__row { grid-template-columns: repeat(2, 1fr); }
    .dl__row .btn { height: 34px; }
    .preview .link-btn { grid-column: 2; margin: 6px 0 0; text-align: left; font-size: 12px; }
    .tab { flex: 1 0 auto; height: 48px; padding: 0 12px; font-size: 13px; }
    .card__body { padding: 18px 16px 20px; }
    .page-home .footer__inner { min-height: 40px; justify-content: center; font-size: 12px; }
    .page-home .footer__inner > span { display: none; }
}
@media (max-width: 520px) { .tab__num { display: none; } .tab { flex: 1 1 auto; padding: 0 8px; } }
@media (min-width: 600px) and (max-width: 959px) { .dl__row { grid-template-columns: repeat(4, 1fr); } }

/* ---------- Legal ---------- */
.legal { padding: 64px 0 96px; }
.legal__inner { max-width: 760px; }
.legal h1 { margin: 0 0 8px; font-size: clamp(36px, 6vw, 56px); font-weight: 700; letter-spacing: -.04em; line-height: 1.05; color: var(--black); }
.legal__meta { margin: 0 0 48px; font-family: var(--mono); font-size: 12px; color: var(--faint); }
.legal h2 { margin: 48px 0 12px; font-size: 22px; font-weight: 600; letter-spacing: -.02em; color: var(--black); }
.legal h3 { margin: 28px 0 8px; font-size: 16px; font-weight: 600; color: var(--black); }
.legal p, .legal li { color: #404040; }
.legal ul { padding-left: 20px; }
.legal li { margin-bottom: 6px; }
.legal a { text-underline-offset: 3px; }
.legal address { font-style: normal; }
.legal .box { padding: 20px 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--soft); }
.legal .box p { margin: 0; }
.legal .box p + p { margin-top: 12px; }
.legal dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 24px; margin: 0; }
.legal dt { color: var(--muted); }
.legal dd { margin: 0; color: var(--ink); }
@media (max-width: 520px) { .legal dl { grid-template-columns: 1fr; gap: 0; } .legal dd { margin-bottom: 10px; } }
.legal .toc { list-style: none; padding: 0; margin: 0 0 8px; columns: 2; column-gap: 24px; font-size: 14px; }
.legal .toc li { margin-bottom: 4px; break-inside: avoid; }
.legal .toc a { color: var(--muted); text-decoration: none; }
.legal .toc a:hover { color: var(--black); }
@media (max-width: 520px) { .legal .toc { columns: 1; } }

/* ---------- 404 ---------- */
.notfound { padding: 120px 0; text-align: center; }
.notfound h1 { margin: 0; font-size: clamp(80px, 16vw, 180px); font-weight: 800; letter-spacing: -.06em; line-height: 1; color: var(--black); }
.notfound p { color: var(--muted); margin: 12px 0 32px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 20px; min-height: 48px; padding-top: 8px; padding-bottom: 8px; font-size: 13px; color: var(--faint); }
.footer__links { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.footer__links a { text-decoration: none; color: var(--muted); }
.footer__links a:hover { color: var(--black); }

/* toast */
.toast {
    position: fixed; left: 50%; bottom: 24px; z-index: 90;
    transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
    padding: 10px 18px; border-radius: 999px; background: var(--black); color: var(--white); font-size: 14px;
    box-shadow: 0 12px 32px -8px rgba(0,0,0,.35);
    transition: all .3s var(--ease);
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }
