/* ==============================================
   holos.works — Bauhaus-Workshop-Amber Stylesheet
   Palette: Honeyed Neutral
   Typeface: Space Grotesk (primary), Anybody (accent)
   ============================================== */

/* --- CSS Custom Properties --- */
:root {
    --parchment-birch: #f4edd9;
    --warm-linen: #e8dfc8;
    --burnished-honey: #c4a265;
    --aged-brass: #b89a5a;
    --workshop-charcoal: #2e2a24;
    --warm-graphite: #5a5347;
    --kiln-ochre: #d4a843;
    --shadow-umber: #3a3228;

    --font-primary: 'Space Grotesk', sans-serif;
    --font-accent: 'Anybody', sans-serif;

    --ease-mechanical: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
    font-family: var(--font-primary);
    font-weight: 400;
    color: var(--workshop-charcoal);
    background: linear-gradient(180deg, #f4edd9 0%, #e8dfc8 100%);
    background-attachment: fixed;
    letter-spacing: 0.02em;
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Grid Dots Background --- */
#grid-dots {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background-image: radial-gradient(circle, rgba(184, 154, 90, 0.08) 1px, transparent 1px);
    background-size: 48px 48px;
}

/* --- Viewport Sections --- */
.viewport-section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    z-index: 1;
}

/* ============================
   HERO SECTION
   ============================ */
#hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
}

/* Holos Mark — Hero */
#hero-mark-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    transition: transform 0.8s var(--ease-smooth), opacity 0.8s var(--ease-smooth);
}

#hero-mark-container.settled {
    position: fixed;
    top: 32px;
    left: 32px;
    transform: translate(0, 0) scale(0.5);
    z-index: 100;
}

#holos-mark-hero circle,
#holos-mark-hero polygon,
#holos-mark-hero rect {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
}

#holos-mark-hero .mark-outer {
    stroke-dasharray: 252;
    stroke-dashoffset: 252;
}

#holos-mark-hero .mark-middle {
    stroke-dasharray: 176;
    stroke-dashoffset: 176;
}

#holos-mark-hero .mark-triangle {
    stroke-dasharray: 180;
    stroke-dashoffset: 180;
}

#holos-mark-hero .mark-square {
    stroke-dasharray: 32;
    stroke-dashoffset: 32;
}

.mark-animate .mark-outer {
    animation: drawStroke 0.8s var(--ease-mechanical) 0.3s forwards;
}

.mark-animate .mark-middle {
    animation: drawStrokeMiddle 0.6s var(--ease-mechanical) 1.1s forwards;
}

.mark-animate .mark-triangle {
    animation: drawStrokeTriangle 0.5s var(--ease-mechanical) 1.7s forwards;
}

.mark-animate .mark-square {
    animation: drawStrokeSquare 0.3s var(--ease-mechanical) 2.2s forwards;
}

@keyframes drawStroke {
    to { stroke-dashoffset: 0; }
}

@keyframes drawStrokeMiddle {
    to { stroke-dashoffset: 0; }
}

@keyframes drawStrokeTriangle {
    to { stroke-dashoffset: 0; }
}

@keyframes drawStrokeSquare {
    to { stroke-dashoffset: 0; }
}

/* Hero Headline */
#hero-headline-area {
    position: relative;
    z-index: 3;
    text-align: center;
    max-width: 90vw;
    opacity: 0;
    transition: opacity 0.6s var(--ease-smooth);
}

#hero-headline-area.visible {
    opacity: 1;
}

#hero-headline {
    font-family: var(--font-accent);
    font-weight: 400;
    font-stretch: 125%;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: var(--workshop-charcoal);
    margin-bottom: 1.5rem;
    min-height: 1.2em;
}

#hero-headline .char {
    opacity: 0;
    display: inline-block;
}

#hero-headline .char.visible {
    opacity: 1;
}

#hero-headline .char-space {
    display: inline;
    width: 0.3em;
}

#hero-subtitle {
    font-family: var(--font-primary);
    font-weight: 400;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    letter-spacing: 0.02em;
    line-height: 1.65;
    color: var(--warm-graphite);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.6s var(--ease-smooth) 0.2s, transform 0.6s var(--ease-smooth) 0.2s;
}

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

/* ============================
   RHYTHM STRIPS
   ============================ */
.rhythm-strip {
    width: 100%;
    height: 48px;
    position: relative;
    z-index: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rhythm-svg {
    width: 100%;
    height: 48px;
}

.rhythm-dot {
    fill: none;
    stroke: rgba(184, 154, 90, 0.4);
    stroke-width: 1;
}

/* ============================
   Z-PATTERN SECTIONS
   ============================ */
.z-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
    padding: 2rem;
}

.z-grid {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    grid-template-rows: auto 1fr auto;
    width: 100%;
    max-width: 1400px;
    height: 80vh;
    gap: 0;
    position: relative;
}

