/* =============================================================
   PPUZZL.in v2 — Editorial Dopamine
   Issue No. 027 / Vol. III
   ============================================================= */

:root {
    /* Dopamine-Neon palette */
    --studio-black: #0B0B12;
    --bone-paper: #F4F1E8;
    --electric-coral: #FF3D6E;
    --acid-lime: #C8FF3D;
    --cyber-violet: #6B3DFF;
    --solar-tangerine: #FFB13D;
    --tidal-cyan: #3DE0FF;
    --soft-ash: #B8B5AC;

    /* perspective tiers */
    --z-bg: -2;
    --z-ribbon: -1;
    --z-body: 0;
    --z-margin: 1;
    --z-hover: 2;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

html, body {
    background: var(--studio-black);
    color: var(--bone-paper);
    font-family: 'Commissioner', 'Inter', system-ui, sans-serif;
    font-weight: 500;
    font-size: 17px;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    perspective: 1200px;
    perspective-origin: 50% 30%;
}

::selection {
    background: var(--electric-coral);
    color: var(--studio-black);
}

/* =============================================================
   BOKEH FIELD (z: -2)
   ============================================================= */
.bokeh-field {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -2;
    mix-blend-mode: screen;
    overflow: hidden;
    filter: hue-rotate(0deg);
    animation: hue-breathe 18s ease-in-out infinite;
}

@keyframes hue-breathe {
    0%, 100% { filter: hue-rotate(0deg); }
    50% { filter: hue-rotate(12deg); }
}

.bokeh {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    will-change: transform;
    --drift-y: 60px;
    --drift-duration: 18s;
    animation: drift var(--drift-duration) ease-in-out infinite;
}

@keyframes drift {
    0%   { transform: translate3d(0, 0, 0); }
    50%  { transform: translate3d(20px, calc(var(--drift-y) * -1), 0); }
    100% { transform: translate3d(0, 0, 0); }
}

/* Twelve bokeh balls — alternating dopamine hues, sizes 80-260, positions, durations */
.bokeh.b1 {
    width: 240px; height: 240px;
    top: 6%; left: 8%;
    background: radial-gradient(circle, hsla(346, 95%, 60%, 0.42) 0%, transparent 70%);
    --drift-y: 70px; --drift-duration: 22s;
}
.bokeh.b2 {
    width: 180px; height: 180px;
    top: 14%; left: 62%;
    background: radial-gradient(circle, hsla(34, 95%, 60%, 0.40) 0%, transparent 70%);
    --drift-y: 50px; --drift-duration: 17s;
}
.bokeh.b3 {
    width: 260px; height: 260px;
    top: 30%; left: 80%;
    background: radial-gradient(circle, hsla(260, 95%, 60%, 0.45) 0%, transparent 70%);
    --drift-y: 90px; --drift-duration: 24s;
}
.bokeh.b4 {
    width: 140px; height: 140px;
    top: 32%; left: 12%;
    background: radial-gradient(circle, hsla(74, 95%, 60%, 0.36) 0%, transparent 70%);
    --drift-y: 40px; --drift-duration: 16s;
}
.bokeh.b5 {
    width: 220px; height: 220px;
    top: 48%; left: 44%;
    background: radial-gradient(circle, hsla(190, 95%, 60%, 0.40) 0%, transparent 70%);
    --drift-y: 80px; --drift-duration: 21s;
}
.bokeh.b6 {
    width: 160px; height: 160px;
    top: 58%; left: 72%;
    background: radial-gradient(circle, hsla(346, 95%, 60%, 0.38) 0%, transparent 70%);
    --drift-y: 55px; --drift-duration: 19s;
}
.bokeh.b7 {
    width: 200px; height: 200px;
    top: 64%; left: 6%;
    background: radial-gradient(circle, hsla(34, 95%, 60%, 0.36) 0%, transparent 70%);
    --drift-y: 65px; --drift-duration: 20s;
}
.bokeh.b8 {
    width: 110px; height: 110px;
    top: 74%; left: 36%;
    background: radial-gradient(circle, hsla(74, 95%, 60%, 0.40) 0%, transparent 70%);
    --drift-y: 35px; --drift-duration: 15s;
}
.bokeh.b9 {
    width: 250px; height: 250px;
    top: 80%; left: 86%;
    background: radial-gradient(circle, hsla(260, 95%, 60%, 0.40) 0%, transparent 70%);
    --drift-y: 85px; --drift-duration: 25s;
}
.bokeh.b10 {
    width: 130px; height: 130px;
    top: 86%; left: 20%;
    background: radial-gradient(circle, hsla(190, 95%, 60%, 0.36) 0%, transparent 70%);
    --drift-y: 45px; --drift-duration: 18s;
}
.bokeh.b11 {
    width: 190px; height: 190px;
    top: 22%; left: 36%;
    background: radial-gradient(circle, hsla(34, 95%, 60%, 0.32) 0%, transparent 70%);
    --drift-y: 60px; --drift-duration: 23s;
}
.bokeh.b12 {
    width: 80px; height: 80px;
    top: 92%; left: 56%;
    background: radial-gradient(circle, hsla(346, 95%, 60%, 0.40) 0%, transparent 70%);
    --drift-y: 30px; --drift-duration: 14s;
}

/* =============================================================
   CHROMATIC RIBBONS (z: -1)
   ============================================================= */
.ribbon-track {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}
.ribbon {
    position: absolute;
    left: -10%;
    width: 120%;
    height: 1px;
    opacity: 0.55;
}
.ribbon.r-coral {
    top: 22%;
    background: linear-gradient(90deg, transparent, var(--electric-coral), transparent);
    transform: rotate(-1.4deg);
}
.ribbon.r-violet {
    top: 52%;
    background: linear-gradient(90deg, transparent, var(--cyber-violet), transparent);
    transform: rotate(0.6deg);
    height: 1px;
}
.ribbon.r-lime {
    top: 82%;
    background: linear-gradient(90deg, transparent, var(--acid-lime), transparent);
    transform: rotate(-0.8deg);
}

/* =============================================================
   LAYOUT — Editorial grid
   ============================================================= */
.issue {
    position: relative;
    z-index: 0;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 96px;
}

.folio {
    display: flex;
    justify-content: space-between;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--soft-ash);
    border-top: 1px solid rgba(184, 181, 172, 0.25);
    padding: 14px 0;
    margin-bottom: 32px;
}

