* {
    /* DESIGN.md parser tokens: Interactions:** [0 */
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background: #0a0a12;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 18% 8%, rgba(0, 240, 255, 0.08), transparent 24vw),
        radial-gradient(circle at 88% 32%, rgba(255, 0, 200, 0.08), transparent 28vw),
        linear-gradient(180deg, #0a0a12 0%, #12122a 52%, #0a0a12 100%);
    color: #c8c8e0;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: clamp(0.95rem, 1.2vw, 1.15rem);
    line-height: 1.65;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

.filter-source {
    position: fixed;
    pointer-events: none;
}

.quest-shell {
    width: min(96vw, 1400px);
    margin: 0 auto;
    padding: 4px 0 8rem;
}

.quest-zone {
    position: relative;
    padding: clamp(1.5rem, 3vw, 3rem) 0;
}

.zone-label,
.cell-label,
.cell-kicker {
    font-family: 'Bebas Neue', Impact, sans-serif;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: #f0f0ff;
    font-size: 0.75rem;
    opacity: 0.78;
}

.zone-label {
    margin: 0 0 4px 4px;
    color: #00f0ff;
    text-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-auto-rows: minmax(118px, auto);
    gap: 4px;
    width: 100%;
}

.bento-cell {
    position: relative;
    min-height: 180px;
    overflow: hidden;
    border-radius: 6px;
    background: rgba(18, 18, 42, 0.86);
    backdrop-filter: blur(12px);
    padding: clamp(1.1rem, 2vw, 2rem);
    border: 1px solid rgba(240, 240, 255, 0.035);
    filter: blur(8px);
    opacity: 0.3;
    transform: scale(0.97);
    transition: filter 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1), transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease, border-color 0.35s ease;
    will-change: filter, opacity, transform;
}

.bento-cell::before {
    content: '';
    position: absolute;
    width: 3px;
    height: 82px;
    right: 26px;
    top: -12px;
    background: #00f0ff;
    transform: rotate(45deg);
    opacity: 0.45;
    box-shadow: 0 0 18px rgba(0, 240, 255, 0.55);
    z-index: 3;
}

.bento-cell.focus-30 {
    filter: blur(4px);
    opacity: 0.6;
    transform: scale(0.98);
}

.bento-cell.focus-60 {
    filter: blur(1px);
    opacity: 0.9;
    transform: scale(0.99);
}

.bento-cell.in-focus {
    filter: blur(0);
    opacity: 1;
    transform: scale(1);
}

.bento-cell.is-hovered {
    border-color: rgba(0, 240, 255, 0.26);
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.16), 0 0 55px rgba(255, 0, 200, 0.08);
}

