/* archetype.works - Celadon Kiln Design System */

/* ========================================
   CSS Custom Properties
   ======================================== */
:root {
    --kiln-char: #1a1816;
    --parchment-glow: #e8e4df;
    --celadon-glaze: #5b8fa8;
    --indigo-depth: #2d4a6b;
    --crackle-gold: #c9a84c;
    --clay-shadow: #4a4640;
    --weathered-stone: #c5c0b8;
    --kiln-blue-fog: #3a6e8a;
    --kiln-char-light: #2c2a28;

    --font-display: 'Caveat', cursive;
    --font-body: 'IBM Plex Sans', sans-serif;
    --font-mono: 'Fira Code', monospace;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: var(--kiln-char);
    color: var(--parchment-glow);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 17px;
    line-height: 1.65;
    letter-spacing: 0.005em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   Noise Overlay
   ======================================== */
#noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.03;
    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;
}

/* ========================================
   Particle Canvas
   ======================================== */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ========================================
   Dot Navigation
   ======================================== */
#dot-nav {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dot-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.dot-btn:hover {
    transform: scale(1.3);
}

.dot-btn svg path {
    fill: none;
    stroke: var(--weathered-stone);
    stroke-width: 1.5;
    opacity: 0.4;
    transition: fill 0.4s ease, stroke 0.4s ease, opacity 0.4s ease;
}

.dot-btn.active svg path {
    fill: var(--celadon-glaze);
    stroke: var(--celadon-glaze);
    opacity: 1;
}

/* Adjust dot colors on light sections */
body.current-light .dot-btn svg path {
    stroke: var(--clay-shadow);
    opacity: 0.4;
}

body.current-light .dot-btn.active svg path {
    fill: var(--celadon-glaze);
    stroke: var(--celadon-glaze);
    opacity: 1;
}

/* ========================================
   Sections
   ======================================== */
.site-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1;
    transition: background-color 1.2s ease-in-out;
}

.section-dark {
    background-color: var(--kiln-char);
    color: var(--parchment-glow);
}

.section-light {
    background-color: var(--parchment-glow);
    color: var(--kiln-char);
}

.section-content {
    max-width: 680px;
    margin: 0 auto;
    padding: 60px 24px;
    text-align: center;
    position: relative;
    z-index: 2;
}

/* ========================================
   Typography
   ======================================== */
.section-heading {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 52px;
    line-height: 1.2;
    letter-spacing: 0.01em;
    margin-bottom: 32px;
    position: relative;
}

.section-dark .section-heading {
    color: var(--parchment-glow);
}

.section-light .section-heading {
    color: var(--kiln-char-light);
}

.section-body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 17px;
    line-height: 1.65;
    letter-spacing: 0.005em;
    max-width: 580px;
    margin: 0 auto;
}

.section-dark .section-body {
    color: var(--weathered-stone);
}

.section-light .section-body {
    color: var(--clay-shadow);
}

.mono-accent {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 14px;
    color: var(--celadon-glaze);
}

/* ========================================
   Typewriter Effect
   ======================================== */
.typewriter-trigger {
    visibility: hidden;
}

.typewriter-trigger.typing {
    visibility: visible;
}

.typewriter-trigger .char {
    opacity: 0;
    transition: opacity 0.05s ease;
}

.typewriter-trigger .char.visible {
    opacity: 1;
}

.typewriter-trigger .char.mistake {
    color: var(--crackle-gold);
    opacity: 1;
}

.typewriter-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background-color: var(--crackle-gold);
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: cursorBlink 1.06s step-end infinite;
}

@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ========================================
   Fade-in Words
   ======================================== */
.fade-in-words .word {
    opacity: 0;
    transition: opacity 0.4s ease;
    display: inline;
}

.fade-in-words .word.visible {
    opacity: 1;
}

/* ========================================
   Hero Section
   ======================================== */
#section-0 {
    min-height: 100vh;
}

#hero-particle-wordmark {
    height: 120px;
    position: relative;
}

#hero-subtitle {
    margin-top: 24px;
    font-size: 16px;
    letter-spacing: 0.08em;
    min-height: 24px;
}

/* ========================================
   Data Viz Labels
   ======================================== */
#data-viz-labels,
#data-viz-labels-2 {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.data-label {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--celadon-glaze);
    opacity: 0;
    transition: opacity 0.6s ease;
    letter-spacing: 0.04em;
}

.data-label.visible {
    opacity: 1;
}

/* ========================================
   Kintsugi Seams
   ======================================== */
.kintsugi-seam {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 20px;
    z-index: 3;
    overflow: visible;
}

.kintsugi-seam svg {
    width: 100%;
    height: 100%;
    display: block;
}

.kintsugi-line {
    fill: none;
    stroke: var(--crackle-gold);
    stroke-width: 1;
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 1.5s ease-in-out;
}

.kintsugi-line.drawn {
    stroke-dashoffset: 0;
}

/* ========================================
   Closing Section
   ======================================== */
.section-closing .section-body {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--celadon-glaze);
    letter-spacing: 0.08em;
    margin-top: 16px;
}

/* ========================================
   Responsive - Mobile
   ======================================== */
@media (max-width: 768px) {
    .section-heading {
        font-size: 36px;
    }

    .section-content {
        max-width: 100%;
        padding: 40px 24px;
    }

    #dot-nav {
        display: none;
    }

    #data-viz-labels,
    #data-viz-labels-2 {
        gap: 24px;
    }

    .data-label {
        font-size: 12px;
    }

    #hero-subtitle {
        font-size: 14px;
    }
}