/* shared heading look */
.section-heading {
    font-family: 'Commissioner', sans-serif;
    font-weight: 900;
    font-variation-settings: 'wght' 900;
    font-size: clamp(48px, 7vw, 96px);
    line-height: 0.92;
    letter-spacing: -0.025em;
    color: var(--bone-paper);
    margin: 8px 0 18px;
    position: relative;
    transition: font-variation-settings 0.35s ease;
}

.section-heading:hover {
    font-variation-settings: 'wght' 800;
}

/* SVG underline injected by JS — see .heading-rule */
.heading-rule {
    display: block;
    width: 100%;
    height: 6px;
    margin-top: 14px;
    overflow: visible;
}
.heading-rule line {
    stroke: var(--tidal-cyan);
    stroke-width: 2;
    stroke-dasharray: 0 1000;
    transition: stroke-dasharray 0.6s ease-out;
}
.heading-rule.is-drawn line {
    stroke-dasharray: 1000 0;
}

.section-subhead {
    font-family: 'Fraunces', Georgia, serif;
    font-style: italic;
    font-weight: 400;
    font-size: 19px;
    color: var(--soft-ash);
    max-width: 600px;
    margin: 6px 0 56px;
    font-variation-settings: "opsz" 14;
}

/* hairline rule with coral ink dot */
.rule-ink {
    position: relative;
    height: 1px;
    background: rgba(184, 181, 172, 0.4);
    margin: 88px 0 0;
}
.rule-ink .ink-dot {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    background: var(--electric-coral);
    border-radius: 50%;
    box-shadow: 0 0 14px rgba(255, 61, 110, 0.5);
}

/* =============================================================
   SECTION 1 — COVER
   ============================================================= */
