/* ==========================================================================
   PLOTGRAPHER.COM
   Art-deco / naval-cartography / hexagonal-honeycomb
   ========================================================================== */

:root {
    --abyssal-navy: #0D1B2A;
    --midnight-steel: #1B2838;
    --iron-depth: #243447;
    --chronometer-gold: #D4AF37;
    --nautical-brass: #B8860B;
    --silver-mist: #C9D6DF;
    --steel-haze: #8FA3B0;
    --parchment-vellum: #E8E0D4;
    --verdigris: #2E8B7A;
    --ghost-rule: #3A506B;
    --deep-navy: #1B2838;
    --slate-blue: #2C3E50;

    --font-display: 'Josefin Sans', 'Inter', sans-serif;
    --font-label: 'Poiret One', 'Space Grotesk', sans-serif;
    --font-body: 'Source Sans 3', 'Inter', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--abyssal-navy);
    color: var(--silver-mist);
    font-family: var(--font-body);
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    line-height: 1.65;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* ----- Persistent honeycomb backdrop ----- */
.honeycomb-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.55;
}

.honeycomb-bg svg {
    width: 100%;
    height: 100%;
}

/* ----- Stratum base ----- */
.stratum {
    position: relative;
    z-index: 2;
    padding: 4rem clamp(1.5rem, 5vw, 6rem);
    width: 100%;
}

.stratum-eyebrow {
    font-family: var(--font-label);
    color: var(--nautical-brass);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    font-size: clamp(0.75rem, 1.1vw, 0.95rem);
    margin-bottom: 0.75rem;
}

.stratum-title {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--silver-mist);
    letter-spacing: 0.08em;
    font-size: clamp(1.4rem, 2.8vw, 2.2rem);
    margin-bottom: 1.25rem;
    line-height: 1.15;
}

.stratum-lede {
    color: var(--steel-haze);
    max-width: 60ch;
    font-size: clamp(0.95rem, 1.1vw, 1.1rem);
}

.stratum-header {
    text-align: left;
    max-width: 720px;
    margin: 0 auto 3.5rem;
    padding: 1.5rem 0;
    border-left: 1px solid var(--ghost-rule);
    padding-left: 1.5rem;
}

/* ==========================================================================
   STRATUM I -- THE MERIDIAN
   ========================================================================== */
.stratum-meridian {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.meridian-stage {
    position: relative;
    width: min(720px, 92vw);
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.meridian-hex {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.hex-outline {
    animation: drawHex 1.5s 0.3s ease-out forwards;
}

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

.hex-coordinates {
    animation: fadeIn 0.6s 1.6s ease-out forwards;
}

.ticks-x line, .ticks-y line {
    opacity: 0;
    animation: fadeIn 0.3s ease-out forwards;
}

.ticks-x line:nth-child(1) { animation-delay: 1.7s; }
.ticks-x line:nth-child(2) { animation-delay: 1.75s; }
.ticks-x line:nth-child(3) { animation-delay: 1.8s; }
.ticks-x line:nth-child(4) { animation-delay: 1.85s; }
.ticks-x line:nth-child(5) { animation-delay: 1.9s; }
.ticks-x line:nth-child(6) { animation-delay: 1.95s; }

.ticks-y line:nth-child(1) { animation-delay: 2.0s; }
.ticks-y line:nth-child(2) { animation-delay: 2.05s; }
.ticks-y line:nth-child(3) { animation-delay: 2.1s; }
.ticks-y line:nth-child(4) { animation-delay: 2.15s; }

.axis-label {
    font-family: var(--font-label);
    font-size: 14px;
    fill: var(--steel-haze);
    letter-spacing: 0.15em;
    opacity: 0;
    animation: fadeIn 0.6s 2.2s ease-out forwards;
}

.plotted-curve {
    animation: drawCurve 2s 2.5s cubic-bezier(0.33, 1, 0.68, 1) forwards;
    filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.45));
}

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

.data-points circle {
    animation: pop 0.4s ease-out forwards;
}

.data-points circle:nth-child(1) { animation-delay: 2.7s; }
.data-points circle:nth-child(2) { animation-delay: 3.0s; }
.data-points circle:nth-child(3) { animation-delay: 3.2s; }
.data-points circle:nth-child(4) { animation-delay: 3.4s; }
.data-points circle:nth-child(5) { animation-delay: 3.6s; }

@keyframes pop {
    0% { opacity: 0; r: 0; }
    60% { opacity: 1; r: 4.5; }
    100% { opacity: 1; r: 3; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.meridian-text {
    position: absolute;
    top: -3.5rem;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    width: 100%;
}

.title-main {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.4rem, 5vw, 4.2rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--silver-mist);
    margin: 0;
    clip-path: inset(0 0 100% 0);
    animation: stamp 0.6s 3.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    text-shadow: 0 0 20px rgba(201, 214, 223, 0.15);
}

@keyframes stamp {
    0% { clip-path: inset(0 0 100% 0); transform: translateX(-50%) translateY(-12px); }
    100% { clip-path: inset(0 0 0 0); transform: translateX(-50%) translateY(0); }
}

.subtitle-main {
    font-family: var(--font-label);
    font-size: clamp(0.85rem, 1.2vw, 1.05rem);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--steel-haze);
    margin-top: 0.6rem;
    opacity: 0;
    animation: fadeIn 0.6s 4.0s ease-out forwards;
}

.meridian-coords {
    position: absolute;
    bottom: -3rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 2.5rem;
    opacity: 0;
    animation: fadeIn 0.6s 4.4s ease-out forwards;
}

.coord-tag {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--chronometer-gold);
    letter-spacing: 0.12em;
}

