/* ============================================
   transactology.com - Styles
   Art-Deco Formalism / Banknote Engraving Aesthetic
   ============================================ */

/* -- Custom Properties -- */
:root {
    --vault-marble: #F2EDE4;
    --obsidian-ledger: #1A1A2E;
    --bullion-gold: #C9A84C;
    --patina-copper: #7B6840;
    --ink-carbon: #2B2B2B;
    --parchment-light: #E8E0D0;
    --mint-verification: #3A7D6E;
    --ledger-line: #D4C9B5;
    --seal-burgundy: #6B2D3E;

    --font-display: 'Playfair Display', serif;
    --font-body: 'Commissioner', sans-serif;
    --font-mono: 'DM Mono', monospace;

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

/* -- Reset -- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    font-weight: 300;
    color: var(--ink-carbon);
    background-color: var(--vault-marble);
    line-height: 1.72;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

/* -- Progress Bar -- */
#progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--bullion-gold);
    z-index: 1000;
    transition: width 0.1s linear;
}

/* -- Navigation -- */
#main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 3rem;
    z-index: 900;
    background: transparent;
    transition: background 0.4s ease;
}

#main-nav.scrolled {
    background: rgba(26, 26, 46, 0.92);
    backdrop-filter: blur(8px);
}

.nav-domain {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--bullion-gold);
    letter-spacing: 0.06em;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
}

.nav-links a {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.72rem;
    color: var(--parchment-light);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    transition: color 0.3s ease, transform 0.3s ease;
}

.nav-links a:hover {
    color: var(--bullion-gold);
}

/* ============================================
   SECTION 1: THE VAULT (Hero)
   ============================================ */
.section-vault {
    position: relative;
    min-height: 110vh;
    background: var(--obsidian-ledger);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.guilloche-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.hero-line {
    width: 60%;
    max-width: 700px;
    height: 4px;
    opacity: 0;
    position: relative;
    z-index: 2;
}

.hero-line.animate {
    opacity: 1;
}

#gold-line {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    transition: stroke-dashoffset 1.8s var(--ease-ceremony);
}

.hero-line.animate #gold-line {
    stroke-dashoffset: 0;
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 2;
    margin-top: 1.5rem;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 9rem);
    color: var(--parchment-light);
    letter-spacing: 0em;
    line-height: 1.05;
    opacity: 0;
    transition: opacity 1s var(--ease-ceremony), letter-spacing 1.2s var(--ease-ceremony);
}

.hero-title.animate {
    opacity: 1;
    letter-spacing: 0.03em;
}

.hero-subtitle {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(1rem, 2vw, 1.6rem);
    color: var(--bullion-gold);
    letter-spacing: 0.08em;
    margin-top: 0.8rem;
    opacity: 0;
    transition: opacity 0.8s var(--ease-ceremony);
}

.hero-subtitle.animate {
    opacity: 1;
}

/* Wax Seal - Hero */
.wax-seal-container {
    position: absolute;
    bottom: 12%;
    right: 10%;
    width: clamp(120px, 18vw, 240px);
    height: clamp(120px, 18vw, 240px);
    opacity: 0.4;
    z-index: 1;
    animation: sealRotate 120s linear infinite;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.wax-seal-container:hover {
    transform: scale(0.95) rotate(3deg);
}

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

.wax-seal {
    width: 100%;
    height: 100%;
}

/* ============================================
   DIAGONAL DIVIDERS
   ============================================ */
.diagonal-divider {
    position: relative;
    width: 100%;
    height: clamp(40px, 6vw, 80px);
    overflow: hidden;
    margin: -1px 0;
}

.diagonal-divider svg {
    width: 100%;
    height: 100%;
    display: block;
}

.divider-dark-to-light {
    background: linear-gradient(to bottom, var(--obsidian-ledger), var(--vault-marble));
}

.divider-light-to-dark {
    background: linear-gradient(to bottom, var(--vault-marble), var(--obsidian-ledger));
}

/* ============================================
   SECTION 2: THE LEDGER
   ============================================ */
.section-ledger {
    position: relative;
    min-height: 120vh;
    background: var(--vault-marble);
    padding: clamp(4rem, 8vh, 8rem) 3rem;
}

/* Ledger Lines (horizontal rules) */
.ledger-lines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    padding: clamp(3rem, 5vh, 5rem) 0;
}

