/* ============================================
   desca.dev — Styles
   Terracotta-warm, inflated-3D, timeline-vertical
   ============================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
    --terracotta: #C4704B;
    --fired-umber: #3D2214;
    --limestone: #F6F0E8;
    --warm-parchment: #EDE4D6;
    --walnut-brown: #5C4332;
    --burnt-sienna: #D4865A;
    --sage-clay: #8B9A7E;
    --volcanic-brown: #2A1810;

    --font-display: 'Albert Sans', sans-serif;
    --font-body: 'Source Sans 3', sans-serif;
    --font-mono: 'DM Mono', monospace;

    --space-xs: 8px;
    --space-sm: 16px;
    --space-md: 32px;
    --space-lg: 48px;
    --space-xl: 80px;
    --space-2xl: 160px;

    --radius-sm: 16px;
    --radius-md: 24px;
    --radius-lg: 32px;
    --radius-pill: 999px;

    --shadow-inflated: 
        inset 0 2px 4px rgba(244, 232, 218, 0.6),
        0 4px 12px rgba(42, 24, 16, 0.15),
        0 8px 32px rgba(196, 112, 75, 0.08);
    --shadow-inflated-hover:
        inset 0 2px 6px rgba(244, 232, 218, 0.7),
        0 6px 18px rgba(42, 24, 16, 0.2),
        0 12px 48px rgba(196, 112, 75, 0.12);
    --shadow-flat:
        inset 0 1px 2px rgba(244, 232, 218, 0.3),
        0 2px 6px rgba(42, 24, 16, 0.08),
        0 4px 16px rgba(196, 112, 75, 0.04);
}

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

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

body {
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--walnut-brown);
    background-color: var(--limestone);
    line-height: 1.72;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- Scroll Progress Bar ---------- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--terracotta), var(--burnt-sienna));
    z-index: 1000;
    transition: width 0.05s linear;
}

/* ---------- Navigation ---------- */
.main-nav {
    position: fixed;
    top: -64px;
    left: 0;
    right: 0;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-lg);
    background: rgba(246, 240, 232, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 900;
    transition: top 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-bottom: 1px solid rgba(196, 112, 75, 0.15);
}

.main-nav.visible {
    top: 0;
}

.nav-logo {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--fired-umber);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    gap: var(--space-md);
}

.nav-links a {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--terracotta);
    text-decoration: none;
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: var(--burnt-sienna);
}

/* ---------- The Atrium (Hero) ---------- */
.atrium {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    background-color: var(--limestone);
}

.atrium-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
}

/* Inflated D letterform */
.hero-letter {
    width: 180px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--burnt-sienna) 0%, var(--terracotta) 60%, var(--fired-umber) 100%);
    box-shadow:
        inset 0 -4px 12px rgba(42, 24, 16, 0.3),
        inset 0 4px 8px rgba(244, 232, 218, 0.5),
        0 8px 24px rgba(42, 24, 16, 0.2),
        0 16px 48px rgba(196, 112, 75, 0.15),
        0 32px 80px rgba(42, 24, 16, 0.08);
    opacity: 0;
    transform: scale(0.85);
    animation: heroLetterIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s forwards;
}

.letter-d {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 6rem;
    color: var(--limestone);
    text-shadow: 0 2px 4px rgba(42, 24, 16, 0.2);
    line-height: 1;
    user-select: none;
}

@keyframes heroLetterIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Hero tagline */
.hero-tagline {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    letter-spacing: 0.06em;
    color: var(--terracotta);
    min-height: 1.5em;
    text-align: center;
}

.tagline-cursor {
    animation: cursorBlink 0.8s step-end infinite;
    color: var(--terracotta);
}

.tagline-cursor.hidden {
    display: none;
}

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

/* After typing, the tagline crossfades to display font */
.hero-tagline.transformed {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    letter-spacing: -0.02em;
    color: var(--fired-umber);
    transition: all 0.6s ease;
}

.hero-subtitle {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.1vw, 1.2rem);
    color: var(--walnut-brown);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.5s ease;
}

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

