/* ===================================================================
   valuator.dev — The Ledger of Worth
   Victorian patent office × quantum laboratory
   =================================================================== */

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

:root {
    --c-parchment: #F5ECD7;
    --c-walnut:    #2C1810;
    --c-gold:      #C4983A;
    --c-ink:       #6B4E37;
    --c-umber:     #3D2B1F;
    --c-deepgold:  #8B6914;
    --c-teal:      #1A3A4A;
    --c-aqua:      #D4F1F9;
    --c-bisque:    #E8C9A0;
    --c-oxblood:   #7C1A2E;

    --f-display: 'Playfair Display', 'Times New Roman', serif;
    --f-script:  'Caveat', 'Brush Script MT', cursive;
    --f-body:    'Source Serif 4', 'Source Serif Pro', Georgia, serif;
    --f-mono:    'IBM Plex Mono', 'Courier New', monospace;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--f-body);
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    line-height: 1.72;
    color: var(--c-umber);
    background-color: var(--c-parchment);
    /* Persistent ledger ruled-paper pattern, fixed so it stays anchored during scroll */
    background-image:
        repeating-linear-gradient(0deg,
            transparent, transparent 47px,
            rgba(196, 152, 58, 0.10) 47px,
            rgba(196, 152, 58, 0.10) 48px),
        repeating-linear-gradient(90deg,
            transparent, transparent 79px,
            rgba(196, 152, 58, 0.05) 79px,
            rgba(196, 152, 58, 0.05) 80px),
        radial-gradient(ellipse at 30% 20%, rgba(196,152,58,0.06), transparent 60%),
        radial-gradient(ellipse at 70% 80%, rgba(124,26,46,0.04), transparent 60%);
    background-attachment: fixed;
    overflow-x: hidden;
    animation: parchmentFade 0.8s ease-out both;
    padding-left: 60px; /* space for sticky epoch sidebar */
}

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

/* ===================================================================
   Bubble field (signature water-bubble motif)
   =================================================================== */
.bubble-field {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.bubble {
    position: absolute;
    border: 1px solid rgba(212, 241, 249, 0.5);
    background: radial-gradient(circle at 30% 30%,
        rgba(212, 241, 249, 0.30),
        rgba(212, 241, 249, 0.05) 60%,
        transparent 100%);
    border-radius: 50%;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    animation: rise var(--bubble-dur, 14s) ease-in infinite,
               pulse 3.2s ease-in-out infinite alternate;
    box-shadow: inset 0 0 12px rgba(212, 241, 249, 0.15),
                0 0 18px rgba(212, 241, 249, 0.08);
}

@keyframes rise {
    0%   { transform: translate3d(0, 110vh, 0) scale(0.7); opacity: 0; }
    8%   { opacity: 0.65; }
    50%  { transform: translate3d(var(--drift, 24px), 50vh, 0) scale(1); }
    92%  { opacity: 0.55; }
    100% { transform: translate3d(calc(var(--drift, 24px) * -1), -10vh, 0) scale(1.05); opacity: 0; }
}

@keyframes pulse {
    from { box-shadow: inset 0 0 12px rgba(212,241,249,0.15), 0 0 14px rgba(212,241,249,0.06); }
    to   { box-shadow: inset 0 0 18px rgba(212,241,249,0.30), 0 0 22px rgba(212,241,249,0.18); }
}

/* ===================================================================
   Epoch sidebar — sticky timeline of valuation epochs
   =================================================================== */
.epoch-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 60px;
    height: 100vh;
    z-index: 20;
    background: linear-gradient(180deg, rgba(44,24,16,0.92), rgba(44,24,16,0.85));
    border-right: 1px solid rgba(196, 152, 58, 0.4);
    box-shadow: inset -2px 0 0 rgba(196,152,58,0.12), 4px 0 16px rgba(0,0,0,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
}

.epoch-rail {
    position: absolute;
    top: 6%;
    bottom: 6%;
    left: 50%;
    width: 1px;
    background: linear-gradient(180deg,
        transparent 0%,
        rgba(196, 152, 58, 0.45) 8%,
        rgba(196, 152, 58, 0.45) 92%,
        transparent 100%);
    transform: translateX(-50%);
}

.epoch-list {
    list-style: none;
    height: 90%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 4% 0;
}

.epoch-item {
    position: relative;
    width: 60px;
    text-align: center;
    transition: transform 0.45s ease, color 0.45s ease;
}

.epoch-num {
    display: block;
    font-family: var(--f-display);
    font-size: 1.05rem;
    font-weight: 900;
    color: var(--c-gold);
    letter-spacing: 0.05em;
    text-shadow: 0 1px 0 rgba(0,0,0,0.4), 0 0 8px rgba(196,152,58,0.25);
    transition: color 0.45s ease, transform 0.45s ease;
}

.epoch-label {
    display: block;
    margin-top: 4px;
    font-family: var(--f-mono);
    font-size: 0.62rem;
    color: rgba(232, 201, 160, 0.7);
    letter-spacing: 0.08em;
}

.epoch-item.is-active .epoch-num {
    color: var(--c-aqua);
    transform: scale(1.18);
    text-shadow: 0 0 12px rgba(212, 241, 249, 0.6);
}

.epoch-item.is-active .epoch-label {
    color: var(--c-aqua);
}

.epoch-item::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    border: 1px solid var(--c-gold);
    background: var(--c-walnut);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    transition: background 0.45s ease, transform 0.45s ease;
    z-index: 1;
    opacity: 0;
}

