:root {
    /* ── Color Tokens ─────────────────────────────── */
    --color-bg: #2A2520;
    /* warm espresso dark */
    --color-surface: #1E1A16;
    /* card / panel near-black */
    --color-surface-raised: #252018;
    /* card hover lift */
    --color-gold: #C9A84C;
    /* primary accent */
    --color-gold-muted: #8A6E32;
    /* subdued labels, separators */
    --color-text-primary: #E8E0D0;
    /* main body text */
    --color-text-secondary: #9A9080;
    /* metadata, labels */
    --color-text-italic: #BDB5A8;
    /* poetic / italic passages */
    --color-border: rgba(201, 168, 76, 0.15);

    /* ── Legacy aliases (keep for SVG inline colours) */
    --temple-stone: #2A2520;
    --deepam-gold: #C9A84C;
    --parchment: #E8E0D0;
    --kolam-red: #8B4A3A;
    --wet-granite: #3D3835;

    /* ── Typography ───────────────────────────────── */
    --font-display: 'Cormorant Garamond', 'Playfair Display', serif;
    --font-mono: 'JetBrains Mono', 'IBM Plex Mono', monospace;
    --font-body: 'DM Sans', 'Inter', sans-serif;
    --font-tamil: 'Noto Serif Tamil', serif;

    /* keep legacy alias */
    --font-heading: var(--font-display);

    /* ── Spacing ──────────────────────────────────── */
    --section-padding: 120px;
    --content-max: 900px;
    --text-max: 640px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
}

/* Grain texture — subliminal depth, quality signal */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

::selection {
    background: var(--wet-granite);
    color: var(--color-gold);
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s cubic-bezier(0.25, 0, 0, 1);
}

/* 1. The Opening — The Threshold */
.viewport-opening {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    padding-top: 80px;
    /* pull content up from center */
}

.hero-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: var(--text-max);
    padding: 0 6vw;
    gap: 0;
}

/* σ glow wrapper — positions glow behind the glyph */
.sigma-glow-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.2em;
}

.sigma-glow {
    position: absolute;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    background: radial-gradient(circle,
            rgba(201, 168, 76, 0.09) 0%,
            rgba(201, 168, 76, 0.04) 35%,
            transparent 65%);
    opacity: 0;
    animation: glowIn 1.8s ease 0.2s forwards;
    pointer-events: none;
}

@keyframes glowIn {
    from {
        opacity: 0;
        transform: scale(0.7);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* The big σ — typographic, Cormorant Garamond display */
.hero-sigma-glyph {
    font-family: var(--font-display);
    font-size: clamp(160px, 24vw, 240px);
    color: var(--color-gold);
    line-height: 0.8;
    opacity: 0;
    animation: revealSigma 1.2s cubic-bezier(0.25, 0, 0, 1) 0.3s forwards;
    text-shadow: 0 0 80px rgba(201, 168, 76, 0.2), 0 0 160px rgba(201, 168, 76, 0.07);
    will-change: opacity, transform;
    user-select: none;
    position: relative;
    z-index: 1;
}

@keyframes revealSigma {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* arg max σ headline block */
.hero-formula {
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    animation: revealUp 0.8s ease 1.6s forwards;
    margin-bottom: 2.4rem;
    gap: 14px;
}

.formula-argmax {
    font-family: var(--font-display);
    font-size: clamp(32px, 5vw, 56px);
    color: var(--color-gold);
    letter-spacing: 0.15em;
    font-weight: 300;
}

/* Mono sub-label — replaces {build·think·create} */
.hero-sublabel {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--color-gold-muted);
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

/* Definition block — philosophy prose */
.hero-definition {
    opacity: 0;
    animation: revealUp 0.8s ease 2.4s forwards;
    max-width: var(--text-max);
    margin-top: 0.5rem;
}

.def-lead {
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: var(--color-text-primary);
    line-height: 1.65;
    margin-bottom: 1.4rem;
    font-style: italic;
    font-weight: 300;
}

.def-body {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--color-text-secondary);
    line-height: 1.85;
    margin-bottom: 1.2rem;
    font-weight: 300;
}

.def-body em {
    color: var(--color-text-italic);
    font-style: italic;
}

.def-manifesto {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--color-text-italic);
    line-height: 2;
    font-style: italic;
    font-weight: 300;
}

/* Tamil anchor — bilingual at base of viewport */
.hero-tamil-anchor {
    position: absolute;
    bottom: 3vh;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.2em;
    opacity: 0;
    animation: revealUp 1s ease 3.4s forwards;
}

.tamil-line {
    font-family: var(--font-tamil);
    font-size: 0.85rem;
    color: rgba(232, 224, 212, 0.28);
    letter-spacing: 0.06em;
}

.tamil-translation {
    font-family: var(--font-body);
    font-size: 0.75rem;
    color: rgba(232, 224, 212, 0.18);
    font-style: italic;
    letter-spacing: 0.04em;
}

@keyframes revealUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}



/* 2. The Corridor */
.breath-space {
    height: 35vh;
    position: relative;
}

.kolam-mask {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    mask-image: linear-gradient(to bottom, transparent, black 30%, black 70%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 30%, black 70%, transparent);
}

.kolam-bg {
    width: 100%;
    height: 100%;
    opacity: 0.03;
    /* Barely perceptible */
    animation: slowRotation 1800s linear infinite;
    /* ~1 degree every 5s */
    transform-origin: center center;
}

@keyframes slowRotation {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Scroll reveal classes */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.1, 0.25, 1), transform 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);
}

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

/* 3. The Philosophy Inscription */
.philosophy {
    max-width: 60ch;
    margin: 10vh auto 15vh;
    text-align: center;
    padding: 0 5vw;
}

