/* === a6c.dev — Kinetic Typographic Design === */

/* Custom Properties for Animation */
@property --font-width {
    syntax: '<percentage>';
    initial-value: 100%;
    inherits: true;
}

@property --letter-spacing-val {
    syntax: '<length>';
    initial-value: -0.03em;
    inherits: true;
}

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

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

body {
    background-color: #0F0E11;
    color: #EDE8D9;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.9375rem;
    line-height: 1.7;
    letter-spacing: 0.02em;
    overflow-x: hidden;
    position: relative;
}

a {
    color: #A8F068;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #F5A623;
}

/* === SVG Noise Overlay === */
.noise-svg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
}

.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
    background: transparent;
}

/* === Grid Line Overlay === */
.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    pointer-events: none;
    z-index: 1;
    padding: 0 2vw;
}

.grid-line {
    border-left: 1px solid #2E2B33;
    height: 100%;
    transition: opacity 0.15s ease;
}

.grid-line:last-child {
    border-right: 1px solid #2E2B33;
}

.grid-line.flicker {
    opacity: 0.1;
}

/* === Background Symbols === */
.bg-symbol {
    position: fixed;
    font-family: 'Anybody', sans-serif;
    font-weight: 800;
    color: #EDE8D9;
    opacity: 0.04;
    pointer-events: none;
    z-index: 0;
    animation: slow-rotate 120s linear infinite;
}

.bg-symbol-ampersand {
    font-size: 50vw;
    top: -10vh;
    right: -10vw;
}

.bg-symbol-asterisk {
    font-size: 40vw;
    bottom: 10vh;
    left: -15vw;
}

.bg-symbol-section {
    font-size: 35vw;
    top: 40vh;
    right: 5vw;
}

.bg-symbol-pilcrow {
    font-size: 30vw;
    bottom: -5vh;
    left: 20vw;
}

@keyframes slow-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* === Scroll to Top === */
.scroll-top {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 100;
    background: none;
    border: none;
    color: #8A8477;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    transition: color 0.3s ease;
}

.scroll-top:hover {
    color: #F5A623;
}

/* === Sections Base === */
.section {
    position: relative;
    min-height: 100vh;
    z-index: 2;
    overflow: hidden;
}

/* === Section 1: The Glyph Stage (Hero) === */
.section-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #0F0E11;
}

.hero-stage {
    position: relative;
    text-align: center;
    width: 100%;
    padding: 0 2vw;
}

.hero-title {
    font-family: 'Anybody', sans-serif;
    font-weight: 800;
    font-size: clamp(15vw, 20vw, 30vw);
    line-height: 0.95;
    letter-spacing: -0.03em;
    color: #EDE8D9;
    font-stretch: var(--font-width);
    position: relative;
    z-index: 3;
    display: inline-block;
}

.hero-char {
    display: inline-block;
    transition: font-stretch 0.05s linear;
    position: relative;
}

.hero-title.decomposed .hero-char {
    opacity: 0.15;
}

.bezier-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 60%;
    z-index: 4;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.bezier-overlay.visible {
    opacity: 1;
}

.bezier-paths path {
    fill: none;
    stroke: #F5A623;
    stroke-width: 1.5;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 1.5s ease;
}

.bezier-paths path.drawn {
    stroke-dashoffset: 0;
}

.bezier-points circle.anchor {
    fill: #F5A623;
    r: 4;
    transform: scale(0);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bezier-points circle.anchor.visible {
    transform: scale(1);
}

.bezier-points circle.handle {
    fill: #A8F068;
    r: 2.5;
    transform: scale(0);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s;
}

.bezier-points circle.handle.visible {
    transform: scale(1);
}

.bezier-points line.handle-line {
    stroke: #8A8477;
    stroke-width: 0.75;
    opacity: 0;
    transition: opacity 0.4s ease 0.15s;
}

.bezier-points line.handle-line.visible {
    opacity: 1;
}

.hero-tagline {
    margin-top: 3rem;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.9375rem;
    color: #8A8477;
    letter-spacing: 0.02em;
}

.tagline-cursor {
    animation: blink-cursor 1s step-end infinite;
    color: #F5A623;
}

@keyframes blink-cursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* === Section 2: The Anatomy === */
.section-anatomy {
    background-color: #1A1320;
    display: flex;
    align-items: center;
}

.anatomy-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 4rem 4vw;
    gap: 2rem;
    position: relative;
}

