/* ============================================
   adhoc.quest - Styles
   Retro marble gallery aesthetic
   ============================================ */

/* === CSS Custom Properties === */
:root {
    --sunset-gold: #C9963B;
    --terracotta: #C4653A;
    --espresso: #2C1810;
    --warm-cream: #FAF0E1;
    --marble-vein: #B8A08C;
    --coral-blush: #E8886C;
    --burnt-umber: #6B3A2A;
    --sunset-apricot: #F5C28A;
    --light-gold: #E8B860;
    --marble-shadow: #d4c4b0;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.7;
    letter-spacing: 0.01em;
    color: var(--espresso);
    background-color: var(--warm-cream);
    overflow-x: hidden;
}

/* === Hero Section === */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 50% 70%, var(--sunset-apricot) 0%, var(--terracotta) 45%, var(--espresso) 100%);
    overflow: hidden;
}

/* Film grain overlay */
.hero-grain {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.04;
    filter: url(#filmGrain);
    pointer-events: none;
    z-index: 1;
}

/* Marble texture overlay for hero */
#hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        repeating-linear-gradient(115deg, rgba(184,160,140,0.04) 0px, transparent 3px, transparent 40px),
        repeating-linear-gradient(155deg, rgba(184,160,140,0.03) 0px, transparent 2px, transparent 50px),
        repeating-linear-gradient(85deg, rgba(184,160,140,0.05) 0px, transparent 2px, transparent 35px);
    pointer-events: none;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 0;
    margin-top: -8vh;
}

/* === Column Fragments === */
.column-fragment {
    position: absolute;
    opacity: 0.5;
    z-index: 1;
}

.column-fragment-left {
    left: 8vw;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
}

.column-fragment-right {
    right: 8vw;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
}

/* === Hero Title (3D Marble Text) === */
.hero-title {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(4rem, 14vw, 12rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--warm-cream);
    text-shadow:
        2px 2px 0 var(--marble-vein),
        4px 4px 0 rgba(44,24,16,0.2),
        6px 6px 12px rgba(44,24,16,0.3);
    line-height: 1;
    animation: lightShift 20s ease-in-out infinite;
}

@keyframes lightShift {
    0%, 100% {
        text-shadow:
            2px 2px 0 var(--marble-vein),
            4px 4px 0 rgba(44,24,16,0.2),
            6px 6px 12px rgba(44,24,16,0.3);
    }
    50% {
        text-shadow:
            3px 1px 0 var(--marble-vein),
            5px 3px 0 rgba(44,24,16,0.2),
            7px 5px 14px rgba(44,24,16,0.35);
    }
}

/* === Hero Subtitle / Typewriter === */
.hero-subtitle {
    margin-top: 2rem;
    min-height: 4rem;
}

.hero-subtitle .type-target {
    font-family: 'Source Serif 4', Georgia, serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.1rem, 2vw, 1.6rem);
    color: var(--warm-cream);
    opacity: 0.9;
    line-height: 1.6;
    min-height: 1.6em;
}

/* Typewriter cursor */
.typewriter-cursor {
    display: inline-block;
    width: 2px;
    height: 1.1em;
    background-color: var(--coral-blush);
    vertical-align: text-bottom;
    margin-left: 2px;
    animation: cursorBlink 530ms step-end infinite;
}

.typewriter-cursor.fade-out {
    animation: cursorFadeOut 800ms ease-out forwards;
}

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

@keyframes cursorFadeOut {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

/* === Scroll Indicator === */
.scroll-indicator {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
}

.scroll-text {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--warm-cream);
    opacity: 0.6;
    margin-bottom: 0.5rem;
}

.scroll-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, var(--warm-cream), transparent);
    opacity: 0.4;
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.4; transform: scaleY(1); }
    50% { opacity: 0.7; transform: scaleY(1.2); }
}

