/* ============================================
   archaic.studio - Styles
   Cool-gray achromatic palette with botanical accent

   Typography: Barlow Condensed 700, Source Serif 4 400, IBM Plex Mono 300
   Palette: Cool grays (#0D0F11 through #B0BEC5) with botanical accent #7D616A

   Editorial scroll-snap plate system. Minimal navigation.
   Nature as insurgent force breaking through industrial decay.
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --bg-primary: #0D0F11;
    --bg-secondary: #1A1D21;
    --text-primary: #B0BEC5;
    --text-secondary: #90A4AE;
    --text-tertiary: #546E7A;
    --accent-cold: #6B7B8D;
    --accent-botanical: #7D616A;
    --accent-decay: #4A5859;
    --accent-steel: #8A9BA8;

    --font-display: 'Barlow Condensed', sans-serif;
    --font-body: 'Source Serif 4', serif;
    --font-mono: 'IBM Plex Mono', monospace;

    --spring-ease: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scrollbar-width: none;
}

html::-webkit-scrollbar {
    display: none;
}

body {
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-family: var(--font-body);
    overflow: hidden;
}

/* --- Scroll Progress Line (right edge, 1px) --- */
.scroll-progress-line {
    position: fixed;
    top: 0;
    right: 0;
    width: 1px;
    height: 0%;
    background: var(--accent-cold);
    z-index: 100;
    transition: none;
}

/* --- Fixed SVG Vine System --- */
.vine-system {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.vine-main {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
}

.vine-branch {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    opacity: 0;
}

.pressed-flower {
    opacity: 0;
    transition: opacity 1.5s ease;
}

.pressed-flower.revealed {
    opacity: 0.4;
}

/* --- Scroll Container --- */
.scroll-container {
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
}

.scroll-container::-webkit-scrollbar {
    display: none;
}

/* --- Plate Base --- */
.plate {
    height: 100vh;
    width: 100%;
    scroll-snap-align: start;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 24px gap between plates in near-black */
.plate + .plate {
    border-top: 24px solid var(--bg-primary);
}

/* Alternating plate backgrounds */
.plate-bg-primary {
    background: var(--bg-primary);
}

.plate-bg-secondary {
    background: var(--bg-secondary);
}

/* --- Plate Content Grid --- */
.plate-content {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 2;
}

/* Asymmetric 8-column grid from botanical field guides */
.plate-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 2fr 1fr 1fr 1fr 0.5fr 0.5fr;
    align-items: center;
    padding: 0 40px;
    gap: 0;
}

.plate-grid-work {
    display: grid;
    grid-template-columns: 1fr 1fr 2fr 1fr 1fr 1fr 0.5fr 0.5fr;
    align-items: center;
    padding: 0 40px;
    gap: 0;
    height: 100%;
}

/* --- Text Zone (Columns 1-2, pushed hard left) --- */
.text-zone {
    grid-column: 1 / 3;
    padding-right: 40px;
    z-index: 3;
}

/* --- Image Zone (Columns 5-8, bleeds right) --- */
.image-zone {
    grid-column: 5 / 9;
    position: relative;
    height: 70vh;
}

/* Work images span columns 3-8 */
.image-zone-wide {
    grid-column: 3 / 9;
    position: relative;
    height: 80vh;
    display: flex;
    align-items: center;
}

/* --- Hero Plate --- */
.plate-hero {
    background: var(--bg-primary);
}

.plate-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

/* Concrete facade generated via CSS gradients with subtle texture */
.concrete-facade {
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 120px,
            rgba(26, 29, 33, 0.3) 120px,
            rgba(26, 29, 33, 0.3) 121px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 200px,
            rgba(26, 29, 33, 0.2) 200px,
            rgba(26, 29, 33, 0.2) 201px
        ),
        linear-gradient(180deg,
            #14161a 0%,
            #181b1f 20%,
            #1c1f24 40%,
            #181b1f 60%,
            #14161a 80%,
            #111317 100%
        );
    filter: contrast(1.1);
}

/* Concrete texture noise via radial gradients */
.concrete-facade::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 2px 2px at 30% 25%, rgba(84,110,122,0.15) 0%, transparent 100%),
        radial-gradient(ellipse 3px 2px at 70% 60%, rgba(84,110,122,0.1) 0%, transparent 100%),
        radial-gradient(ellipse 2px 3px at 45% 80%, rgba(84,110,122,0.12) 0%, transparent 100%),
        radial-gradient(ellipse 1px 1px at 20% 45%, rgba(144,164,174,0.08) 0%, transparent 100%),
        radial-gradient(ellipse 2px 1px at 80% 30%, rgba(144,164,174,0.06) 0%, transparent 100%);
}

