/* ============================================================================
   LOGO CREATOR PRO — Glass / Dark theme
   Near-black surface · violet→blue accent · backdrop-blurred panels
   ============================================================================ */

@import url('https://rsms.me/inter/inter.css');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    /* Surface */
    --bg:           #06070a;
    --bg-elev-0:    #0a0b10;
    --bg-elev-1:    #11131a;
    --bg-elev-2:    #181b24;
    --hairline:     rgba(255, 255, 255, 0.08);
    --hairline-2:   rgba(255, 255, 255, 0.14);

    /* Glass */
    --glass:        rgba(255, 255, 255, 0.04);
    --glass-strong: rgba(255, 255, 255, 0.07);
    --glass-border: rgba(255, 255, 255, 0.10);
    --glass-blur:   18px;

    /* Ink (text) */
    --ink:          #f4f5f7;
    --ink-soft:     #c8cad1;
    --ink-muted:    #8c8f98;
    --ink-faint:    #5b5e68;

    /* Accent — electric violet → blue (the brand gradient) */
    --accent:       #7c5cff;
    --accent-2:     #2d7bff;
    --accent-glow:  rgba(124, 92, 255, 0.45);
    --grad-accent:  linear-gradient(135deg, #7c5cff 0%, #2d7bff 100%);
    --grad-accent-soft: linear-gradient(135deg, rgba(124,92,255,0.18), rgba(45,123,255,0.18));

    /* Legacy color tokens (mapped onto the new theme so old markup still reads correctly) */
    --paper:        var(--bg-elev-1);
    --paper-deep:   var(--bg-elev-2);
    --paper-shadow: rgba(0, 0, 0, 0.5);
    --cobalt:       #2d7bff;
    --cobalt-deep:  #1f5fd8;
    --tomato:       #7c5cff;
    --tomato-deep:  #5a3fe0;
    --sun:          #ffb547;
    --sun-deep:     #d9921f;
    --mint:         #4ad6a4;

    /* Type */
    --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif;
    --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
    --font-script:  'Inter', -apple-system, system-ui, sans-serif;
    --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

    /* Rhythm */
    --r1: 4px;  --r2: 8px; --r3: 12px; --r4: 16px;
    --r5: 24px; --r6: 32px; --r7: 48px; --r8: 64px; --r9: 96px;

    /* Shapes */
    --radius-sm: 10px;
    --radius:    16px;
    --radius-lg: 22px;
    --radius-xl: 28px;

    --shadow-paper: 0 1px 0 rgba(255,255,255,0.04) inset, 0 12px 40px -16px rgba(0,0,0,0.7);
    --shadow-press: 0 8px 24px -12px rgba(0,0,0,0.6);
    --shadow-glow:  0 0 0 1px rgba(124,92,255,0.35), 0 14px 50px -10px var(--accent-glow);
}

* { box-sizing: border-box; }

html { background: var(--bg); color-scheme: dark; }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--bg);
    min-height: 100vh;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "ss01", "cv11";
    letter-spacing: -0.005em;
    overflow-x: hidden;
}

/* Ambient gradient mesh — fixed, behind everything */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background:
        radial-gradient(900px 600px at 88% -10%, rgba(124, 92, 255, 0.16), transparent 60%),
        radial-gradient(720px 540px at 0% 100%, rgba(45, 123, 255, 0.14), transparent 55%),
        radial-gradient(500px 360px at 50% 40%, rgba(255, 181, 71, 0.04), transparent 70%);
    background-attachment: fixed;
}

/* Fine grain so the surface doesn't read flat */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.06;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='1'/></svg>");
    background-size: 220px 220px;
}

/* Legacy decorative utilities — neutralized for the dark theme */
.halftone, .halftone--cobalt, .halftone--tomato, .crosshatch { background: transparent; opacity: 0; }

/* ============================================================================
   TYPOGRAPHY
   ============================================================================ */

.display, h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.06;
    color: var(--ink);
    margin: 0 0 var(--r4);
}

h1, .display-1 {
    font-size: clamp(44px, 7vw, 96px);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.02;
}
h2, .display-2 {
    font-size: clamp(28px, 4vw, 52px);
    font-weight: 600;
    letter-spacing: -0.03em;
}
h3 {
    font-size: clamp(18px, 2vw, 22px);
    font-weight: 600;
    letter-spacing: -0.015em;
}

