/* ══════════════════════════════════════════════════════════════════
   MAIN.CSS — Global Styles
   Botanical Portfolio — Techno-Organic Minimalist
   ══════════════════════════════════════════════════════════════════ */

@import './tokens.css';

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--artichoke) var(--beige);
}

body {
    background-color: var(--beige);
    color: var(--msu-green);
    font-family: var(--font-mono);
    font-size: var(--fs-base);
    line-height: 1.7;
    overflow-x: hidden;
    /* Shift content to make room for the left nav */
    padding-left: var(--nav-width);
    transition: padding-left var(--dur-slow) var(--ease-organic);
}

/* ── Grain Texture Overlay ─────────────────────────────────────── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
    background-size: 200px 200px;
}

/* ── Scrollbar ────────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: var(--beige);
}

::-webkit-scrollbar-thumb {
    background: var(--artichoke);
    border-radius: 2px;
}

/* ── Selection ───────────────────────────────────────────────── */
::selection {
    background: var(--artichoke-40);
    color: var(--msu-green);
}

/* ── Typography Base ─────────────────────────────────────────── */
h1,
h2,
h3 {
    font-family: var(--font-serif);
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--msu-green);
}

h4,
h5,
h6 {
    font-family: var(--font-mono);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: var(--fs-xs);
    color: var(--asparagus);
}

p {
    max-width: 65ch;
    color: var(--asparagus);
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--dur-fast) var(--ease-out);
}

a:hover {
    color: var(--artichoke);
}

img {
    display: block;
    width: 100%;
    height: auto;
}

/* ── Layout Container ────────────────────────────────────────── */
.container {
    width: 100%;
    max-width: var(--page-max);
    margin: 0 auto;
    padding: 0 var(--sp-8);
}

/* ── Section Base ────────────────────────────────────────────── */
.section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    padding: var(--sp-8) 0;
    position: relative;
}

.section+.section {
    border-top: var(--border-thin);
}

/* ── Section Label ───────────────────────────────────────────── */
.section-label {
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--artichoke);
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    margin-bottom: var(--sp-4);
}

.section-label::before {
    content: '';
    display: inline-block;
    width: 24px;
    height: 1px;
    background: var(--artichoke);
}

/* ── Canvas Background Layer ─────────────────────────────────── */
#bio-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 1;
}

/* ── Main Content Layer ──────────────────────────────────────── */
.page-content {
    position: relative;
    z-index: 1;
}

/* ── Tag Chips ───────────────────────────────────────────────── */
.tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    letter-spacing: 0.08em;
    padding: 2px 8px;
    border: 1px solid var(--artichoke-40);
    color: var(--artichoke);
    border-radius: 2px;
    background: var(--artichoke-10);
    transition: all var(--dur-fast) var(--ease-out);
}

.tag:hover {
    background: var(--artichoke-20);
    border-color: var(--artichoke);
}

/* ── Thin Divider Lines ──────────────────────────────────────── */
.line-h {
    width: 100%;
    height: 1px;
    background: var(--artichoke-40);
}

.line-v {
    width: 1px;
    height: 100%;
    background: var(--artichoke-40);
}

/* ── Button Base ─────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: var(--sp-3) var(--sp-6);
    border: 1px solid var(--msu-green);
    color: var(--msu-green);
    background: transparent;
    cursor: pointer;
    transition: all var(--dur-base) var(--ease-organic);
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--msu-green);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--dur-base) var(--ease-organic);
    z-index: -1;
}

.btn:hover {
    color: var(--beige);
}

.btn:hover::after {
    transform: scaleX(1);
}

/* ── Coordinate Label ────────────────────────────────────────── */
.coord-label {
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    color: var(--artichoke);
    letter-spacing: 0.05em;
    opacity: 0.8;
}

/* ── Fade In Animation ───────────────────────────────────────── */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

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

@keyframes scanline {
    from {
        top: -100%;
    }

    to {
        top: 100%;
    }
}

@keyframes bboxPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.animate-fade-up {
    animation: fadeUp 0.8s var(--ease-out) both;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
    body {
        padding-left: 0;
        padding-top: 56px;
        /* mobile top nav height */
    }

    .container {
        padding: 0 var(--sp-4);
    }
}

@media (min-width: 1200px) {
    :root {
        --nav-width: 60px;
    }
}