.scroll-chevron {
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

/* ---------- Marble Divider ---------- */
.marble-divider {
    height: 1px;
    margin: 0 auto;
    width: 80%;
    max-width: 800px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(237, 228, 214, 0.8) 10%,
        rgba(196, 112, 75, 0.3) 25%,
        rgba(139, 154, 126, 0.15) 40%,
        rgba(237, 228, 214, 0.8) 55%,
        rgba(196, 112, 75, 0.3) 70%,
        rgba(139, 154, 126, 0.15) 85%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: marbleDrift 30s linear infinite;
}

@keyframes marbleDrift {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

/* ---------- Stratigraphy (Timeline) ---------- */
.stratigraphy {
    padding: var(--space-2xl) var(--space-lg);
    position: relative;
    background-color: var(--limestone);
}

.section-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.8rem, 6vw, 5.2rem);
    letter-spacing: -0.02em;
    color: var(--fired-umber);
    text-align: center;
    margin-bottom: var(--space-xl);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
}

.section-ornament {
    display: block;
}

/* Timeline container */
.timeline-container {
    position: relative;
    max-width: 960px;
    margin: 0 auto;
    padding: var(--space-lg) 0;
}

/* Timeline spine */
.timeline-spine {
    position: absolute;
    left: 20%;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: var(--terracotta);
    transform-origin: top;
    clip-path: inset(0 0 100% 0);
    transition: clip-path 0.1s linear;
}

/* Timeline entry base */
.timeline-entry {
    position: relative;
    margin-bottom: var(--space-2xl);
    display: flex;
    align-items: flex-start;
}

/* Timeline marker */
.timeline-marker {
    position: absolute;
    left: 20%;
    top: 24px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--terracotta);
    border: 3px solid var(--limestone);
    transform: translateX(-50%) scale(0);
    z-index: 10;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.timeline-marker.inflated {
    transform: translateX(-50%) scale(1);
}

/* Timeline date */
.timeline-date {
    position: absolute;
    left: 20%;
    top: 24px;
}

.date-label {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--terracotta);
    white-space: nowrap;
}

/* Right entries: date left of spine, card right of spine */
.timeline-entry--right .timeline-date {
    transform: translateX(-100%) translateX(-24px);
    top: 28px;
}

.timeline-entry--right .timeline-card {
    margin-left: calc(20% + 48px);
    width: calc(80% - 96px);
}

/* Left entries: date right of spine, card left of spine */
.timeline-entry--left .timeline-date {
    transform: translateX(20px);
    top: 28px;
}

.timeline-entry--left .timeline-card {
    margin-left: var(--space-lg);
    width: calc(20% - 96px + 48px);
    min-width: 320px;
}

/* Timeline card */
.timeline-card {
    background: var(--limestone);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    border: 1px solid rgba(196, 112, 75, 0.1);
    box-shadow: var(--shadow-inflated);
    opacity: 0;
    transition: 
        opacity 0.5s ease,
        transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.2s ease-out,
        border-color 0.3s ease;
    background: linear-gradient(145deg, rgba(246, 240, 232, 1) 0%, rgba(237, 228, 214, 0.4) 100%);
}

.timeline-entry--right .timeline-card {
    transform: translateX(40px);
}

.timeline-entry--left .timeline-card {
    transform: translateX(-40px);
}

.timeline-card.revealed {
    opacity: 1;
    transform: translateX(0);
}

.timeline-card:hover {
    box-shadow: var(--shadow-inflated-hover);
    transform: translateY(-4px);
    border-color: rgba(196, 112, 75, 0.4);
}

.timeline-card.revealed:hover {
    transform: translateY(-4px);
}

.card-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    letter-spacing: -0.02em;
    color: var(--fired-umber);
    margin-bottom: var(--space-sm);
}

.card-description {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.1vw, 1.2rem);
    line-height: 1.72;
    color: var(--walnut-brown);
    margin-bottom: var(--space-md);
}

/* Card expanded content */
.card-expanded {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.5s ease, opacity 0.4s ease, margin 0.4s ease;
    margin-top: 0;
}

.card-expanded.open {
    max-height: 600px;
    opacity: 1;
    margin-top: var(--space-md);
}

.card-detail {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.95rem, 1vw, 1.1rem);
    line-height: 1.72;
    color: var(--walnut-brown);
    margin-bottom: var(--space-md);
}

/* Tags */
.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--limestone);
    background-color: var(--sage-clay);
    padding: 6px 16px;
    border-radius: var(--radius-pill);
    box-shadow:
        inset 0 1px 2px rgba(244, 232, 218, 0.3),
        0 2px 8px rgba(139, 154, 126, 0.2);
}

/* Card toggle button */
.card-toggle {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--terracotta);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 0;
    position: relative;
    transition: color 0.2s ease;
}

.card-toggle::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--terracotta);
    opacity: 0.3;
    transition: opacity 0.2s ease;
}

