/* ============================================================
   hibiki.quest — pop-art dimmed by candlelight
   ============================================================ */

:root {
    --peat-floor:      #1B1410;
    --bothy-hearth:    #2E2218;
    --tallow-cream:    #F2E6D2;
    --tallow-gold:     #E8B23A;
    --litho-vermilion: #C4421F;
    --bottle-green:    #3F6F5E;
    --walnut-bark:     #7A4A2B;

    --col-width: 760px;
    --flicker-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
    min-height: 100vh;
    font-family: "Bricolage Grotesque", system-ui, sans-serif;
    color: var(--tallow-cream);
    /* 1400px radial gradient from Bothy Hearth -> Peat Floor + soot noise */
    background-color: var(--peat-floor);
    background-image:
        radial-gradient(1400px 1400px at 50% 38%, var(--bothy-hearth) 0%, #241B14 42%, var(--peat-floor) 100%),
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/><feColorMatrix type='matrix' values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.5 0'/></filter><rect width='160' height='160' filter='url(%23n)' opacity='0.02'/></svg>");
    background-attachment: fixed, fixed;
    overflow-x: hidden;
}

/* ---------- focus lens ---------- */
/* The lens overlay blurs everything OUTSIDE a 520px circle that follows the pointer. */
#focus-lens {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 50;
    backdrop-filter: blur(2.4px) saturate(0.86) brightness(0.97);
    -webkit-backdrop-filter: blur(2.4px) saturate(0.86) brightness(0.97);
    background: rgba(27, 20, 16, 0.10);
    /* hole punched at --lx / --ly */
    --lx: 50%;
    --ly: 50%;
    -webkit-mask-image: radial-gradient(circle 260px at var(--lx) var(--ly), transparent 0%, transparent 56%, #000 78%, #000 100%);
    mask-image: radial-gradient(circle 260px at var(--lx) var(--ly), transparent 0%, transparent 56%, #000 78%, #000 100%);
    transition: -webkit-mask-image 90ms linear, mask-image 90ms linear;
}

/* the candle bloom that sits behind sharp content, riding the lens centre */
#focus-lens::before {
    content: "";
    position: fixed;
    left: var(--lx);
    top: var(--ly);
    width: 520px;
    height: 520px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(232,178,58,0.16) 0%, rgba(232,178,58,0.04) 60%, rgba(232,178,58,0) 100%);
    /* this layer is decorative; it reads above the blur but below content visually via blend */
    mix-blend-mode: screen;
    z-index: -1;
}

@media (prefers-reduced-motion: reduce) {
    #focus-lens {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: transparent;
        -webkit-mask-image: none;
        mask-image: none;
    }
    #focus-lens::before {
        left: 50%;
        top: 38vh;
        position: fixed;
    }
    html { scroll-behavior: auto; }
}

/* ---------- the candle column ---------- */
.candle-column {
    position: relative;
    width: var(--col-width);
    max-width: calc(100vw - 32px);
    margin: 0 auto;
    padding: 9vh 0 12vh;
    z-index: 1;
}

/* ---------- stanza : 5-beat candle stanza ---------- */
.stanza {
    position: relative;
    margin-bottom: 2px;
}

/* 1. Wick — a 96px pop-art badge */
.wick {
    height: 96px;
    display: flex;
    align-items: center;
}
.wick-left  { justify-content: center; transform: translateX(-13px); }
.wick-right { justify-content: center; transform: translateX(13px); }