/* === Dentil Molding Divider === */
.dentil-divider {
    width: 100%;
    height: 4px;
    background: repeating-linear-gradient(90deg, var(--sunset-gold) 0px, var(--sunset-gold) 8px, transparent 8px, transparent 16px);
}

/* === Gallery Section === */
#gallery {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    background-color: var(--warm-cream);
    /* Marble texture */
    background-image:
        repeating-linear-gradient(115deg, rgba(184,160,140,0.04) 0px, transparent 3px, transparent 40px),
        repeating-linear-gradient(155deg, rgba(184,160,140,0.03) 0px, transparent 2px, transparent 50px),
        repeating-linear-gradient(85deg, rgba(184,160,140,0.05) 0px, transparent 2px, transparent 35px);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: minmax(280px, auto);
    gap: 24px;
}

/* === Card Base Styles === */
.card {
    background-color: var(--warm-cream);
    background-image:
        repeating-linear-gradient(115deg, rgba(184,160,140,0.06) 0px, transparent 3px, transparent 40px),
        repeating-linear-gradient(155deg, rgba(184,160,140,0.04) 0px, transparent 2px, transparent 50px);
    border: 2px solid var(--sunset-gold);
    border-radius: 4px;
    transform: perspective(800px) rotateX(2deg);
    transition:
        border-color 300ms ease-out,
        background-color 300ms ease-out;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    /* Initial state for entrance animation */
    opacity: 0;
    transform: perspective(800px) rotateX(2deg) translateY(40px);
}

