/* ============================================
   bcd.day — Skeuomorphic Blockchain Experience
   ============================================ */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    color: #3b2a1a;
    background-color: #f2e6d4;
    line-height: 1.65;
    overflow-x: hidden;
}

/* ---- SVG Filters (hidden) ---- */
.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* ---- Typography ---- */
h1, h2 {
    font-family: 'Lilita One', cursive;
    letter-spacing: 0.02em;
    color: #2d1b0e;
}

code {
    font-family: 'Source Code Pro', monospace;
    font-weight: 400;
    color: #1a3a4a;
}

/* ---- Chain Progress Indicator ---- */
.chain-progress {
    position: fixed;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 100;
    gap: 0;
}

.chain-block {
    width: 24px;
    height: 16px;
    border-radius: 4px;
    border: 2px solid #8a7a6a;
    background: transparent;
    transition: background-color 0.5s ease, border-color 0.5s ease;
}

.chain-block.filled {
    background-color: #3a8a7a;
    border-color: #3a8a7a;
}

.chain-block.active {
    animation: blockPulse 2s ease-in-out infinite;
    background-color: #3a8a7a;
    border-color: #3a8a7a;
}

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

.chain-link {
    width: 2px;
    height: 12px;
    background-color: #8a7a6a;
}

/* ---- Desk Surface Base ---- */
.desk-surface {
    position: relative;
    width: 100%;
    min-height: 50vh;
    padding: clamp(4rem, 8vh, 7rem) 0;
}

.desk-surface::before {
    content: '';
    position: absolute;
    inset: 0;
    filter: url(#noise-paper);
    pointer-events: none;
    z-index: 0;
}

.desk-container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
}

/* Desk texture variations */
.desk-oak {
    background-color: #f2e6d4;
}

.desk-walnut {
    background-color: #ede0cc;
}