.cover {
    min-height: 100vh;
    padding-top: 32px;
    padding-bottom: 60px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.masthead {
    margin-top: 60px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.masthead-kicker {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--acid-lime);
    margin-bottom: 18px;
}

.masthead-title {
    font-family: 'Commissioner', sans-serif;
    font-weight: 800;
    font-variation-settings: 'wght' 800;
    font-size: clamp(120px, 18vw, 280px);
    line-height: 0.85;
    letter-spacing: -0.025em;
    color: var(--bone-paper);
    transition: font-variation-settings 0.4s ease, transform 0.4s ease;
    text-shadow:
        0 0 60px rgba(255, 61, 110, 0.18),
        0 0 120px rgba(107, 61, 255, 0.18);
}

.masthead-title:hover {
    font-variation-settings: 'wght' 900;
}

.masthead-tld {
    font-family: 'Fraunces', Georgia, serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(26px, 3vw, 44px);
    color: var(--solar-tangerine);
    margin-top: 14px;
    font-variation-settings: "opsz" 24;
}

.masthead-tld .dot-coral {
    color: var(--electric-coral);
    font-weight: 800;
}

.cover-strap {
    margin-top: 48px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    align-items: end;
    border-top: 1px solid rgba(184, 181, 172, 0.3);
    padding-top: 24px;
}

.strap-quote {
    font-family: 'Fraunces', Georgia, serif;
    font-style: italic;
    font-weight: 700;
    font-size: clamp(22px, 2.4vw, 32px);
    line-height: 1.2;
    max-width: 800px;
    color: var(--bone-paper);
    font-variation-settings: "opsz" 90;
}
.strap-strong {
    color: var(--electric-coral);
    font-style: normal;
    font-weight: 800;
    font-family: 'Commissioner', sans-serif;
    font-variation-settings: 'wght' 800;
}

.strap-meta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--soft-ash);
    letter-spacing: 0.08em;
}

.cover-tags {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 36px;
}

.chip {
    font-family: 'Commissioner', sans-serif;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.18em;
    padding: 8px 14px;
    border-radius: 999px;
    color: var(--studio-black);
}
.chip-coral { background: var(--electric-coral); }
.chip-lime { background: var(--acid-lime); }
.chip-violet { background: var(--cyber-violet); color: var(--bone-paper); }
.chip-cyan { background: var(--tidal-cyan); }

/* =============================================================
   SECTION 2 — EDITOR'S NOTE
   ============================================================= */
.editor-note {
    padding: 80px 0 40px;
    position: relative;
}

.note-wrap {
    position: relative;
    max-width: 720px;
    margin: 24px auto 0;
}

.note-body p {
    font-family: 'Commissioner', sans-serif;
    font-weight: 500;
    font-size: 19px;
    line-height: 1.65;
    color: var(--bone-paper);
    margin-bottom: 22px;
}

/* Drop cap on first paragraph */
.note-body p:first-of-type::first-letter {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 700;
    font-style: italic;
    font-size: 7em;
    line-height: 0.85;
    float: left;
    padding: 0.05em 0.12em 0 0;
    color: var(--electric-coral);
    font-variation-settings: "opsz" 144;
}

/* Marginalia chips, gutter-right at rotation */
.marginalia {
    position: absolute;
    right: -200px;
    width: 170px;
    background: var(--acid-lime);
    color: var(--studio-black);
    padding: 12px 14px;
    font-family: 'Commissioner', sans-serif;
    font-style: italic;
    font-weight: 300;
    font-size: 13.5px;
    line-height: 1.4;
    z-index: 1;
    box-shadow: 4px 6px 0 rgba(11, 11, 18, 0.4);
}

.marg-1 { top: 30px; transform: rotate(-4deg); }
.marg-2 { top: 240px; transform: rotate(3deg); background: var(--solar-tangerine); }
.marg-3 { top: 460px; transform: rotate(-2deg); background: var(--tidal-cyan); }

/* =============================================================
   SECTION 3 — FEATURE CARDS (dopamine grid)
   ============================================================= */
.features {
    padding: 80px 0 40px;
    position: relative;
}

.grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
    perspective: 1200px;
    perspective-origin: 50% 30%;
}

.feature-card {
    position: relative;
    background: var(--bone-paper);
    color: var(--studio-black);
    padding: 28px 28px 32px;
    cursor: pointer;
    overflow: hidden;
    transform-style: preserve-3d;
    transition:
        transform 0.4s cubic-bezier(0.2, 0.9, 0.3, 1),
        filter 0.4s ease,
        box-shadow 0.4s ease;
    box-shadow:
        4px 4px 0 var(--electric-coral),
        12px 12px 0 var(--cyber-violet),
        24px 24px 0 var(--acid-lime);
}

