/* ===========================================================================
   desca.dev — Lisbon back-alley pinned under museum vitrine glass.
   Single-column zine measure, candy-bright graffiti, vintage halftone substrate.
   =========================================================================== */

:root {
    --cream: #fff5e6;
    --ink: #1b1a1f;
    --cherry: #ff2d6f;
    --bubblegum: #ffb3d1;
    --mint: #37e8a4;
    --cobalt: #3d56ff;
    --saturn: #ffd23f;
    --vacuum: #0d0c10;

    --col: 640px;
    --baseline: 24px;

    --font-display: "Space Grotesk", "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --font-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--cream);
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 18px;
    line-height: 1.62;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

@media (min-width: 768px) {
    html, body { font-size: 19px; }
}

body {
    overflow-x: hidden;
    position: relative;
}

a {
    color: var(--ink);
    text-decoration: none;
    background-image:
        linear-gradient(to right, var(--ink) 0, var(--ink) 100%),
        linear-gradient(to right, var(--cherry) 0, var(--cherry) 100%);
    background-position: 0 100%, 0 100%;
    background-repeat: no-repeat, no-repeat;
    background-size: 100% 1px, 0% 3px;
    padding-bottom: 4px;
    transition: background-size 280ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
a:hover {
    background-size: 100% 1px, 100% 3px;
    color: var(--ink);
}

p, ol, ul, blockquote {
    margin: 0 0 var(--baseline) 0;
}

em { font-style: italic; }

code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    color: var(--ink);
    background: rgba(61, 86, 255, 0.08);
    padding: 1px 6px;
    border-bottom: 2px solid var(--cobalt);
}

/* ===== Curtain rise ===== */
.curtain {
    position: fixed;
    inset: 0;
    background: var(--ink);
    z-index: 9999;
    pointer-events: none;
    opacity: 1;
    transition: opacity 200ms ease-out;
}
.curtain.lifted { opacity: 0; }

/* ===== Studio mark (top-left, scrolls with page) ===== */
.studio-mark {
    position: absolute;
    top: 24px;
    left: 24px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    padding: 0;
    z-index: 5;
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: lowercase;
    color: var(--ink);
}
.studio-mark span {
    border-bottom: 1px solid var(--ink);
    padding-bottom: 2px;
}

/* ===== Drip column (full-height right gutter) ===== */
.drip-column {
    position: fixed;
    top: 0;
    right: 16px;
    width: 24px;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    opacity: 0.85;
}

/* ===== SVG defs holder ===== */
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ===== Main container ===== */
main {
    position: relative;
    z-index: 1;
    max-width: 100%;
}

/* ===========================================================================
   MASTHEAD
   =========================================================================== */
.masthead {
    position: relative;
    height: 560px;
    background: var(--cream);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.masthead-inner {
    width: min(var(--col), calc(100vw - 48px));
    text-align: left;
    position: relative;
    z-index: 2;
}
.masthead-tag {
    width: 100%;
    margin-bottom: 16px;
}
.bubble-tag {
    width: 100%;
    height: auto;
    display: block;
    overflow: visible;
}
.bubble-letter {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
}
.bubble-letter.drawn {
    animation: drawStroke 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.bubble-letter.filled {
    fill: attr(data-fill-color);
}
@keyframes drawStroke {
    to { stroke-dashoffset: 0; }
}

.bubble-fill-mask {
    transform-origin: center bottom;
    transform: scaleY(0);
    transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1);
}
.bubble-fill-mask.poured { transform: scaleY(1); }

.masthead-tagline {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--ink);
    letter-spacing: 0.02em;
    margin: 0 0 32px 0;
    min-height: 22px;
}
.masthead-tagline .cursor::after {
    content: "_";
    display: inline-block;
    margin-left: 2px;
    color: var(--saturn);
    animation: blink 1s steps(2) infinite;
    font-weight: 700;
}
.masthead-tagline.done .cursor::after { content: ""; }

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.masthead-meta {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--ink);
    opacity: 0.7;
    letter-spacing: 0.05em;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.meta-dot { color: var(--cherry); font-weight: 700; }

.reg {
    position: absolute;
    width: 16px;
    height: 16px;
    opacity: 0.5;
}
.reg.tl { top: 16px; left: 16px; }
.reg.tr { top: 16px; right: 16px; }
.reg.bl { bottom: 16px; left: 16px; }
.reg.br { bottom: 16px; right: 16px; }

/* ===========================================================================
   SCROLL SECTIONS
   =========================================================================== */
.scroll {
    position: relative;
    width: min(var(--col), calc(100vw - 48px));
    margin: 0 auto;
    padding: 96px 0 48px 0;
    z-index: 2;
}

.scroll h2 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 48px;
    line-height: 1.04;
    letter-spacing: -0.014em;
    margin: 0 0 24px 0;
    position: relative;
    display: inline-block;
}