.philosophy p {
    font-family: var(--font-body);
    font-size: 1.1rem;
    line-height: 2;
    color: var(--parchment);
    opacity: 0.85;
    margin-bottom: 0;
}

.maximize {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--deepam-gold);
    margin-top: 2rem;
}

/* Section label — mono utility used for THREE PILLARS, THREE CONTEXTS, etc. */
.section-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--color-gold-muted);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-align: center;
    margin: 0 auto 48px;
    display: block;
}

/* 4. The Trifecta — Devakoshtha architecture */
.trifecta {
    max-width: 960px;
    margin: 0 auto 20vh;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: end;
    gap: 2vw;
    padding: 0 4vw;
}

.koshtha-link {
    display: block;
    text-decoration: none;
    cursor: pointer;
    position: relative;
    transition: transform 0.3s cubic-bezier(0.25, 0, 0, 1),
        filter 0.3s cubic-bezier(0.25, 0, 0, 1);
    border-radius: 2px;
}

.koshtha-link:hover {
    transform: scale(1.025) translateY(-4px);
    filter: drop-shadow(0 8px 28px rgba(201, 168, 76, 0.2));
}

/* Hover arrow affordance — HTML element over SVG */
.card-hover-arrow {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--color-gold);
    opacity: 0;
    transition: opacity 0.25s cubic-bezier(0.25, 0, 0, 1);
    pointer-events: none;
    z-index: 2;
}

.koshtha-link:hover .card-hover-arrow {
    opacity: 1;
}

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

/* 5. The Ecosystem Arc */
.arc {
    margin: 0 auto 10vh;
    text-align: center;
    padding: 0 4vw;
}

/* Arc chain — three nodes with inline descriptors */
.arc-chain {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-top: 32px;
}

.arc-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.arc-node-name {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    letter-spacing: 0.04em;
    transition: color 0.3s cubic-bezier(0.25, 0, 0, 1);
}

.arc-node--active .arc-node-name {
    color: var(--color-gold);
    font-weight: 500;
}

.arc-node-desc {
    font-family: var(--font-body);
    font-size: 0.7rem;
    color: var(--color-text-secondary);
    font-style: italic;
    opacity: 0.7;
}

.arc-node-arrow {
    color: var(--color-gold-muted);
    font-size: 1rem;
    line-height: 1;
}

.faded-link {
    color: var(--color-text-secondary);
    opacity: 0.7;
}

.faded-link:hover,
.active-link:hover {
    color: var(--color-gold);
    opacity: 1;
}

.active-link {
    color: var(--color-text-secondary);
}

/* Section separator — breath mark between ecosystem and author */
.section-rule {
    width: 160px;
    height: 1px;
    border: none;
    background: var(--color-border);
    margin: 0 auto 10vh;
}

/* 6. Signature — Author */
.signature {
    text-align: center;
    margin: 0 auto 15vh;
}

.name-tamil {
    font-family: var(--font-tamil);
    font-size: 2rem;
    color: var(--color-text-primary);
    font-weight: 300;
    margin-bottom: 6px;
}

.name-eng {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--color-text-secondary);
    font-weight: 300;
    font-style: italic;
    margin-bottom: 28px;
}

.location-container {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    opacity: 0.6;
    letter-spacing: 0.08em;
}

.location-tamil {
    font-family: var(--font-tamil);
    font-size: 0.95rem;
    margin-bottom: 6px;
}

.location-eng {
    font-size: 0.8rem;
    opacity: 0.7;
}

.midpoint-dot {
    margin: 0 6px;
}

.signature-contact {
    margin-top: 2rem;
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: rgba(232, 224, 212, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.contact-link {
    color: rgba(232, 224, 212, 0.5);
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-link:hover {
    color: var(--deepam-gold);
}

.signature-year {
    margin-top: 1rem;
    font-family: var(--font-body);
    font-size: 0.7rem;
    color: rgba(232, 224, 212, 0.18);
    letter-spacing: 0.1em;
}

.signature-contact {
    margin-top: 2rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.06em;
}

.contact-link {
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color 0.3s cubic-bezier(0.25, 0, 0, 1);
}

.contact-link:hover {
    color: var(--color-gold);
}

.signature-year {
    margin-top: 1rem;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--color-text-secondary);
    opacity: 0.4;
    letter-spacing: 0.1em;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 1024px) {
    .trifecta {
        gap: 1.5vw;
        padding: 0 2vw;
    }
}

@media (max-width: 768px) {
    .trifecta {
        grid-template-columns: 1fr;
        max-width: 300px;
        gap: 3rem;
        margin-left: auto;
        margin-right: auto;
    }

    .name-tamil {
        font-size: 1.8rem;
    }

    .name-eng {
        font-size: 1.3rem;
    }

    .arc-chain {
        gap: 12px;
    }

    .arc-node-arrow {
        transform: rotate(90deg);
    }
}

@media (max-width: 640px) {
    .viewport-opening {
        padding-top: 60px;
    }

    .formula-argmax {
        font-size: clamp(28px, 9vw, 36px);
    }

    .def-body {
        font-size: 0.95rem;
    }

    .hero-tamil-anchor {
        flex-direction: column;
        gap: 4px;
    }

    .trifecta {
        grid-template-columns: 1fr;
        max-width: 280px;
        gap: 2.5rem;
        margin-left: auto;
        margin-right: auto;
    }

    .koshtha-svg {
        display: none;
        /* hide pillar art on mobile — text panels stand alone */
    }

    .arc-chain {
        flex-direction: column;
        gap: 8px;
    }

    .arc-node-arrow {
        /* horizontal → becomes vertical ↓ */
        display: inline-block;
        transform: rotate(90deg);
    }
}