/* ========================================
   archaic.studio - Styles
   Hexagonal Honeycomb / Warm Earthy / Dopamine
   ======================================== */

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

:root {
    /* Palette - Warm Earthy */
    --bg-primary: #F5E6D3;
    --bg-secondary: #EDE0CC;
    --text-primary: #2C1810;
    --text-secondary: #3E2723;
    --accent-copper: #B87333;
    --accent-saddle: #8B4513;
    --accent-sienna: #A0522D;
    --highlight-gold: #D4A03C;
    --dopamine-vermillion: #E25822;
    --deep-shadow: #1A0F0A;
    --clay: #C4A882;

    /* Hex sizing */
    --hex-size: min(20vw, 280px);
    --hex-gap: 0px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'EB Garamond', Georgia, 'Times New Roman', serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Typography --- */
.section-heading {
    font-family: 'EB Garamond', Georgia, serif;
    font-weight: 700;
    font-size: clamp(36px, 5vw, 72px);
    color: var(--text-primary);
    letter-spacing: 0.03em;
    line-height: 1.15;
    margin-bottom: 0.5em;
}

h3 {
    font-family: 'EB Garamond', Georgia, serif;
    font-weight: 500;
    color: var(--accent-saddle);
}

.body-text {
    font-family: 'EB Garamond', Georgia, serif;
    font-weight: 400;
    font-size: clamp(16px, 1.8vw, 20px);
    line-height: 1.72;
    color: var(--text-secondary);
    max-width: 38em;
}

.caption-text {
    font-family: 'Cormorant', Georgia, serif;
    font-weight: 300;
    font-size: clamp(12px, 1.2vw, 15px);
    font-variant: small-caps;
    color: var(--accent-sienna);
    letter-spacing: 0.05em;
}

.dimension {
    font-family: 'Source Code Pro', monospace;
    font-weight: 400;
    font-size: 12px;
    color: var(--accent-copper);
}

/* --- Patina Texture Overlay --- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(139, 69, 19, 0.04) 0%, transparent 70%),
        radial-gradient(ellipse at 80% 30%, rgba(160, 82, 45, 0.03) 0%, transparent 60%),
        radial-gradient(ellipse at 50% 80%, rgba(184, 115, 51, 0.03) 0%, transparent 65%);
}

/* --- Fixed Hex Navigation --- */
#hex-nav {
    position: fixed;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hex-nav-btn {
    width: 40px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--text-primary);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    text-decoration: none;
    transition: background 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hex-nav-btn span {
    font-family: 'EB Garamond', Georgia, serif;
    font-weight: 700;
    font-size: 14px;
    color: var(--accent-copper);
    line-height: 1;
}

.hex-nav-btn:hover,
.hex-nav-btn.active {
    background: var(--accent-copper);
    transform: scale(1.15);
}

.hex-nav-btn:hover span,
.hex-nav-btn.active span {
    color: var(--text-primary);
}

/* --- Chamber Sections --- */
.chamber {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.chamber-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--deep-shadow);
    z-index: 0;
}

.chamber-light {
    background: var(--bg-primary);
}

/* --- Hexagonal Cell System --- */
.hex-row {
    display: flex;
    justify-content: center;
    gap: var(--hex-gap);
    position: relative;
    z-index: 1;
}

.hex-row-offset {
    margin-top: calc(var(--hex-size) * -0.13);
    margin-left: calc(var(--hex-size) * 0.52);
}

.hex-cell {
    width: var(--hex-size);
    flex-shrink: 0;
    opacity: 0;
    transform: scale(0);
    transition: none;
}