.pop-badge {
    font-family: "Frunchy Sage", "Bricolage Grotesque", sans-serif;
    font-size: 64px;
    line-height: 1;
    color: var(--tallow-cream);
    background:
        linear-gradient(7deg, var(--litho-vermilion) 0%, var(--litho-vermilion) 70%, #b23c1c 100%);
    padding: 8px 22px 14px;
    border-radius: 6px;
    box-shadow: 0 6px 24px rgba(196,66,31,0.22), inset 0 2px 0 rgba(255,255,255,0.08);
    /* halftone field receding behind */
    position: relative;
    isolation: isolate;
}
.pop-badge::after {
    content: "";
    position: absolute;
    inset: -18px -26px -26px -18px;
    z-index: -1;
    background-image: radial-gradient(var(--litho-vermilion) 1.3px, transparent 1.4px);
    background-size: 9px 9px;
    transform: rotate(7deg);
    opacity: 0.18;
    border-radius: 10px;
}
.pop-badge-green {
    background: linear-gradient(7deg, var(--bottle-green) 0%, var(--bottle-green) 70%, #375f51 100%);
    box-shadow: 0 6px 24px rgba(63,111,94,0.22), inset 0 2px 0 rgba(255,255,255,0.08);
}
.pop-badge-green::after {
    background-image: radial-gradient(var(--bottle-green) 1.3px, transparent 1.4px);
    opacity: 0.20;
}

/* 2. Flame — focal artwork / quote, sharp inside the halo */
.flame {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 8px 0 0;
}

/* 3. Halo — 64px gauzy radial gradient */
.halo {
    height: 64px;
    background: radial-gradient(ellipse 60% 100% at 50% 0%, rgba(232,178,58,0.10) 0%, rgba(232,178,58,0.03) 55%, transparent 100%);
}

/* 4. Body — 18px reading text, ragged right */
.body {
    max-width: 640px;
    margin: 0 auto;
    padding: 4px 24px 0;
    text-align: left;
}
.body p {
    font-size: 18px;
    line-height: 1.55;
    font-variation-settings: "opsz" 18, "wght" 400;
    color: var(--tallow-cream);
    margin-bottom: 1.05em;
    text-align: left;       /* ragged right */
    text-wrap: pretty;
}

/* brass-rivet list */
.rivet-list {
    list-style: none;
    margin: 0 0 1.2em;
    padding: 0;
}
.rivet-list li {
    position: relative;
    padding-left: 22px;
    font-size: 18px;
    line-height: 1.55;
    margin-bottom: 0.5em;
    font-variation-settings: "opsz" 18, "wght" 400;
}
.rivet-list li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 0.62em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--tallow-gold);
    box-shadow: 0 0 0 1px var(--walnut-bark);
}

/* marginalia — Caveat, tilted, deterministic */
.marginalia {
    font-family: "Caveat", cursive;
    font-weight: 500;
    font-size: 16px !important;
    line-height: 1.4 !important;
    color: var(--walnut-bark);
    font-variation-settings: normal;
    margin: 1.4em 0 0.4em;
    display: inline-block;
}

/* 5. Wax — 4px Tallow Gold rule, thick left, taper right */
.wax {
    display: block;
    width: 100%;
    height: 8px;
    margin: 22px 0 30px;
}
.wax path { fill: var(--tallow-gold); }
.wax::after { content: none; }

/* ---------- masthead ---------- */
.masthead .flame { padding-top: 0; }
.masthead-title {
    font-family: "Bricolage Grotesque", sans-serif;
    font-variation-settings: "opsz" 96, "wght" 380;
    font-size: clamp(72px, 13vw, 132px);
    line-height: 0.92;
    letter-spacing: -0.02em;
    color: var(--tallow-cream);
    text-shadow: 0 2px 30px rgba(232,178,58,0.10);
    transition: font-variation-settings 600ms var(--flicker-ease);
}
.masthead-sub {
    margin-top: 14px;
    font-size: 17px;
    font-variation-settings: "opsz" 14, "wght" 360;
    color: var(--tallow-gold);
    letter-spacing: 0.04em;
}

