/* ============================================
   multipledger.com - Neubrutalist Ledger-Craft
   ============================================ */

/* --- CSS Variables / Palette --- */
:root {
    --kiln-bisque: #f2e6d4;
    --raw-umber: #2d2016;
    --fired-terracotta: #c2552a;
    --ochre-glaze: #d4943c;
    --kiln-copper: #8b5e3c;
    --kiln-smoke: #b8a99a;
    --slip-white: #faf6f0;
    --oxidized-sage: #6b7c5a;

    --shadow-default: 6px 6px 0px var(--raw-umber);
    --shadow-hover: 8px 8px 0px var(--raw-umber);
    --shadow-active: 2px 2px 0px var(--raw-umber);
    --border-default: 4px solid var(--raw-umber);

    --font-display: 'Unbounded', cursive;
    --font-body: 'Hanken Grotesk', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;

    --slab-max-width: 960px;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.7;
    letter-spacing: 0.01em;
    color: var(--raw-umber);
    background-color: var(--kiln-bisque);
    overflow-x: hidden;
}

/* --- Marble Texture Background --- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(250, 246, 240, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 60%, rgba(184, 169, 154, 0.06) 0%, transparent 55%),
        radial-gradient(ellipse at 50% 85%, rgba(250, 246, 240, 0.05) 0%, transparent 50%),
        linear-gradient(135deg, rgba(184, 169, 154, 0.03) 0%, rgba(250, 246, 240, 0.04) 50%, rgba(184, 169, 154, 0.03) 100%),
        var(--kiln-bisque);
    pointer-events: none;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    filter: url(#marble-grain);
    opacity: 0.04;
    pointer-events: none;
}

/* --- Hero Section --- */
#hero {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    padding: 0 24px;
}

.hero-line-h {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 6px;
    background: var(--raw-umber);
    transform: scaleX(0);
    transform-origin: left;
}

.hero-line-v {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 40vh;
    background: var(--raw-umber);
    transform: scaleY(0);
    transform-origin: top;
    margin-left: -3px;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(3.2rem, 9vw, 7rem);
    letter-spacing: 0.04em;
    line-height: 0.95;
    text-transform: uppercase;
    color: var(--fired-terracotta);
    opacity: 0;
    transform: translateY(20px);
    position: relative;
    z-index: 2;
}

.hero-subtitle {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 2.4vw, 1.4rem);
    color: var(--kiln-copper);
    opacity: 0;
    transform: translateY(20px);
    position: relative;
    z-index: 2;
    margin-top: 16px;
}

.scroll-prompt {
    position: absolute;
    bottom: 48px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    z-index: 2;
    cursor: pointer;
    border: var(--border-default);
    background: var(--kiln-bisque);
    box-shadow: var(--shadow-default);
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 120ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 120ms cubic-bezier(0.22, 1, 0.36, 1);
}

.scroll-prompt:hover {
    transform: translateX(-50%) translate(-2px, -2px);
    box-shadow: var(--shadow-hover);
}

.scroll-prompt:active {
    transform: translateX(-50%) translate(4px, 4px);
    box-shadow: var(--shadow-active);
}

.scroll-prompt.visible {
    opacity: 1;
}

@keyframes bounceArrow {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(4px); }
}

.scroll-prompt.bouncing {
    animation: bounceArrow 1.5s ease-in-out infinite;
}

