/* ============================================
   algoha.com - Bauhaus Structural Functionalism
   ============================================ */

/* CSS Custom Properties */
:root {
    --bg-primary: #f0f0f2;
    --bg-secondary: #e4e4e8;
    --surface: #f7f7f9;
    --text-primary: #2a2a32;
    --text-secondary: #6b6b78;
    --accent-primary: #3a3a42;
    --accent-secondary: #7889a0;
    --divider: #c8c8cc;
    --mountain-stroke: #9b9ba3;
    --bauhaus-red: #c4453c;

    --font-display: 'Josefin Sans', sans-serif;
    --font-deco: 'Poiret One', cursive;
    --font-body: 'Work Sans', sans-serif;

    --gutter: 24px;
    --col-count: 12;
    --baseline: 8px;
}

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

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

body {
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    line-height: 1.72;
    letter-spacing: 0.005em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    line-height: 1.2;
}

p {
    max-width: 62ch;
    font-size: clamp(0.95rem, 1.1vw, 1.1rem);
    color: var(--text-secondary);
}

ul {
    list-style: none;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ============================================
   Navigation
   ============================================ */
#main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background-color: var(--bg-primary);
    z-index: 100;
    border-bottom: 1px solid var(--divider);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 48px;
    max-width: 1440px;
    margin: 0 auto;
}

.nav-logo {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-primary);
}

.nav-links {
    display: flex;
    gap: 48px;
}

.nav-link {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--text-secondary);
    position: relative;
    padding-bottom: 2px;
    transition: color 250ms ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--bauhaus-red);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 200ms ease;
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link:hover::after {
    transform: scaleX(1);
}

/* ============================================
   Hero Section
   ============================================ */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-primary);
    scroll-snap-align: start;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

#hero-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(3rem, 8vw, 7rem);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-primary);
    white-space: nowrap;
}

#hero-title .char {
    display: inline-block;
    opacity: 0;
    transition: opacity 200ms ease;
}

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

.hero-ridgeline {
    position: absolute;
    bottom: 15%;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1;
    pointer-events: none;
}

#hero-svg {
    width: 100%;
    height: auto;
    display: block;
}

.mountain-path {
    stroke-dasharray: var(--path-length, 3000);
    stroke-dashoffset: var(--path-length, 3000);
}

.mountain-path.animate {
    animation: draw-ridge forwards;
    animation-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1);
}

#hero-path.animate {
    animation-duration: 3.5s;
}

.divider-path.animate {
    animation-duration: 1.8s;
}

.card-bg-path.animate {
    animation-duration: 2.5s;
}

@keyframes draw-ridge {
    to {
        stroke-dashoffset: 0;
    }
}

/* Hero path flash to red on completion */
#hero-path.flash {
    stroke: var(--bauhaus-red);
    transition: stroke 150ms ease;
}

#hero-path.flash-out {
    stroke: var(--mountain-stroke);
    transition: stroke 300ms ease;
}

/* ============================================
   Grid Scaffold
   ============================================ */
.grid-scaffold {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 600ms ease;
}

.grid-scaffold.visible {
    opacity: 1;
}

.grid-scaffold svg {
    width: 100%;
    height: 100%;
}

.grid-line {
    stroke: var(--divider);
    stroke-width: 1;
    opacity: 0.3;
}

/* ============================================
   Content Sections
   ============================================ */
.content-section {
    position: relative;
    padding: 96px 48px 48px;
    max-width: 1440px;
    margin: 0 auto;
    z-index: 1;
}

/* Section Numerals (Poiret One watermark) */
.section-numeral {
    font-family: var(--font-deco);
    font-weight: 400;
    font-size: clamp(4rem, 10vw, 9rem);
    color: var(--mountain-stroke);
    opacity: 0;
    position: absolute;
    top: 32px;
    left: 48px;
    line-height: 1;
    z-index: 0;
    pointer-events: none;
    transition: opacity 600ms cubic-bezier(0.34, 0, 0.21, 1);
}

.section-numeral.visible {
    opacity: 0.4;
}

/* Section Divider Ridgeline */
.section-divider-ridge {
    width: 40vw;
    margin: 0 auto 48px;
    opacity: 0;
    transition: opacity 400ms ease;
}

.section-divider-ridge.visible {
    opacity: 1;
}

.divider-svg {
    width: 100%;
    height: auto;
    display: block;
}

/* Card Groups */
.card-group {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--gutter);
    position: relative;
    z-index: 1;
}