.hex-cell.visible {
    animation: bounceEnter 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.hex-border {
    width: 100%;
    aspect-ratio: 1.1547;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: var(--accent-copper);
    padding: 2px;
    position: relative;
}

.hex-inner {
    width: 100%;
    height: 100%;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: var(--deep-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

/* --- Decorative Fills --- */
.fill-copper { background: var(--accent-copper); }
.fill-sienna { background: var(--accent-sienna); }
.fill-gold { background: var(--highlight-gold); }
.fill-dark { background: var(--deep-shadow); }
.fill-vermillion { background: var(--dopamine-vermillion); }
.fill-umber { background: var(--text-primary); }

/* Honeycomb texture for decorative fills */
.decorative-fill .hex-inner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        conic-gradient(from 0deg at 33% 33%, transparent 0deg, rgba(212,160,60,0.08) 60deg, transparent 60deg) repeat,
        conic-gradient(from 180deg at 66% 66%, transparent 0deg, rgba(237,224,204,0.06) 60deg, transparent 60deg) repeat;
    background-size: 30px 30px;
}

/* --- Content Cells --- */
.content-inner {
    background: var(--bg-primary);
    padding: 12%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}

/* --- Hero Section --- */
#chamber-hero {
    padding: 0;
}

.honeycomb-hero {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 20px;
}

.hero-title-piece {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.hero-char {
    font-family: 'EB Garamond', Georgia, serif;
    font-weight: 700;
    font-size: clamp(20px, 3.5vw, 48px);
    color: var(--bg-primary);
    letter-spacing: 0.05em;
    display: inline-block;
    opacity: 0;
    transform: translateX(-15px);
}

.hero-char.char-visible {
    animation: charBounce 500ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.dot-char {
    color: var(--dopamine-vermillion);
    font-size: clamp(24px, 4vw, 56px);
}

.title-cell .hex-inner {
    background: var(--deep-shadow);
}

.tagline {
    font-family: 'Cormorant', Georgia, serif;
    font-weight: 300;
    font-size: clamp(13px, 1.5vw, 18px);
    font-variant: small-caps;
    color: var(--highlight-gold);
    letter-spacing: 0.08em;
    text-align: center;
}

.tagline-cell .hex-inner {
    background: var(--deep-shadow);
}

/* --- Archaic Object SVGs --- */
.archaic-object {
    width: 65%;
    height: 65%;
    filter: drop-shadow(4px 6px 12px rgba(44, 24, 16, 0.35));
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.object-cell:hover .archaic-object {
    transform: scale(1.05);
}

.object-cell:hover .hex-border {
    box-shadow: 0 0 20px rgba(226, 88, 34, 0.4);
}

.object-cell .hex-inner {
    background: var(--deep-shadow);
}

/* Object vertical bounce */
.hex-cell.visible .archaic-object {
    animation: objectBounce 700ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* --- Wax Seals --- */
.wax-seal {
    position: absolute;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, var(--dopamine-vermillion), var(--accent-saddle));
    box-shadow: 1px 2px 4px rgba(26, 15, 10, 0.4), inset 0 -1px 2px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'EB Garamond', Georgia, serif;
    font-weight: 700;
    font-size: 16px;
    color: var(--bg-primary);
    z-index: 2;
    pointer-events: none;
}

/* --- Philosophy Section --- */
.philosophy-grid {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1200px;
    --hex-size: min(40vw, 500px);
}

.philosophy-grid .hex-row {
    justify-content: center;
}

.philosophy-grid .hex-row-offset {
    margin-left: calc(var(--hex-size) * 0.3);
}

.philosophy-grid .expanded-cell {
    width: calc(var(--hex-size) * 1.5);
}

.philosophy-grid .content-inner .section-heading {
    font-size: clamp(24px, 3vw, 40px);
    color: var(--accent-saddle);
    margin-bottom: 0.4em;
}

.philosophy-grid .content-inner .body-text {
    margin-bottom: 0.8em;
}

.philosophy-grid .content-inner .body-text:last-child {
    margin-bottom: 0;
}

/* Tool watermark */
.tool-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: auto;
    opacity: 0.06;
    z-index: 0;
    pointer-events: none;
}

/* --- Gallery Section --- */
#chamber-gallery {
    padding: 80px 20px;
}

.gallery-heading {
    font-family: 'EB Garamond', Georgia, serif;
    font-weight: 700;
    font-size: clamp(36px, 5vw, 72px);
    color: var(--bg-primary);
    letter-spacing: 0.03em;
    text-align: center;
    position: relative;
    z-index: 1;
    margin-bottom: 8px;
}

.gallery-subheading {
    text-align: center;
    position: relative;
    z-index: 1;
    margin-bottom: 40px;
}

.gallery-grid {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1400px;
}

.gallery-grid .hex-row {
    justify-content: center;
}

.gallery-cell .hex-inner {
    background: var(--deep-shadow);
    flex-direction: column;
}

.gallery-cell:hover .hex-border {
    box-shadow: 0 0 20px rgba(226, 88, 34, 0.4);
}

.gallery-cell:hover .archaic-object {
    transform: scale(1.05);
}

.object-label {
    position: absolute;
    bottom: 18%;
    font-family: 'Cormorant', Georgia, serif;
    font-weight: 300;
    font-size: 12px;
    font-variant: small-caps;
    color: var(--accent-sienna);
    text-align: center;
    letter-spacing: 0.04em;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* --- Process Section --- */
#chamber-process {
    padding: 80px 0;
    align-items: center;
}

.process-heading {
    text-align: center;
    margin-bottom: 4px;
}

.process-subheading {
    text-align: center;
    margin-bottom: 40px;
}

.process-scroll-container {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-copper) var(--bg-secondary);
    padding: 20px 40px;
    cursor: grab;
}

.process-scroll-container:active {
    cursor: grabbing;
}

.process-scroll-container::-webkit-scrollbar {
    height: 6px;
}

.process-scroll-container::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.process-scroll-container::-webkit-scrollbar-thumb {
    background: var(--accent-copper);
    border-radius: 3px;
}

.process-track {
    display: flex;
    gap: 0;
    width: max-content;
    padding: 20px 0;
}

.process-cell {
    width: 260px;
    flex-shrink: 0;
}

.process-cell .content-inner {
    align-items: center;
    text-align: center;
    padding: 10%;
}

.process-number {
    font-family: 'EB Garamond', Georgia, serif;
    font-weight: 700;
    font-size: 28px;
    color: var(--dopamine-vermillion);
    margin-bottom: 8px;
}

.process-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 12px;
}