/* --- Hero Animations (classes added via JS) --- */
.hero-line-h.animate {
    transform: scaleX(1);
    transition: transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-line-v.animate {
    transform: scaleY(1);
    transition: transform 400ms cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-title.animate {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 500ms cubic-bezier(0.22, 1, 0.36, 1), transform 500ms cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-subtitle.animate {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 500ms cubic-bezier(0.22, 1, 0.36, 1), transform 500ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* --- Slab Stack --- */
#slabStack {
    max-width: var(--slab-max-width);
    margin: 0 auto;
    padding: 48px 24px 96px;
    display: flex;
    flex-direction: column;
    gap: 48px;
}

/* --- Slab --- */
.slab {
    position: relative;
    border: var(--border-default);
    box-shadow: var(--shadow-default);
    background-color: var(--kiln-bisque);
    background-image: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 31px,
        var(--kiln-smoke) 31px,
        var(--kiln-smoke) 32px
    );
    padding: 48px 48px 56px;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 400ms cubic-bezier(0.22, 1, 0.36, 1), transform 400ms cubic-bezier(0.22, 1, 0.36, 1);
}

.slab.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* Ledger line parallax layer */
.slab .ledger-parallax {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 31px,
        var(--kiln-smoke) 31px,
        var(--kiln-smoke) 32px
    );
    pointer-events: none;
    z-index: 0;
}

/* --- Slab Tab (Clay Tab Markers) --- */
.slab-tab {
    position: sticky;
    top: 12px;
    width: 120px;
    height: 36px;
    margin-left: -64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--raw-umber);
    box-shadow: 3px 3px 0px var(--raw-umber);
    z-index: 10;
    transform: translateX(-40px);
    opacity: 0;
    transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1) 150ms,
                opacity 300ms cubic-bezier(0.22, 1, 0.36, 1) 150ms,
                background-color 300ms ease;
}

.slab.in-view .slab-tab {
    transform: translateX(0);
    opacity: 1;
}

.slab-tab.pinned-bounce {
    animation: tabBounce 200ms ease-out;
}

@keyframes tabBounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.slab-tab.passed {
    background-color: var(--kiln-smoke) !important;
}

.tab-label {
    font-family: var(--font-mono);
    font-size: clamp(0.75rem, 1.4vw, 0.9rem);
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--raw-umber);
}

/* --- Slab Number (Ledger Stamp) --- */
.slab-number {
    position: absolute;
    top: 12px;
    left: 16px;
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 48px;
    line-height: 1;
    color: var(--fired-terracotta);
    opacity: 0;
    transition: opacity 400ms ease 300ms;
    z-index: 1;
    pointer-events: none;
    user-select: none;
}

.slab.in-view .slab-number {
    opacity: 0.12;
}

/* --- Slab Motif (SVG Corner) --- */
.slab-motif {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 64px;
    height: 64px;
    z-index: 2;
    transition: transform 300ms ease-out;
}

.slab-motif:hover {
    transform: rotate(45deg);
}

.slab-motif svg {
    transition: stroke 300ms ease;
}

.slab-motif:hover svg {
    stroke: var(--fired-terracotta);
}

/* --- Slab Content --- */
.slab-content {
    position: relative;
    z-index: 2;
    padding-top: 24px;
}

.slab-content h2 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3rem);
    letter-spacing: -0.01em;
    line-height: 1.1;
    color: var(--raw-umber);
    margin-bottom: 20px;
}

.slab-content p {
    max-width: 580px;
    margin-bottom: 16px;
    color: var(--raw-umber);
}

/* --- Divider Bar (Terracotta) --- */
.divider-bar {
    width: 40%;
    height: 6px;
    background: var(--fired-terracotta);
    border-radius: 3px;
    box-shadow: 3px 3px 0px var(--raw-umber);
    margin-bottom: 28px;
}

/* --- Clay Token (Interactive Elements) --- */
.clay-token {
    border: var(--border-default);
    background: var(--slip-white);
    box-shadow: var(--shadow-default);
    transition: transform 120ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 120ms cubic-bezier(0.22, 1, 0.36, 1);
    cursor: pointer;
}

.clay-token:hover {
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow-hover);
}

.clay-token:active {
    transform: translate(4px, 4px);
    box-shadow: var(--shadow-active);
}

/* --- Ledger Data Table (Slab 02) --- */
.ledger-data {
    margin-top: 24px;
    max-width: 580px;
}

.ledger-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--kiln-smoke);
}

.ledger-row:last-child {
    border-bottom: none;
}

.ledger-key {
    font-family: var(--font-mono);
    font-size: clamp(0.75rem, 1.4vw, 0.9rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--kiln-copper);
}

