:root {
    --paper: #fff7df;
    --ink: #191919;
    --purple: #7c5cff;
    --pink: #ff6fae;
    --orange: #ff9d3d;
    --yellow: #ffd84d;
    --mint: #8ee8c7;
    --blue: #75c7ff;
    --white: #fffdf8;
    --shadow: 8px 8px 0 var(--ink);
    --shadow-sm: 4px 4px 0 var(--ink);
    --radius: 26px;
    --sans:
        Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", sans-serif;
    --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
* {
    box-sizing: border-box;
}
html {
    scroll-behavior: smooth;
}
body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--sans);
    color: var(--ink);
    background: var(--paper);
    overflow-x: hidden;
}
button,
input,
textarea,
select {
    font: inherit;
    color: inherit;
}
button {
    cursor: pointer;
}
.bg-shape {
    position: fixed;
    z-index: 0;
    pointer-events: none;
    filter: saturate(1.05);
}
.bg-shape.one {
    width: 260px;
    height: 260px;
    border-radius: 58% 42% 46% 54%/62% 35% 65% 38%;
    background: var(--pink);
    top: -80px;
    right: -70px;
    transform: rotate(18deg);
}
.bg-shape.two {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: var(--mint);
    bottom: -80px;
    left: -65px;
}
.bg-shape.three {
    width: 120px;
    height: 120px;
    background: var(--purple);
    left: 6vw;
    top: 28vh;
    border-radius: 30px;
    transform: rotate(24deg);
}
.doodle-grid {
    position: fixed;
    inset: 0;
    z-index: 0;
    opacity: 0.22;
    pointer-events: none;
    background-image: radial-gradient(var(--ink) 1px, transparent 1px);
    background-size: 24px 24px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 80%);
}
.shell {
    position: relative;
    z-index: 2;
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 46px;
}
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 26px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 900;
    letter-spacing: -0.03em;
}
.logo-bubble {
    width: 52px;
    height: 52px;
    border: 2px solid var(--ink);
    border-radius: 18px;
    background: var(--yellow);
    display: grid;
    place-items: center;
    box-shadow: var(--shadow-sm);
    transform: rotate(-6deg);
    font-size: 23px;
}
.brand small {
    display: block;
    font-family: var(--mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.13em;
    margin-top: 2px;
    font-weight: 700;
}
.pill {
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: var(--white);
    padding: 10px 14px;
    font-family: var(--mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    box-shadow: 3px 3px 0 var(--ink);
}
.hero {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 30px;
    align-items: center;
    margin-bottom: 34px;
}
.hero h1 {
    margin: 0;
    font-size: clamp(64px, 10vw, 144px);
    line-height: 0.78;
    letter-spacing: -0.075em;
    font-weight: 950;
}
.hero h1 span {
    display: inline-block;
}
.hero .pop-word {
    background: var(--purple);
    color: white;
    border: 2px solid var(--ink);
    padding: 0.04em 0.12em 0.09em;
    border-radius: 0.18em;
    box-shadow: 7px 7px 0 var(--ink);
    transform: rotate(-2deg);
}
.hero-copy {
    max-width: 520px;
    justify-self: end;
}
.hero-copy p {
    font-size: clamp(17px, 1.7vw, 22px);
    line-height: 1.45;
    margin: 0 0 18px;
    font-weight: 650;
}
.hero-stickers {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.sticker {
    padding: 8px 12px;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: var(--yellow);
    box-shadow: 3px 3px 0 var(--ink);
    font-family: var(--mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    transform: rotate(-2deg);
}
.sticker:nth-child(2) {
    background: var(--blue);
    transform: rotate(2deg);
}
.sticker:nth-child(3) {
    background: var(--mint);
    transform: rotate(-1deg);
}
.workspace {
    display: grid;
    grid-template-columns: 1.08fr 0.92fr;
    gap: 24px;
    align-items: start;
}
.card {
    background: var(--white);
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px 22px;
    border-bottom: 2px solid var(--ink);
    background: var(--yellow);
}
.card.preview .card-head {
    background: var(--blue);
}
.card-head strong {
    font-size: 16px;
}
.card-head span {
    font-family: var(--mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.controls {
    padding: 24px;
}
.section-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 28px 0 14px;
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.section-label:first-child {
    margin-top: 0;
}
.section-label::after {
    content: "";
    height: 2px;
    background: var(--ink);
    flex: 1;
    opacity: 0.2;
}
.field {
    margin-bottom: 20px;
}
.field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.field-grid.three {
    grid-template-columns: repeat(3, 1fr);
}
label {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-weight: 850;
    font-size: 13px;
    margin-bottom: 8px;
}
.label-meta {
    font-family: var(--mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}
textarea,
input,
select {
    width: 100%;
    border: 2px solid var(--ink);
    background: #fff;
    border-radius: 16px;
    outline: none;
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        background 0.18s ease;
}
textarea {
    min-height: 146px;
    padding: 16px;
    resize: vertical;
    font-size: 15px;
    line-height: 1.5;
}
select,
input {
    height: 52px;
    padding: 0 14px;
}
textarea:focus,
input:focus,
select:focus {
    background: #fffef4;
    box-shadow: 4px 4px 0 var(--purple);
    transform: translate(-2px, -2px);
}
.help {
    font-size: 11px;
    line-height: 1.5;
    margin-top: 7px;
    color: #4f4f4f;
}
.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 3px 0 22px;
}
.meta-chip {
    border: 2px solid var(--ink);
    background: var(--mint);
    border-radius: 999px;
    padding: 7px 10px;
    font-family: var(--mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.meta-chip:nth-child(2) {
    background: #ffe5f0;
}
.meta-chip:nth-child(3) {
    background: #e5dbff;
}
.meta-chip:nth-child(4) {
    background: #fff2ba;
}
.color-control {
    display: grid;
    grid-template-columns: 50px 1fr;
    gap: 9px;
}
.color-control input[type="color"] {
    padding: 4px;
    height: 52px;
    border-radius: 14px;
    cursor: pointer;
}
.color-control input[type="text"] {
    min-width: 0;
}
.range-wrap {
    border: 2px solid var(--ink);
    border-radius: 16px;
    background: #fff;
    padding: 10px 13px;
    height: 52px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.range-wrap input[type="range"] {
    height: auto;
    padding: 0;
    border: 0;
    box-shadow: none;
    transform: none;
    background: transparent;
    accent-color: var(--purple);
    flex: 1;
}
.range-value {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 800;
    min-width: 34px;
    text-align: right;
}
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 2px solid var(--ink);
    border-radius: 16px;
    padding: 12px 14px;
    background: #fff;
}
.toggle-copy strong {
    display: block;
    font-size: 13px;
}
.toggle-copy small {
    display: block;
    margin-top: 2px;
    color: #555;
    font-size: 10px;
}
.switch {
    position: relative;
    width: 48px;
    height: 28px;
    flex: 0 0 auto;
}
.switch input {
    opacity: 0;
    position: absolute;
}
.slider {
    position: absolute;
    inset: 0;
    border: 2px solid var(--ink);
    background: #ddd;
    border-radius: 999px;
    cursor: pointer;
}
.slider::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    border: 2px solid var(--ink);
    background: #fff;
    border-radius: 50%;
    transition: 0.2s;
}
.switch input:checked + .slider {
    background: var(--mint);
}
.switch input:checked + .slider::before {
    transform: translateX(20px);
}
.logo-drop {
    border: 2px dashed var(--ink);
    border-radius: 16px;
    padding: 15px;
    background: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
}
.logo-drop input {
    border: 0;
    height: auto;
    padding: 0;
    border-radius: 0;
    min-width: 0;
}
.logo-preview {
    width: 46px;
    height: 46px;
    border: 2px solid var(--ink);
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: #f5f5f5;
    overflow: hidden;
    flex: 0 0 auto;
    font-size: 19px;
}
.logo-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.logo-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
.mini-btn {
    border: 2px solid var(--ink);
    border-radius: 10px;
    background: white;
    padding: 7px 9px;
    font-size: 10px;
    font-weight: 850;
    box-shadow: 2px 2px 0 var(--ink);
}
.actions {
    display: grid;
    grid-template-columns: 1.25fr 1fr 1fr;
    gap: 10px;
}
.btn {
    min-height: 50px;
    border: 2px solid var(--ink);
    border-radius: 16px;
    background: white;
    font-weight: 900;
    box-shadow: 4px 4px 0 var(--ink);
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease;
    position: relative;
}
.btn:hover:not(:disabled) {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 var(--ink);
}
.btn:active:not(:disabled) {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 var(--ink);
}
.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.btn-primary {
    background: var(--purple);
    color: white;
}
.btn-clear {
    margin-top: 10px;
    width: 100%;
    background: var(--pink);
}
.preview {
    position: sticky;
    top: 16px;
}
.preview-stage {
    min-height: 520px;
    display: grid;
    place-items: center;
    padding: 44px;
    position: relative;
    overflow: hidden;
    background: #fff5fb;
}
.preview-stage::before {
    content: "";
    position: absolute;
    width: 180px;
    height: 180px;
    background: var(--orange);
    border: 2px solid var(--ink);
    border-radius: 50%;
    right: -60px;
    top: 40px;
}
.preview-stage::after {
    content: "";
    position: absolute;
    width: 100px;
    height: 100px;
    background: var(--mint);
    border: 2px solid var(--ink);
    border-radius: 24px;
    left: 28px;
    bottom: 36px;
    transform: rotate(14deg);
}
.burst {
    position: absolute;
    font-size: 34px;
    font-weight: 950;
    z-index: 1;
}
.burst.a {
    left: 26px;
    top: 25px;
    transform: rotate(-12deg);
}
.burst.b {
    right: 28px;
    bottom: 28px;
    transform: rotate(9deg);
}
.qr-shell {
    width: min(78%, 380px);
    aspect-ratio: 1;
    border: 2px solid var(--ink);
    border-radius: 24px;
    background: white;
    padding: 18px;
    display: grid;
    place-items: center;
    box-shadow: 10px 10px 0 var(--ink);
    position: relative;
    z-index: 3;
    transform: rotate(-1deg);
    overflow: hidden;
}
#qrWrap {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
}
#qrWrap canvas,
#qrWrap svg {
    width: 100% !important;
    height: 100% !important;
    display: block;
}
.empty-state {
    text-align: center;
    font-family: var(--mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1.6;
}
.empty-state strong {
    display: block;
    font-family: var(--sans);
    font-size: 20px;
    text-transform: none;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}
.status-bar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    border-top: 2px solid var(--ink);
    padding: 17px 20px;
    background: var(--mint);
}
.status-left {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}
.status-dot {
    width: 10px;
    height: 10px;
    border: 2px solid var(--ink);
    border-radius: 50%;
    background: white;
    flex: 0 0 auto;
}
.status-dot.ok {
    background: #6ce28c;
}
.status-dot.warn {
    background: var(--yellow);
}
.status-dot.err {
    background: #ff6f6f;
}
.status-text {
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.status-mode {
    font-family: var(--mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.fun-tip {
    margin-top: 24px;
    border: 2px solid var(--ink);
    border-radius: 20px;
    background: var(--orange);
    box-shadow: 5px 5px 0 var(--ink);
    padding: 15px 18px;
    font-weight: 800;
    transform: rotate(-0.5deg);
}
.footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 26px;
    padding: 18px 2px 0;
    font-family: var(--mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
@media (max-width: 1050px) {
    .field-grid.three {
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 950px) {
    .hero {
        grid-template-columns: 1fr;
    }
    .hero-copy {
        justify-self: start;
    }
    .workspace {
        grid-template-columns: 1fr;
    }
    .preview {
        position: relative;
        top: auto;
    }
}
@media (max-width: 650px) {
    .shell {
        width: min(100% - 20px, 1280px);
    }
    .topbar .pill {
        display: none;
    }
    .hero {
        margin-top: 12px;
    }
    .hero h1 {
        font-size: clamp(60px, 24vw, 100px);
    }
    .field-grid,
    .field-grid.three,
    .actions {
        grid-template-columns: 1fr;
    }
    .controls {
        padding: 18px;
    }
    .preview-stage {
        min-height: 420px;
        padding: 46px 30px;
    }
    .qr-shell {
        width: min(86%, 330px);
    }
    .footer {
        flex-direction: column;
    }
    .bg-shape.three {
        display: none;
    }
}
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}