.card-toggle:hover {
    color: var(--burnt-sienna);
}

.card-toggle:hover::after {
    opacity: 0.6;
}

.card-toggle.active {
    color: var(--burnt-sienna);
}

/* ---------- Philosophy Section ---------- */
.philosophy-section {
    padding: var(--space-2xl) var(--space-lg);
    background-color: var(--warm-parchment);
    transition: background-color 0.6s ease;
}

.philosophy-content {
    max-width: 720px;
    margin: 0 auto;
}

.philosophy-quote {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.4rem, 3vw, 2rem);
    letter-spacing: -0.02em;
    line-height: 1.4;
    color: var(--fired-umber);
    margin-bottom: var(--space-lg);
    padding-left: var(--space-md);
    border-left: 3px solid var(--terracotta);
}

.philosophy-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.1vw, 1.2rem);
    line-height: 1.72;
    color: var(--walnut-brown);
    margin-bottom: var(--space-md);
}

.philosophy-text:last-child {
    margin-bottom: 0;
}

/* ---------- The Bedrock (Contact / Footer) ---------- */
.bedrock {
    background-color: var(--volcanic-brown);
    padding: var(--space-2xl) var(--space-lg);
    position: relative;
    overflow: hidden;
}

.bedrock-spine-transition {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to bottom, var(--warm-parchment), var(--volcanic-brown));
    pointer-events: none;
}

.bedrock-content {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
    padding-top: var(--space-xl);
}

.bedrock-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.8rem, 6vw, 5.2rem);
    letter-spacing: -0.02em;
    color: var(--limestone);
    margin-bottom: var(--space-sm);
}

.bedrock-subtitle {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.3vw, 1.3rem);
    color: var(--burnt-sienna);
    margin-bottom: var(--space-xl);
    line-height: 1.72;
}

.bedrock-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}

.bedrock-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--limestone);
    text-decoration: none;
    padding: 16px 32px;
    border-radius: var(--radius-pill);
    background: linear-gradient(145deg, var(--burnt-sienna) 0%, var(--terracotta) 100%);
    box-shadow:
        inset 0 2px 4px rgba(244, 232, 218, 0.3),
        0 4px 12px rgba(42, 24, 16, 0.3),
        0 8px 32px rgba(196, 112, 75, 0.15);
    transition: 
        transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.2s ease-out;
}

.bedrock-btn:hover {
    transform: translateY(-3px);
    box-shadow:
        inset 0 2px 6px rgba(244, 232, 218, 0.4),
        0 6px 18px rgba(42, 24, 16, 0.35),
        0 12px 48px rgba(196, 112, 75, 0.2);
}

.bedrock-footer {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    color: rgba(246, 240, 232, 0.4);
    text-transform: uppercase;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .main-nav {
        padding: 0 var(--space-sm);
    }

    .nav-links {
        gap: var(--space-sm);
    }

    .stratigraphy {
        padding: var(--space-xl) var(--space-sm);
    }

    .timeline-spine {
        left: 24px;
    }

    .timeline-marker {
        left: 24px;
    }

    .timeline-entry--right .timeline-date,
    .timeline-entry--left .timeline-date {
        left: 24px;
        transform: translateX(24px);
        top: 0;
    }

    .timeline-entry--right .timeline-card,
    .timeline-entry--left .timeline-card {
        margin-left: 56px;
        width: calc(100% - 72px);
        min-width: unset;
    }

    .timeline-entry--left .timeline-card {
        transform: translateX(40px);
    }

    .timeline-card {
        padding: var(--space-md);
    }

    .timeline-entry {
        flex-direction: column;
        margin-bottom: var(--space-xl);
    }

    .timeline-entry--right .timeline-date,
    .timeline-entry--left .timeline-date {
        position: relative;
        left: 56px;
        margin-bottom: var(--space-xs);
    }

    .bedrock {
        padding: var(--space-xl) var(--space-sm);
    }

    .bedrock-links {
        flex-direction: column;
        align-items: center;
    }

    .bedrock-btn {
        width: 100%;
        max-width: 280px;
    }

    .philosophy-section {
        padding: var(--space-xl) var(--space-sm);
    }

    .hero-letter {
        width: 140px;
        height: 140px;
    }

    .letter-d {
        font-size: 4.5rem;
    }
}

@media (max-width: 480px) {
    .nav-links a {
        font-size: 0.75rem;
    }

    .hero-letter {
        width: 120px;
        height: 120px;
    }

    .letter-d {
        font-size: 3.8rem;
    }
}