.epoch-item.is-active::before {
    background: var(--c-aqua);
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 0.7;
}

/* ===================================================================
   HERO — diagonally bisected
   =================================================================== */
.hero {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    align-items: stretch;
    background: linear-gradient(135deg,
        var(--c-parchment) 0%, var(--c-parchment) 49.6%,
        var(--c-gold) 49.6%, var(--c-gold) 49.9%,
        var(--c-walnut) 49.9%, var(--c-walnut) 100%);
    z-index: 2;
}

.hero::before {
    /* Sepia daguerreotype vignette */
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 25% 25%, rgba(255,255,255,0.0) 30%, rgba(44,24,16,0.18) 100%),
        repeating-linear-gradient(0deg,
            transparent, transparent 47px,
            rgba(196, 152, 58, 0.07) 47px,
            rgba(196, 152, 58, 0.07) 48px);
    pointer-events: none;
    mix-blend-mode: multiply;
}

.hero-illustration {
    grid-column: 1 / 7;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 3rem 3rem;
    animation: slideInL 900ms cubic-bezier(0.23, 1, 0.32, 1) 0.6s both;
}

.brass-instrument {
    width: min(70%, 460px);
    height: auto;
    filter: drop-shadow(0 6px 18px rgba(44,24,16,0.35));
}

.needle {
    transform-origin: 200px 200px;
    animation: needleSweep 18s ease-in-out infinite;
}

@keyframes needleSweep {
    0%, 100% { transform: rotate(-32deg); }
    25%      { transform: rotate(54deg); }
    55%      { transform: rotate(-12deg); }
    80%      { transform: rotate(28deg); }
}

.hero-stamp {
    position: absolute;
    bottom: 3.5rem;
    left: 3rem;
    font-family: var(--f-mono);
    font-size: 0.74rem;
    color: var(--c-deepgold);
    letter-spacing: 0.18em;
    line-height: 1.6;
    border: 1px solid rgba(139,105,20,0.4);
    padding: 0.6rem 0.9rem;
    background: rgba(245, 236, 215, 0.4);
    transform: rotate(-3deg);
}

.stamp-line {
    display: block;
}

.hero-titleblock {
    grid-column: 7 / 13;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 6rem 3rem 4rem 5rem;
    color: var(--c-bisque);
    animation: slideInR 900ms cubic-bezier(0.23, 1, 0.32, 1) 0.6s both;
}

@keyframes slideInL {
    from { opacity: 0; transform: translateX(-60px) rotate(-1deg); }
    to   { opacity: 1; transform: translateX(0) rotate(0); }
}
@keyframes slideInR {
    from { opacity: 0; transform: translateX(60px) rotate(1deg); }
    to   { opacity: 1; transform: translateX(0) rotate(0); }
}