.script {
    font-family: var(--font-display);
    font-weight: 500;
    font-style: italic;
    color: var(--ink-soft);
    letter-spacing: -0.01em;
}
.script-lg { font-size: clamp(20px, 2.6vw, 28px); }

.mono {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

.eyebrow {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

a {
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid var(--hairline-2);
    transition: color .15s, border-color .15s;
}
a:hover { color: var(--accent-2); border-bottom-color: var(--accent-2); }

/* Misregistration is now a no-op — just rendered as plain text */
.misreg { position: relative; display: inline-block; color: var(--ink); }
.misreg::before, .misreg::after { content: none; }

/* Headline gradient mark — used on hero accents */
.grad-text {
    background: var(--grad-accent);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* ============================================================================
   LAYOUT
   ============================================================================ */

.shell { max-width: 1240px; margin: 0 auto; padding: 0 var(--r5); position: relative; }
.shell--narrow { max-width: 720px; }
.shell--wide   { max-width: 1480px; }

.row { display: flex; gap: var(--r4); }
.col { flex: 1; min-width: 0; }
.stack > * + * { margin-top: var(--r4); }

/* ============================================================================
   NAVIGATION
   ============================================================================ */

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--r3) var(--r4);
    margin-top: var(--r4);
    gap: var(--r5);
    flex-wrap: wrap;
    background: rgba(10, 11, 16, 0.55);
    backdrop-filter: blur(var(--glass-blur)) saturate(160%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
    border: 1px solid var(--hairline);
    border-radius: 999px;
    box-shadow: var(--shadow-paper);
}

.nav__brand {
    display: inline-flex;
    align-items: center;
    gap: var(--r2);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: -0.015em;
    color: var(--ink);
    text-decoration: none;
    border: 0;
}
.nav__brand .mark {
    display: inline-block;
    width: 22px; height: 22px;
    border-radius: 7px;
    background: var(--grad-accent);
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.18) inset,
        0 6px 18px -4px var(--accent-glow);
    position: relative;
    overflow: hidden;
}
.nav__brand .mark::after {
    content: "";
    position: absolute;
    inset: 1px 1px 50% 1px;
    border-radius: 6px 6px 2px 2px;
    background: linear-gradient(180deg, rgba(255,255,255,0.35), rgba(255,255,255,0));
}
.nav__brand .est { font-family: var(--font-mono); font-size: 10px; color: var(--ink-faint); margin-left: 4px; letter-spacing: 0.12em; text-transform: uppercase; }

.nav__links { display: flex; gap: var(--r4); align-items: center; flex-wrap: wrap; }
.nav__link {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: -0.005em;
    color: var(--ink-soft);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 8px;
    border: 0;
    transition: color .15s, background .15s;
}
.nav__link:hover { color: var(--ink); background: var(--glass); }
.nav__link.is-active { color: var(--ink); background: var(--glass-strong); }

.nav__credits {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-soft);
    border: 1px solid var(--glass-border);
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--glass);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.nav__credits b {
    color: var(--ink);
    font-weight: 600;
    background: var(--grad-accent);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--r2);
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 14px;
    letter-spacing: -0.01em;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid var(--glass-border);
    background: var(--glass);
    color: var(--ink);
    cursor: pointer;
    text-decoration: none;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: transform .12s ease, box-shadow .15s ease, background .15s, border-color .15s, color .15s;
    line-height: 1;
}
.btn:hover {
    background: var(--glass-strong);
    border-color: var(--hairline-2);
    transform: translateY(-1px);
}
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* Primary CTA — gradient with subtle inner highlight */
.btn--tomato {
    background: var(--grad-accent);
    border: 1px solid rgba(255,255,255,0.16);
    color: #ffffff;
    box-shadow:
        0 0 0 1px rgba(124,92,255,0.18),
        0 12px 32px -10px var(--accent-glow),
        inset 0 1px 0 rgba(255,255,255,0.22);
}
.btn--tomato:hover {
    background: var(--grad-accent);
    color: #ffffff;
    box-shadow:
        0 0 0 1px rgba(124,92,255,0.28),
        0 18px 42px -10px var(--accent-glow),
        inset 0 1px 0 rgba(255,255,255,0.28);
}

