/* HHASSL.com — Ethereal editorial with technological undertones
   Palette: burgundy-cream  |  Type: Libre Baskerville + DM Sans + IBM Plex Mono
   Layout : parallax-sections, full-viewport narrative panes
*/

:root {
    --burgundy:        #6B1D3A;
    --burgundy-deep:   #3D0F22;
    --cream:           #F5EDE3;
    --rose:            #D4A5A5;
    --ivory:           #FDF8F3;
    --gold:            #B8975A;
    --gold-bright:     #D4B96A;
    --charcoal:        #2E2226;

    --serif: "Libre Baskerville", "Baskerville", Georgia, serif;
    --sans:  "DM Sans", "Inter", system-ui, -apple-system, sans-serif;
    --mono:  "IBM Plex Mono", "Space Mono", ui-monospace, monospace;

    --baseline: 28px;
    --col-w: 680px;
    --gutter: 24px;

    --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html {
    scroll-behavior: smooth;
    background: var(--cream);
}

body {
    font-family: var(--sans);
    font-size: 1.125rem;
    line-height: 1.75;
    color: var(--charcoal);
    background: var(--cream);
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   Page-wide textures: dot-grid (engineering paper) + grain
   ============================================================ */

.dot-grid {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background-image: radial-gradient(circle, rgba(46,34,38,0.18) 1px, transparent 1.4px);
    background-size: 32px 32px;
    background-position: 0 0;
    opacity: 0.28;
    mix-blend-mode: multiply;
}

.grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    opacity: 0.06;
    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'/><feColorMatrix values='0 0 0 0 0.18  0 0 0 0 0.13  0 0 0 0 0.15  0 0 0 0.9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
    mix-blend-mode: multiply;
}

/* Soft burgundy-to-cream bleed between section transitions */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(80% 40% at 50% 0%,   rgba(107,29,58,0.07), transparent 70%),
        radial-gradient(60% 35% at 50% 100%, rgba(212,165,165,0.08), transparent 70%);
}

/* ============================================================
   Pip navigation (right edge)
   ============================================================ */

.pip-nav {
    position: fixed;
    top: 50%;
    right: 28px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 18px;
    z-index: 50;
}

.pip {
    --pip-size: 8px;
    width: var(--pip-size);
    height: var(--pip-size);
    border-radius: 50px;
    background: rgba(107, 29, 58, 0.35);
    display: block;
    position: relative;
    transition: width 380ms var(--ease-out),
                background-color 300ms var(--ease-out),
                transform 300ms var(--ease-out);
    text-decoration: none;
    cursor: pointer;
}
.pip:hover { background: var(--burgundy); transform: scale(1.15); }
.pip.is-active {
    width: 28px;
    background: var(--burgundy);
}
.pip-label {
    position: absolute;
    right: calc(100% + 14px);
    top: 50%;
    transform: translateY(-50%) translateX(8px);
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--burgundy-deep);
    background: var(--ivory);
    padding: 4px 10px;
    border: 1px solid rgba(107,29,58,0.18);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 240ms var(--ease-out), transform 240ms var(--ease-out);
}
.pip:hover .pip-label,
.pip.is-active .pip-label {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* ============================================================
   Panes (full-viewport parallax sections)
   ============================================================ */

main { position: relative; z-index: 3; }

.pane {
    position: relative;
    min-height: 100vh;
    padding: 120px 48px 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.pane + .pane {
    border-top: 1px dashed rgba(107,29,58,0.14);
}

/* Soft burgundy-cream gradient bleed at section boundaries */
.pane::before {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 160px;
    background: linear-gradient(to bottom, rgba(212,165,165,0.18), transparent);
    pointer-events: none;
    z-index: 1;
}
.pane::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 160px;
    background: linear-gradient(to top, rgba(107,29,58,0.06), transparent);
    pointer-events: none;
    z-index: 1;
}
.hero::before { opacity: 0; }

.parallax-bg, .parallax-fg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    will-change: transform;
}
.parallax-bg { z-index: 1; }
.parallax-fg { z-index: 4; }

.content {
    position: relative;
    z-index: 5;
    width: 100%;
    max-width: var(--col-w);
}
.content-hero  { text-align: center; }
.content-center{ text-align: center; }
.content-offset{ margin-left: auto; margin-right: 6%; }