/* ==========================================================================
   SUNBURST DIVIDERS
   ========================================================================== */
.sunburst-divider {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.sunburst {
    width: 200px;
    height: 140px;
    overflow: visible;
}

.sunburst line {
    stroke-dasharray: 60;
    stroke-dashoffset: 60;
    transition: stroke-dashoffset 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.sunburst.is-visible line {
    stroke-dashoffset: 0;
}

/* ==========================================================================
   STRATUM II -- THE GRID FIELD
   ========================================================================== */
.stratum-grid-field {
    min-height: 150vh;
    padding-top: 6rem;
    padding-bottom: 6rem;
}

.honeycomb-field {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(4, 100px);
    gap: 6px 14px;
    padding-top: 40px;
}

.hex-cell {
    position: relative;
    background: var(--midnight-steel);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.4rem;
    text-align: center;
    border: 1px solid transparent;
    transition: background 0.4s ease, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.6s ease;
    opacity: 0;
    transform: scale(0.2) rotate(30deg);
    overflow: hidden;
}

.hex-cell.is-revealed {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.hex-cell:hover {
    background: var(--iron-depth);
}

.hex-cell--small {
    grid-column: span 2;
    grid-row: span 2;
}

.hex-cell--medium {
    grid-column: span 2;
    grid-row: span 2;
}

.hex-cell--medium .hex-content,
.hex-cell--small .hex-content {
    width: 78%;
}

/* Honeycomb offset rows */
.hex-cell:nth-child(1) { grid-column: 1 / span 2; grid-row: 1 / span 2; }
.hex-cell:nth-child(2) { grid-column: 3 / span 2; grid-row: 1 / span 2; transform: scale(0.2) rotate(30deg) translateY(50px); }
.hex-cell:nth-child(3) { grid-column: 5 / span 2; grid-row: 1 / span 2; }
.hex-cell:nth-child(4) { grid-column: 2 / span 2; grid-row: 3 / span 2; transform: scale(0.2) rotate(30deg) translateY(50px); }
.hex-cell:nth-child(5) { grid-column: 4 / span 2; grid-row: 3 / span 2; }
.hex-cell:nth-child(6) { grid-column: 6 / span 2; grid-row: 3 / span 2; transform: scale(0.2) rotate(30deg) translateY(50px); }

.honeycomb-field {
    grid-template-rows: repeat(8, 90px);
}

.hex-cell:nth-child(7) { grid-column: 1 / span 2; grid-row: 5 / span 2; }
.hex-cell:nth-child(8) { grid-column: 3 / span 2; grid-row: 5 / span 2; transform: scale(0.2) rotate(30deg) translateY(50px); }
.hex-cell:nth-child(9) { grid-column: 5 / span 2; grid-row: 5 / span 2; }
.hex-cell:nth-child(10) { grid-column: 2 / span 2; grid-row: 7 / span 2; transform: scale(0.2) rotate(30deg) translateY(50px); }
.hex-cell:nth-child(11) { grid-column: 4 / span 2; grid-row: 7 / span 2; }
.hex-cell:nth-child(12) { grid-column: 6 / span 2; grid-row: 7 / span 2; transform: scale(0.2) rotate(30deg) translateY(50px); }

.hex-cell.is-revealed:nth-child(2),
.hex-cell.is-revealed:nth-child(4),
.hex-cell.is-revealed:nth-child(6),
.hex-cell.is-revealed:nth-child(8),
.hex-cell.is-revealed:nth-child(10),
.hex-cell.is-revealed:nth-child(12) {
    transform: scale(1) rotate(0deg) translateY(50px);
}

.hex-cell--accent {
    background: linear-gradient(135deg, var(--midnight-steel) 0%, var(--iron-depth) 100%);
}

.hex-content {
    width: 80%;
}

.hex-eyebrow {
    font-family: var(--font-label);
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--nautical-brass);
    margin-bottom: 0.5rem;
}

.hex-headline {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.15rem;
    letter-spacing: 0.05em;
    color: var(--silver-mist);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.hex-body {
    font-size: 0.85rem;
    color: var(--steel-haze);
    line-height: 1.4;
}

.hex-body-tight {
    font-size: 0.78rem;
    color: var(--steel-haze);
    line-height: 1.35;
}

.hex-caption {
    font-family: var(--font-label);
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--steel-haze);
    margin-top: 0.5rem;
}

.hex-readout {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    color: var(--chronometer-gold);
    letter-spacing: 0.05em;
    margin: 0.5rem 0;
}

.hex-readout-large {
    font-family: var(--font-mono);
    font-size: 1.8rem;
    color: var(--chronometer-gold);
    letter-spacing: 0.02em;
    margin: 0.5rem 0;
}

.hex-readout-large .unit {
    font-size: 1rem;
    color: var(--steel-haze);
    margin-left: 0.15em;
}

.mini-chart {
    width: 78%;
    height: auto;
    max-height: 60%;
}

.hex-deco {
    width: 70%;
    height: 70%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hex-deco svg {
    width: 100%;
    height: 100%;
}

.hex-cell--chart {
    flex-direction: column;
}

.hex-cell--readout {
    flex-direction: column;
}

/* ==========================================================================
   STRATUM III -- THE DEEP CHART
   ========================================================================== */
.stratum-deep-chart {
    min-height: 200vh;
    padding-top: 8rem;
    padding-bottom: 8rem;
    perspective: 1200px;
}

.depth-stage {
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
    min-height: 80vh;
    display: flex;
    align-items: center;
    transform-style: preserve-3d;
}

.depth-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    transition: transform 0.1s linear;
}

.depth-layer svg {
    width: 100%;
    height: 100%;
}

.depth-layer--back {
    transform: translateZ(-100px) scale(1.05);
    opacity: 0.3;
}

.depth-layer--mid {
    transform: translateZ(0);
    opacity: 0.7;
}

.depth-layer--front {
    transform: translateZ(100px) scale(0.92);
    opacity: 1;
    filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.5));
}