.hero-eyebrow {
    font-family: var(--f-mono);
    font-size: 0.78rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--c-gold);
    margin-bottom: 1.5rem;
    text-shadow: 0 1px 0 rgba(0,0,0,0.6);
}

.hero-title {
    font-family: var(--f-display);
    font-weight: 900;
    font-size: clamp(2.4rem, 5.2vw, 4.8rem);
    line-height: 1.05;
    letter-spacing: 0.02em;
    color: var(--c-gold);
    text-shadow: 0 2px 0 rgba(0,0,0,0.45), 0 0 30px rgba(196,152,58,0.2);
    margin-bottom: 1.5rem;
    font-feature-settings: "swsh" 1, "liga" 1;
}

.title-line {
    display: block;
}

.title-italic {
    font-style: italic;
    color: var(--c-aqua);
    text-shadow: 0 0 18px rgba(212,241,249,0.35), 0 2px 0 rgba(0,0,0,0.4);
}

.hero-script {
    font-family: var(--f-script);
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    color: var(--c-bisque);
    margin-bottom: 1.8rem;
    transform: rotate(-1.5deg);
}

.hero-rule {
    width: 60%;
    max-width: 320px;
}

.hero-rule svg {
    width: 100%;
    height: auto;
}

.orn-path {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    animation: drawOrn 1.6s ease-out 1.4s forwards;
}

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

.hero-margin {
    position: absolute;
    bottom: 8%;
    right: 6%;
}

/* ===================================================================
   Margin notes — handwritten Caveat annotations
   =================================================================== */
.margin-note {
    display: inline-block;
    font-family: var(--f-script);
    font-size: clamp(1.1rem, 1.8vw, 1.4rem);
    color: var(--c-ink);
    transform: rotate(-3deg);
    opacity: 0;
    transition: opacity 0.7s ease, transform 0.7s ease;
    pointer-events: none;
    letter-spacing: 0.01em;
    text-shadow: 0 1px 0 rgba(245,236,215,0.6);
}

.margin-note.is-visible {
    opacity: 0.78;
    transform: rotate(-3deg) translateY(0);
}

.margin-note--right {
    position: absolute;
    bottom: 4%;
    right: 4%;
    transform: rotate(3deg);
}
.margin-note--right.is-visible { transform: rotate(3deg); }

.margin-note--mid {
    position: absolute;
    top: 18%;
    right: 6%;
    transform: rotate(-4deg);
}
.margin-note--mid.is-visible { transform: rotate(-4deg); }

.margin-note--lower {
    position: absolute;
    bottom: 8%;
    left: 6%;
    transform: rotate(-2deg);
}
.margin-note--lower.is-visible { transform: rotate(-2deg); }

.margin-note--gold {
    color: var(--c-bisque);
    text-shadow: 0 1px 0 rgba(0,0,0,0.5);
}

/* ===================================================================
   Ornament dividers
   =================================================================== */
.ornament-divider {
    position: relative;
    z-index: 3;
    margin: 0;
    padding: 1.4rem 0;
    background: var(--c-parchment);
    text-align: center;
    overflow: hidden;
}

.ornament-divider--gold {
    background: var(--c-walnut);
}

.orn-svg {
    width: min(80%, 720px);
    height: auto;
    display: block;
    margin: 0 auto;
}

.orn-draw {
    stroke-dasharray: 1600;
    stroke-dashoffset: 1600;
    transition: stroke-dashoffset 1.5s ease-out;
}

.ornament-divider.is-visible .orn-draw {
    stroke-dashoffset: 0;
}

/* ===================================================================
   Diagonal sections
   =================================================================== */
.diag-section {
    position: relative;
    z-index: 2;
    padding: clamp(5rem, 11vh, 9rem) clamp(1.5rem, 4vw, 4rem);
    margin-top: -1px;
    overflow: hidden;
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 700ms cubic-bezier(0.23, 1, 0.32, 1),
                transform 700ms cubic-bezier(0.23, 1, 0.32, 1);
}