/* Corner Marks */
.corner-mark {
    position: absolute;
    width: 24px;
    height: 24px;
    opacity: 0;
    transition: opacity 0.3s var(--ease-smooth) 1.2s;
    z-index: 5;
}

.corner-mark::before,
.corner-mark::after {
    content: '';
    position: absolute;
    background: rgba(184, 154, 90, 0.3);
}

.corner-tl { top: 0; left: 0; }
.corner-tl::before { top: 0; left: 0; width: 24px; height: 1px; }
.corner-tl::after { top: 0; left: 0; width: 1px; height: 24px; }

.corner-tr { top: 0; right: 0; }
.corner-tr::before { top: 0; right: 0; width: 24px; height: 1px; }
.corner-tr::after { top: 0; right: 0; width: 1px; height: 24px; }

.corner-bl { bottom: 0; left: 0; }
.corner-bl::before { bottom: 0; left: 0; width: 24px; height: 1px; }
.corner-bl::after { bottom: 0; left: 0; width: 1px; height: 24px; }

.corner-br { bottom: 0; right: 0; }
.corner-br::before { bottom: 0; right: 0; width: 24px; height: 1px; }
.corner-br::after { bottom: 0; right: 0; width: 1px; height: 24px; }

.z-section.in-view .corner-mark {
    opacity: 1;
}

/* Z-Anchor Positions */
.z-anchor {
    display: flex;
    align-items: flex-start;
    padding: 1.5rem;
}

.z-top-left {
    grid-column: 1;
    grid-row: 1;
    align-items: flex-start;
    justify-content: flex-start;
}

.z-top-right {
    grid-column: 3;
    grid-row: 1;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
}

.z-center {
    grid-column: 2;
    grid-row: 2;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.z-bottom-left {
    grid-column: 1;
    grid-row: 3;
    align-items: flex-end;
    justify-content: flex-start;
}

.z-bottom-right {
    grid-column: 3;
    grid-row: 3;
    align-items: flex-end;
    justify-content: flex-end;
    text-align: right;
}

/* Wordmark */
.wordmark-container {
    position: relative;
    width: 120px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wordmark-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 120px;
    height: 48px;
}

.wordmark-border .border-draw {
    stroke-dasharray: 334;
    stroke-dashoffset: 334;
    transition: stroke-dashoffset 1.2s var(--ease-mechanical);
}

.z-section.in-view .wordmark-border .border-draw {
    stroke-dashoffset: 0;
}

.wordmark {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    letter-spacing: 0.2em;
    color: var(--workshop-charcoal);
    position: relative;
    z-index: 2;
}

/* Section Titles */
.section-title {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: clamp(2rem, 5.5vw, 4.5rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.05;
    color: var(--workshop-charcoal);
    margin-bottom: 0.75rem;
}

/* Horizontal Rule */
.h-rule {
    width: 0;
    height: 1px;
    background: var(--warm-graphite);
    transition: width 0.8s var(--ease-mechanical) 0.4s;
}

.z-section.in-view .h-rule {
    width: 100%;
}

/* Diagonal Lines */
.diagonal-line {
    position: absolute;
    width: 100%;
    height: 1px;
    background: rgba(184, 154, 90, 0.3);
    transform-origin: top right;
    transform: scaleX(0);
    transition: transform 0.6s var(--ease-mechanical) 0.2s;
}

.diagonal-upper {
    top: 10%;
    transform: rotate(-18deg) scaleX(0);
    transform-origin: top right;
}

.diagonal-lower {
    bottom: 10%;
    transform: rotate(-18deg) scaleX(0);
    transform-origin: bottom left;
}

.z-section.in-view .diagonal-upper {
    transform: rotate(-18deg) scaleX(1);
}

.z-section.in-view .diagonal-lower {
    transform: rotate(-18deg) scaleX(1);
}

/* Z Center Content */
.z-center-content {
    display: flex;
    align-items: center;
    gap: 3rem;
    position: relative;
    z-index: 2;
}

/* Body Text */
.body-text {
    font-family: var(--font-primary);
    font-weight: 400;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    letter-spacing: 0.02em;
    line-height: 1.65;
    max-width: 58ch;
    color: var(--workshop-charcoal);
}

/* Geometric Shapes */
.geo-shape {
    flex-shrink: 0;
}

.geo-circle-large svg {
    width: 200px;
    height: 200px;
}

.geo-squares-group svg {
    width: 220px;
    height: 220px;
}

.geo-holos-mark-large svg {
    width: 240px;
    height: 240px;
}

/* Border Draw Animations for SVG shapes */
.border-draw-circle {
    stroke-dasharray: 620;
    stroke-dashoffset: 620;
    transition: stroke-dashoffset 1s var(--ease-mechanical);
}

.border-draw-rect {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    transition: stroke-dashoffset 1s var(--ease-mechanical);
}

.border-draw-tri {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    transition: stroke-dashoffset 1s var(--ease-mechanical);
}

/* Section-specific dash arrays */
.geo-circle-large .border-draw-circle {
    stroke-dasharray: 622;
    stroke-dashoffset: 622;
}

.sq-1 {
    stroke-dasharray: 480;
    stroke-dashoffset: 480;
}

.sq-2 {
    stroke-dasharray: 640;
    stroke-dashoffset: 640;
    transition-delay: 0.25s;
}

.sq-3 {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    transition-delay: 0.5s;
}

.z-section.in-view .border-draw-circle,
.z-section.in-view .border-draw-rect,
.z-section.in-view .border-draw-tri {
    stroke-dashoffset: 0;
}

/* Unity section: simultaneous draw */
.unity-sim {
    transition-delay: 0s;
}

/* Interactive Geometry — Hover */
.geo-shape svg {
    transition: transform 0.35s var(--ease-smooth);
}

.geo-shape svg:hover {
    transform: scale(1.03);
}

.geo-shape svg:hover circle,
.geo-shape svg:hover rect,
.geo-shape svg:hover polygon {
    stroke: var(--kiln-ochre);
    transition: stroke 0.35s var(--ease-smooth);
}

/* Navigation Elements */
.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--workshop-charcoal);
}