.scroll h3 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 22px;
    line-height: 1.2;
    letter-spacing: -0.01em;
    margin: 48px 0 16px 0;
}

.scroll p {
    margin: 0 0 var(--baseline) 0;
}

/* Underline-draw under h2 */
.scroll h2::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -10px;
    height: 8px;
    background: none;
    pointer-events: none;
}
.scroll h2 .underline-svg {
    position: absolute;
    left: 0;
    bottom: -14px;
    width: 105%;
    height: 12px;
    overflow: visible;
}
.scroll h2 .underline-svg path {
    stroke: var(--cherry);
    stroke-width: 5;
    fill: none;
    stroke-linecap: round;
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    transition: stroke-dashoffset 600ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.scroll h2.in-view .underline-svg path { stroke-dashoffset: 0; }

/* ===== Callouts (italic, indented, cherry rule) ===== */
.callout {
    display: block;
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.05em;
    line-height: 1.5;
    margin: 32px 0 32px 24px;
    padding: 4px 0 4px 20px;
    border-left: 3px solid var(--cherry);
    color: var(--ink);
}

/* ===== Numbered procedure steps (mono) ===== */
ol.proc {
    list-style: none;
    padding: 0;
    margin: 24px 0;
}
ol.proc li {
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.65;
    margin-bottom: 14px;
    padding-left: 8px;
}
ol.proc .num {
    color: var(--cherry);
    font-weight: 700;
    margin-right: 8px;
}

/* ===== Field-note bullets (spray dot marker) ===== */
ul.field-notes {
    list-style: none;
    padding: 0;
    margin: 24px 0;
}
ul.field-notes li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 16px;
    line-height: 1.62;
}
ul.field-notes .bullet {
    position: absolute;
    left: 0;
    top: 8px;
    width: 14px;
    height: 14px;
}

/* ===== Letter blockquotes ===== */
.letter {
    margin: 32px 0;
    padding: 0 0 0 20px;
    border-left: 3px solid var(--cherry);
}
.letter p {
    font-style: italic;
    line-height: 1.55;
    margin-bottom: 12px;
}
.letter footer {
    font-family: var(--font-mono);
    font-size: 13px;
    font-style: normal;
    color: var(--ink);
    opacity: 0.75;
    letter-spacing: 0.03em;
}

/* ===========================================================================
   GUTTER GRAFFITI (parallax behind column)
   =========================================================================== */
.gutter {
    position: absolute;
    top: 40px;
    z-index: -1;
    pointer-events: none;
    will-change: transform;
}
.gutter-right {
    right: calc(50% - var(--col)/2 - 240px);
    width: 220px;
    transform: translateY(60px);
}
.gutter-left {
    left: calc(50% - var(--col)/2 - 280px);
    width: 240px;
    top: 120px;
    transform: translateY(60px);
}
@media (max-width: 1100px) {
    .gutter { display: none; }
}

.num-tag {
    width: 100%;
    height: auto;
    overflow: visible;
}
.throwup {
    width: 100%;
    height: auto;
    overflow: visible;
    opacity: 0.75;
}

/* ===========================================================================
   COMPOSITE FIGURES (halftone + spray + index card)
   =========================================================================== */
.composite {
    position: relative;
    margin: 48px 0 56px 0;
    padding: 0;
}
.halftone-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 5 / 3;
    overflow: visible;
    background: var(--cream);
    box-shadow: 0 0 0 1px var(--ink);
}
.halftone {
    width: 100%;
    height: 100%;
    display: block;
    filter: grayscale(1) contrast(1.4) sepia(0.18);
    mix-blend-mode: multiply;
}
.spray-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
.tag-scar {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 40px;
    height: 24px;
    opacity: 0.7;
}
.date-stamp {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 64px;
    height: 64px;
    border: 2px solid var(--cobalt);
    border-radius: 50%;
    color: var(--cobalt);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(-8deg);
    background: rgba(255, 245, 230, 0.6);
    letter-spacing: 0.04em;
    opacity: 0.85;
}