.diag-section.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.diag-light {
    background: var(--c-parchment);
    color: var(--c-umber);
    clip-path: polygon(0 4%, 100% 0, 100% 96%, 0 100%);
    margin-top: -3vw;
}

.diag-dark {
    background: var(--c-walnut);
    color: var(--c-bisque);
    clip-path: polygon(0 0, 100% 4%, 100% 100%, 0 96%);
    margin-top: -3vw;
}

.diag-dark::before, .diag-light::before {
    /* internal grid-line scaffold (sub-section ledger) */
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(0deg,
            transparent, transparent 47px,
            rgba(196, 152, 58, 0.10) 47px,
            rgba(196, 152, 58, 0.10) 48px),
        repeating-linear-gradient(90deg,
            transparent, transparent calc(100% / 12 - 1px),
            rgba(196, 152, 58, 0.12) calc(100% / 12 - 1px),
            rgba(196, 152, 58, 0.12) calc(100% / 12));
    pointer-events: none;
    opacity: 0.55;
}

.diag-dark::before {
    background-image:
        repeating-linear-gradient(0deg,
            transparent, transparent 47px,
            rgba(196, 152, 58, 0.16) 47px,
            rgba(196, 152, 58, 0.16) 48px),
        repeating-linear-gradient(90deg,
            transparent, transparent calc(100% / 12 - 1px),
            rgba(196, 152, 58, 0.14) calc(100% / 12 - 1px),
            rgba(196, 152, 58, 0.14) calc(100% / 12));
    opacity: 0.7;
}

.section-frame {
    position: relative;
    max-width: 1240px;
    margin: 0 auto;
    padding: 2rem clamp(0.5rem, 2vw, 2rem);
    z-index: 2;
}

.section-head {
    text-align: center;
    margin-bottom: 4rem;
    padding: 0 1rem;
}

.section-eyebrow {
    display: inline-block;
    font-family: var(--f-mono);
    font-size: 0.78rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--c-deepgold);
    border-top: 1px solid rgba(196, 152, 58, 0.5);
    border-bottom: 1px solid rgba(196, 152, 58, 0.5);
    padding: 0.4rem 1.2rem;
    margin-bottom: 1.4rem;
}

.section-eyebrow--gold {
    color: var(--c-gold);
    border-color: rgba(196, 152, 58, 0.65);
}

.section-title {
    font-family: var(--f-display);
    font-weight: 900;
    font-size: clamp(2rem, 4.4vw, 3.4rem);
    letter-spacing: 0.02em;
    line-height: 1.1;
    color: var(--c-umber);
    margin-bottom: 0.9rem;
    font-feature-settings: "swsh" 1;
}

.diag-dark .section-title {
    color: var(--c-gold);
    text-shadow: 0 1px 0 rgba(0,0,0,0.5);
}

.section-lede {
    font-family: var(--f-body);
    font-size: clamp(1rem, 1.6vw, 1.15rem);
    color: var(--c-ink);
    max-width: 620px;
    margin: 0 auto;
    line-height: 1.7;
}

.diag-dark .section-lede {
    color: var(--c-bisque);
}

/* ===================================================================
   Card grids
   =================================================================== */
.card-grid {
    display: grid;
    gap: clamp(1.5rem, 2.5vw, 2.4rem);
    margin: 0 auto;
}

.card-grid-3 {
    grid-template-columns: repeat(3, 1fr);
    max-width: 1100px;
}

.card-grid-6 {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: minmax(280px, auto);
    max-width: 1100px;
}