.ledger-rule {
    width: 100%;
    height: 1px;
    background: var(--ledger-line);
    opacity: 0;
    transition: opacity 0.5s var(--ease-ceremony);
}

.ledger-rule.visible {
    opacity: 1;
}

/* Ledger Grid - Debit/Credit Split */
.ledger-grid {
    display: grid;
    grid-template-columns: 33% 67%;
    max-width: 1200px;
    margin: 0 auto;
    padding: clamp(2rem, 4vh, 4rem) 0;
    position: relative;
    z-index: 2;
}

.debit-column {
    padding-right: 2rem;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding-top: 0.3rem;
}

.annotation {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--patina-copper);
}

.credit-column {
    padding-left: 2rem;
    border-left: 1px solid var(--ledger-line);
}

.credit-column p {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(1rem, 1.2vw, 1.25rem);
    color: var(--ink-carbon);
    line-height: 1.72;
    letter-spacing: 0.01em;
    max-width: 640px;
}

/* Reveal animations */
.reveal-item {
    opacity: 0;
    transform: translateY(2rem);
    transition: opacity 0.7s var(--ease-ceremony), transform 0.7s var(--ease-ceremony);
}

.reveal-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   SECTION 3: THE EXCHANGE
   ============================================ */
.section-exchange {
    position: relative;
    min-height: 100vh;
    background: var(--obsidian-ledger);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.exchange-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 900px;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.exchange-label {
    width: 100%;
    text-align: center;
}

.exchange-sender {
    text-align: left;
    padding-left: 2rem;
}

.exchange-receiver {
    text-align: right;
    padding-right: 2rem;
}

.mono-label {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: clamp(0.85rem, 1.2vw, 1.2rem);
    letter-spacing: 0.04em;
    color: var(--parchment-light);
    opacity: 0.7;
}

/* Transaction Arrow */
.transaction-arrow-container {
    width: 100%;
    height: 60px;
}

.transaction-arrow {
    width: 100%;
    height: 100%;
}

.arrow-shaft {
    stroke-dasharray: 950;
    stroke-dashoffset: 950;
    transition: stroke-dashoffset 2.4s var(--ease-ceremony);
}

.arrow-head {
    stroke-dasharray: 80;
    stroke-dashoffset: 80;
    transition: stroke-dashoffset 0.6s var(--ease-ceremony) 2s;
}

.arrow-fletching {
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    transition: stroke-dashoffset 0.5s var(--ease-ceremony) 0.3s;
}

.section-exchange.in-view .arrow-shaft {
    stroke-dashoffset: 0;
}

.section-exchange.in-view .arrow-head {
    stroke-dashoffset: 0;
}

.section-exchange.in-view .arrow-fletching {
    stroke-dashoffset: 0;
}

/* Mechanical Counter */
.mechanical-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-top: 1rem;
}

.counter-digit-group {
    display: flex;
}

.counter-digit {
    width: 2.2rem;
    height: 3rem;
    overflow: hidden;
    position: relative;
    background: rgba(201, 168, 76, 0.08);
    border: 1px solid rgba(201, 168, 76, 0.15);
    margin: 0 1px;
    border-radius: 2px;
}

.digit-strip {
    display: flex;
    flex-direction: column;
    transition: transform 0.6s var(--ease-ceremony);
}

.digit-strip span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 3rem;
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    color: var(--bullion-gold);
    letter-spacing: 0.04em;
}

.counter-separator {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    color: var(--bullion-gold);
    padding: 0 0.15rem;
    opacity: 0.7;
}

/* Guilloche pulse animation */
.guilloche-exchange {
    animation: guillochePulse 8s ease-in-out infinite;
}

@keyframes guillochePulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1.4; }
}

/* ============================================
   SECTION 4: THE RECORD
   ============================================ */
.section-record {
    position: relative;
    min-height: 140vh;
    background: var(--vault-marble);
    padding: clamp(4rem, 8vh, 8rem) 3rem;
}

.record-spine {
    position: absolute;
    left: calc(33% + 3rem);
    top: clamp(4rem, 8vh, 8rem);
    bottom: clamp(4rem, 8vh, 8rem);
    width: 2px;
    background: var(--bullion-gold);
    opacity: 0.5;
}

.record-entry {
    display: grid;
    grid-template-columns: 33% 67%;
    max-width: 1200px;
    margin: 0 auto;
    padding: clamp(2rem, 3vh, 3rem) 0;
    position: relative;
    z-index: 2;
}

