:root {
  --bg: #08080a;
  --ink: #fff;
  --muted: rgba(255, 255, 255, .62);
  --line: rgba(255, 255, 255, .12);
  --panel: rgba(255, 255, 255, .055);
  --accent: #34b8f8;
  --ok: #24d6b6;
  --err: #ff8a8f;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background:
    radial-gradient(900px 500px at 50% -10%, rgba(255,255,255,.07), transparent 70%),
    radial-gradient(900px 600px at 50% 110%, rgba(52,184,248,.08), transparent 70%),
    var(--bg);
  color: var(--ink); font-family: var(--font); line-height: 1.4;
}
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.top { display: flex; align-items: center; justify-content: space-between; padding: 16px max(16px, env(safe-area-inset-left)); max-width: 1100px; margin: 0 auto; }
.mark { display: inline-flex; align-items: center; gap: 9px; color: #fff; text-decoration: none; font-weight: 800; letter-spacing: .08em; }
.mark svg { width: 26px; height: 26px; }
.back { background: none; border: 0; color: var(--muted); font-weight: 600; padding: 10px; min-height: 44px; cursor: pointer; }

/* ---------- Landing ---------- */
.landing { min-height: calc(100dvh - 80px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 8px 20px 40px; }
.landing h1 { font-size: clamp(2.2rem, 7vw, 4rem); line-height: 1.04; letter-spacing: -.03em; font-weight: 800; margin: 0 0 12px; }
.sub { color: var(--muted); margin: 0; font-size: clamp(1rem, 2.6vw, 1.2rem); }

.card-stage { background: none; border: 0; padding: 0; margin: clamp(28px, 6vh, 56px) 0 8px; cursor: pointer; perspective: 1200px; -webkit-tap-highlight-color: transparent; border-radius: 24px; }
.card3d { display: block; position: relative; width: min(78vw, 340px); aspect-ratio: 85.6 / 54; transform-style: preserve-3d; animation: spin 10s linear infinite; transition: scale .2s; }
.card-stage:hover .card3d { scale: 1.05; }
.card-stage:active .card3d { scale: .97; }
@keyframes spin { from { transform: rotateX(-8deg) rotateY(0); } to { transform: rotateX(-8deg) rotateY(360deg); } }
.face { position: absolute; inset: 0; border-radius: 5.2% / 8.2%; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: grid; place-items: center; overflow: hidden;
  box-shadow: 0 30px 60px -28px rgba(52,184,248,.55), inset 0 0 0 1px rgba(255,255,255,.28); }
.front { background: linear-gradient(150deg, #243a63 0%, #10182c 55%, #0a0f1d 100%); }
.front::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, rgba(255,255,255,.28), rgba(255,255,255,.04) 38%, transparent 60%); }
.front .nfc { position: absolute; top: 12%; right: 9%; width: 17%; color: rgba(255,255,255,.85); }
.wordmark { font-weight: 800; letter-spacing: .14em; font-size: clamp(1.8rem, 9vw, 2.6rem); color: #fff; position: relative; z-index: 1; }
.back.face, .face.back { transform: rotateY(180deg); background: linear-gradient(210deg, #1b1b22, #0c0c10); }
.mini { display: grid; grid-template-columns: 1fr 1fr; gap: 7%; width: 44%; aspect-ratio: 1.55; }
.mini i { border-radius: 14%; box-shadow: inset 0 1px 0 rgba(255,255,255,.5); }

.cta { margin: 22px 0 0; font-weight: 700; font-size: 1.15rem; letter-spacing: .01em; animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.how { list-style: none; padding: 0; margin: clamp(28px, 6vh, 56px) 0 0; display: flex; gap: 12px 28px; flex-wrap: wrap; justify-content: center; color: var(--muted); font-size: .95rem; }
.how b { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line); color: #fff; margin-right: 8px; font-size: .8rem; }

/* tone tokens: c1 top-left, c2 bottom-right (brief 3.1) */
.t-orange { --c1: 248 168 84; --c2: 236 124 44; } .t-teal { --c1: 36 214 182; --c2: 6 164 138; }
.t-blue { --c1: 52 184 248; --c2: 12 132 212; } .t-coral { --c1: 246 116 118; --c2: 220 68 82; }
.t-violet { --c1: 184 132 238; --c2: 132 78 212; } .t-pink { --c1: 240 128 206; --c2: 206 74 164; }
.mini i { background: linear-gradient(158deg, rgb(var(--c1)), rgb(var(--c2))); }

/* ---------- Configurator ---------- */
.config { max-width: 1100px; margin: 0 auto; padding: 0 16px 80px; }
.build-title { font-size: clamp(1.8rem, 5vw, 2.6rem); letter-spacing: -.03em; margin: 8px 0 20px; font-weight: 800; }
.build { display: grid; gap: 20px; grid-template-columns: 1fr; }
.preview { order: 0; }
@media (max-width: 899px) { .phone { aspect-ratio: 4 / 5; } }
@media (min-width: 900px) {
  .build { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; column-gap: 40px; }
  .build > .col:first-child { grid-column: 1; grid-row: 1; }
  .build > .col:last-child { grid-column: 1; grid-row: 2; }
  .preview { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: 16px; }
}
.col { display: grid; gap: 20px; }
.step { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: clamp(16px, 4vw, 24px); }
.step h2 { margin: 0 0 14px; font-size: 1.25rem; letter-spacing: -.01em; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.step h2 b { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #fff; color: #000; font-size: .85rem; align-self: center; }
.step h2 small { color: var(--muted); font-weight: 500; font-size: .85rem; }
.help { color: var(--muted); font-size: .92rem; margin: -4px 0 14px; }

.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field > span:first-child { font-size: .85rem; color: var(--muted); font-weight: 600; }
input[type=text], input[type=email], input[type=url] {
  width: 100%; min-height: 48px; padding: 10px 14px; font-size: 16px; /* 16px stops iOS zoom */
  background: rgba(0,0,0,.35); border: 1px solid var(--line); border-radius: 14px; outline: none;
}
input::placeholder { color: rgba(255,255,255,.32); }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(52,184,248,.25); }
input[aria-invalid=true] { border-color: var(--err); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.pets { border: 0; padding: 0; margin: 4px 0 0; display: flex; gap: 8px; flex-wrap: wrap; }
.pets legend { font-size: .85rem; color: var(--muted); font-weight: 600; margin-bottom: 8px; padding: 0; }
.pets label { position: relative; }
.pets input { position: absolute; opacity: 0; inset: 0; }
.pets span { display: inline-block; padding: 10px 18px; min-height: 44px; border-radius: 999px; border: 1px solid var(--line); background: rgba(0,0,0,.3); cursor: pointer; font-weight: 600; }
.pets input:checked + span { background: #fff; color: #000; border-color: #fff; }
.pets input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

/* link rows */
.rows { display: grid; gap: 10px; margin-bottom: 12px; }
.row { display: grid; grid-template-columns: 14px minmax(0, 1fr) 44px; gap: 8px 10px; align-items: center; padding: 10px; border-radius: 16px; background: rgba(0,0,0,.25); border: 1px solid var(--line); }
.row .dot { width: 14px; height: 14px; border-radius: 50%; background: linear-gradient(158deg, rgb(var(--c1)), rgb(var(--c2))); grid-row: 1; }
.row .inputs { display: grid; gap: 8px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .row .inputs { grid-template-columns: 150px 1fr; } }
.row .x { width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent; color: var(--muted); font-size: 1.4rem; cursor: pointer; }
.row .x:hover { color: #fff; background: var(--panel); }
.row .msg { grid-column: 2 / 3; margin: 0; font-size: .82rem; color: var(--err); min-height: 0; }
.row .msg:empty { display: none; }
.ghost-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 18px; border-radius: 14px; border: 1px dashed rgba(255,255,255,.3); background: transparent; color: #fff; font-weight: 600; cursor: pointer; text-decoration: none; }
.ghost-btn:hover { background: var(--panel); }
.ghost-btn[disabled] { opacity: .4; cursor: not-allowed; }

/* ---------- Live preview ---------- */
.phone { position: relative; width: min(100%, 320px); margin: 0 auto; aspect-ratio: 9 / 16; border-radius: 34px; padding: 18px 14px 16px; background: #0b0b0e; border: 1px solid rgba(255,255,255,.18); box-shadow: 0 30px 70px -30px rgba(0,0,0,.9), inset 0 0 0 5px #050507; display: flex; flex-direction: column; }
.p-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 6px 6px 14px; }
#p-name { font-size: 1.5rem; font-weight: 800; letter-spacing: -.028em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(160deg, #2c2c33, #17171b); border: 1px solid rgba(255,255,255,.14); font-weight: 700; font-size: .85rem; }
.p-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: 10px; }
.p-grid.one { grid-template-columns: 1fr; }
.p-grid.odd .tile:last-child { grid-column: span 2; }
.tile {
  position: relative; border-radius: 20px; padding: 12px; min-height: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; color: #fff;
  background:
    linear-gradient(180deg, rgba(255,255,255,.20), rgba(255,255,255,.05) 36%, transparent 56%),
    radial-gradient(at 100% 115%, rgba(0,0,0,.10), transparent 60%),
    linear-gradient(158deg, rgb(var(--c1) / .94), rgb(var(--c2) / .80));
  box-shadow: 0 22px 44px -30px rgb(var(--c2) / .75), inset 0 -10px 18px -12px rgba(0,0,0,.35);
  backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%);
  animation: pop .28s cubic-bezier(.2,.9,.25,1) both;
}
.tile::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(150deg, rgba(255,255,255,.75), rgba(255,255,255,.16) 30%, rgba(255,255,255,.05) 62%, rgba(255,255,255,.32));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
@keyframes pop { from { opacity: 0; transform: scale(.92); } }
.tile .top { display: flex; justify-content: space-between; align-items: flex-start; padding: 0; margin: 0; max-width: none; }
.tile svg { width: 26px; height: 26px; fill: none; stroke: #fff; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tile .aff { width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.22); display: grid; place-items: center; font-size: .7rem; }
.tile .lbl { font-weight: 700; font-size: clamp(.95rem, 4.4vw, 1.15rem); line-height: 1.1; overflow-wrap: anywhere; text-shadow: 0 1px 8px rgba(0,0,0,.25); }
.tile.ghost { background: transparent; box-shadow: none; backdrop-filter: none; border: 1.5px dashed rgba(255,255,255,.22); color: rgba(255,255,255,.4); justify-content: flex-end; animation: none; }
.tile.ghost::before { display: none; }
.p-pet { position: absolute; width: 38px; height: 28px; pointer-events: none; transition: left .3s, top .3s; }
.p-pet svg { width: 100%; height: 100%; overflow: visible; }
.p-pet .fur { fill: var(--fur, #fbf6ef); } .p-pet .shade { fill: var(--shade, #e4d9cc); }
.p-pet .fur-stroke { fill: none; stroke: var(--fur, #fbf6ef); stroke-linecap: round; }
.p-pet .eye, .p-pet .ink { fill: #2a2230; } .p-pet .pink { fill: #f3a3b2; } .p-pet .blush { fill: #f3a3b2; opacity: .45; }
.p-pet .ear { fill: var(--ear, var(--fur, #fbf6ef)); } .p-pet .muzzle { fill: var(--muzzle, var(--fur, #fbf6ef)); }
.p-pet.dog { --fur: #f7e2c4; --shade: #e2c49c; --muzzle: #fff4e4; }
.p-pet .pet-shadow { fill: rgba(0,0,0,.22); }
.preview-note { text-align: center; color: var(--muted); font-size: .8rem; margin: 10px 0 0; }

/* ---------- Domain choices ---------- */
.choices { display: grid; gap: 10px; }
.choice { display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: start; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: rgba(0,0,0,.25); cursor: pointer; }
.choice:has(input:checked) { border-color: #fff; background: rgba(255,255,255,.08); }
.choice input { margin: 3px 0 0; width: 20px; height: 20px; accent-color: #fff; }
.choice b { display: block; }
.choice em { display: block; font-style: normal; color: var(--muted); font-size: .88rem; margin-top: 2px; }
.choice-body { padding: 2px 4px 6px 4px; }
.find-list { display: grid; gap: 10px; }
.find-item { display: grid; gap: 4px; }
.status { margin: 0; font-size: .86rem; color: var(--muted); min-height: 1.2em; }
.status.good { color: var(--ok); } .status.warn { color: #ffcf87; }
.prefixed { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 14px; background: rgba(0,0,0,.35); overflow: hidden; }
.prefixed:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(52,184,248,.25); }
.prefixed i { font-style: normal; display: flex; align-items: center; padding: 0 0 0 14px; color: var(--muted); font-size: .9rem; white-space: nowrap; }
.prefixed input { border: 0; background: transparent; box-shadow: none; padding-left: 2px; }

/* ---------- Checkout ---------- */
.summary { color: var(--muted); font-size: .92rem; margin: 4px 0 14px; }
.errors { margin: 0 0 14px; padding: 12px 16px 12px 32px; border-radius: 14px; background: rgba(255,138,143,.1); border: 1px solid rgba(255,138,143,.4); color: #ffd0d2; font-size: .92rem; }
.primary { width: 100%; min-height: 58px; border: 0; border-radius: 18px; font-weight: 800; font-size: 1.1rem; letter-spacing: .01em; color: #fff; cursor: pointer;
  background: linear-gradient(180deg, #3d8bff, #156dff); box-shadow: 0 16px 40px -16px rgba(21,109,255,.9), inset 0 1px 0 rgba(255,255,255,.35); }
.primary:active { transform: scale(.985); }
.primary[disabled] { opacity: .6; cursor: progress; }
.fine { color: var(--muted); font-size: .8rem; text-align: center; margin: 12px 0 0; }
.fallback { margin-top: 16px; padding: 14px; border-radius: 16px; border: 1px solid rgba(255,207,135,.4); background: rgba(255,207,135,.08); display: grid; gap: 10px; }
.fallback p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .card3d { animation: none; transform: rotateX(-8deg) rotateY(-18deg); transition: none; }
  .cta, .tile { animation: none; }
  .p-pet { transition: none; }
}
@media (max-height: 560px) and (orientation: landscape) { .landing h1 { font-size: 1.8rem; } .card-stage { margin-top: 18px; } .how { display: none; } }