@media (max-width: 880px) {
    .card-grid-3, .card-grid-6 {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 580px) {
    .card-grid-3, .card-grid-6 {
        grid-template-columns: 1fr;
    }
}

/* ===================================================================
   Card-flip — Victorian certificate front / data readout back
   =================================================================== */
.flip-card {
    position: relative;
    perspective: 1200px;
    aspect-ratio: 3 / 4;
    cursor: pointer;
}

.flip-card--small {
    aspect-ratio: 4 / 5;
}

.flip-card--offset-0 { transform: translateY(0); }
.flip-card--offset-1 { transform: translateY(40px); }
.flip-card--offset-2 { transform: translateY(80px); }

@media (max-width: 580px) {
    .flip-card--offset-1, .flip-card--offset-2 { transform: translateY(0); }
}

.flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.flip-card:hover .flip-inner,
.flip-card:focus .flip-inner,
.flip-card.is-flipped .flip-inner {
    transform: rotateY(180deg);
}

.flip-front, .flip-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    overflow: hidden;
    border-radius: 2px;
}

/* Front — Victorian certificate */
.flip-front {
    background:
        radial-gradient(ellipse at 30% 20%, rgba(255,255,255,0.4), transparent 60%),
        linear-gradient(160deg, var(--c-bisque), var(--c-parchment) 60%, var(--c-bisque));
    border: 1px solid rgba(196, 152, 58, 0.6);
    box-shadow:
        inset 0 0 0 1px rgba(245,236,215,0.6),
        inset 0 0 0 6px rgba(245,236,215,0.95),
        inset 0 0 0 7px rgba(196,152,58,0.5),
        0 8px 22px rgba(44, 24, 16, 0.18),
        0 2px 4px rgba(44, 24, 16, 0.12);
    padding: 1.6rem 1.4rem 1.3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: var(--c-umber);
}

.flip-front::before {
    /* Inner rule frame */
    content: "";
    position: absolute;
    inset: 14px;
    border: 1px solid rgba(196, 152, 58, 0.5);
    pointer-events: none;
}

.flip-front::after {
    /* Subtle ledger lines */
    content: "";
    position: absolute;
    inset: 22px;
    background-image: repeating-linear-gradient(0deg,
        transparent, transparent 23px,
        rgba(196,152,58,0.08) 23px,
        rgba(196,152,58,0.08) 24px);
    pointer-events: none;
}

.cert-corner {
    position: absolute;
    width: 18px;
    height: 18px;
    border: 1px solid var(--c-gold);
}
.cert-corner--tl { top: 22px; left: 22px; border-right: 0; border-bottom: 0; }
.cert-corner--tr { top: 22px; right: 22px; border-left: 0; border-bottom: 0; }
.cert-corner--bl { bottom: 22px; left: 22px; border-right: 0; border-top: 0; }
.cert-corner--br { bottom: 22px; right: 22px; border-left: 0; border-top: 0; }

.cert-eyebrow {
    position: relative;
    font-family: var(--f-mono);
    font-size: 0.66rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--c-deepgold);
    margin-top: 0.3rem;
    margin-bottom: 0.7rem;
    z-index: 2;
}

.cert-title {
    position: relative;
    font-family: var(--f-display);
    font-weight: 900;
    font-size: clamp(1.6rem, 2.4vw, 2rem);
    color: var(--c-umber);
    line-height: 1.1;
    margin-bottom: 0.5rem;
    letter-spacing: 0.01em;
    font-feature-settings: "swsh" 1;
    z-index: 2;
}

.cert-title--sm {
    font-size: clamp(1.3rem, 2vw, 1.6rem);
}

.cert-script {
    position: relative;
    font-family: var(--f-script);
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    color: var(--c-ink);
    margin-bottom: 0.9rem;
    z-index: 2;
    transform: rotate(-1deg);
}

.cert-body {
    position: relative;
    font-family: var(--f-body);
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--c-umber);
    max-width: 90%;
    z-index: 2;
}