/* Card Spans */
.card-span-2 { grid-column: span 2; }
.card-span-3 { grid-column: span 3; }
.card-span-4 { grid-column: span 4; }
.card-span-5 { grid-column: span 5; }
.card-span-8 { grid-column: span 8; }

/* Cards */
.card {
    background-color: var(--surface);
    border-left: 2px solid var(--accent-primary);
    border-radius: 0;
    padding: 32px;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 500ms cubic-bezier(0.34, 0, 0.21, 1),
                transform 500ms cubic-bezier(0.34, 0, 0.21, 1),
                border-color 250ms ease;
}

.card.visible {
    opacity: 1;
    transform: translateY(0);
}

.card:hover {
    border-left-color: var(--bauhaus-red);
}

.card-title {
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: var(--text-primary);
    margin-bottom: 16px;
    transition: letter-spacing 300ms ease;
}

.card:hover .card-title {
    letter-spacing: 0.16em;
}

.card-body {
    margin-bottom: 16px;
    line-height: 1.72;
}

.card-body:last-child {
    margin-bottom: 0;
}

.card-body-emphasis {
    font-weight: 500;
    color: var(--text-primary);
}

.highlight-text {
    color: var(--bauhaus-red);
    font-weight: 500;
}

.card-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card-list li {
    font-family: var(--font-body);
    font-size: clamp(0.9rem, 1vw, 1rem);
    color: var(--text-secondary);
    padding-left: 16px;
    position: relative;
}

.card-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 8px;
    height: 1px;
    background-color: var(--accent-primary);
}

/* Card Watermark SVG */
.card-watermark-svg {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 60%;
    pointer-events: none;
    opacity: 0.08;
}

/* Card Geometric Accents */
.card-geometric {
    margin-bottom: 16px;
}

.geo-diamond {
    display: inline-block;
    width: 10px;
    height: 10px;
    border: 1px solid var(--mountain-stroke);
    transform: rotate(45deg);
}

.geo-circle {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 1px solid var(--mountain-stroke);
    border-radius: 0;
}

/* Sidebar Cards */
.card-sidebar {
    background-color: var(--bg-secondary);
}

/* ============================================
   Full-width Dividers
   ============================================ */
.full-divider {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0 48px;
    margin: 0 auto;
    max-width: 1440px;
    height: 48px;
}

.divider-node {
    width: 12px;
    height: 12px;
    border-radius: 0;
    border: 1.5px solid var(--bauhaus-red);
    background: transparent;
    flex-shrink: 0;
    position: relative;
}

/* Make divider-node a circle */
.divider-node {
    border-radius: 50%;
}

.divider-line {
    flex: 1;
    height: 1px;
    background-color: var(--mountain-stroke);
    margin-left: 0;
}

/* ============================================
   Footer
   ============================================ */
#footer {
    padding: 48px 48px 32px;
    max-width: 1440px;
    margin: 48px auto 0;
    border-top: 1px solid var(--divider);
}

.footer-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 24px;
}

.footer-mark {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-primary);
}

.footer-divider-line {
    width: 48px;
    height: 1px;
    background-color: var(--divider);
}

.footer-text {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

.footer-bottom {
    display: flex;
    align-items: center;
}

.footer-year {
    font-family: var(--font-deco);
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--mountain-stroke);
    opacity: 0.3;
}

/* ============================================
   Responsive (below 768px)
   ============================================ */
@media (max-width: 768px) {
    .nav-inner {
        padding: 0 24px;
    }

    .nav-links {
        gap: 24px;
    }

    .nav-link {
        font-size: 10px;
        letter-spacing: 0.2em;
    }

    .content-section {
        padding: 72px 24px 32px;
    }

    .section-numeral {
        left: 24px;
        font-size: clamp(3rem, 8vw, 5rem);
    }

    .section-divider-ridge {
        width: 70vw;
        margin-bottom: 32px;
    }

    .card-group {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }

    .card-span-2,
    .card-span-3,
    .card-span-4,
    .card-span-5,
    .card-span-8 {
        grid-column: span 4;
    }

    .card {
        padding: 24px;
    }

    .full-divider {
        padding: 0 24px;
        height: 32px;
    }

    #footer {
        padding: 32px 24px 24px;
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .nav-links {
        gap: 16px;
    }

    .nav-link {
        font-size: 9px;
        letter-spacing: 0.15em;
    }

    #hero-title {
        font-size: clamp(2rem, 10vw, 4rem);
    }
}

/* ============================================
   Scroll Snap (Hero only)
   ============================================ */
html {
    scroll-snap-type: y proximity;
}