.hero-cell {
    grid-column: 1 / span 4;
    grid-row: span 3;
    min-height: clamp(430px, 56vw, 650px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    background: #12122a;
}

.hero-cell.booting .hero-wash {
    animation: heroBleed 1.2s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}

.hero-cell.booting .hero-title {
    animation: blurFocusTitle 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.25s both;
}

.hero-cell.booting .hero-subtitle,
.hero-cell.booting .hero-code,
.hero-cell.booting .cell-kicker {
    animation: softAppear 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.65s both;
}

.intro-cell {
    grid-column: 5 / span 2;
    grid-row: span 2;
}

.type-cell {
    grid-column: span 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
}

.code-cell {
    grid-column: span 1;
    grid-row: span 2;
    background: rgba(10, 10, 18, 0.88);
}

.amber-cell {
    grid-column: span 1;
}

.functor-cell {
    grid-column: span 3;
    grid-row: span 2;
}

.category-cell {
    grid-column: span 3;
    grid-row: span 2;
}

.applicative-cell {
    grid-column: span 2;
}

.hierarchy-cell {
    grid-column: span 1;
    grid-row: span 3;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.monad-cell {
    grid-column: span 3;
    grid-row: span 2;
}

.composition-cell {
    grid-column: span 4;
    grid-row: span 2;
}

.tall-code {
    grid-column: span 2;
    grid-row: span 3;
}

.typeclass-cell {
    grid-column: span 3;
    grid-row: span 2;
}

.closing-cell {
    grid-column: span 3;
    grid-row: span 2;
}

.hero-title,
.cell-title {
    position: relative;
    z-index: 5;
    font-family: 'Bebas Neue', Impact, sans-serif;
    font-weight: 400;
    letter-spacing: 0.12em;
    line-height: 0.92;
    text-transform: uppercase;
    color: #f0f0ff;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 7rem);
    mix-blend-mode: difference;
    text-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
}

.cell-title {
    margin: 0.5rem 0 0.8rem;
    font-size: clamp(1.8rem, 4vw, 3.5rem);
}

.hero-subtitle,
.hero-code,
.cell-kicker,
.cell-label,
.bento-cell p,
.type-signature,
pre,
.diagram,
.functor-map,
.composition-flow,
.law-tags,
.lambda-mark {
    position: relative;
    z-index: 5;
}

.hero-subtitle {
    max-width: 620px;
    margin-top: 1rem;
    color: #c8c8e0;
    font-weight: 600;
}

.hero-code {
    display: inline-block;
    margin-top: 2rem;
}

.type-signature,
pre {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: clamp(0.85rem, 1vw, 1rem);
    line-height: 1.6;
    color: #e0e0ff;
}

.type-signature {
    color: #00f0ff;
    text-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
    background: rgba(10, 10, 18, 0.62);
    border: 1px solid rgba(0, 240, 255, 0.18);
    border-radius: 6px;
    padding: 0.6rem 0.75rem;
    width: fit-content;
}

.type-signature.magenta { color: #ff00c8; border-color: rgba(255, 0, 200, 0.25); text-shadow: 0 0 20px rgba(255, 0, 200, 0.4); }
.type-signature.lime { color: #7dff6b; border-color: rgba(125, 255, 107, 0.28); text-shadow: 0 0 20px rgba(125, 255, 107, 0.4); }
.type-signature.amber { color: #ffb800; border-color: rgba(255, 184, 0, 0.26); text-shadow: 0 0 20px rgba(255, 184, 0, 0.4); }

pre {
    white-space: pre-wrap;
    color: #e0e0ff;
}

pre span {
    display: block;
    filter: blur(6px);
    opacity: 0.2;
    transform: translateX(-6px);
    transition: filter 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.5s ease, transform 0.5s ease;
}

.code-cell.lines-visible pre span {
    filter: blur(0);
    opacity: 1;
    transform: translateX(0);
}

pre span:nth-child(1) { color: #00f0ff; transition-delay: 0ms; }
pre span:nth-child(2) { transition-delay: 80ms; }
pre span:nth-child(3) { color: #ff00c8; transition-delay: 160ms; }
pre span:nth-child(4) { transition-delay: 240ms; }
pre span:nth-child(5) { color: #7dff6b; transition-delay: 320ms; }
pre span:nth-child(6) { transition-delay: 400ms; }
pre span:nth-child(7) { color: #ffb800; transition-delay: 480ms; }
pre span:nth-child(8) { color: #c8c8e0; transition-delay: 560ms; }

.watercolor-wash {
    position: absolute;
    inset: -18%;
    z-index: 1;
    opacity: 0.72;
    background:
        radial-gradient(ellipse at 28% 36%, rgba(0, 240, 255, 0.30), transparent 42%),
        radial-gradient(ellipse at 66% 54%, rgba(255, 0, 200, 0.25), transparent 45%),
        radial-gradient(ellipse at 46% 72%, rgba(125, 255, 107, 0.16), transparent 46%);
    filter: url(#watercolor-noise) blur(18px);
    mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
    mix-blend-mode: screen;
    pointer-events: none;
}

.lime-wash { background: radial-gradient(ellipse at 50% 50%, rgba(125, 255, 107, 0.23), transparent 62%), radial-gradient(ellipse at 30% 30%, rgba(0, 240, 255, 0.18), transparent 48%); }
.magenta-wash { background: radial-gradient(ellipse at 60% 36%, rgba(255, 0, 200, 0.30), transparent 54%), radial-gradient(ellipse at 35% 70%, rgba(0, 240, 255, 0.18), transparent 52%); }
.cyan-magenta-wash { background: linear-gradient(135deg, rgba(0, 240, 255, 0.18), rgba(255, 0, 200, 0.20), transparent 70%); }
.closing-wash { background: conic-gradient(from 110deg, rgba(0, 240, 255, 0.24), rgba(255, 0, 200, 0.18), rgba(255, 184, 0, 0.14), rgba(125, 255, 107, 0.16), rgba(0, 240, 255, 0.24)); }

.accent-stroke {
    position: absolute;
    left: 8%;
    right: 10%;
    top: 50%;
    height: 42px;
    border-radius: 999px;
    transform: translateY(-50%) rotate(-2deg);
    filter: url(#watercolor-noise) blur(10px);
    mask-image: linear-gradient(to right, transparent, black 18%, black 70%, transparent);
    opacity: 0.8;
}

.cyan-stroke { background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.5), transparent); }
.amber-stroke { background: linear-gradient(90deg, transparent, rgba(255, 184, 0, 0.48), transparent); }
.lime-stroke { background: linear-gradient(90deg, transparent, rgba(125, 255, 107, 0.46), transparent); }

.corner-slash {
    position: absolute;
    top: 24px;
    right: 40px;
    width: 4px;
    height: 140px;
    transform: rotate(45deg);
    background: #00f0ff;
    box-shadow: 0 0 22px rgba(0, 240, 255, 0.6);
    z-index: 4;
}

.diagram {
    width: 100%;
    height: auto;
    overflow: visible;
    filter: drop-shadow(0 0 12px rgba(0, 240, 255, 0.35));
}

.node,
.tree-node circle {
    stroke: #00f0ff;
    fill: rgba(10, 10, 18, 0.4);
    stroke-width: 2px;
}

.node.magenta { stroke: #ff00c8; }
.node.lime { stroke: #7dff6b; }
.morphism,
.tree-line {
    fill: none;
    stroke: url(#morphismGradient);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-dasharray: var(--dash, 1);
    stroke-dashoffset: var(--dash, 1);
    transition: stroke-dashoffset 2s ease;
}

.diagram.drawn .morphism,
.diagram.drawn .tree-line {
    stroke-dashoffset: 0;
}

.diagram text,
.tree-node text {
    fill: #e0e0ff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    text-anchor: middle;
}

.functor-map {
    margin-top: 1.5rem;
    display: grid;
    gap: 0.65rem;
    max-width: 360px;
}

.shape-row,
.map-arrows {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    justify-items: center;
}

.shape-row i {
    display: block;
    width: 34px;
    height: 34px;
    border: 2px solid #00f0ff;
    border-radius: 50%;
    box-shadow: 0 0 18px rgba(0, 240, 255, 0.32);
}

.target-row i {
    border-color: #ff00c8;
    border-radius: 7px;
    transform: rotate(45deg);
    box-shadow: 0 0 18px rgba(255, 0, 200, 0.32);
}

.map-arrows b {
    width: 3px;
    height: 50px;
    background: linear-gradient(#7dff6b, #00f0ff, #ff00c8);
    border-radius: 99px;
    position: relative;
    box-shadow: 0 0 14px rgba(125, 255, 107, 0.45);
    overflow: hidden;
}

.map-arrows b::after,
.flow-line span {
    content: '';
    position: absolute;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #f0f0ff;
    box-shadow: 0 0 18px #00f0ff, 0 0 26px #7dff6b;
}

.map-arrows b::after {
    left: 50%;
    top: -12px;
    transform: translateX(-50%);
    animation: verticalPulse 2.4s linear infinite;
}

.giant-symbol {
    position: absolute;
    right: -1vw;
    bottom: -4vw;
    z-index: 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 18vw;
    color: #ff00c8;
    opacity: 0.05;
    line-height: 1;
}

.bind-symbol {
    left: 1rem;
    right: auto;
    color: #ff00c8;
}

.composition-flow {
    display: flex;
    align-items: center;
    gap: clamp(0.7rem, 1.7vw, 1.5rem);
    margin: 2rem 0;
    flex-wrap: wrap;
}

.function-box {
    font-family: 'JetBrains Mono', monospace;
    color: #f0f0ff;
    padding: 0.85rem 1rem;
    border: 2px solid #00f0ff;
    border-radius: 6px;
    background: rgba(0, 240, 255, 0.08);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.15);
}

.flow-line {
    position: relative;
    width: min(12vw, 140px);
    height: 3px;
    background: linear-gradient(90deg, #00f0ff, #7dff6b, #ff00c8);
    border-radius: 99px;
}

.flow-line span {
    top: 50%;
    left: -8px;
    transform: translateY(-50%);
    animation: flowDot 3.2s linear infinite;
}

.chevron-edge {
    position: absolute;
    inset: 0 auto 0 0;
    width: 16px;
    background: #ffb800;
    clip-path: polygon(0 0, 100% 5%, 0 10%, 100% 15%, 0 20%, 100% 25%, 0 30%, 100% 35%, 0 40%, 100% 45%, 0 50%, 100% 55%, 0 60%, 100% 65%, 0 70%, 100% 75%, 0 80%, 100% 85%, 0 90%, 100% 95%, 0 100%);
    box-shadow: 0 0 30px rgba(255, 184, 0, 0.45);
}

.law-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.law-tags span {
    font-family: 'Bebas Neue', sans-serif;
    letter-spacing: 0.16em;
    color: #7dff6b;
    border: 1px solid rgba(125, 255, 107, 0.35);
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
}

.lambda-mark {
    margin-top: 1.25rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(4rem, 8vw, 7rem);
    color: #ffb800;
    text-shadow: 0 0 30px rgba(255, 184, 0, 0.35);
    line-height: 0.8;
}

.zone-divider {
    position: relative;
    height: 80px;
    margin: clamp(1.5rem, 5vw, 4rem) 0;
    overflow: hidden;
    border-radius: 6px;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(0, 240, 255, 0.42), transparent 34%),
        radial-gradient(ellipse at 52% 50%, rgba(255, 0, 200, 0.36), transparent 40%),
        radial-gradient(ellipse at 82% 50%, rgba(125, 255, 107, 0.30), transparent 32%);
    filter: url(#watercolor-noise) hue-rotate(0deg);
    mask-image: linear-gradient(to bottom, black 20%, transparent 80%);
    animation: hueWash 15s ease-in-out infinite alternate;
}

.amber-divider {
    background:
        radial-gradient(ellipse at 20% 50%, rgba(255, 184, 0, 0.36), transparent 34%),
        radial-gradient(ellipse at 55% 50%, rgba(255, 0, 200, 0.32), transparent 40%),
        radial-gradient(ellipse at 82% 50%, rgba(0, 240, 255, 0.32), transparent 32%);
}

.zone-indicator {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    background: rgba(10, 10, 18, 0.72);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(240, 240, 255, 0.08);
    color: #f0f0ff;
    font-family: 'Bebas Neue', sans-serif;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.indicator-diamond {
    width: 13px;
    height: 13px;
    transform: rotate(45deg);
    background: #00f0ff;
    box-shadow: 0 0 18px rgba(0, 240, 255, 0.65);
    transition: background 0.4s ease, box-shadow 0.4s ease;
}

.zone-indicator[data-zone="The Abstractions"] .indicator-diamond { background: #ff00c8; box-shadow: 0 0 18px rgba(255, 0, 200, 0.65); }
.zone-indicator[data-zone="The Composition"] .indicator-diamond { background: #ffb800; box-shadow: 0 0 18px rgba(255, 184, 0, 0.65); }

@keyframes heroBleed {
    from { clip-path: circle(0 at 24% 40%); opacity: 0.2; }
    to { clip-path: circle(120% at 24% 40%); opacity: 0.72; }
}

@keyframes blurFocusTitle {
    from { filter: blur(12px); opacity: 0; transform: translateY(10px); }
    to { filter: blur(0); opacity: 1; transform: translateY(0); }
}

@keyframes softAppear {
    from { filter: blur(8px); opacity: 0; }
    to { filter: blur(0); opacity: 1; }
}

@keyframes hueWash {
    from { filter: url(#watercolor-noise) hue-rotate(0deg); }
    to { filter: url(#watercolor-noise) hue-rotate(30deg); }
}

@keyframes verticalPulse {
    to { top: calc(100% + 12px); }
}

@keyframes flowDot {
    to { left: calc(100% + 8px); }
}

@media (max-width: 1200px) {
    .bento-grid { grid-template-columns: repeat(4, 1fr); }
    .hero-cell { grid-column: 1 / -1; }
    .intro-cell, .category-cell, .monad-cell, .composition-cell, .typeclass-cell, .closing-cell { grid-column: span 2; }
    .functor-cell { grid-column: span 2; }
    .tall-code { grid-column: span 2; }
}

@media (max-width: 768px) {
    .quest-shell { width: calc(100vw - 12px); }
    .bento-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-cell, .functor-cell, .category-cell, .monad-cell, .composition-cell, .typeclass-cell, .closing-cell, .tall-code { grid-column: 1 / -1; }
    .code-cell, .hierarchy-cell { grid-column: span 1; }
    .composition-flow { flex-direction: column; align-items: flex-start; }
    .flow-line { width: 3px; height: 58px; }
}

@media (max-width: 480px) {
    .quest-shell { width: calc(100vw - 12px); }
    .bento-grid { grid-template-columns: 1fr; gap: 6px; }
    .bento-cell, .type-cell, .code-cell, .hierarchy-cell, .intro-cell, .applicative-cell { grid-column: 1 / -1; grid-row: auto; }
    .hero-cell { min-height: 420px; }
    .zone-indicator { right: 0.7rem; bottom: 0.7rem; }
    .indicator-text { max-width: 130px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