/* Vertical crack running through center of concrete facade */
.hero-crack {
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    transform: translateX(-50%);
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(125, 97, 106, 0.1) 10%,
        rgba(125, 97, 106, 0.25) 20%,
        rgba(125, 97, 106, 0.15) 35%,
        rgba(125, 97, 106, 0.3) 50%,
        rgba(125, 97, 106, 0.2) 65%,
        rgba(125, 97, 106, 0.25) 80%,
        rgba(125, 97, 106, 0.1) 90%,
        transparent 100%
    );
    z-index: 1;
}

/* Crack shadow / depth effect */
.hero-crack::before {
    content: '';
    position: absolute;
    top: 15%;
    left: -4px;
    width: 10px;
    height: 70%;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(13, 15, 17, 0.8) 20%,
        rgba(13, 15, 17, 0.95) 50%,
        rgba(13, 15, 17, 0.8) 80%,
        transparent 100%
    );
    filter: blur(3px);
}

/* Crack inner glow (botanical accent) */
.hero-crack::after {
    content: '';
    position: absolute;
    top: 25%;
    left: -1px;
    width: 4px;
    height: 50%;
    background: linear-gradient(
        180deg,
        transparent,
        rgba(125, 97, 106, 0.4) 30%,
        rgba(125, 97, 106, 0.5) 50%,
        rgba(125, 97, 106, 0.4) 70%,
        transparent
    );
    filter: blur(1px);
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

/* Title split across the crack: "archaic" left, ".studio" right */
.hero-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 6rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-primary);
    display: flex;
    gap: clamp(20px, 5vw, 80px);
    position: relative;
}

.hero-title-left {
    text-align: right;
}

.hero-title-right {
    text-align: left;
    color: var(--accent-steel);
}

/* --- Body Text (Source Serif 4) --- */
.body-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.95rem, 1.2vw, 1.15rem);
    line-height: 1.72;
    letter-spacing: 0.01em;
    color: var(--text-secondary);
    max-width: 320px;
}

/* --- Image Frames --- */
.image-frame {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    clip-path: inset(0 100% 0 0);
    transition: clip-path 1.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.image-frame.revealed {
    clip-path: inset(0 0 0 0);
}

/* CSS treatment for all imagery: heavily desaturated, high contrast */
.image-placeholder {
    position: absolute;
    inset: 0;
    filter: saturate(0.15) contrast(1.2) brightness(0.85);
    mix-blend-mode: luminosity;
}

/* Gradient overlay creating editorial lighting effect */
.image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(13,15,17,0.6) 0%, transparent 60%);
    mix-blend-mode: multiply;
}

/* --- Generated image backgrounds (concrete + botanical collision) --- */
.concrete-ivy {
    background:
        radial-gradient(ellipse 60% 40% at 65% 45%, rgba(74,88,89,0.5) 0%, transparent 70%),
        radial-gradient(ellipse 30% 50% at 40% 60%, rgba(125,97,106,0.15) 0%, transparent 60%),
        linear-gradient(170deg, #1A1D21 0%, #252830 30%, #1E2126 50%, #2A2D33 70%, #1A1D21 100%);
    background-size: 100% 100%;
}

.concrete-ivy::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, transparent 48%, rgba(74,88,89,0.3) 49%, rgba(74,88,89,0.3) 51%, transparent 52%),
        linear-gradient(0deg, transparent 60%, rgba(74,88,89,0.15) 70%, transparent 85%),
        repeating-linear-gradient(95deg, transparent, transparent 80px, rgba(26,29,33,0.3) 80px, rgba(26,29,33,0.3) 81px);
}

.steel-vines {
    background:
        radial-gradient(ellipse 50% 30% at 55% 50%, rgba(84,110,122,0.3) 0%, transparent 60%),
        radial-gradient(circle at 30% 40%, rgba(125,97,106,0.12) 0%, transparent 40%),
        linear-gradient(200deg, #1E2126 0%, #22252A 40%, #1A1D21 70%, #252830 100%);
}

.steel-vines::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(45deg, transparent 30%, rgba(107,123,141,0.1) 50%, transparent 70%),
        repeating-linear-gradient(0deg, transparent, transparent 60px, rgba(26,29,33,0.25) 60px, rgba(26,29,33,0.25) 61px);
}