/* Cobalt = solid blue accent button */
.btn--cobalt {
    background: linear-gradient(180deg, #3a86ff, #2466d8);
    border: 1px solid rgba(255,255,255,0.16);
    color: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.22), 0 8px 22px -10px rgba(45,123,255,0.55);
}
.btn--cobalt:hover { background: linear-gradient(180deg, #4a92ff, #2b73e8); color: #fff; }

/* Sun = amber accent for warnings/tips */
.btn--sun {
    background: linear-gradient(180deg, #ffc269, #f29a2a);
    border: 1px solid rgba(0,0,0,0.18);
    color: #1a1108;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.45), 0 8px 22px -10px rgba(255,181,71,0.45);
}
.btn--sun:hover { color: #1a1108; }

/* Ink = dark filled */
.btn--ink {
    background: linear-gradient(180deg, #1d2030, #11131a);
    border: 1px solid var(--hairline-2);
    color: var(--ink);
}
.btn--ink:hover { background: linear-gradient(180deg, #242838, #161823); }

.btn--ghost {
    background: transparent;
    color: var(--ink-soft);
    border-color: var(--hairline);
}
.btn--ghost:hover { color: var(--ink); background: var(--glass); }

.btn--lg { font-size: 16px; padding: 14px 24px; border-radius: 999px; }
.btn--sm { font-size: 12px; padding: 7px 12px; }

/* ============================================================================
   CARDS / PANELS  (legacy class: .paper)
   ============================================================================ */

.paper {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: var(--r5);
    box-shadow: var(--shadow-paper);
    backdrop-filter: blur(var(--glass-blur)) saturate(140%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%);
    position: relative;
    overflow: hidden;
}
/* Subtle inner top highlight (glass top-light) */
.paper::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, transparent 30%);
    border-radius: inherit;
}

.paper--cobalt {
    background: linear-gradient(135deg, rgba(45,123,255,0.20), rgba(45,123,255,0.06));
    border-color: rgba(45,123,255,0.35);
    color: var(--ink);
}
.paper--tomato {
    background: linear-gradient(135deg, rgba(124,92,255,0.22), rgba(45,123,255,0.10));
    border-color: rgba(124,92,255,0.35);
    color: var(--ink);
}
.paper--sun {
    background: linear-gradient(135deg, rgba(255,181,71,0.16), rgba(255,181,71,0.05));
    border-color: rgba(255,181,71,0.32);
    color: var(--ink);
}
.paper--ink {
    background: linear-gradient(180deg, #0e1019, #060709);
    border-color: var(--hairline-2);
    color: var(--ink);
}

.paper--cobalt .eyebrow,
.paper--tomato .eyebrow,
.paper--ink   .eyebrow,
.paper--sun   .eyebrow { color: var(--ink-soft); -webkit-text-fill-color: var(--ink-soft); background: none; }

/* Old tilt + tape decorations — removed visually but classes preserved */
.paper--tilt-l, .paper--tilt-r { transform: none; }
.paper__corner-tape, .paper__corner-tape--right { display: none; }

/* ============================================================================
   STAMPS / BADGES / TAGS  (legacy classes preserved)
   ============================================================================ */

.stamp {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-soft);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    padding: 5px 11px;
    background: var(--glass);
    backdrop-filter: blur(8px);
    transform: none;
    mix-blend-mode: normal;
}
.stamp--cobalt { color: #79a9ff; border-color: rgba(45,123,255,0.45); background: rgba(45,123,255,0.10); }
.stamp--ink    { color: var(--ink); border-color: var(--hairline-2); background: var(--glass-strong); }
.stamp--lg     { font-size: 11px; padding: 7px 14px; letter-spacing: 0.18em; }

.tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

/* ============================================================================
   FORMS
   ============================================================================ */

label, .label {
    display: block;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--ink-soft);
    margin-bottom: var(--r2);
}

input[type="text"], input[type="password"], input[type="email"], input[type="number"], input[type="file"], textarea, select {
    width: 100%;
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--ink);
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    padding: 11px 14px;
    outline: none;
    border-radius: var(--radius-sm);
    transition: border-color .15s, background .15s, box-shadow .15s;
    line-height: 1.3;
}
input::placeholder, textarea::placeholder { color: var(--ink-faint); }
input[type="text"]:focus, input[type="password"]:focus, input[type="email"]:focus, input[type="number"]:focus, textarea:focus, select:focus {
    border-color: rgba(124,92,255,0.55);
    background: rgba(255,255,255,0.05);
    box-shadow: 0 0 0 4px rgba(124,92,255,0.14);
}
textarea {
    min-height: 120px;
    border-radius: var(--radius-sm);
    background-attachment: local;
    line-height: 1.5;
    resize: vertical;
}
select {
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'><path d='M1 1l5 6 5-6' fill='none' stroke='%23c8cad1' stroke-width='1.5' stroke-linecap='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}
input[type="range"] {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
    margin: 8px 0;
}
input[type="range"]::-webkit-slider-runnable-track {
    height: 4px;
    background: var(--hairline-2);
    border-radius: 999px;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px; height: 18px;
    margin-top: -7px;
    border: 0;
    background: var(--grad-accent);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 0 4px rgba(124,92,255,0.18), 0 4px 12px -2px var(--accent-glow);
}
input[type="range"]::-moz-range-track { height: 4px; background: var(--hairline-2); border-radius: 999px; }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border: 0; background: linear-gradient(135deg, #7c5cff, #2d7bff); border-radius: 50%; cursor: pointer; }

/* ============================================================================
   MESSAGES / TOASTS
   ============================================================================ */

.msg {
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--ink-soft);
    font-family: var(--font-body);
}
.msg--error   { background: rgba(255, 84, 84, 0.10); border-color: rgba(255, 84, 84, 0.45); color: #ffb3b3; }
.msg--success { background: rgba(74, 214, 164, 0.10); border-color: rgba(74, 214, 164, 0.40); color: #a7ecd0; }
.msg--warn    { background: rgba(255, 181, 71, 0.10); border-color: rgba(255, 181, 71, 0.40); color: #ffd49a; }
.msg a { color: inherit; text-decoration: underline; border: 0; }

/* ============================================================================
   HERO BLOCK (legacy class: .print-block)
   ============================================================================ */

.print-block {
    position: relative;
    padding: var(--r9) 0 var(--r8);
}
.print-block__title {
    font-size: clamp(48px, 9vw, 112px);
    font-weight: 700;
    line-height: 0.98;
    letter-spacing: -0.045em;
    margin: 0;
    color: var(--ink);
}
.print-block__title em {
    font-style: normal;
    font-weight: 700;
    background: var(--grad-accent);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    display: inline;
    transform: none;
    margin: 0;
    letter-spacing: -0.045em;
}

/* ============================================================================
   GALLERY / THUMBS
   ============================================================================ */

.thumb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--r4);
}
.thumb {
    position: relative;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: var(--r3);
    text-decoration: none;
    color: var(--ink);
    display: block;
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    transition: transform .18s ease, box-shadow .18s ease, border-color .15s;
    overflow: hidden;
    border-bottom: 1px solid var(--glass-border);
}
.thumb::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255,255,255,0.05), transparent 30%);
    border-radius: inherit;
}
.thumb:hover {
    transform: translateY(-3px);
    border-color: rgba(124,92,255,0.45);
    box-shadow: 0 16px 36px -16px var(--accent-glow);
}
.thumb__art {
    aspect-ratio: 1 / 1;
    background:
        radial-gradient(circle at 30% 20%, rgba(124,92,255,0.10), transparent 60%),
        var(--bg-elev-0);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: var(--r3);
    border: 1px solid var(--hairline);
}
.thumb__art img, .thumb__art object { width: 100%; height: 100%; object-fit: contain; }
.thumb__art--vector { background: var(--bg-elev-0); }
.thumb__art--video {
    color: var(--accent-2);
    font-size: 42px;
}
.thumb__caption {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--r2);
    padding: 0 2px;
}
.thumb__name {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 14px;
    color: var(--ink);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.thumb__meta { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-muted); }
.thumb__num {
    position: absolute;
    top: 10px; right: 12px;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--ink-faint);
    transform: none;
    mix-blend-mode: normal;
    letter-spacing: 0.08em;
}

