/* ===== Design Palette Reference =====
   #1c1c1e  Deep Background
   #2a2a2c  Surface
   #4a4a4e  Midtone
   #a0a0a0  Text Primary
   #d0d0d2  Text Emphasis
   #c8883a  Accent Amber
   #a06e2e  Hover Amber
   #252527  Grid Lines
   #202022  Secondary Grid
   #2e2e30  Panel Edge
   #555555  Technical Labels
===== */

/* ===== Custom Properties & @property for morphing ===== */
@property --grid-size {
    syntax: '<length>';
    inherits: false;
    initial-value: 48px;
}

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

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

body {
    background: #1c1c1e;
    color: #a0a0a0;
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    line-height: 1.85;
    overflow-x: hidden;
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20'%3E%3Cline x1='10' y1='0' x2='10' y2='8' stroke='%234a4a4e' stroke-width='1'/%3E%3Cline x1='10' y1='12' x2='10' y2='20' stroke='%234a4a4e' stroke-width='1'/%3E%3Cline x1='0' y1='10' x2='8' y2='10' stroke='%234a4a4e' stroke-width='1'/%3E%3Cline x1='12' y1='10' x2='20' y2='10' stroke='%234a4a4e' stroke-width='1'/%3E%3C/svg%3E") 10 10, crosshair;
}

/* ===== Floating Tolerance Symbols ===== */
.tolerance-symbol {
    position: fixed;
    width: 40px;
    height: 40px;
    opacity: 0.06;
    z-index: 5;
    pointer-events: none;
}
.ts-1 { top: 12%; left: 8%; }
.ts-2 { top: 45%; right: 6%; }
.ts-3 { bottom: 20%; left: 12%; }
.ts-4 { top: 70%; left: 50%; }

/* ===== Engineering Grid Background ===== */
#grid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cpath d='M 48 0 L 0 0 0 48' fill='none' stroke='%23252527' stroke-width='0.3'/%3E%3C/svg%3E");
    background-size: 48px 48px;
    transform: rotateX(0.5deg);
    will-change: transform;
}

/* ===== Noise Canvas ===== */
#noise-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: overlay;
}

/* ===== Main Container ===== */
#main-container {
    position: relative;
    z-index: 1;
    perspective: 1200px;
}

/* ===== Sections ===== */
.section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    opacity: 0;
    transition: opacity 800ms cubic-bezier(0.33, 0, 0, 1);
}

.section.visible {
    opacity: 1;
}

/* ===== Section 1: The Void ===== */
.section-void {
    flex-direction: column;
    opacity: 1; /* always visible */
}

.void-content {
    text-align: center;
    transform: translateZ(-40px);
}

.domain-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: clamp(3rem, 10vw, 8rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #d0d0d2;
    animation: title-pulse 10s ease-in-out infinite;
}

@keyframes title-pulse {
    0%, 100% { opacity: 0.28; }
    50% { opacity: 0.35; }
}

.amber-dot {
    color: #c8883a;
    transition: color 400ms ease;
}

.domain-title:hover .amber-dot {
    color: #a06e2e;
}

.hero-hairline {
    width: 0;
    height: 1px;
    background: #c8883a;
    margin: 2rem auto 0;
    animation: hairline-expand 2s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards;
}

@keyframes hairline-expand {
    to { width: min(480px, 80vw); }
}

/* ===== Content Panels ===== */
.content-panel {
    max-width: 640px;
    padding: 3rem;
    border: 1px solid #2a2a2c;
    background: rgba(28, 28, 30, 0.85);
    animation: border-morph 20s ease-in-out infinite;
    box-shadow: 0 0 0 1px #2e2e30;
}

@keyframes border-morph {
    0%, 100% { border-width: 1px; }
    25% { border-width: 1.2px; }
    50% { border-width: 0.8px; }
    75% { border-width: 1.1px; }
}

.panel-layer-1 {
    transform: translateZ(-20px);
}

.panel-layer-2 {
    transform: translateZ(0px);
}

.panel-layer-3 {
    transform: translateZ(-40px);
}

/* ===== Section Labels ===== */
.section-label {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #d0d0d2;
    display: block;
    margin-bottom: 2rem;
}

/* ===== Body Text ===== */
.body-text {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    line-height: 1.85;
    color: #a0a0a0;
    margin-bottom: 1.5rem;
}

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

/* ===== Dimension Lines ===== */
.dimension-line {
    position: absolute;
    display: flex;
    align-items: center;
    height: 1px;
}

.dim-right {
    right: 0;
    top: 50%;
}

.dim-left {
    left: 0;
    top: 50%;
}

.dim-line-body {
    flex: 1;
    height: 1px;
    background: #4a4a4e;
}

.dim-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    color: #555555;
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

.dim-terminator {
    width: 1px;
    height: 8px;
    background: #4a4a4e;
    flex-shrink: 0;
}

/* ===== Section 5: The Grid / Footer ===== */
.section-grid {
    min-height: 100vh;
    flex-direction: column;
}

.grid-zoom-container {
    text-align: center;
    transform: translateZ(-20px);
    position: relative;
}

.footer-watermark {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: clamp(4rem, 15vw, 12rem);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #2a2a2c;
    line-height: 1;
}

.footer-sub {
    margin-top: 2rem;
}

.mono-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    color: #555555;
}

/* ===== Section Grid dense background ===== */
.section-grid {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12'%3E%3Cpath d='M 12 0 L 0 0 0 12' fill='none' stroke='%23202022' stroke-width='0.15'/%3E%3C/svg%3E");
    background-size: 12px 12px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .dimension-line {
        display: none;
    }

    .content-panel {
        padding: 2rem 1.5rem;
    }

    .section {
        padding: 3rem 1.5rem;
    }

    .panel-layer-1,
    .panel-layer-2,
    .panel-layer-3 {
        transform: translateZ(0);
    }
}