/* asymmetric column spans */
.grid > .feature-card:nth-child(3n+1) { grid-column: span 5; min-height: 320px; }
.grid > .feature-card:nth-child(3n+2) { grid-column: span 7; min-height: 380px; }
.grid > .feature-card:nth-child(3n+3) { grid-column: span 4; min-height: 250px; }

/* z-plane based depth-of-field on deeper cards */
.feature-card.z-1 { z-index: 5; }
.feature-card.z-2 { z-index: 4; filter: saturate(0.92); }
.feature-card.z-3 { z-index: 3; filter: blur(0.6px) saturate(0.85); }
.feature-card.z-4 { z-index: 2; filter: blur(1.4px) saturate(0.7); }

.feature-card:hover {
    z-index: 10;
    filter: none;
    transform: translate3d(0, -8px, 40px) rotateX(-2deg);
    box-shadow:
        6px 6px 0 var(--electric-coral),
        14px 14px 0 var(--cyber-violet),
        28px 28px 0 var(--acid-lime),
        40px 40px 60px rgba(0, 0, 0, 0.4);
}

.z-label {
    position: absolute;
    top: 14px;
    right: 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.12em;
    color: var(--cyber-violet);
    opacity: 0.7;
}

.card-kicker {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--electric-coral);
    margin-bottom: 16px;
}

.card-title {
    font-family: 'Commissioner', sans-serif;
    font-weight: 800;
    font-variation-settings: 'wght' 800;
    font-size: clamp(22px, 2.4vw, 32px);
    line-height: 1.04;
    letter-spacing: -0.022em;
    color: var(--studio-black);
    margin-bottom: 16px;
    transition: font-variation-settings 0.3s ease;
}

.feature-card:hover .card-title {
    font-variation-settings: 'wght' 900;
}

.card-body {
    font-family: 'Commissioner', sans-serif;
    font-weight: 500;
    font-size: 15px;
    line-height: 1.55;
    color: rgba(11, 11, 18, 0.78);
    margin-bottom: 18px;
}

.card-tag {
    display: inline-block;
    font-family: 'Commissioner', sans-serif;
    font-weight: 700;
    font-size: 10px;
    letter-spacing: 0.18em;
    padding: 6px 10px;
    background: var(--studio-black);
    color: var(--acid-lime);
    border-radius: 2px;
}

.card-pull {
    font-family: 'Fraunces', Georgia, serif;
    font-style: italic;
    font-weight: 700;
    font-size: 22px;
    line-height: 1.18;
    margin: 14px 0 18px;
    color: var(--cyber-violet);
    border-left: 3px solid var(--electric-coral);
    padding-left: 14px;
    font-variation-settings: "opsz" 60;
}

/* ripple SVG sits absolutely inside card */
.feature-card .ripple-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}

/* =============================================================
   SECTION 4 — LONG-FORM
   ============================================================= */
.long-form {
    padding: 80px 0 40px;
    position: relative;
}

.article-body {
    max-width: 720px;
    margin: 16px auto 0;
}

.article-cols {
    column-count: 2;
    column-gap: 32px;
    margin-bottom: 32px;
}

.article-cols p {
    font-family: 'Commissioner', sans-serif;
    font-weight: 500;
    font-size: 16px;
    line-height: 1.7;
    color: var(--bone-paper);
    margin-bottom: 16px;
    break-inside: avoid-column;
}

.article-cols .first-para::first-letter {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 700;
    font-style: italic;
    font-size: 5.5em;
    line-height: 0.85;
    float: left;
    padding: 0.04em 0.1em 0 0;
    color: var(--acid-lime);
    font-variation-settings: "opsz" 144;
}

.pull-quote {
    font-family: 'Fraunces', Georgia, serif;
    font-style: italic;
    font-weight: 700;
    font-size: clamp(24px, 3.4vw, 40px);
    line-height: 1.15;
    color: var(--electric-coral);
    margin: 32px 0;
    padding: 28px 0;
    border-top: 1px solid var(--cyber-violet);
    border-bottom: 1px solid var(--cyber-violet);
    text-align: center;
    font-variation-settings: "opsz" 120;
}

.pull-attr {
    display: block;
    font-style: normal;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 12px;
    letter-spacing: 0.15em;
    color: var(--soft-ash);
    margin-top: 14px;
}

/* =============================================================
   SECTION 5 — ISSUE INDEX
   ============================================================= */