.card.card-visible {
    opacity: 1;
    transform: perspective(800px) rotateX(2deg) translateY(0);
    transition:
        border-color 300ms ease-out,
        background-color 300ms ease-out,
        opacity 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Wide cards span 2 columns */
.card-wide {
    grid-column: span 2;
}

/* Card hover */
.card:hover {
    border-color: var(--light-gold);
    background-color: rgba(245, 194, 138, 0.3);
}

.card:hover .marble-object {
    transform: rotateY(15deg);
}

/* === Card Object Area === */
.card-object-area {
    flex: 0 0 60%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 2rem 1rem 1rem;
}

/* === Marble Objects - Shared === */
.marble-object {
    position: relative;
    transition: transform 300ms ease-out;
}

/* Object reflection */
.object-reflection {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 70%;
    height: 20px;
    background: radial-gradient(ellipse, rgba(44,24,16,0.15) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(8px);
}

/* === Marble Sphere === */
.marble-sphere {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FAF0E1 0%, #B8A08C 40%, #FAF0E1 60%, #d4c4b0 100%);
    box-shadow:
        12px 16px 40px rgba(44,24,16,0.35),
        -4px -4px 20px rgba(249,240,225,0.15),
        inset -8px -8px 20px rgba(44,24,16,0.1),
        inset 4px 4px 10px rgba(249,240,225,0.3);
}

.sphere-highlight {
    position: absolute;
    top: 15%;
    left: 25%;
    width: 30%;
    height: 25%;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(255,255,255,0.5) 0%, transparent 70%);
}

.marble-sphere-small {
    width: 70px;
    height: 70px;
}

/* === Marble Cube === */
.marble-cube {
    width: 90px;
    height: 90px;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateX(-15deg) rotateY(25deg);
}

.cube-face {
    position: absolute;
    background: linear-gradient(135deg, #FAF0E1 0%, #B8A08C 40%, #FAF0E1 60%, #d4c4b0 100%);
}

.cube-front {
    width: 80px;
    height: 80px;
    top: 10px;
    left: 5px;
    box-shadow:
        8px 12px 30px rgba(44,24,16,0.3);
}

.cube-top {
    width: 80px;
    height: 25px;
    top: -10px;
    left: 10px;
    background: linear-gradient(135deg, #FAF0E1 0%, #d4c4b0 60%, #B8A08C 100%);
    transform: skewX(-40deg);
}

.cube-side {
    width: 25px;
    height: 80px;
    top: 5px;
    right: -10px;
    background: linear-gradient(135deg, #B8A08C 0%, #d4c4b0 40%, #B8A08C 100%);
    transform: skewY(-40deg);
}

/* === Marble Torus === */
.marble-torus {
    width: 120px;
    height: 70px;
    position: relative;
}

.torus-ring {
    width: 120px;
    height: 70px;
    border-radius: 50%;
    border: 22px solid transparent;
    background: linear-gradient(135deg, #FAF0E1, #B8A08C, #FAF0E1, #d4c4b0) border-box;
    -webkit-mask:
        linear-gradient(#fff 0 0) padding-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    box-shadow:
        10px 14px 35px rgba(44,24,16,0.3),
        -3px -3px 15px rgba(249,240,225,0.1);
}

.torus-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 76px;
    height: 26px;
    border-radius: 50%;
    box-shadow: inset 0 4px 12px rgba(44,24,16,0.2), inset 0 -2px 8px rgba(249,240,225,0.1);
}

/* === Marble Cylinder === */
.marble-cylinder {
    width: 60px;
    height: 110px;
    position: relative;
}

.cylinder-body {
    width: 60px;
    height: 90px;
    background: linear-gradient(90deg, #B8A08C 0%, #FAF0E1 30%, #d4c4b0 70%, #B8A08C 100%);
    border-radius: 4px;
    box-shadow:
        10px 14px 35px rgba(44,24,16,0.3),
        -3px -3px 15px rgba(249,240,225,0.1);
    position: absolute;
    bottom: 0;
}

.cylinder-cap {
    width: 70px;
    height: 20px;
    background: linear-gradient(135deg, #FAF0E1 0%, #d4c4b0 50%, #B8A08C 100%);
    border-radius: 50%;
    position: absolute;
    top: 0;
    left: -5px;
    box-shadow: 0 -2px 8px rgba(44,24,16,0.15);
}

/* === Marble Pyramid === */
.marble-pyramid {
    width: 90px;
    height: 100px;
    position: relative;
}

.pyramid-front {
    position: absolute;
    bottom: 0;
    left: 10px;
    width: 0;
    height: 0;
    border-left: 40px solid transparent;
    border-right: 40px solid transparent;
    border-bottom: 95px solid #d4c4b0;
    filter: drop-shadow(8px 10px 20px rgba(44,24,16,0.3));
}

.pyramid-left {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 25px solid transparent;
    border-right: 25px solid transparent;
    border-bottom: 95px solid #B8A08C;
    transform: scaleX(0.5) translateX(-30px);
}

/* === Marble Double Sphere === */
.marble-double-sphere {
    display: flex;
    gap: 20px;
    align-items: center;
}

.ds-left,
.ds-right {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FAF0E1 0%, #B8A08C 40%, #FAF0E1 60%, #d4c4b0 100%);
    box-shadow:
        12px 16px 40px rgba(44,24,16,0.35),
        -4px -4px 20px rgba(249,240,225,0.15),
        inset -8px -8px 20px rgba(44,24,16,0.1),
        inset 4px 4px 10px rgba(249,240,225,0.3);
    position: relative;
}

.ds-right {
    width: 60px;
    height: 60px;
}

/* === Marble Arch === */
.marble-arch {
    width: 100px;
    height: 100px;
    position: relative;
}

.arch-left,
.arch-right {
    position: absolute;
    bottom: 0;
    width: 18px;
    height: 60px;
    background: linear-gradient(90deg, #B8A08C 0%, #FAF0E1 40%, #d4c4b0 80%, #B8A08C 100%);
    box-shadow: 4px 8px 20px rgba(44,24,16,0.25);
}

.arch-left {
    left: 10px;
}

.arch-right {
    right: 10px;
}

.arch-top {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 80px;
    height: 50px;
    border-radius: 40px 40px 0 0;
    background: linear-gradient(135deg, #FAF0E1 0%, #B8A08C 40%, #FAF0E1 60%, #d4c4b0 100%);
    box-shadow:
        6px 8px 25px rgba(44,24,16,0.3),
        inset 0 -20px 30px rgba(44,24,16,0.15);
}

/* === Marble Obelisk === */
.marble-obelisk {
    width: 40px;
    height: 120px;
    position: relative;
}

.obelisk-body {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 100px;
    background: linear-gradient(90deg, #B8A08C 0%, #FAF0E1 35%, #d4c4b0 70%, #B8A08C 100%);
    clip-path: polygon(10% 0%, 90% 0%, 100% 100%, 0% 100%);
    box-shadow: 8px 12px 30px rgba(44,24,16,0.3);
}

.obelisk-cap {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-bottom: 25px solid #d4c4b0;
    filter: drop-shadow(2px 3px 8px rgba(44,24,16,0.2));
}

/* === Card Text Area === */
.card-text {
    flex: 0 0 40%;
    padding: 1rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.card-title {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--espresso);
    line-height: 1.2;
    min-height: 1.4em;
}

.card-title .typed-text {
    display: inline;
}

.card-category {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: clamp(0.85rem, 1.5vw, 1.1rem);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--terracotta);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Laurel badge before category */
.card-category::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23C9963B' stroke-width='1'%3E%3Cellipse cx='5' cy='8' rx='2' ry='4' transform='rotate(-20 5 8)'/%3E%3Cellipse cx='11' cy='8' rx='2' ry='4' transform='rotate(20 11 8)'/%3E%3C/g%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.card-body {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.1vw, 1rem);
    line-height: 1.65;
    color: var(--espresso);
    opacity: 0;
    transition: opacity 400ms ease-out 200ms;
}

.card.card-visible .card-body {
    opacity: 1;
}

/* === Slow Spin Animation for Background Objects === */
@keyframes slowSpin {
    from { transform: rotateY(0deg); }
    to { transform: rotateY(360deg); }
}

/* === Footer === */
#footer {
    background-color: var(--espresso);
    padding: 3rem 2rem;
    text-align: center;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.footer-columns {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
}

.footer-column-svg {
    width: 40px;
    height: 120px;
    opacity: 0.5;
}

.footer-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.laurel-wreath {
    width: 80px;
    height: 40px;
    opacity: 0.8;
}

.footer-title {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(1.8rem, 4vw, 3rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--sunset-gold);
}

.footer-tagline {
    font-family: 'Source Serif 4', Georgia, serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.5vw, 1.15rem);
    color: var(--warm-cream);
    opacity: 0.7;
}

/* === Mobile Responsive === */
@media (max-width: 900px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .card-wide {
        grid-column: span 1;
    }

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

    .column-fragment {
        display: none;
    }

    #gallery {
        padding: 2rem 1rem;
    }

    .card-object-area {
        flex: 0 0 50%;
        padding: 1.5rem 1rem 0.5rem;
    }

    .card-text {
        flex: 0 0 50%;
        padding: 0.75rem 1rem 1.25rem;
    }

    .footer-column-svg {
        display: none;
    }

    .footer-columns {
        gap: 1rem;
    }
}

@media (max-width: 600px) {
    .hero-subtitle .type-target {
        font-size: clamp(0.95rem, 3.5vw, 1.2rem);
    }

    .marble-sphere {
        width: 75px;
        height: 75px;
    }

    .marble-sphere-small {
        width: 55px;
        height: 55px;
    }

    .marble-cube {
        width: 70px;
        height: 70px;
    }

    .cube-front {
        width: 60px;
        height: 60px;
    }

    .cube-top {
        width: 60px;
        height: 20px;
    }

    .cube-side {
        width: 20px;
        height: 60px;
    }

    .ds-left {
        width: 60px;
        height: 60px;
    }

    .ds-right {
        width: 45px;
        height: 45px;
    }
}

/* === Tablet 2-column layout === */
@media (min-width: 601px) and (max-width: 900px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .card-wide {
        grid-column: span 2;
    }
}