.caption {
    position: absolute;
    bottom: -36px;
    left: 24px;
    width: 240px;
    max-width: 240px;
    min-height: 64px;
    padding: 10px 14px;
    background: var(--cream);
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.45;
    box-shadow: 3px 3px 0 var(--ink);
    transform: rotate(var(--card-rotate, -1.4deg));
    z-index: 4;
    /* Torn-edge-ish: jagged bottom via clip-path */
    clip-path: polygon(0 0, 100% 0, 100% 92%, 96% 100%, 88% 94%, 80% 100%, 72% 92%, 64% 100%, 56% 94%, 48% 100%, 40% 92%, 32% 100%, 24% 94%, 16% 100%, 8% 92%, 0 100%);
}

/* ===========================================================================
   COLOPHON (inverted, near-black field)
   =========================================================================== */
.colophon {
    position: relative;
    margin-top: 96px;
    padding: 96px 0 80px 0;
    background: var(--vacuum);
    width: 100vw;
    margin-left: calc(50% - 50vw);
    overflow: hidden;
    color: var(--cream);
}
.colophon::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(255, 45, 111, 0.04), transparent 60%);
    pointer-events: none;
}
.colophon > h2,
.colophon > p,
.colophon > .final-rule {
    width: min(var(--col), calc(100vw - 48px));
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 2;
}
.colophon h2.invert-h {
    color: var(--cream);
    margin-top: 0;
}
.colophon h2.invert-h .underline-svg path { stroke: var(--cherry); }

.colophon p.invert {
    color: var(--cream);
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.7;
    letter-spacing: 0.01em;
    opacity: 0.9;
}
.colophon p.invert em { color: var(--bubblegum); font-style: italic; }
.colophon p.invert code {
    color: var(--mint);
    background: rgba(55, 232, 164, 0.1);
    border-bottom-color: var(--mint);
}
.colophon a.mailto {
    color: var(--cream);
    background-image:
        linear-gradient(to right, var(--cream) 0, var(--cream) 100%),
        linear-gradient(to right, var(--cherry) 0, var(--cherry) 100%);
    font-family: var(--font-mono);
    font-size: 14px;
}
.cta-label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--saturn);
    margin-right: 12px;
}

.colophon .credits {
    margin-top: 64px;
    font-size: 11px;
    opacity: 0.55;
}

.colophon .gutter-right {
    right: calc(50% - var(--col)/2 - 240px);
    top: 40px;
}

.stencil-d {
    position: absolute;
    top: 50%;
    left: calc(50% + var(--col)/2);
    transform: translate(-30%, -50%);
    width: 600px;
    height: 600px;
    z-index: 1;
    pointer-events: none;
    opacity: 0.6;
}
@media (max-width: 1100px) {
    .stencil-d { left: 50%; transform: translate(-50%, -50%); width: 80vw; height: 80vw; opacity: 0.18; }
    .colophon .gutter-right { display: none; }
}

.final-rule {
    height: 1px;
    background: var(--cherry);
    margin-top: 48px;
    width: 60px !important;
}

/* ===========================================================================
   Drip column animation
   =========================================================================== */
.drip-shape {
    fill: var(--cherry);
    opacity: 0.8;
}

/* ===========================================================================
   Responsive
   =========================================================================== */
@media (max-width: 700px) {
    .scroll h2 { font-size: 36px; }
    .scroll { padding: 64px 0 32px 0; }
    .masthead { height: 440px; }
    .caption { width: 200px; left: 8px; bottom: -28px; }
    .studio-mark { top: 16px; left: 16px; }
    .drip-column { right: 4px; width: 16px; }
}

/* Reduced motion: drips and underlines appear without animating. */
@media (prefers-reduced-motion: reduce) {
    .bubble-letter { stroke-dashoffset: 0 !important; animation: none !important; }
    .scroll h2 .underline-svg path { stroke-dashoffset: 0 !important; }
    .gutter { transform: translateY(0) !important; }
}