@media (max-width: 820px) {
    .pane { padding: 96px 24px; }
    .content-offset { margin: 0 auto; }
    .pip-nav { right: 12px; }
    .pip-label { display: none; }
}

/* ============================================================
   Typography
   ============================================================ */

h1, h2, h3 {
    font-family: var(--serif);
    color: var(--burgundy-deep);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

h1 {
    font-size: clamp(2.4rem, 5vw, 4.8rem);
    margin-bottom: calc(var(--baseline) * 1.2);
    position: relative;
    display: inline-block;
}

h2 {
    font-size: clamp(1.6rem, 3vw, 2.8rem);
    margin-bottom: calc(var(--baseline) * 0.9);
    position: relative;
    display: inline-block;
    max-width: 100%;
}

h3 {
    font-family: var(--serif);
    font-size: 1.35rem;
    line-height: 1.3;
    margin-bottom: 8px;
}

p {
    margin-bottom: var(--baseline);
    max-width: 62ch;
}

.kicker {
    font-family: var(--mono);
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--burgundy);
    margin-bottom: calc(var(--baseline) * 0.75);
    opacity: 0.85;
}

.dek {
    font-family: var(--serif);
    font-style: italic;
    font-size: clamp(1.05rem, 1.6vw, 1.35rem);
    color: var(--charcoal);
    margin: 0 auto var(--baseline);
    max-width: 56ch;
    line-height: 1.55;
}

.lede {
    font-size: 1.22rem;
    line-height: 1.7;
    color: var(--burgundy-deep);
}

.meta-line {
    font-family: var(--mono);
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    color: var(--burgundy);
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.meta-line .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--gold);
    display: inline-block;
    box-shadow: 0 0 0 4px rgba(184,151,90,0.18);
}
kbd {
    font-family: var(--mono);
    font-size: 0.72rem;
    border: 1px solid rgba(107,29,58,0.4);
    padding: 2px 6px;
    border-radius: 3px;
    background: var(--ivory);
    color: var(--burgundy-deep);
}

/* ============================================================
   Underline-draw effect (SVG)
   ============================================================ */

.underline-draw {
    position: relative;
    padding-bottom: 14px;
}
.ud-svg {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 18px;
    overflow: visible;
}
.ud-svg path {
    stroke-dasharray: 700;
    stroke-dashoffset: 700;
    transition: stroke-dashoffset 900ms var(--ease-out);
}
.in-view .ud-svg path,
h1.in-view .ud-svg path,
h2.in-view .ud-svg path {
    stroke-dashoffset: 0;
}

/* ============================================================
   Hero
   ============================================================ */

.hero {
    background: linear-gradient(180deg, var(--cream) 0%, #FBF3E8 50%, var(--cream) 100%);
}
.hero-radiant {
    position: absolute;
    width: 120%;
    height: 120%;
    left: -10%;
    top: -10%;
}
.hero-radiant .trace {
    stroke-dasharray: 900;
    stroke-dashoffset: 900;
    animation: drawTrace 2.4s var(--ease-out) forwards;
}
.hero-radiant .trace:nth-child(2) { animation-delay: 0.1s; }
.hero-radiant .trace:nth-child(3) { animation-delay: 0.2s; }
.hero-radiant .trace:nth-child(4) { animation-delay: 0.3s; }
.hero-radiant .trace:nth-child(5) { animation-delay: 0.4s; }
.hero-radiant .trace:nth-child(6) { animation-delay: 0.5s; }
.hero-radiant .trace:nth-child(7) { animation-delay: 0.6s; }
.hero-radiant .trace:nth-child(8) { animation-delay: 0.7s; }

@keyframes drawTrace {
    to { stroke-dashoffset: 0; }
}

.content-hero h1 {
    font-size: clamp(3.2rem, 9vw, 7rem);
    letter-spacing: 0.06em;
    color: var(--burgundy-deep);
    text-shadow: 0 1px 0 rgba(255,255,255,0.6);
}

.hero-divider {
    position: absolute;
    bottom: 36px;
    left: 0; right: 0;
    z-index: 5;
    padding: 0 10%;
}
.circuit-divider {
    width: 100%;
    height: 32px;
    overflow: visible;
}
.cd-path {
    stroke-dasharray: 1400;
    stroke-dashoffset: 1400;
    animation: drawTrace 2s var(--ease-out) 0.4s forwards;
}

/* ============================================================
   Floating shapes
   ============================================================ */

.float-shape {
    position: absolute;
    display: block;
    will-change: transform;
}
.shape-circle {
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(212,165,165,0.55), rgba(107,29,58,0.18) 70%, transparent);
    filter: blur(0.5px);
    width: 140px; height: 140px;
}
.shape-circle.big { width: 240px; height: 240px; }