/* ============================================================================
   CATEGORY TILES — glass icons with depth
   ============================================================================ */

.cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--r4); }
.cat {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    aspect-ratio: 5 / 4;
    padding: var(--r4) var(--r4) var(--r3);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    background: var(--glass);
    text-decoration: none;
    color: var(--ink);
    overflow: hidden;
    backdrop-filter: blur(var(--glass-blur)) saturate(140%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%);
    transition: transform .15s ease, border-color .15s, box-shadow .15s;
}
.cat::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(120% 80% at 50% -10%, rgba(124,92,255,0.12), transparent 60%);
    pointer-events: none;
}
.cat:hover {
    transform: translateY(-2px);
    border-color: rgba(124,92,255,0.45);
    box-shadow: 0 16px 36px -18px var(--accent-glow);
}
.cat:nth-child(3n+2)::before { background: radial-gradient(120% 80% at 50% -10%, rgba(45,123,255,0.14), transparent 60%); }
.cat:nth-child(3n+3)::before { background: radial-gradient(120% 80% at 50% -10%, rgba(74,214,164,0.10), transparent 60%); }
.cat__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px; height: 56px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
    border: 1px solid var(--glass-border);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.10), 0 6px 18px -6px rgba(0,0,0,0.6);
    position: relative;
    overflow: hidden;
}
.cat__icon svg { width: 28px; height: 28px; display: block; }
.cat__icon::after {
    content: "";
    position: absolute;
    inset: 1px 1px 55% 1px;
    border-radius: 13px 13px 4px 4px;
    background: linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0));
    pointer-events: none;
}
.cat__name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 17px;
    letter-spacing: -0.015em;
    color: var(--ink);
}
.cat__index {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-bottom: 4px;
}