.record-debit {
    padding-right: 2rem;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding-top: 0.5rem;
}

.timestamp {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: clamp(0.85rem, 1vw, 1.1rem);
    letter-spacing: 0.04em;
    color: var(--patina-copper);
}

.record-credit {
    padding-left: 2.5rem;
}

.record-credit h3 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.8rem, 3.5vw, 3.5rem);
    color: var(--ink-carbon);
    letter-spacing: 0.03em;
    line-height: 1.05;
    margin-bottom: 1rem;
}

.record-credit p {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(1rem, 1.2vw, 1.25rem);
    color: var(--ink-carbon);
    line-height: 1.72;
    letter-spacing: 0.01em;
    max-width: 600px;
}

.record-rule {
    max-width: 1200px;
    margin: 0 auto;
    height: 1px;
    background: var(--ledger-line);
    position: relative;
    z-index: 2;
}

/* Record reveal animation (slide from left) */
.record-entry.reveal-item {
    opacity: 0;
    transform: translateX(-3rem);
    transition: opacity 0.7s var(--ease-ceremony), transform 0.7s var(--ease-ceremony);
}

.record-entry.reveal-item.visible {
    opacity: 1;
    transform: translateX(0);
}

/* ============================================
   SECTION 5: THE SEAL (Footer)
   ============================================ */
.section-seal {
    position: relative;
    min-height: 80vh;
    background: var(--obsidian-ledger);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.seal-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
}

.seal-main {
    width: clamp(140px, 25vw, 300px);
    height: clamp(140px, 25vw, 300px);
    transform: scale(0.2);
    transition: transform 0.8s var(--ease-ceremony);
}

.seal-main.scaled {
    transform: scale(1);
}

.wax-seal-large {
    width: 100%;
    height: 100%;
}

.settled-text {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.8rem, 4vw, 3.5rem);
    color: var(--bullion-gold);
    letter-spacing: 0.12em;
    opacity: 0;
    transition: opacity 0.8s var(--ease-ceremony) 0.3s;
}

.settled-text.visible {
    opacity: 1;
}

.final-line {
    width: clamp(200px, 30vw, 400px);
    height: 4px;
    opacity: 0;
    transition: opacity 0.6s var(--ease-ceremony) 0.6s;
}

.final-line.visible {
    opacity: 1;
}

#final-line line {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    transition: stroke-dashoffset 1.2s var(--ease-ceremony) 0.8s;
}

.final-line.visible line {
    stroke-dashoffset: 0;
}

.seal-footer-space {
    min-height: 20vh;
}

/* Guilloche in seal section - higher opacity */
.guilloche-seal {
    opacity: 0.5;
    transition: opacity 0.8s ease;
}

.section-seal.in-view .guilloche-seal {
    opacity: 1;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    #main-nav {
        padding: 1rem 1.5rem;
    }

    .nav-links {
        gap: 1.2rem;
    }

    .nav-links a {
        font-size: 0.6rem;
        letter-spacing: 0.08em;
    }

    .ledger-grid,
    .record-entry {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .debit-column,
    .record-debit {
        justify-content: flex-start;
        padding-right: 0;
        padding-left: 0;
    }

    .credit-column {
        border-left: none;
        border-top: 1px solid var(--ledger-line);
        padding-left: 0;
        padding-top: 1rem;
    }

    .record-credit {
        padding-left: 0;
    }

    .record-spine {
        display: none;
    }

    .section-ledger,
    .section-record {
        padding: clamp(3rem, 6vh, 6rem) 1.5rem;
    }

    .wax-seal-container {
        bottom: 5%;
        right: 5%;
    }

    .counter-digit {
        width: 1.6rem;
        height: 2.2rem;
    }

    .digit-strip span {
        width: 1.6rem;
        height: 2.2rem;
    }

    .exchange-content {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .nav-links {
        display: none;
    }

    .hero-title {
        font-size: clamp(2.5rem, 12vw, 4rem);
    }
}

/* ============================================
   SELECTION STYLES
   ============================================ */
::selection {
    background: var(--bullion-gold);
    color: var(--obsidian-ledger);
}

/* ============================================
   SCROLLBAR STYLES
   ============================================ */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--obsidian-ledger);
}

::-webkit-scrollbar-thumb {
    background: var(--bullion-gold);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--patina-copper);
}