.nav-circle {
    display: inline-block;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--burnished-honey);
    transition: background-color 0.35s var(--ease-smooth), border-color 0.35s var(--ease-smooth);
    background-image: linear-gradient(var(--burnished-honey), var(--burnished-honey));
    background-size: 0% 100%;
    background-repeat: no-repeat;
    background-position: left;
    transition: background-size 0.35s var(--ease-smooth), border-color 0.35s var(--ease-smooth);
}

.nav-link:hover .nav-circle {
    background-size: 100% 100%;
    border-color: var(--kiln-ochre);
}

.nav-square {
    display: inline-block;
    width: 36px;
    height: 36px;
    border: 1px solid var(--burnished-honey);
    transition: background-size 0.35s var(--ease-smooth), border-color 0.35s var(--ease-smooth);
    background-image: linear-gradient(var(--burnished-honey), var(--burnished-honey));
    background-size: 0% 100%;
    background-repeat: no-repeat;
    background-position: left;
}

.nav-link:hover .nav-square {
    background-size: 100% 100%;
    border-color: var(--kiln-ochre);
}

.nav-label {
    font-family: var(--font-primary);
    font-weight: 500;
    font-size: clamp(0.8rem, 1.4vw, 0.95rem);
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

/* Resolution Text */
.resolution-text {
    font-family: var(--font-primary);
    font-weight: 400;
    font-size: clamp(0.85rem, 1.5vw, 1rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--warm-graphite);
}

/* ============================
   FOOTER / COLOPHON
   ============================ */
.footer-section {
    min-height: 50vh;
    background: var(--shadow-umber);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.footer-content {
    text-align: center;
    opacity: 0;
    filter: blur(4px);
    transition: opacity 1s var(--ease-smooth), filter 1s var(--ease-smooth);
}

.footer-content.in-view {
    opacity: 1;
    filter: blur(0px);
}

#holos-mark-footer {
    display: block;
    margin: 0 auto 1.5rem;
}

.footer-wordmark {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    letter-spacing: 0.2em;
    color: var(--burnished-honey);
    margin-bottom: 1rem;
}

.footer-motto {
    font-family: var(--font-primary);
    font-weight: 400;
    font-size: clamp(0.7rem, 1.2vw, 0.82rem);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    line-height: 1.4;
    color: var(--warm-linen);
    max-width: 60ch;
    margin: 0 auto;
}

/* ============================
   RESPONSIVE (< 768px)
   ============================ */
@media (max-width: 768px) {
    .z-grid {
        display: flex;
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        padding: 2rem 1rem;
        gap: 2rem;
    }

    .z-anchor {
        padding: 0.5rem 0;
    }

    .z-top-right {
        align-items: flex-start;
        text-align: left;
    }

    .z-bottom-right {
        align-items: flex-start;
        text-align: left;
    }

    .z-center-content {
        flex-direction: column;
        gap: 2rem;
    }

    .diagonal-line {
        display: none;
    }

    .geo-circle-large svg {
        width: 140px;
        height: 140px;
    }

    .geo-squares-group svg {
        width: 160px;
        height: 160px;
    }

    .geo-holos-mark-large svg {
        width: 180px;
        height: 180px;
    }

    .rhythm-strip {
        height: 24px;
    }

    .rhythm-svg {
        height: 24px;
    }

    #hero-mark-container.settled {
        top: 16px;
        left: 16px;
        transform: translate(0, 0) scale(0.4);
    }

    .corner-mark {
        display: none;
    }

    .section-title {
        font-size: clamp(1.8rem, 8vw, 3rem);
    }
}

/* ============================
   ANIMATIONS — UTILITY
   ============================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Smooth scroll anchor offset */
[id] {
    scroll-margin-top: 2rem;
}