/* ============================================================================
   ANIMATIONS — subtle, never bouncy
   ============================================================================ */

@keyframes press-in {
    0%   { transform: scale(0.98); opacity: 0; filter: blur(6px); }
    100% { transform: scale(1); opacity: 1; filter: blur(0); }
}
@keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.anim-press { animation: press-in .45s cubic-bezier(.2,.7,.2,1) both; }
.anim-rise  { animation: rise .55s cubic-bezier(.2,.7,.2,1) both; }
.anim-rise.delay-1 { animation-delay: .05s; }
.anim-rise.delay-2 { animation-delay: .12s; }
.anim-rise.delay-3 { animation-delay: .19s; }
.anim-rise.delay-4 { animation-delay: .26s; }
.anim-rise.delay-5 { animation-delay: .33s; }

@media (prefers-reduced-motion: reduce) {
    .anim-press, .anim-rise { animation: none; }
}

/* ============================================================================
   PRESS / GENERATION OVERLAY
   ============================================================================ */

.press-overlay {
    position: fixed; inset: 0;
    display: none;
    align-items: center; justify-content: center;
    background: rgba(6, 7, 10, 0.72);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    z-index: 9999;
    flex-direction: column;
    gap: var(--r4);
}
.press-overlay.is-on { display: flex; }
.press-overlay__title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(28px, 4vw, 40px);
    letter-spacing: -0.03em;
    color: var(--ink);
    text-align: center;
}
.press-overlay__sub {
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--ink-muted);
    letter-spacing: 0;
}
.press-overlay__bar {
    width: min(60vw, 320px);
    height: 3px;
    background: var(--hairline);
    border-radius: 999px;
    overflow: hidden;
    border: 0;
    position: relative;
}
.press-overlay__bar::after {
    content: "";
    display: block;
    width: 40%; height: 100%;
    background: var(--grad-accent);
    border-radius: 999px;
    animation: slide 1.4s cubic-bezier(.4,.0,.2,1) infinite;
    box-shadow: 0 0 12px var(--accent-glow);
}
@keyframes slide {
    0%   { transform: translateX(-110%); }
    100% { transform: translateX(260%); }
}

/* ============================================================================
   DECORATIONS — neutralized
   ============================================================================ */

.scribble-underline {
    background: none;
    padding-bottom: 0;
    box-shadow: inset 0 -2px 0 rgba(124,92,255,0.45);
}
.arrow-doodle {
    display: inline-block;
    color: var(--accent-2);
    font-family: var(--font-body);
    transform: none;
    margin: 0 .15em;
}
hr.rule {
    border: 0;
    height: 1px;
    margin: var(--r6) 0;
    background: linear-gradient(90deg, transparent, var(--hairline-2), transparent);
}

/* ============================================================================
   SECTION HEADERS
   ============================================================================ */

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--r4);
    margin-bottom: var(--r5);
    border-bottom: 1px solid var(--hairline);
    padding-bottom: var(--r4);
}
.section-head h2 { margin: 0; }
.section-head__no { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint); }

/* ============================================================================
   FOOTER
   ============================================================================ */

.foot {
    margin-top: var(--r9);
    padding: var(--r6) var(--r4);
    border-top: 1px solid var(--hairline);
    color: var(--ink-faint);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.10em;
    text-transform: uppercase;
}
.foot__row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--r4); }
.foot a { color: var(--ink-muted); border: 0; }
.foot a:hover { color: var(--ink); }