/* Wax seal */
.wax-seal {
    position: relative;
    margin-top: auto;
    margin-bottom: 0.4rem;
    width: 56px;
    height: 56px;
    border-radius: 47% 53% 49% 51% / 51% 47% 53% 49%;
    background: radial-gradient(circle at 35% 35%,
        #A33044 0%, #7C1A2E 35%, #5A1220 70%, #3D0A14 100%);
    box-shadow:
        inset 2px 2px 6px rgba(255,255,255,0.18),
        inset -3px -3px 8px rgba(0,0,0,0.45),
        0 4px 8px rgba(44,24,16,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.wax-seal::before {
    /* Drip imperfection */
    content: "";
    position: absolute;
    width: 14px;
    height: 10px;
    background: radial-gradient(circle, #5A1220 0%, transparent 80%);
    border-radius: 50%;
    bottom: -4px;
    left: 18%;
    box-shadow: 30px 1px 0 -2px #5A1220;
}

.wax-mark {
    font-family: var(--f-display);
    font-weight: 900;
    color: rgba(245, 236, 215, 0.85);
    font-size: 1.5rem;
    text-shadow: 0 1px 1px rgba(0,0,0,0.6);
    transform: rotate(-3deg);
}

.wax-seal--sm {
    width: 38px;
    height: 38px;
    margin-top: 0.6rem;
}
.wax-seal--sm .wax-mark { font-size: 1rem; }

/* Back — futuristic data readout */
.flip-back {
    transform: rotateY(180deg);
    background:
        radial-gradient(ellipse at 30% 0%, rgba(212,241,249,0.08), transparent 60%),
        linear-gradient(170deg, #1A3A4A 0%, #0F2733 50%, #1A3A4A 100%);
    border: 1px solid rgba(212, 241, 249, 0.25);
    box-shadow:
        inset 0 0 0 1px rgba(212,241,249,0.08),
        inset 0 0 30px rgba(212,241,249,0.05),
        0 6px 20px rgba(0,0,0,0.4);
    padding: 1.4rem 1.3rem;
    color: var(--c-aqua);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.scan-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(212, 241, 249, 0.7) 50%,
        transparent 100%);
    box-shadow: 0 0 12px rgba(212, 241, 249, 0.6);
    pointer-events: none;
    animation: scan 3.6s ease-in-out infinite;
    top: 0;
}

@keyframes scan {
    0%   { top: 0; opacity: 0.85; }
    50%  { top: 100%; opacity: 0.85; }
    51%  { top: 0; opacity: 0; }
    52%  { opacity: 0.85; }
    100% { top: 100%; opacity: 0.85; }
}

.flip-back::before {
    /* Faint grid */
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 11px,
            rgba(212,241,249,0.05) 11px, rgba(212,241,249,0.05) 12px),
        repeating-linear-gradient(90deg, transparent, transparent 11px,
            rgba(212,241,249,0.05) 11px, rgba(212,241,249,0.05) 12px);
    pointer-events: none;
}

.data-label {
    font-family: var(--f-mono);
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    color: rgba(212, 241, 249, 0.55);
    margin-bottom: 1rem;
    text-transform: uppercase;
    border-bottom: 1px dashed rgba(212, 241, 249, 0.2);
    padding-bottom: 0.4rem;
    position: relative;
    z-index: 2;
}

.data-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.3rem 0;
    border-bottom: 1px solid rgba(212, 241, 249, 0.08);
    position: relative;
    z-index: 2;
}

.data-key {
    font-family: var(--f-mono);
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    color: rgba(232, 201, 160, 0.7);
}

.data-val {
    font-family: var(--f-mono);
    font-size: 0.95rem;
    color: var(--c-gold);
    text-shadow: 0 0 6px rgba(196, 152, 58, 0.5),
                 0 1px 0 var(--c-deepgold);
    letter-spacing: 0.04em;
}

.data-foot {
    font-family: var(--f-mono);
    font-size: 0.62rem;
    letter-spacing: 0.16em;
    color: rgba(212, 241, 249, 0.45);
    margin-top: 0.9rem;
    position: relative;
    z-index: 2;
}

/* ===================================================================
   Section 2 — philosophical aside
   =================================================================== */
.aside-script {
    font-family: var(--f-script);
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    line-height: 1.4;
    color: var(--c-bisque);
    text-align: center;
    max-width: 920px;
    margin: 0 auto 1.6rem;
    text-shadow: 0 1px 0 rgba(0,0,0,0.45);
    transform: rotate(-0.6deg);
}

.aside-line {
    display: block;
}

.aside-emph {
    color: var(--c-aqua);
    text-shadow: 0 0 14px rgba(212,241,249,0.3), 0 1px 0 rgba(0,0,0,0.4);
    transform: rotate(0.4deg);
}

.aside-attrib {
    text-align: center;
    font-family: var(--f-mono);
    font-size: 0.74rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--c-gold);
    margin-top: 1.4rem;
}

/* ===================================================================
   Section 4 — testimonial frame
   =================================================================== */
.testimonial-frame {
    position: relative;
    max-width: 720px;
    margin: 0 auto;
    padding: clamp(2rem, 4vw, 3.4rem) clamp(2.4rem, 5vw, 4rem);
}

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

.frame-orn {
    stroke-dasharray: 220;
    stroke-dashoffset: 220;
    transition: stroke-dashoffset 1.4s ease-out;
}

.is-visible .frame-orn,
.diag-section.is-visible .frame-orn {
    stroke-dashoffset: 0;
}

.testimonial {
    position: relative;
    text-align: center;
    z-index: 2;
}

.testi-text {
    font-family: var(--f-display);
    font-style: italic;
    font-size: clamp(1.2rem, 2.2vw, 1.7rem);
    line-height: 1.5;
    color: var(--c-bisque);
    margin-bottom: 1.6rem;
    font-feature-settings: "swsh" 1;
}

.testi-footer {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.testi-name {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 1rem;
    color: var(--c-gold);
    letter-spacing: 0.06em;
}

.testi-role {
    font-family: var(--f-script);
    font-size: 1.1rem;
    color: var(--c-bisque);
    opacity: 0.8;
}

.seal-of-record {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 3.5rem;
}

.wax-seal--lg {
    width: 110px;
    height: 110px;
    position: relative;
}

.wax-mark--lg {
    font-size: 2.4rem;
    z-index: 2;
}

.wax-ring {
    position: absolute;
    inset: 8px;
    border: 1px solid rgba(245, 236, 215, 0.4);
    border-radius: 50%;
    font-family: var(--f-mono);
    font-size: 0.55rem;
    letter-spacing: 0.4em;
    color: rgba(245, 236, 215, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    animation: ringSpin 28s linear infinite;
}

@keyframes ringSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.seal-caption {
    font-family: var(--f-script);
    font-size: 1.2rem;
    color: var(--c-bisque);
    margin-top: 0.9rem;
    transform: rotate(-2deg);
}

/* ===================================================================
   FINAL — porthole / monocle
   =================================================================== */
.porthole-section {
    position: relative;
    z-index: 2;
    padding: clamp(5rem, 12vh, 9rem) 1.5rem 4rem;
    background:
        radial-gradient(circle at 50% 30%, rgba(196,152,58,0.10), transparent 65%),
        var(--c-walnut);
    color: var(--c-bisque);
    overflow: hidden;
    text-align: center;
}

.porthole-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 47px,
            rgba(196, 152, 58, 0.10) 47px, rgba(196, 152, 58, 0.10) 48px);
    pointer-events: none;
    opacity: 0.5;
}

.porthole {
    position: relative;
    width: min(560px, 86vw);
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 35%,
        rgba(245,236,215,0.04) 0%,
        rgba(26, 58, 74, 0.18) 60%,
        rgba(44,24,16,0.5) 100%);
    overflow: hidden;
    box-shadow: 0 18px 60px rgba(0,0,0,0.45),
                inset 0 0 0 8px rgba(196,152,58,0.18),
                inset 0 0 30px rgba(212,241,249,0.06);
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 1s ease, transform 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.porthole.is-visible {
    opacity: 1;
    transform: scale(1);
}

.porthole-rim {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 4px solid var(--c-gold);
    box-shadow: inset 0 0 0 1px var(--c-deepgold),
                inset 0 0 24px rgba(196, 152, 58, 0.25),
                0 0 30px rgba(196, 152, 58, 0.15);
    pointer-events: none;
}

.porthole-spin {
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    background: conic-gradient(from 0deg,
        var(--c-gold) 0deg,
        var(--c-deepgold) 45deg,
        var(--c-bisque) 90deg,
        var(--c-deepgold) 135deg,
        var(--c-gold) 180deg,
        var(--c-deepgold) 225deg,
        var(--c-bisque) 270deg,
        var(--c-deepgold) 315deg,
        var(--c-gold) 360deg);
    -webkit-mask: radial-gradient(circle, transparent 0 49.5%, #000 50% 50.5%, transparent 51%);
            mask: radial-gradient(circle, transparent 0 49.5%, #000 50% 50.5%, transparent 51%);
    animation: spin 24s linear infinite;
    pointer-events: none;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.porthole-inner {
    position: absolute;
    inset: 8%;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 35%,
        rgba(245,236,215,0.06),
        rgba(26, 58, 74, 0.2) 50%,
        rgba(15, 39, 51, 0.5) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    border: 1px solid rgba(196,152,58,0.3);
}

.porthole-eyebrow {
    font-family: var(--f-mono);
    font-size: 0.72rem;
    letter-spacing: 0.34em;
    text-transform: uppercase;
    color: var(--c-gold);
    margin-bottom: 0.8rem;
}

.porthole-num {
    font-family: var(--f-mono);
    font-size: clamp(2rem, 5vw, 3.4rem);
    color: var(--c-aqua);
    text-shadow: 0 0 20px rgba(212, 241, 249, 0.5),
                 0 2px 0 var(--c-deepgold);
    letter-spacing: 0.05em;
    margin-bottom: 1.2rem;
}

.porthole-title {
    font-family: var(--f-display);
    font-weight: 900;
    font-size: clamp(1.6rem, 3.4vw, 2.4rem);
    color: var(--c-gold);
    line-height: 1.15;
    margin-bottom: 1rem;
    letter-spacing: 0.02em;
    font-feature-settings: "swsh" 1;
}

.porthole-title em {
    font-style: italic;
    color: var(--c-bisque);
}

.porthole-script {
    font-family: var(--f-script);
    font-size: clamp(1.1rem, 1.8vw, 1.3rem);
    color: var(--c-bisque);
    margin-bottom: 1.6rem;
    transform: rotate(-1deg);
    max-width: 80%;
}

.porthole-link {
    font-family: var(--f-mono);
    font-size: 0.7rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--c-gold);
    text-decoration: none;
    border: 1px solid var(--c-gold);
    padding: 0.6rem 1.2rem;
    transition: all 0.45s ease;
    background: rgba(245, 236, 215, 0.04);
}

.porthole-link:hover {
    background: var(--c-gold);
    color: var(--c-walnut);
    box-shadow: 0 0 20px rgba(196, 152, 58, 0.4);
    letter-spacing: 0.36em;
}

.ledger-foot {
    margin-top: 5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.4rem;
    font-family: var(--f-mono);
    font-size: 0.7rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--c-gold);
    flex-wrap: wrap;
}

.foot-rule {
    flex: 0 0 auto;
    width: 40px;
    height: 1px;
    background: var(--c-gold);
    opacity: 0.5;
}

/* ===================================================================
   Responsive
   =================================================================== */
@media (max-width: 880px) {
    body { padding-left: 0; }
    .epoch-sidebar { display: none; }

    .hero {
        grid-template-columns: 1fr;
        background: linear-gradient(180deg,
            var(--c-parchment) 0%, var(--c-parchment) 49%,
            var(--c-walnut) 51%, var(--c-walnut) 100%);
    }
    .hero-illustration {
        grid-column: 1;
        padding: 4rem 2rem 2rem;
    }
    .hero-titleblock {
        grid-column: 1;
        padding: 3rem 2rem 5rem;
    }
    .hero-stamp { left: 2rem; bottom: 1.5rem; }

    .diag-light, .diag-dark {
        clip-path: polygon(0 1.5%, 100% 0, 100% 98.5%, 0 100%);
    }
}

@media (max-width: 580px) {
    .hero-title { font-size: clamp(2rem, 9vw, 3rem); }
    .section-frame { padding: 1rem 0.5rem; }
    .ledger-foot { gap: 0.6rem; font-size: 0.6rem; }
}