/* ---------- chamber titles (variable flicker) ---------- */
.chamber-title {
    font-family: "Bricolage Grotesque", sans-serif;
    font-variation-settings: "opsz" 56, "wght" 380;
    font-size: clamp(34px, 5.4vw, 56px);
    line-height: 1.04;
    margin: 14px auto 18px;
    color: var(--tallow-cream);
    text-align: center;
    transition: font-variation-settings 600ms var(--flicker-ease);
}
.chamber-title.lit {
    font-variation-settings: "opsz" 56, "wght" 720;
}
.masthead-title.lit {
    font-variation-settings: "opsz" 96, "wght" 720;
}

/* ---------- echo mark ---------- */
.echo-mark {
    position: relative;
    margin: 4px auto 6px;
    text-align: center;
    isolation: isolate;
    padding: 14px 0 6px;
}
.echo-text {
    font-family: "Frunchy Sage", "Bricolage Grotesque", sans-serif;
    font-size: clamp(84px, 16vw, 124px);
    line-height: 0.9;
    color: var(--litho-vermilion);
    letter-spacing: 0.01em;
    display: inline-block;
    transform: rotate(-2deg);
}
.echo-mark::after {
    content: "";
    position: absolute;
    inset: -6px -10% -10px -10%;
    z-index: -1;
    background-image: radial-gradient(var(--litho-vermilion) 2px, transparent 2.2px);
    background-size: 14px 14px;
    transform: rotate(7deg);
    -webkit-mask-image: linear-gradient(105deg, #000 0%, #000 38%, transparent 86%);
    mask-image: linear-gradient(105deg, #000 0%, #000 38%, transparent 86%);
    opacity: 0.12;
}
.echo-mark-green .echo-text { color: var(--bottle-green); transform: rotate(2deg); }
.echo-mark-green::after { background-image: radial-gradient(var(--bottle-green) 2px, transparent 2.2px); opacity: 0.14; }

/* ---------- hold render (3D-ish candle still-life, CSS) ---------- */
.hold-render {
    position: relative;
    width: var(--col-width);
    max-width: calc(100vw - 32px);
    aspect-ratio: 1 / 1;
    border-radius: 4px;
    overflow: hidden;
    background:
        radial-gradient(circle at 38% 30%, #4a3a2a 0%, #2c2118 40%, #1a130e 100%);
    box-shadow: inset 0 0 90px rgba(0,0,0,0.6), 0 10px 40px rgba(0,0,0,0.4);
    filter: brightness(0.94) sepia(0.06);
    isolation: isolate;
}

/* halftone halo underneath the candle render */
.halftone-halo {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 480px;
    height: 480px;
    max-width: 80%;
    max-height: 80%;
    transform: translate(-50%, -50%) rotate(7deg);
    border-radius: 50%;
    background-image: radial-gradient(var(--litho-vermilion) 2px, transparent 2.3px);
    background-size: 15px 15px;
    -webkit-mask-image: radial-gradient(circle, #000 0%, #000 30%, transparent 75%);
    mask-image: radial-gradient(circle, #000 0%, #000 30%, transparent 75%);
    opacity: 0.12;
    z-index: 0;
}

.render-scene { position: absolute; inset: 0; z-index: 1; }

.oak-slab {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 34%;
    background: linear-gradient(180deg, #3a2a1c 0%, #2a1d12 60%, #1c130c 100%);
    box-shadow: inset 0 8px 24px rgba(0,0,0,0.4);
}
.oak-slab::after {
    content: "";
    position: absolute; inset: 0;
    background-image: repeating-linear-gradient(92deg, rgba(0,0,0,0.12) 0 2px, transparent 2px 28px);
    opacity: 0.5;
}

/* clay/pewter holder — base form, rotated per chamber via modifier */
.holder {
    position: absolute;
    left: 50%;
    bottom: 30%;
    width: 150px;
    height: 90px;
    transform: translateX(-50%);
    background: radial-gradient(ellipse at 35% 25%, #b4a08a 0%, #8a7560 40%, #574635 100%);
    border-radius: 50% 50% 18px 18px / 60% 60% 18px 18px;
    box-shadow: inset 0 -10px 20px rgba(0,0,0,0.35), 0 6px 14px rgba(0,0,0,0.4);
}
.holder::before { /* throw-marks */
    content: "";
    position: absolute; inset: 0;
    border-radius: inherit;
    background-image: repeating-radial-gradient(ellipse at 50% 100%, transparent 0 6px, rgba(0,0,0,0.05) 6px 7px);
}
.holder-hand  { transform: translateX(-50%) rotate(0deg);  border-radius: 60% 40% 22px 22px / 70% 50% 22px 22px; }
.holder-bell  { transform: translateX(-50%) rotate(17deg); border-radius: 50% 50% 14px 14px / 75% 75% 14px 14px; width: 130px; }
.holder-rope  { transform: translateX(-50%) rotate(34deg); border-radius: 42px;  width: 140px; height: 96px; }
.holder-stone { transform: translateX(-50%) rotate(51deg); border-radius: 46% 54% 40% 60% / 50% 50% 50% 50%; }
.holder-stone::after { /* hole through it */
    content: "";
    position: absolute;
    left: 56%; top: 38%;
    width: 30px; height: 30px;
    transform: translate(-50%,-50%);
    border-radius: 50%;
    background: radial-gradient(circle, #1a130c 0%, #2a1d12 70%, transparent 100%);
}

/* the candle */
.candle {
    position: absolute;
    left: 50%;
    bottom: 41%;
    transform: translateX(-50%);
    z-index: 2;
}
.candle-stick {
    width: 34px;
    height: 120px;
    margin: 0 auto;
    background: linear-gradient(95deg, #d9c9ac 0%, #f2e6d2 35%, #cdbb9c 100%);
    border-radius: 5px 5px 2px 2px;
    box-shadow: inset -6px 0 12px rgba(0,0,0,0.18), 0 0 30px rgba(242,230,210,0.12);
}
.candle-flame {
    width: 16px;
    height: 30px;
    margin: 0 auto -3px;
    border-radius: 50% 50% 50% 50% / 65% 65% 35% 35%;
    background: radial-gradient(circle at 50% 70%, #fff4d6 0%, var(--tallow-gold) 45%, #c4421f 95%);
    transform: rotate(11deg);
    transform-origin: bottom center;
    box-shadow: 0 0 24px 8px rgba(232,178,58,0.45), 0 0 60px 26px rgba(232,178,58,0.18);
    filter: blur(0.3px);
    animation: flame-flicker 2.6s ease-in-out infinite;
}
@keyframes flame-flicker {
    0%,100% { transform: rotate(11deg) scaleY(1); opacity: 1; }
    40%     { transform: rotate(9deg)  scaleY(1.06); opacity: 0.94; }
    70%     { transform: rotate(13deg) scaleY(0.97); opacity: 0.98; }
}
@media (prefers-reduced-motion: reduce) {
    .candle-flame { animation: none; }
}

/* pop-art object intruding */
.popart-object { position: absolute; z-index: 3; }
.popart-tin {
    left: 9%;
    bottom: 30%;
    width: 86px;
    height: 110px;
    background: linear-gradient(7deg, var(--litho-vermilion) 0%, var(--litho-vermilion) 70%, #b23c1c 100%);
    border-radius: 4px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.4), inset 0 0 0 4px rgba(242,230,210,0.18);
}
.popart-tin::after {
    content: "";
    position: absolute; inset: 0;
    background-image: radial-gradient(rgba(242,230,210,0.55) 1.6px, transparent 1.8px);
    background-size: 8px 8px;
    border-radius: 4px;
}
.popart-tin-dim { filter: brightness(0.78) saturate(0.85); left: 8%; }
.popart-panel {
    right: 12%;
    top: 14%;
    width: 110px;
    height: 84px;
    background: linear-gradient(7deg, var(--litho-vermilion) 0%, var(--litho-vermilion) 70%, #b23c1c 100%);
    border: 4px solid var(--tallow-cream);
    border-radius: 2px;
    transform: rotate(-5deg);
    box-shadow: 0 8px 18px rgba(0,0,0,0.45);
}
.popart-panel::after {
    content: "";
    position: absolute; inset: 4px;
    background-image: radial-gradient(rgba(27,20,16,0.4) 1.4px, transparent 1.6px);
    background-size: 7px 7px;
}
.popart-pow {
    right: 10%;
    bottom: 30%;
    width: 120px;
    height: 96px;
    background: var(--tallow-cream);
    border-radius: 50% 50% 50% 8px / 55% 55% 55% 8px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 18px rgba(0,0,0,0.4);
    transform: rotate(6deg);
}
.popart-pow span {
    font-family: "Frunchy Sage", sans-serif;
    font-size: 30px;
    color: var(--litho-vermilion);
    transform: rotate(-4deg);
}

/* render haze — thicker on right */
.render-haze {
    position: absolute; inset: 0;
    z-index: 4;
    background: linear-gradient(100deg, rgba(232,178,58,0.0) 0%, rgba(232,178,58,0.04) 50%, rgba(214,170,110,0.10) 100%);
    pointer-events: none;
}
.hold-render::after { /* sitewide candle dim */
    content: "";
    position: absolute; inset: 0;
    z-index: 5;
    background: radial-gradient(circle at 50% 46%, transparent 30%, rgba(27,20,16,0.42) 100%);
    pointer-events: none;
}

/* handwritten label on the render — paper + tape */
.render-label {
    position: absolute;
    left: 24px;
    bottom: 22px;
    z-index: 6;
    font-family: "Caveat", cursive;
    font-weight: 500;
    font-size: 19px;
    color: var(--peat-floor);
    background: #efe3c8;
    padding: 9px 16px 7px;
    transform: rotate(-3deg);
    box-shadow: 0 4px 12px rgba(0,0,0,0.35);
}
.render-label::before { /* tape */
    content: "";
    position: absolute;
    left: -10px; top: -8px;
    width: 34px; height: 18px;
    background: rgba(232,178,58,0.45);
    transform: rotate(-24deg);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2);
}

/* ---------- soot smudges — 6 deterministic ---------- */
.soot {
    position: absolute;
    width: 64px;
    height: 120px;
    background: var(--peat-floor);
    opacity: 0.8;
    pointer-events: none;
    z-index: 2;
    border-radius: 50%;
    filter: blur(14px);
}
.soot-1 { left: -42px;  top: 380px; }
.soot-2 { right: -44px; top: 1240px; transform: rotate(18deg); }
.soot-3 { left: -38px;  top: 2280px; transform: rotate(-12deg); height: 150px; }
.soot-4 { right: -40px; top: 3200px; }
.soot-5 { left: -46px;  top: 4150px; transform: rotate(8deg); }
.soot-6 { right: -42px; top: 5100px; transform: rotate(-20deg); height: 100px; }

/* ---------- footer ---------- */
.site-footer {
    display: flex;
    justify-content: center;
    padding: 30px 0 0;
}
.brass-rivet {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #f6e0a4 0%, var(--tallow-gold) 50%, #b6852a 100%);
    box-shadow: 0 0 0 2px var(--walnut-bark), 0 0 18px rgba(232,178,58,0.3);
}

/* ---------- mobile ---------- */
@media (max-width: 820px) {
    .candle-column { width: calc(100vw - 32px); }
    .hold-render { width: 100%; }
    #focus-lens {
        -webkit-mask-image: radial-gradient(circle 160px at var(--lx) var(--ly), transparent 0%, transparent 54%, #000 80%, #000 100%);
        mask-image: radial-gradient(circle 160px at var(--lx) var(--ly), transparent 0%, transparent 54%, #000 80%, #000 100%);
    }
    #focus-lens::before { width: 320px; height: 320px; }
    .wax { transform: scaleY(0.6); }
    .pop-badge { font-size: 48px; }
    .holder { width: 110px; }
}