/* ============================================================================
   UTILITIES
   ============================================================================ */

.muted { color: var(--ink-muted); }
.center { text-align: center; }
.between { display: flex; justify-content: space-between; align-items: center; gap: var(--r4); flex-wrap: wrap; }
.gap-2 { gap: var(--r2); } .gap-3 { gap: var(--r3); } .gap-4 { gap: var(--r4); }
.mt-0 { margin-top: 0; } .mt-2 { margin-top: var(--r2); } .mt-3 { margin-top: var(--r3); } .mt-4 { margin-top: var(--r4); } .mt-5 { margin-top: var(--r5); } .mt-6 { margin-top: var(--r6); }
.mb-0 { margin-bottom: 0; } .mb-3 { margin-bottom: var(--r3); } .mb-4 { margin-bottom: var(--r4); } .mb-5 { margin-bottom: var(--r5); }

/* Focus visibility */
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 4px; }

/* ============================================================================
   PER-CATEGORY COLORS  (consumed by .cat__icon SVG and .cat::before glow)
   ============================================================================ */

.cat--sports     { --cat-from: #ff8a8e; --cat-to: #ff3a47; }
.cat--corporate  { --cat-from: #5a9aff; --cat-to: #2d7bff; }
.cat--badge      { --cat-from: #ffd089; --cat-to: #f5a623; }
.cat--law        { --cat-from: #c8a3ff; --cat-to: #8b5cf6; }
.cat--minimalist { --cat-from: #e7e9ee; --cat-to: #98a0b3; }
.cat--vintage    { --cat-from: #e0b87a; --cat-to: #b8843a; }
.cat--mascot     { --cat-from: #ff95bc; --cat-to: #ff5e8c; }
.cat--luxury     { --cat-from: #ffc89e; --cat-to: #d97a3a; }
.cat--tech       { --cat-from: #7ee6ff; --cat-to: #2bb8e6; }
.cat--artistic   { --cat-from: #d8a3ff; --cat-to: #a472ff; }
.cat--cute       { --cat-from: #ff9ed8; --cat-to: #ff5dbe; }
.cat--nature     { --cat-from: #7eebbc; --cat-to: #2ab87a; }

.cat::before {
    background: radial-gradient(120% 80% at 50% -10%,
        color-mix(in srgb, var(--cat-from, #9d80ff) 28%, transparent),
        transparent 60%);
}
.cat__icon {
    border-color: color-mix(in srgb, var(--cat-from, #ffffff) 22%, var(--glass-border));
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.10),
        0 6px 18px -6px color-mix(in srgb, var(--cat-from, #000) 40%, rgba(0,0,0,0.6));
}
.cat:hover {
    border-color: color-mix(in srgb, var(--cat-from, #7c5cff) 55%, var(--glass-border));
    box-shadow: 0 16px 36px -18px color-mix(in srgb, var(--cat-from, #7c5cff) 70%, transparent);
}

/* Drop the index numerals everywhere */
.cat__index { display: none; }

/* Override the global :nth-child glow stripes so the per-category color stays primary */
.cat:nth-child(3n+2)::before,
.cat:nth-child(3n+3)::before { background: radial-gradient(120% 80% at 50% -10%,
    color-mix(in srgb, var(--cat-from, #9d80ff) 28%, transparent), transparent 60%); }

/* ============================================================================
   MOBILE NAV — hamburger, slide-down drawer, bottom tab bar
   ============================================================================ */

.nav__mobile-actions { display: none; align-items: center; gap: var(--r2); }
.nav__credits--mobile {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.06em;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--ink-soft);
}
.nav__credits--mobile b {
    color: var(--ink);
    background: var(--grad-accent);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 600;
}

.nav__hamburger {
    width: 40px; height: 40px;
    display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 5px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    cursor: pointer;
    padding: 0;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.nav__hamburger span {
    display: block;
    width: 18px;
    height: 1.5px;
    background: var(--ink);
    border-radius: 2px;
    transition: transform .2s, opacity .2s;
}

/* Drawer (full-screen overlay on phone) */
.nav-drawer {
    position: fixed;
    inset: 0;
    z-index: 9990;
    background: rgba(6, 7, 10, 0.55);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    opacity: 0; pointer-events: none;
    transition: opacity .2s ease;
    display: flex; align-items: flex-start; justify-content: center;
}
.nav-drawer.is-open { opacity: 1; pointer-events: auto; }
.nav-drawer__panel {
    width: 100%;
    max-width: 480px;
    padding: var(--r4);
    padding-top: max(var(--r4), env(safe-area-inset-top));
    transform: translateY(-12px);
    transition: transform .25s cubic-bezier(.2,.7,.2,1);
}
.nav-drawer.is-open .nav-drawer__panel { transform: translateY(0); }
.nav-drawer__head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: var(--r5);
}
.nav-drawer__close {
    width: 40px; height: 40px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    cursor: pointer;
    color: var(--ink);
}
.nav-drawer__close svg { width: 18px; height: 18px; }
.nav-drawer__list { display: flex; flex-direction: column; gap: 6px; }
.nav-drawer__row {
    display: flex; align-items: center; gap: var(--r3);
    padding: 14px 16px;
    border-radius: 14px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--ink);
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 500;
    letter-spacing: -0.01em;
    transition: background .15s, border-color .15s;
}
.nav-drawer__row:hover { background: var(--glass-strong); }
.nav-drawer__row.is-active {
    background: linear-gradient(135deg, rgba(124,92,255,0.20), rgba(45,123,255,0.10));
    border-color: rgba(124,92,255,0.45);
}
.nav-drawer__icon {
    width: 36px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px;
    background: var(--glass-strong);
    border: 1px solid var(--glass-border);
    color: var(--accent-2);
}
.nav-drawer__icon svg { width: 20px; height: 20px; }
.nav-drawer__meta {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--ink-muted);
}
.nav-drawer__divider {
    height: 1px;
    background: var(--hairline);
    margin: var(--r3) var(--r3);
}

/* Bottom tab bar — phone only (hidden on desktop) */
.tabbar {
    position: fixed;
    left: 0; right: 0;
    bottom: 0;
    z-index: 900;
    display: none;
    background: rgba(8, 9, 14, 0.78);
    backdrop-filter: blur(24px) saturate(170%);
    -webkit-backdrop-filter: blur(24px) saturate(170%);
    border-top: 1px solid var(--hairline);
    padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
    justify-content: space-around;
    align-items: stretch;
    gap: 2px;
}
.tabbar__item {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 4px;
    padding: 6px 4px 4px;
    text-decoration: none;
    color: var(--ink-muted);
    border: 0;
    border-radius: 10px;
    transition: color .15s;
    -webkit-tap-highlight-color: transparent;
}
.tabbar__item:hover { color: var(--ink-soft); }
.tabbar__item.is-active { color: var(--ink); }
.tabbar__item.is-active .tabbar__icon {
    background: var(--grad-accent);
    color: #fff;
    box-shadow: 0 6px 18px -6px var(--accent-glow);
}
.tabbar__icon {
    width: 38px; height: 30px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px;
    transition: background .15s, color .15s, box-shadow .15s;
}
.tabbar__icon svg { width: 20px; height: 20px; }
.tabbar__label {
    font-family: var(--font-body);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0;
}
.tabbar__item--cta .tabbar__icon { background: var(--grad-accent); color: #fff; }

/* ============================================================================
   RESPONSIVE — tablet → phone
   Mobile-first defaults stay above; rules below tighten the layout down.
   ============================================================================ */

/* Tablet and below */
@media (max-width: 960px) {
    .shell { padding: 0 var(--r4); }
    .print-block { padding: var(--r8) 0 var(--r7); }
    .print-block__title { font-size: clamp(44px, 8vw, 88px); }
    h1, .display-1 { font-size: clamp(36px, 6vw, 80px); }
    .thumb-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--r3); }
    .cat-grid    { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--r3); }
    .section-head { gap: var(--r3); }
}

/* Phone */
@media (max-width: 720px) {
    body { font-size: 14px; line-height: 1.5; padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
    .shell { padding: 0 var(--r3); }

    /* Nav: keep the pill horizontal — brand on left, mobile actions on right.
       Desktop link row is hidden in favor of the hamburger drawer + tab bar. */
    .nav {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: var(--r2);
        padding: 8px 8px 8px 14px;
        border-radius: 999px;
        margin-top: var(--r3);
    }
    .nav__brand { font-size: 14px; }
    .nav__brand .est { display: none; }
    .nav__links--desktop { display: none; }
    .nav__mobile-actions { display: inline-flex; }

    /* Drawer is mobile-only */
    .tabbar { display: flex; }

    /* Hero */
    .print-block { padding: var(--r6) 0 var(--r5); }
    .print-block__title { font-size: clamp(40px, 11vw, 64px); line-height: 1; }
    h1, .display-1 { font-size: clamp(32px, 9vw, 56px); }
    h2, .display-2 { font-size: clamp(24px, 6vw, 36px); }
    h3 { font-size: 18px; }

    /* Cards/panels */
    .paper { padding: var(--r4); border-radius: var(--radius); }
    hr.rule { margin: var(--r5) 0; }

    /* Grids */
    .thumb-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--r3); }

    /* Category grid → homescreen-style: 4 columns of square icon tiles with name below */
    .cat-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--r3) var(--r3);
    }
    .cat {
        aspect-ratio: 1 / 1;
        padding: 0;
        background: transparent;
        border: 0;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: 8px;
        overflow: visible;
    }
    .cat::before { display: none; }
    .cat:hover { transform: none; box-shadow: none; border: 0; }
    .cat:active .cat__icon { transform: scale(0.93); }
    .cat__icon {
        width: 100%;
        max-width: 64px;
        aspect-ratio: 1 / 1;
        height: auto;
        border-radius: 18px;
        background:
            radial-gradient(120% 100% at 50% 0%, color-mix(in srgb, var(--cat-from, #fff) 45%, transparent), transparent 70%),
            linear-gradient(180deg,
                color-mix(in srgb, var(--cat-from, #fff) 22%, var(--bg-elev-1)),
                color-mix(in srgb, var(--cat-to,   #fff) 14%, var(--bg-elev-0)));
        border: 1px solid color-mix(in srgb, var(--cat-from, #fff) 30%, var(--glass-border));
        box-shadow:
            inset 0 1px 0 rgba(255,255,255,0.20),
            0 8px 18px -6px color-mix(in srgb, var(--cat-from, #000) 50%, rgba(0,0,0,0.6));
        transition: transform .12s ease;
    }
    .cat__icon::after {
        content: "";
        position: absolute;
        inset: 1px 1px 55% 1px;
        border-radius: 17px 17px 4px 4px;
        background: linear-gradient(180deg, rgba(255,255,255,0.28), rgba(255,255,255,0));
        pointer-events: none;
    }
    .cat__icon svg { width: 60%; height: 60%; }
    .cat__name {
        font-size: 11.5px;
        font-weight: 500;
        text-align: center;
        line-height: 1.15;
        color: var(--ink-soft);
        letter-spacing: -0.005em;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Forms — single column, larger touch targets */
    input[type="text"], input[type="password"], input[type="email"], input[type="number"], input[type="file"], textarea, select {
        font-size: 16px; /* prevents iOS auto-zoom on focus */
        padding: 12px 14px;
    }

    /* Buttons */
    .btn       { padding: 11px 18px; font-size: 14px; }
    .btn--lg   { padding: 14px 22px; font-size: 15px; }
    .btn--sm   { padding: 8px 12px;  font-size: 12px; }

    /* Section heads stack vertically */
    .section-head { flex-direction: column; align-items: flex-start; gap: var(--r2); padding-bottom: var(--r3); }
    .section-head__no { font-size: 10px; }

    /* Generator: two-column row collapses naturally via flex-wrap;
       just shrink the gap so they hug the screen edge. */
    .row { gap: var(--r3); }

    /* Press overlay */
    .press-overlay__title { font-size: clamp(22px, 6vw, 32px); }
    .press-overlay__bar { width: min(75vw, 280px); }

    /* Footer */
    .foot { padding: var(--r5) var(--r3); }
    .foot__row { flex-direction: column; gap: var(--r2); }
}

/* Small phone */
@media (max-width: 420px) {
    .shell { padding: 0 var(--r3); }
    .print-block__title { font-size: clamp(36px, 12vw, 52px); }
    .cat-grid   { grid-template-columns: repeat(4, 1fr); gap: var(--r2); }
    .cat__icon  { max-width: 56px; border-radius: 16px; }
    .cat__name  { font-size: 10.5px; }
    .thumb-grid { grid-template-columns: repeat(2, 1fr); }
    .btn--lg    { padding: 12px 16px; font-size: 14px; }
    .paper      { padding: var(--r3); }
}