.depth-content {
    position: relative;
    z-index: 5;
    max-width: 540px;
    margin-left: auto;
    margin-right: 5%;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(27, 40, 56, 0.85), rgba(13, 27, 42, 0.65));
    border: 1px solid var(--ghost-rule);
    backdrop-filter: blur(2px);
    transform: translateZ(40px);
}

.depth-content .stratum-eyebrow,
.depth-content .stratum-title {
    text-align: left;
}

.depth-paragraph {
    color: var(--silver-mist);
    margin-bottom: 1.2rem;
    font-size: 1rem;
    line-height: 1.7;
}

.depth-paragraph .emph {
    color: var(--chronometer-gold);
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* ==========================================================================
   STRATUM IV -- INSTRUMENT PANEL
   ========================================================================== */
.stratum-instruments {
    min-height: 100vh;
    padding-top: 6rem;
    padding-bottom: 6rem;
}

.instrument-rack {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    align-items: start;
}

.gauge-hex {
    position: relative;
    background: var(--midnight-steel);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    padding: 2rem 1.5rem;
    aspect-ratio: 1 / 1.05;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 1px solid transparent;
    transition: background 0.4s ease;
}

.gauge-hex:hover {
    background: var(--iron-depth);
}

.gauge {
    width: 70%;
    max-width: 160px;
    aspect-ratio: 1 / 1;
    margin-bottom: 0.8rem;
}

.gauge-arc {
    transition: stroke-dashoffset 1.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gauge-needle {
    transform-origin: 60px 60px;
    transform: rotate(-135deg);
    transition: transform 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    filter: drop-shadow(0 0 4px rgba(212, 175, 55, 0.55));
}

.gauge-meta {
    width: 100%;
}

.gauge-label {
    font-family: var(--font-label);
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--steel-haze);
    margin-bottom: 0.3rem;
}

.gauge-readout {
    font-family: var(--font-mono);
    font-size: 1.15rem;
    color: var(--chronometer-gold);
    letter-spacing: 0.05em;
}

.gauge-unit {
    color: var(--steel-haze);
    font-size: 0.85rem;
    margin-left: 0.15em;
}

/* ==========================================================================
   STRATUM V -- THE COORDINATES
   ========================================================================== */
.stratum-coordinates {
    min-height: 50vh;
    padding-top: 6rem;
    padding-bottom: 6rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.closing-hex {
    position: relative;
    width: min(560px, 92vw);
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.closing-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.closing-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
    max-width: 80%;
}

.closing-data {
    margin-top: 1.2rem;
    margin-bottom: 1.5rem;
    text-align: left;
    display: inline-block;
}

.coord-line {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    border-bottom: 1px solid var(--ghost-rule);
    padding: 0.5rem 0;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.coord-key {
    color: var(--steel-haze);
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.coord-val {
    color: var(--chronometer-gold);
}

.closing-foot {
    font-family: var(--font-label);
    font-size: 0.78rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--steel-haze);
    margin-top: 1rem;
}

/* ==========================================================================
   COMPASS NAVIGATION
   ========================================================================== */
.compass {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 64px;
    height: 64px;
    z-index: 50;
    transition: transform 0.6s ease-out;
}

.compass-svg {
    width: 100%;
    height: 100%;
    cursor: pointer;
    filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.7));
}

.vertex {
    cursor: pointer;
    transition: fill 0.3s ease, stroke-width 0.3s ease, r 0.3s ease;
}

.vertex:hover {
    fill: var(--iron-depth);
    r: 6;
}

.vertex.is-active {
    fill: var(--chronometer-gold);
    animation: vertexPulse 2s infinite ease-in-out;
}

@keyframes vertexPulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.compass-label {
    font-family: var(--font-label);
    font-size: 12px;
    fill: var(--chronometer-gold);
    letter-spacing: 0.1em;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 820px) {
    .honeycomb-field {
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: repeat(12, 80px);
    }

    .hex-cell:nth-child(1) { grid-column: 1 / span 2; grid-row: 1 / span 2; }
    .hex-cell:nth-child(2) { grid-column: 3 / span 2; grid-row: 1 / span 2; }
    .hex-cell:nth-child(3) { grid-column: 1 / span 2; grid-row: 3 / span 2; }
    .hex-cell:nth-child(4) { grid-column: 3 / span 2; grid-row: 3 / span 2; }
    .hex-cell:nth-child(5) { grid-column: 1 / span 2; grid-row: 5 / span 2; }
    .hex-cell:nth-child(6) { grid-column: 3 / span 2; grid-row: 5 / span 2; }
    .hex-cell:nth-child(7) { grid-column: 1 / span 2; grid-row: 7 / span 2; }
    .hex-cell:nth-child(8) { grid-column: 3 / span 2; grid-row: 7 / span 2; }
    .hex-cell:nth-child(9) { grid-column: 1 / span 2; grid-row: 9 / span 2; }
    .hex-cell:nth-child(10) { grid-column: 3 / span 2; grid-row: 9 / span 2; }
    .hex-cell:nth-child(11) { grid-column: 1 / span 2; grid-row: 11 / span 2; }
    .hex-cell:nth-child(12) { grid-column: 3 / span 2; grid-row: 11 / span 2; }

    .hex-cell.is-revealed:nth-child(2),
    .hex-cell.is-revealed:nth-child(4),
    .hex-cell.is-revealed:nth-child(6),
    .hex-cell.is-revealed:nth-child(8),
    .hex-cell.is-revealed:nth-child(10),
    .hex-cell.is-revealed:nth-child(12) {
        transform: scale(1) rotate(0deg);
    }

    .depth-content {
        margin-right: auto;
        margin-left: auto;
    }
}