.asphalt-bloom {
    background:
        radial-gradient(ellipse 40% 60% at 50% 55%, rgba(74,88,89,0.4) 0%, transparent 70%),
        radial-gradient(circle at 60% 40%, rgba(125,97,106,0.18) 0%, transparent 35%),
        linear-gradient(160deg, #1C1F23 0%, #20232A 35%, #1A1D21 60%, #23262C 100%);
}

.asphalt-bloom::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle 2px at 35% 65%, rgba(125,97,106,0.25) 0%, transparent 100%),
        radial-gradient(circle 3px at 55% 45%, rgba(125,97,106,0.2) 0%, transparent 100%),
        radial-gradient(circle 1px at 45% 70%, rgba(125,97,106,0.3) 0%, transparent 100%);
}

/* Work plate images */
.work-img-1 {
    background:
        radial-gradient(ellipse 70% 50% at 60% 40%, rgba(74,88,89,0.4) 0%, transparent 60%),
        radial-gradient(ellipse 30% 40% at 30% 60%, rgba(125,97,106,0.15) 0%, transparent 50%),
        linear-gradient(135deg, #1E2126 0%, #22252C 30%, #1A1D21 60%, #252830 100%);
}

.work-img-1::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(0deg, transparent, transparent 100px, rgba(26,29,33,0.2) 100px, rgba(26,29,33,0.2) 101px),
        repeating-linear-gradient(90deg, transparent, transparent 150px, rgba(26,29,33,0.15) 150px, rgba(26,29,33,0.15) 151px),
        radial-gradient(circle at 70% 30%, rgba(84,110,122,0.2) 0%, transparent 40%);
}

.work-img-2 {
    background:
        radial-gradient(ellipse 60% 60% at 50% 50%, rgba(84,110,122,0.3) 0%, transparent 60%),
        radial-gradient(ellipse 40% 30% at 70% 35%, rgba(125,97,106,0.12) 0%, transparent 50%),
        linear-gradient(180deg, #1C1F24 0%, #20232A 40%, #1A1D21 80%, #1E2126 100%);
}

.work-img-2::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(60deg, transparent 40%, rgba(107,123,141,0.08) 50%, transparent 60%),
        repeating-linear-gradient(90deg, transparent, transparent 120px, rgba(26,29,33,0.2) 120px, rgba(26,29,33,0.2) 121px);
}

.work-img-3 {
    background:
        radial-gradient(ellipse 50% 70% at 45% 50%, rgba(74,88,89,0.35) 0%, transparent 60%),
        radial-gradient(circle at 65% 45%, rgba(125,97,106,0.2) 0%, transparent 35%),
        linear-gradient(225deg, #1A1D21 0%, #252830 30%, #1E2126 60%, #1A1D21 100%);
}

.work-img-3::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle 40px at 40% 50%, rgba(84,110,122,0.15) 0%, transparent 100%),
        radial-gradient(circle 60px at 60% 40%, rgba(74,88,89,0.1) 0%, transparent 100%),
        radial-gradient(circle 30px at 50% 65%, rgba(125,97,106,0.12) 0%, transparent 100%);
}

/* --- Image Caption (IBM Plex Mono) --- */
.image-caption {
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    position: absolute;
    bottom: 20px;
    right: 0;
}

/* --- Plate Titles (Barlow Condensed) --- */
.plate-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-primary);
    line-height: 1.05;
    margin-bottom: 30px;
}

/* --- Work Plates --- */
.work-text {
    grid-column: 1 / 3;
    padding-right: 40px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-self: center;
}

.work-meta {
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-top: 10px;
}

.work-frame {
    width: 100%;
    height: 70vh;
    transition: clip-path 1.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.6s var(--spring-ease);
}

/* Hover: slight saturation increase as if proximity revives color */
.work-frame .image-placeholder {
    transition: filter 0.6s ease;
}

.work-frame:hover .image-placeholder {
    filter: saturate(0.35) contrast(1.2) brightness(0.85);
}

/* Pressed flower corner decorations on work images */
.pressed-corner {
    position: absolute;
    width: 40px;
    height: 40px;
    opacity: 0.3;
    z-index: 5;
}