.shape-poly {
    width: 160px; height: 160px;
    background: linear-gradient(135deg, rgba(253,248,243,0.85), rgba(212,165,165,0.35));
    clip-path: polygon(20% 0, 100% 18%, 92% 78%, 38% 100%, 0 60%);
    border: 1px solid rgba(184,151,90,0.4);
}
.shape-poly.big { width: 260px; height: 220px; }

/* hero scattered */
.s1 { top: 10%; left: 8%;  opacity: 0.55; }
.s2 { bottom: 18%; right: 12%; width: 90px; height: 90px; opacity: 0.5; }
.s3 { top: 18%;  right: 10%; opacity: 0.45; transform: rotate(-12deg); }
.s4 { bottom: 14%; left: 14%; width: 110px; height: 110px; opacity: 0.4; transform: rotate(20deg); }

.s5  { top: 12%; left: 6%; width: 110px; height: 110px; opacity: 0.55; }
.s6  { bottom: 14%; right: 8%; opacity: 0.4; transform: rotate(-18deg); }
.s7  { top: 16%; right: 8%; opacity: 0.5; transform: rotate(28deg); }
.s8  { bottom: 14%; left: 6%; width: 120px; height: 120px; opacity: 0.5; }
.s9  { top: 50%; right: 4%; width: 90px; height: 90px; opacity: 0.4; transform: rotate(-32deg); }
.s10 { top: 14%; right: 10%; width: 130px; height: 130px; opacity: 0.5; }
.s11 { bottom: 16%; left: 8%; width: 140px; height: 140px; opacity: 0.45; transform: rotate(14deg); }
.s12 { top: 18%; left: 12%; width: 120px; height: 120px; opacity: 0.5; }
.s13 { bottom: 16%; right: 12%; width: 150px; height: 130px; opacity: 0.45; transform: rotate(-22deg); }

.sg1 { top: 14%;  left: 8%;  opacity: 0.6; }
.sg2 { top: 30%;  right: 6%; opacity: 0.55; transform: rotate(-14deg); }
.sg3 { bottom: 16%; left: 28%; width: 120px; height: 120px; opacity: 0.55; }
.sg4 { bottom: 22%; right: 22%; width: 140px; height: 130px; opacity: 0.5; transform: rotate(22deg); }

.wireframe {
    position: absolute;
    width: 200px;
    height: 200px;
    top: 56%;
    left: 8%;
    opacity: 0.85;
    will-change: transform;
}

/* ============================================================
   Background circuit traces (margins)
   ============================================================ */

.bg-trace {
    position: absolute;
    height: 100%;
    width: auto;
}
.bg-trace-left  { top: 0; left: 0;  width: 220px; opacity: 1; }
.bg-trace-right { top: 0; right: 0; width: 220px; opacity: 1; }
.bg-trace-wide  { top: 0; left: 0;  width: 100%; height: 100%; }

.bg-trace .trace {
    stroke-dasharray: 1600;
    stroke-dashoffset: 1600;
    transition: stroke-dashoffset 1500ms var(--ease-out);
}
.in-view .bg-trace .trace,
.pane.in-view .bg-trace .trace {
    stroke-dashoffset: 0;
}

/* ============================================================
   Pull-quote
   ============================================================ */

.pull-quote {
    font-family: var(--serif);
    font-style: italic;
    font-size: clamp(1.4rem, 2.4vw, 2rem);
    line-height: 1.4;
    color: var(--burgundy-deep);
    border-left: 2px solid var(--gold);
    padding: 12px 0 12px 28px;
    margin: calc(var(--baseline) * 1.5) 0;
    position: relative;
    max-width: 60ch;
}
.pull-quote .quote-mark {
    font-family: var(--serif);
    font-size: 4rem;
    line-height: 0.6;
    color: var(--gold);
    position: absolute;
    top: 8px;
    left: -28px;
}
.pull-quote cite {
    display: block;
    font-style: normal;
    font-family: var(--mono);
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    color: var(--burgundy);
    margin-top: 14px;
    text-transform: uppercase;
}