.anatomy-glyph {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.anatomy-char {
    font-family: 'Anybody', sans-serif;
    font-weight: 800;
    font-size: clamp(200px, 30vw, 450px);
    line-height: 1;
    color: #EDE8D9;
    letter-spacing: -0.03em;
    transition: all 0.6s ease;
}

.anatomy-bezier {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.anatomy-paths path {
    fill: none;
    stroke: #F5A623;
    stroke-width: 1.5;
    stroke-dasharray: 800;
    stroke-dashoffset: 0;
}

.anatomy-points circle {
    fill: #F5A623;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.anatomy-data {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 2rem;
}

.data-label {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #F5A623;
    margin-bottom: 2rem;
}

.data-readout {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.9375rem;
}

.data-line {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid #2E2B33;
}

.data-key {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 0.6875rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #8A8477;
}

.data-value {
    color: #EDE8D9;
    font-variant-numeric: tabular-nums;
    transition: all 0.3s ease;
}

/* === Section 3: The Forge === */
.section-forge {
    background-color: #0F0E11;
    padding: 8rem 2vw;
    display: flex;
    align-items: center;
}

.forge-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1rem;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

.forge-block {
    background-color: #1A1320;
    padding: 2.5rem 2rem;
    border: 1px solid #2E2B33;
    position: relative;
    z-index: 2;
    box-shadow: 0 0 40px rgba(15, 14, 17, 0.8);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.forge-block:hover {
    border-color: #F5A623;
    transform: translateY(-2px);
}

.forge-block:active {
    border-color: #E85D4A;
}

.forge-block-1 {
    grid-column: 1 / span 5;
    grid-row: 1;
}

.forge-block-2 {
    grid-column: 6 / span 3;
    grid-row: 1;
    margin-top: 20px;
}

.forge-block-3 {
    grid-column: 3 / span 7;
    grid-row: 2;
    margin-top: -20px;
    z-index: 3;
}

.forge-block-4 {
    grid-column: 10 / span 3;
    grid-row: 1 / span 2;
    margin-top: 40px;
}

.forge-block-5 {
    grid-column: 1 / span 6;
    grid-row: 3;
    margin-top: -20px;
}

.forge-block-6 {
    grid-column: 8 / span 4;
    grid-row: 3;
    margin-top: 10px;
}

.forge-counter {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 600;
    font-size: 2.5rem;
    color: #F5A623;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.forge-label {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 0.6875rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #A8F068;
    margin-bottom: 1rem;
}

.forge-text {
    color: #8A8477;
    font-size: 0.875rem;
    line-height: 1.6;
}

/* === Section 4: The Grid Collapse === */
.section-collapse {
    background-color: #1A1320;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8rem 4vw;
}

.collapse-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 2rem;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    transition: grid-template-columns 0.1s linear;
}

.collapse-content {
    padding: 3rem 2rem;
}

.collapse-col-1 {
    grid-column: 1 / span 4;
}

.collapse-col-2 {
    grid-column: 5 / span 4;
}

.collapse-col-3 {
    grid-column: 9 / span 4;
}

.collapse-heading {
    font-family: 'Anybody', sans-serif;
    font-weight: 800;
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 0.95;
    letter-spacing: -0.03em;
    color: #EDE8D9;
    margin-bottom: 1.5rem;
    font-stretch: var(--font-width);
}

.collapse-text {
    color: #8A8477;
    font-size: 0.9375rem;
    line-height: 1.7;
}

/* === Section 5: The Signal === */
.section-signal {
    background-color: #0F0E11;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.signal-container {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.signal-ampersand {
    font-family: 'Anybody', sans-serif;
    font-weight: 800;
    font-size: clamp(30vw, 40vw, 50vw);
    line-height: 1;
    color: #EDE8D9;
    opacity: 0.08;
    animation: signal-pulse 4s ease-in-out infinite;
    user-select: none;
}

@keyframes signal-pulse {
    0%, 100% { transform: scale(1); opacity: 0.08; }
    50% { transform: scale(1.04); opacity: 0.12; }
}

.signal-info {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.signal-item {
    position: absolute;
    pointer-events: auto;
}

.signal-item-left {
    top: 30%;
    left: 6vw;
}

.signal-item-right {
    top: 25%;
    right: 6vw;
    text-align: right;
}

.signal-item-bottom {
    bottom: 15%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

.signal-label {
    display: block;
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 0.6875rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #F5A623;
    margin-bottom: 0.5rem;
}

.signal-link {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.9375rem;
    color: #EDE8D9;
    transition: color 0.3s ease;
}

.signal-link:hover {
    color: #A8F068;
}

.signal-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.9375rem;
    color: #8A8477;
}

/* === Text Gradient Animation (kinetic elements) === */
.kinetic-gradient {
    background: linear-gradient(90deg, #F5A623, #A8F068, #F5A623);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-shift 3s linear infinite;
}

@keyframes gradient-shift {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
    .hero-title {
        --font-width: 100% !important;
    }
    .bg-symbol {
        animation: none;
    }
    .signal-ampersand {
        animation: none;
        opacity: 0.08;
    }
    .tagline-cursor {
        animation: none;
        opacity: 1;
    }
    .bezier-paths path {
        stroke-dashoffset: 0;
        transition: none;
    }
    .bezier-points circle,
    .bezier-points line {
        transform: scale(1);
        opacity: 1;
        transition: none;
    }
}

/* === Mobile Responsive (< 768px) === */
@media screen and (max-width: 767px) {
    .hero-title {
        font-size: 18vw;
    }

    .anatomy-container {
        grid-template-columns: 1fr;
        padding: 4rem 5vw;
    }

    .anatomy-glyph {
        justify-content: center;
    }

    .anatomy-char {
        font-size: 40vw;
    }

    .anatomy-bezier {
        width: 100%;
        height: 50%;
    }

    .anatomy-data {
        padding-left: 0;
    }

    .forge-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .forge-block {
        grid-column: 1 / -1 !important;
        grid-row: auto !important;
        margin-top: 0 !important;
    }

    .forge-block:nth-child(odd) {
        margin-left: 5vw;
    }

    .forge-block:nth-child(even) {
        margin-right: 5vw;
    }

    .collapse-grid {
        grid-template-columns: 1fr !important;
    }

    .collapse-col-1,
    .collapse-col-2,
    .collapse-col-3 {
        grid-column: 1 / -1;
    }

    .signal-item-left {
        top: 15%;
        left: 5vw;
    }

    .signal-item-right {
        top: auto;
        bottom: 30%;
        right: 5vw;
    }

    .grid-overlay {
        display: none;
    }
}