.corner-tl {
    top: 15px;
    left: 15px;
    border-top: 1px solid var(--accent-botanical);
    border-left: 1px solid var(--accent-botanical);
}

.corner-tl::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    width: 12px;
    height: 12px;
    border-radius: 50% 50% 50% 0;
    border: 1px solid var(--accent-decay);
    transform: rotate(-45deg);
}

.corner-br {
    bottom: 15px;
    right: 15px;
    border-bottom: 1px solid var(--accent-botanical);
    border-right: 1px solid var(--accent-botanical);
}

.corner-br::before {
    content: '';
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 12px;
    height: 12px;
    border-radius: 50% 50% 0 50%;
    border: 1px solid var(--accent-decay);
    transform: rotate(45deg);
}

/* --- Philosophy Plates --- */
.plate-philosophy {
    background: var(--bg-secondary);
}

.root-network {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.08;
    z-index: 0;
}

/* Slow pulse animation: roots appear alive beneath surface */
.root-line {
    animation: rootPulse 8s ease-in-out infinite;
}

@keyframes rootPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.005); }
}

.philosophy-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 60px;
    max-width: 900px;
    margin: 0 auto;
    gap: 60px;
}

/* Pull quotes in Barlow Condensed */
.pull-quote {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 4rem);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-primary);
    line-height: 1.2;
    text-align: center;
    position: relative;
}

/* Thorn accents instead of quotation marks */
.thorn-accent {
    display: inline-block;
    width: 5px;
    height: 5px;
    background: var(--accent-cold);
    transform: rotate(45deg);
    margin: 0 12px;
    vertical-align: middle;
}

.philosophy-body {
    text-align: center;
    max-width: 600px;
}

/* --- Contact Plate --- */
.plate-contact {
    background: var(--bg-primary);
}

.contact-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
}

/* Email in IBM Plex Mono */
.contact-email {
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: 1.5rem;
    letter-spacing: 0.1em;
    color: var(--text-primary);
    text-decoration: none;
    position: relative;
    transition: color 0.4s ease;
}

.contact-email::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--accent-botanical);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.6s var(--spring-ease);
}

.contact-email:hover {
    color: var(--accent-botanical);
}

.contact-email:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Closing statement in Storm gray */
.contact-closing {
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

/* --- Text Animation Classes --- */
.animate-text {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.2s ease, transform 1.2s ease;
}

.animate-text.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    .animate-text {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .image-frame {
        clip-path: inset(0 0 0 0);
        transition: none;
    }

    .vine-main,
    .vine-branch {
        stroke-dashoffset: 0;
        transition: none;
    }

    .pressed-flower {
        opacity: 0.4;
        transition: none;
    }

    .root-line {
        animation: none;
    }

    .work-frame {
        transition: none;
    }

    .work-frame .image-placeholder {
        transition: none;
    }

    .contact-email,
    .contact-email::after {
        transition: none;
    }
}

/* --- Responsive: Tablet --- */
@media (max-width: 1024px) {
    .plate-grid,
    .plate-grid-work {
        grid-template-columns: 1fr 1fr 1fr 1fr;
        padding: 0 24px;
    }

    .text-zone,
    .work-text {
        grid-column: 1 / 3;
    }

    .image-zone {
        grid-column: 3 / 5;
        height: 50vh;
    }

    .image-zone-wide {
        grid-column: 2 / 5;
        height: 60vh;
    }
}

/* --- Responsive: Mobile --- */
@media (max-width: 768px) {
    .plate-grid,
    .plate-grid-work {
        grid-template-columns: 1fr;
        padding: 40px 24px;
        align-content: center;
        gap: 30px;
    }

    .text-zone,
    .work-text {
        grid-column: 1 / -1;
        padding-right: 0;
    }

    .image-zone,
    .image-zone-wide {
        grid-column: 1 / -1;
        height: 40vh;
    }

    .body-text {
        max-width: 100%;
    }

    .hero-title {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .hero-title-left,
    .hero-title-right {
        text-align: center;
    }

    .philosophy-content {
        padding: 40px 24px;
    }

    .pull-quote {
        font-size: clamp(1.4rem, 5vw, 2.5rem);
    }

    .contact-email {
        font-size: 1.1rem;
    }

    .vine-system {
        opacity: 0.5;
    }

    .work-frame {
        height: 40vh;
    }
}