/* ============================================================
   Specimen figure (circuit diagram)
   ============================================================ */

.specimen {
    background: var(--ivory);
    border: 1px solid rgba(184,151,90,0.4);
    padding: 28px 28px 18px;
    margin: var(--baseline) 0;
    position: relative;
}
.specimen::before, .specimen::after {
    content: "";
    position: absolute;
    width: 12px; height: 12px;
    border: 1px solid var(--gold);
}
.specimen::before { top: -1px; left: -1px;  border-right: none; border-bottom: none; }
.specimen::after  { bottom: -1px; right: -1px; border-left:  none; border-top:    none; }

.specimen-svg {
    width: 100%;
    height: auto;
    display: block;
}
.specimen-svg .spec-path {
    stroke-dasharray: 700;
    stroke-dashoffset: 700;
    transition: stroke-dashoffset 1600ms var(--ease-out);
}
.specimen.in-view .spec-path { stroke-dashoffset: 0; }

.specimen figcaption {
    font-family: var(--mono);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    color: var(--burgundy);
    margin-top: 14px;
    text-align: center;
}

/* ============================================================
   Annotations / atlas / colophon
   ============================================================ */

.annotations {
    list-style: none;
    margin-top: var(--baseline);
    padding-left: 0;
}
.annotations li {
    font-family: var(--serif);
    font-style: italic;
    font-size: 1.1rem;
    color: var(--burgundy-deep);
    padding: 10px 0;
    border-bottom: 1px dotted rgba(107,29,58,0.3);
    display: flex;
    gap: 14px;
    align-items: baseline;
}
.ann-tag {
    font-family: var(--mono);
    font-style: normal;
    font-size: 0.78rem;
    color: var(--gold);
    letter-spacing: 0.1em;
    min-width: 28px;
}

.atlas-list {
    list-style: none;
    margin-top: var(--baseline);
    padding: 0;
}
.atlas-item {
    display: flex;
    gap: 22px;
    padding: 22px 0;
    border-bottom: 1px solid rgba(107,29,58,0.18);
    transition: background-color 300ms var(--ease-out);
}
.atlas-item:last-child { border-bottom: none; }
.atlas-num {
    font-family: var(--serif);
    font-style: italic;
    font-size: 1.6rem;
    color: var(--gold);
    min-width: 40px;
    line-height: 1.1;
    transition: color 300ms var(--ease-out);
}
.atlas-item:hover .atlas-num { color: var(--gold-bright); }
.atlas-body h3 { color: var(--burgundy-deep); margin-bottom: 4px; }
.atlas-body p  { margin-bottom: 6px; }
.atlas-meta {
    font-family: var(--mono);
    font-size: 0.74rem;
    letter-spacing: 0.1em;
    color: var(--burgundy);
    text-transform: uppercase;
}

.colophon-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 36px;
    margin: var(--baseline) auto;
    max-width: 560px;
    text-align: left;
    border-top: 1px solid rgba(107,29,58,0.2);
    border-bottom: 1px solid rgba(107,29,58,0.2);
    padding: 22px 0;
}
.colophon-grid > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.colophon-grid dt {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold);
}
.colophon-grid dd {
    font-family: var(--serif);
    font-style: italic;
    font-size: 1.05rem;
    color: var(--burgundy-deep);
}

.signoff {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    font-family: var(--serif);
    font-style: italic;
    color: var(--burgundy);
    margin-top: var(--baseline);
}
.sig-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--gold), transparent);
    max-width: 120px;
}

/* ============================================================
   Reveal animation (fade + rise)
   ============================================================ */

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 600ms var(--ease-out),
                transform 600ms var(--ease-out);
}
.reveal.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   Hover gold-shimmer for interactive elements
   ============================================================ */

a, .pip, .atlas-item {
    transition: color 300ms var(--ease-out),
                background-color 300ms var(--ease-out);
}
a { color: var(--burgundy); text-decoration: none; }
a:hover { color: var(--gold-bright); }

/* ============================================================
   Reduced motion
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 200ms !important;
    }
    .parallax-bg, .parallax-fg { transform: none !important; }
    .reveal { opacity: 1; transform: none; }
    .ud-svg path { stroke-dashoffset: 0 !important; }
    html { scroll-behavior: auto; }
}