.ledger-value {
    font-family: var(--font-body);
    font-weight: 600;
    color: var(--raw-umber);
}

/* --- Features Grid (Slab 03) --- */
.features-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 24px;
}

.feature-token {
    padding: 24px;
}

.feature-token h3 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1rem, 2vw, 1.3rem);
    letter-spacing: -0.01em;
    line-height: 1.2;
    color: var(--raw-umber);
    margin-bottom: 8px;
}

.feature-token p {
    font-size: clamp(0.88rem, 1.5vw, 1rem);
    line-height: 1.6;
    color: var(--raw-umber);
    max-width: none;
    margin-bottom: 0;
}

/* --- Process Steps (Slab 04) --- */
.process-steps {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.process-step {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.step-number {
    font-family: var(--font-mono);
    font-size: clamp(0.85rem, 1.6vw, 1rem);
    letter-spacing: 0.08em;
    color: var(--fired-terracotta);
    flex-shrink: 0;
    padding-top: 2px;
    min-width: 28px;
}

.step-body h3 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.1rem, 2.2vw, 1.4rem);
    line-height: 1.2;
    color: var(--raw-umber);
    margin-bottom: 6px;
}

.step-body p {
    max-width: 520px;
}

/* --- Blockquote (Slab 05) --- */
.clay-quote {
    border: var(--border-default);
    box-shadow: var(--shadow-default);
    background: var(--slip-white);
    padding: 28px 32px;
    margin-top: 28px;
    max-width: 580px;
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.7;
    color: var(--kiln-copper);
    font-style: italic;
}

.clay-quote cite {
    display: block;
    margin-top: 12px;
    font-style: normal;
    font-family: var(--font-mono);
    font-size: clamp(0.75rem, 1.4vw, 0.9rem);
    letter-spacing: 0.08em;
    color: var(--kiln-smoke);
}

/* --- Contact Actions (Slab 06) --- */
.contact-actions {
    display: flex;
    gap: 16px;
    margin-top: 28px;
    flex-wrap: wrap;
}

.contact-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    font-family: var(--font-mono);
    font-size: clamp(0.75rem, 1.4vw, 0.9rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--raw-umber);
    background: var(--fired-terracotta);
}

.contact-btn.secondary {
    background: var(--slip-white);
}

.contact-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow-hover);
}

.contact-btn:active {
    transform: translate(4px, 4px);
    box-shadow: var(--shadow-active);
}

/* --- Footer / Kiln Stamp --- */
.footer-slab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 56px 48px;
    background-image: none;
}

.kiln-stamp {
    width: 120px;
    height: 120px;
    border: 2px solid var(--raw-umber);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.kiln-monogram {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 2.4rem;
    color: var(--raw-umber);
    letter-spacing: 0.04em;
}

.footer-text {
    font-family: var(--font-mono);
    font-size: clamp(0.75rem, 1.4vw, 0.9rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--kiln-smoke);
}

/* --- Links --- */
a {
    color: var(--fired-terracotta);
    text-decoration: none;
    transition: color 120ms ease;
}

a:hover {
    color: var(--raw-umber);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .slab {
        padding: 40px 24px 48px;
    }

    .slab-tab {
        margin-left: -40px;
        width: 100px;
        height: 32px;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .contact-actions {
        flex-direction: column;
    }

    .contact-btn {
        text-align: center;
    }

    .slab-number {
        font-size: 36px;
    }

    .slab-motif {
        width: 48px;
        height: 48px;
    }

    .slab-motif svg {
        width: 48px;
        height: 48px;
    }

    #slabStack {
        padding: 32px 16px 64px;
        gap: 36px;
    }
}

@media (max-width: 480px) {
    .slab {
        padding: 32px 16px 40px;
    }

    .slab-tab {
        margin-left: -32px;
        width: 90px;
        height: 28px;
    }

    .hero-inner {
        padding: 0 16px;
    }

    .process-step {
        flex-direction: column;
        gap: 8px;
    }
}

/* --- Selection Color --- */
::selection {
    background: var(--fired-terracotta);
    color: var(--slip-white);
}