.process-title {
    font-family: 'EB Garamond', Georgia, serif;
    font-weight: 500;
    font-size: 20px;
    color: var(--accent-saddle);
    margin-bottom: 8px;
}

.process-desc {
    font-family: 'EB Garamond', Georgia, serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* --- Contact Section --- */
#chamber-contact {
    min-height: 100vh;
}

.contact-grid {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1000px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.contact-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    z-index: 2;
}

.contact-cell {
    width: min(80vw, 500px);
}

.contact-cell .content-inner {
    background: var(--bg-primary);
    align-items: center;
    text-align: center;
}

.contact-cell .section-heading {
    font-size: clamp(28px, 4vw, 48px);
    color: var(--text-primary);
}

.contact-details {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contact-line {
    line-height: 1.6;
}

.contact-link {
    font-family: 'EB Garamond', Georgia, serif;
    font-weight: 500;
    font-size: 18px;
    color: var(--accent-copper);
}

.closing-statement {
    font-family: 'EB Garamond', Georgia, serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(16px, 2vw, 22px);
    line-height: 1.72;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.closing-attribution {
    font-family: 'Cormorant', Georgia, serif;
    font-weight: 300;
    font-size: 14px;
    font-variant: small-caps;
    color: var(--accent-sienna);
    letter-spacing: 0.06em;
}

/* Hex outlines (dissolved lattice) */
.hex-outline {
    position: absolute;
    width: 80px;
    aspect-ratio: 1.1547;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    border: 2px solid var(--accent-copper);
    z-index: 1;
    opacity: 0.25;
    pointer-events: none;
}

/* Use a pseudo-element trick for hex outline border */
.hex-outline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: var(--accent-copper);
    opacity: 0.2;
}

.hex-outline::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: var(--deep-shadow);
}

/* --- Animations --- */
@keyframes bounceEnter {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    50% {
        opacity: 1;
        transform: scale(1.08);
    }
    75% {
        transform: scale(0.97);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes charBounce {
    0% {
        opacity: 0;
        transform: translateX(-15px);
    }
    60% {
        opacity: 1;
        transform: translateX(4px);
    }
    80% {
        transform: translateX(-2px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes objectBounce {
    0% {
        transform: translateY(30px);
    }
    50% {
        transform: translateY(-5px);
    }
    75% {
        transform: translateY(2px);
    }
    100% {
        transform: translateY(0);
    }
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    :root {
        --hex-size: min(22vw, 200px);
    }

    .hide-tablet {
        display: none;
    }

    .hex-row-offset {
        margin-left: calc(var(--hex-size) * 0.52);
    }

    .philosophy-grid {
        --hex-size: min(45vw, 420px);
    }

    .philosophy-grid .expanded-cell {
        width: calc(var(--hex-size) * 1.3);
    }
}

@media (max-width: 640px) {
    :root {
        --hex-size: min(42vw, 180px);
    }

    .hide-mobile {
        display: none;
    }

    #hex-nav {
        left: 6px;
    }

    .hex-nav-btn {
        width: 32px;
        height: 37px;
    }

    .hex-nav-btn span {
        font-size: 11px;
    }

    .hex-row-offset {
        margin-left: calc(var(--hex-size) * 0.52);
    }

    .philosophy-grid {
        --hex-size: min(80vw, 350px);
    }

    .philosophy-grid .hex-row,
    .philosophy-grid .hex-row-offset {
        flex-direction: column;
        align-items: center;
        margin-left: 0;
        margin-top: 0;
    }

    .philosophy-grid .expanded-cell {
        width: var(--hex-size);
    }

    .philosophy-grid .decorative-fill {
        display: none;
    }

    .gallery-grid .hex-row,
    .gallery-grid .hex-row-offset {
        flex-wrap: wrap;
        margin-left: 0;
        margin-top: 0;
        gap: 4px;
    }

    .contact-cell {
        width: 90vw;
    }

    .process-cell {
        width: 220px;
    }

    .wax-seal {
        display: none;
    }
}

/* --- Hover / Interaction States --- */
.gallery-cell {
    transition: filter 0.3s ease;
}

.gallery-cell:hover {
    filter: brightness(1.1);
}

/* Vermillion accent glow on hex hover */
.object-cell .hex-border,
.gallery-cell .hex-border {
    transition: box-shadow 0.3s ease;
}

/* --- Bounce Target (pre-animation state) --- */
.bounce-target {
    opacity: 0;
    transform: scale(0);
}

.bounce-target.visible {
    animation: bounceEnter 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Gallery heading special bounce */
.gallery-heading.bounce-target {
    transform: translateY(20px);
}

.gallery-heading.bounce-target.visible {
    animation: headingBounce 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes headingBounce {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    60% {
        opacity: 1;
        transform: translateY(-5px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Process subheading bounce */
.gallery-subheading.bounce-target {
    transform: translateY(15px);
}

.gallery-subheading.bounce-target.visible {
    animation: headingBounce 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