.desk-felt {
    background: linear-gradient(180deg, #d4ede8 0%, #c8e5df 100%);
}

.desk-felt::before {
    filter: url(#noise-paper);
}

.desk-oak-light {
    background-color: #f5ebd9;
}

.desk-walnut-dark {
    background-color: #3b2a1a;
    color: #f2e6d4;
}

.desk-walnut-dark::before {
    filter: url(#noise-leather);
}

/* ---- Desk Grid (F-pattern) ---- */
.desk-grid {
    display: grid;
    grid-template-columns: 1fr 0.7fr;
    gap: 2rem;
    align-items: start;
}

.desk-grid-full {
    grid-template-columns: 1fr;
}

.desk-content-full {
    width: 100%;
}

/* ---- Brass Plaque Headings ---- */
.brass-plaque {
    background: linear-gradient(135deg, #b8942a 0%, #d4aa3a 50%, #b8942a 100%);
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 1.5rem;
    box-shadow:
        0 2px 4px rgba(45, 27, 14, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.15);
    position: relative;
}

.brass-plaque::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 4px;
    filter: url(#noise-metal);
    pointer-events: none;
}

.brass-plaque h2 {
    font-size: clamp(2rem, 5vw, 4rem);
    color: #2d1b0e;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2);
    line-height: 1.2;
}

.brass-plaque-light h2 {
    color: #f2e6d4;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ---- Desk Subtitles ---- */
.desk-subtitle {
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: clamp(1.1rem, 2.5vw, 1.6rem);
    color: #4a3728;
    margin-bottom: 1.5rem;
    padding-left: 0.5rem;
    border-left: 3px solid #b8942a;
}

.desk-subtitle-light {
    color: #d4ede8;
    border-left-color: #d4ede8;
}

/* ---- Drawer Body (Progressive Disclosure) ---- */
.drawer-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

.drawer-body.open {
    max-height: 1200px;
}

.drawer-inner {
    padding: 1.5rem 0;
    border-top: 1px solid rgba(45, 27, 14, 0.08);
}

.drawer-inner p {
    font-size: clamp(0.95rem, 1.8vw, 1.125rem);
    line-height: 1.65;
    margin-bottom: 1.5rem;
    color: #3b2a1a;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.drawer-body.open .drawer-inner p {
    opacity: 1;
    transform: translateY(0);
}

.drawer-body.open .drawer-inner p:nth-child(1) { transition-delay: 0.1s; }
.drawer-body.open .drawer-inner p:nth-child(2) { transition-delay: 0.2s; }
.drawer-body.open .drawer-inner p:nth-child(3) { transition-delay: 0.3s; }
.drawer-body.open .drawer-inner p:nth-child(4) { transition-delay: 0.4s; }

.drawer-inner-light p {
    color: #d4ede8;
}

/* Ledger lines in drawer content */
.drawer-inner p {
    background-image: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent calc(1.5rem * 1.65 - 1px),
        rgba(45, 27, 14, 0.06) calc(1.5rem * 1.65 - 1px),
        rgba(45, 27, 14, 0.06) calc(1.5rem * 1.65)
    );
}

/* ---- Code Examples ---- */
.code-example {
    background-color: #e8f0e8;
    padding: 1rem 1.25rem;
    border-radius: 4px;
    font-family: 'Source Code Pro', monospace;
    font-size: 0.9rem;
    line-height: 1.8;
    color: #1a3a4a;
    border-left: 3px solid #1a3a4a;
}

.hash-text {
    color: #3a8a7a;
    font-weight: 500;
}

/* ---- Drawer Pull ---- */
.drawer-pull {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 2rem;
    cursor: pointer;
    user-select: none;
}

.pull-handle {
    width: 60px;
    height: 14px;
    background: linear-gradient(180deg, #d4aa3a 0%, #b8942a 40%, #96782a 100%);
    border-radius: 0 0 30px 30px;
    box-shadow:
        0 2px 4px rgba(45, 27, 14, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    position: relative;
}

.pull-handle::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 0 0 30px 30px;
    filter: url(#noise-metal);
    pointer-events: none;
}

.drawer-pull:hover .pull-handle {
    box-shadow:
        0 4px 8px rgba(45, 27, 14, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(1px);
}

.drawer-pull.active .pull-handle {
    box-shadow:
        inset 0 2px 4px rgba(45, 27, 14, 0.3),
        inset 0 1px 0 rgba(0, 0, 0, 0.05);
}

.drawer-pull.open .pull-handle {
    transform: rotate(180deg);
}

.pull-handle-light {
    background: linear-gradient(180deg, #d4ede8 0%, #b8cfc9 40%, #8aafaa 100%);
}

.pull-label {
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    color: #8a7a6a;
    margin-top: 0.5rem;
    letter-spacing: 0.05em;
}

/* ---- Embossed Seals ---- */
.embossed-seal {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.seal-svg {
    width: 120px;
    height: 120px;
    filter: drop-shadow(0 2px 3px rgba(45, 27, 14, 0.2));
}

/* ---- Interactive Elements (Desk Interactive) ---- */
.desk-interactive {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 2rem;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #f2e6d4;
    position: relative;
    padding: 0;
}

.desk-edge {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(180deg, #7a5230 0%, #5a3c20 100%);
    filter: url(#noise-leather);
    z-index: 2;
    box-shadow: 0 4px 12px rgba(45, 27, 14, 0.3);
}

.hero-frame {
    position: relative;
    padding: 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    width: min(90vw, 800px);
}

/* ---- Brass Corners ---- */
.brass-corner {
    position: absolute;
    width: 40px;
    height: 40px;
}

.brass-corner::before,
.brass-corner::after {
    content: '';
    position: absolute;
    background: linear-gradient(135deg, #d4aa3a, #b8942a);
}

.brass-corner-tl { top: 0; left: 0; }
.brass-corner-tl::before { top: 0; left: 0; width: 40px; height: 4px; border-radius: 2px; }
.brass-corner-tl::after { top: 0; left: 0; width: 4px; height: 40px; border-radius: 2px; }

.brass-corner-tr { top: 0; right: 0; }
.brass-corner-tr::before { top: 0; right: 0; width: 40px; height: 4px; border-radius: 2px; }
.brass-corner-tr::after { top: 0; right: 0; width: 4px; height: 40px; border-radius: 2px; }

.brass-corner-bl { bottom: 0; left: 0; }
.brass-corner-bl::before { bottom: 0; left: 0; width: 40px; height: 4px; border-radius: 2px; }
.brass-corner-bl::after { bottom: 0; left: 0; width: 4px; height: 40px; border-radius: 2px; }

.brass-corner-br { bottom: 0; right: 0; }
.brass-corner-br::before { bottom: 0; right: 0; width: 40px; height: 4px; border-radius: 2px; }
.brass-corner-br::after { bottom: 0; right: 0; width: 4px; height: 40px; border-radius: 2px; }

/* Brass corner animation */
.brass-corner::before,
.brass-corner::after {
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.brass-corner-tr::before,
.brass-corner-br::before {
    transform-origin: right center;
}

.brass-corner::after {
    transform: scaleY(0);
    transform-origin: top center;
}

.brass-corner-bl::after,
.brass-corner-br::after {
    transform-origin: bottom center;
}

body.loaded .brass-corner::before {
    transform: scaleX(1);
}

body.loaded .brass-corner::after {
    transform: scaleY(1);
}

/* ---- Hero Title ---- */
.hero-content {
    text-align: center;
    z-index: 1;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 6rem);
    color: #2d1b0e;
    margin-bottom: 1.5rem;
    display: inline-block;
}

.hero-title .letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.hero-title .letter.visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-title .dot {
    color: #b8942a;
}

/* ---- Hero Tagline ---- */
.hero-tagline {
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    color: #3a8a7a;
    margin-bottom: 3rem;
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid #3a8a7a;
    width: 0;
    margin-left: auto;
    margin-right: auto;
    animation: typewriter 2s steps(55) 1.2s forwards, blinkCursor 0.7s step-end infinite 1.2s;
}

@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blinkCursor {
    50% { border-color: transparent; }
}

/* ---- Combination Dial ---- */
.combo-dial-wrapper {
    margin-top: 2rem;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.5s ease 1.5s, transform 0.5s ease 1.5s;
}

body.loaded .combo-dial-wrapper {
    opacity: 1;
    transform: scale(1);
}

.combo-dial {
    width: 160px;
    height: 160px;
    margin: 0 auto;
    position: relative;
}

.dial-face {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        #d4aa3a 0deg,
        #b8942a 36deg,
        #d4aa3a 72deg,
        #b8942a 108deg,
        #d4aa3a 144deg,
        #b8942a 180deg,
        #d4aa3a 216deg,
        #b8942a 252deg,
        #d4aa3a 288deg,
        #b8942a 324deg,
        #d4aa3a 360deg
    );
    border: 4px solid #7a5230;
    box-shadow:
        0 4px 12px rgba(45, 27, 14, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.15),
        inset 0 -2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    animation: dialWobble 3s ease-in-out 2s infinite;
}

@keyframes dialWobble {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(15deg); }
    75% { transform: rotate(-5deg); }
}

.dial-tick {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    transform: rotate(var(--angle));
}

.dial-tick span {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%) rotate(calc(-1 * var(--angle)));
    font-family: 'Source Code Pro', monospace;
    font-size: 0.7rem;
    font-weight: 500;
    color: #2d1b0e;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}

.dial-pointer {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    background: #2d1b0e;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* ---- Hero Pull ---- */
.hero-pull {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    animation: bounceIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) 2s forwards;
}

@keyframes bounceIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ============================================
   BLOCK EXPLORER
   ============================================ */
.block-explorer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 2rem 0;
    flex-wrap: wrap;
}

.explorer-block {
    width: 100px;
    height: 80px;
    perspective: 800px;
    cursor: pointer;
}

.block-front,
.block-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.6s ease;
}

.explorer-block {
    position: relative;
}

.block-front {
    background: linear-gradient(145deg, #f2e6d4 0%, #e8dac6 100%);
    border: 2px solid #7a5230;
    box-shadow:
        0 3px 6px rgba(45, 27, 14, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    z-index: 2;
}

.block-front:hover {
    box-shadow:
        0 5px 10px rgba(45, 27, 14, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.block-number {
    font-family: 'Lilita One', cursive;
    font-size: 1.4rem;
    color: #2d1b0e;
}

.block-label {
    font-family: 'Nunito', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    color: #7a5230;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.block-back {
    background-color: #1a4a4a;
    border: 2px solid #3a8a7a;
    transform: rotateY(180deg);
    padding: 0.4rem;
    z-index: 1;
}

.explorer-block.flipped .block-front {
    transform: rotateY(180deg);
}

.explorer-block.flipped .block-back {
    transform: rotateY(0deg);
}

.block-hash,
.block-prev,
.block-time,
.block-data {
    font-family: 'Source Code Pro', monospace;
    font-size: 0.55rem;
    color: #d4ede8;
    line-height: 1.6;
}

.block-hash {
    color: #3a8a7a;
    font-weight: 500;
}

.chain-link-h {
    width: 20px;
    height: 4px;
    background: linear-gradient(90deg, #b8942a, #d4aa3a, #b8942a);
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(45, 27, 14, 0.15);
}

/* ============================================
   SECTION ENTRY ANIMATIONS
   ============================================ */
.desk-surface[data-desk] {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.desk-surface[data-desk].in-view {
    opacity: 1;
    transform: translateY(0);
}

.desk-surface[data-desk] .brass-plaque {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.4s ease 0.2s, transform 0.4s ease 0.2s;
}

.desk-surface[data-desk].in-view .brass-plaque {
    opacity: 1;
    transform: scale(1);
}

.desk-surface[data-desk] .drawer-pull {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.5s,
                transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.5s;
}

.desk-surface[data-desk].in-view .drawer-pull {
    opacity: 1;
    transform: translateY(0);
}

.desk-surface[data-desk] .desk-subtitle {
    opacity: 0;
    transition: opacity 0.4s ease 0.3s;
}

.desk-surface[data-desk].in-view .desk-subtitle {
    opacity: 1;
}

.desk-surface[data-desk] .embossed-seal {
    opacity: 0;
    transform: scale(0.8) rotate(-10deg);
    transition: opacity 0.5s ease 0.4s, transform 0.5s ease 0.4s;
}

.desk-surface[data-desk].in-view .embossed-seal {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    background: linear-gradient(180deg, #2d1b0e 0%, #1a100a 100%);
    padding: 3rem 2rem;
    text-align: center;
    position: relative;
}

.site-footer::before {
    content: '';
    position: absolute;
    inset: 0;
    filter: url(#noise-leather);
    pointer-events: none;
}

.footer-content {
    position: relative;
    z-index: 1;
}

.footer-seal {
    margin-bottom: 1rem;
}

.footer-seal-svg {
    width: 60px;
    height: 60px;
}

.footer-text {
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: #8a7a6a;
    margin-bottom: 0.5rem;
}

.footer-year {
    font-family: 'Source Code Pro', monospace;
    font-size: 0.8rem;
    color: #7a5230;
}

/* ============================================
   BRASS CORNER BRACKETS ON CONTENT CARDS
   ============================================ */
.desk-container {
    position: relative;
}

.desk-container::before,
.desk-container::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    pointer-events: none;
}

.desk-container::before {
    top: -8px;
    left: 1rem;
    border-top: 3px solid #b8942a;
    border-left: 3px solid #b8942a;
}

.desk-container::after {
    bottom: -8px;
    right: 1rem;
    border-bottom: 3px solid #b8942a;
    border-right: 3px solid #b8942a;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 959px) {
    .desk-grid {
        grid-template-columns: 1fr;
    }

    .desk-interactive {
        padding-top: 1rem;
    }

    .hero-frame {
        padding: 2rem;
    }
}

@media (max-width: 599px) {
    .chain-progress {
        display: none;
    }

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

    .hero-tagline {
        white-space: normal;
        border-right: none;
        width: auto;
        animation: fadeInUp 1s ease 1.2s forwards;
        opacity: 0;
    }

    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .combo-dial {
        width: 120px;
        height: 120px;
    }

    .block-explorer {
        flex-direction: column;
        gap: 0;
    }

    .chain-link-h {
        width: 4px;
        height: 20px;
    }

    .explorer-block {
        width: 140px;
    }

    .brass-plaque h2 {
        font-size: clamp(1.6rem, 6vw, 2.5rem);
    }

    .desk-surface {
        padding: clamp(2rem, 5vh, 4rem) 0;
    }
}

/* ---- Drawer body open animation for explorer ---- */
.drawer-body-explorer.open {
    max-height: 600px;
}

/* ---- Selection color ---- */
::selection {
    background-color: #b8942a;
    color: #f2e6d4;
}