.index {
    padding: 80px 0 40px;
    position: relative;
}

.toc {
    list-style: none;
    counter-reset: tocnum;
    max-width: 900px;
    margin: 16px auto 0;
}

.toc li {
    counter-increment: tocnum;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: baseline;
    gap: 18px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(184, 181, 172, 0.3);
    font-family: 'Commissioner', sans-serif;
    font-weight: 700;
    font-size: clamp(18px, 2vw, 24px);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bone-paper);
    transition: color 0.3s ease, padding-left 0.3s ease;
    cursor: default;
}

.toc li::before {
    content: counter(tocnum, decimal-leading-zero);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 12px;
    color: var(--cyber-violet);
    letter-spacing: 0.06em;
    min-width: 24px;
}

.toc li:hover {
    color: var(--acid-lime);
    padding-left: 12px;
}

.toc-title { grid-column: 2; }
.toc-num {
    grid-column: 3;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 14px;
    color: var(--solar-tangerine);
    letter-spacing: 0.08em;
}

/* =============================================================
   SECTION 6 — COLOPHON
   ============================================================= */
.colophon {
    padding: 80px 0 100px;
    position: relative;
}

.colophon-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 48px;
    max-width: 1080px;
    margin: 24px auto 0;
    padding-top: 32px;
    border-top: 1px solid rgba(184, 181, 172, 0.4);
}

.col {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    line-height: 1.9;
    letter-spacing: 0.04em;
    color: var(--bone-paper);
    text-transform: uppercase;
}

.col-head {
    color: var(--electric-coral);
    margin-bottom: 14px;
    letter-spacing: 0.18em;
    font-size: 11px;
    border-bottom: 1px solid rgba(255, 61, 110, 0.4);
    padding-bottom: 6px;
}

.col p:not(.col-head) {
    color: var(--soft-ash);
    font-size: 11.5px;
}

.signoff {
    margin-top: 64px;
    text-align: center;
    font-family: 'Commissioner', sans-serif;
    font-weight: 800;
    font-variation-settings: 'wght' 800;
    font-size: clamp(18px, 2vw, 24px);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--acid-lime);
}

/* =============================================================
   RIPPLES — coral expanding circles on click
   ============================================================= */
.ripple-circle {
    fill: rgba(255, 61, 110, 0.5);
    pointer-events: none;
    animation: ripple-expand 700ms ease-out forwards;
}

@keyframes ripple-expand {
    0%   { r: 0;   fill-opacity: 0.55; }
    100% { r: 600; fill-opacity: 0;    }
}

/* =============================================================
   TABLET — 768-1024
   ============================================================= */
@media (max-width: 1024px) {
    .issue { padding: 0 40px; }

    .grid {
        grid-template-columns: repeat(8, 1fr);
        gap: 20px;
    }
    .grid > .feature-card:nth-child(3n+1) { grid-column: span 4; }
    .grid > .feature-card:nth-child(3n+2) { grid-column: span 4; }
    .grid > .feature-card:nth-child(3n+3) { grid-column: span 4; }

    .marginalia { display: none; }

    .note-wrap { max-width: 100%; }
}

/* =============================================================
   MOBILE — < 768
   ============================================================= */
@media (max-width: 767px) {
    body { font-size: 16px; }
    .issue { padding: 0 20px; }

    .bokeh-field {
        position: fixed;
        background-attachment: fixed;
    }

    .section-heading { font-size: clamp(40px, 11vw, 64px); }

    .masthead-title { font-size: clamp(72px, 22vw, 140px); }

    .grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .grid > .feature-card:nth-child(3n+1),
    .grid > .feature-card:nth-child(3n+2),
    .grid > .feature-card:nth-child(3n+3) {
        grid-column: span 1;
        min-height: auto;
    }

    /* flatten z-planes on mobile */
    .feature-card.z-2,
    .feature-card.z-3,
    .feature-card.z-4 { filter: none; }

    .feature-card {
        box-shadow:
            3px 3px 0 var(--electric-coral),
            8px 8px 0 var(--cyber-violet),
            14px 14px 0 var(--acid-lime);
    }

    .article-cols { column-count: 1; }

    .colophon-grid { grid-template-columns: 1fr; gap: 28px; }

    .cover-strap { grid-template-columns: 1fr; }

    .folio { font-size: 10px; }
}
