/* =========================================
   SSETTL.com — Wabi-Sabi Design System
   ========================================= */

/* Custom Properties */
:root {
    --color-bg-primary: #f5f0e8;
    --color-bg-deep: #ebe3d5;
    --color-text: #2c2825;
    --color-text-secondary: #7a7268;
    --color-gold: #c9a84c;
    --color-gold-light: #e8d48b;
    --color-terracotta: #c4956a;
    --color-terracotta-deep: #8b6346;
    --color-celadon: #b8c4a8;
    --color-stone: #7a7268;

    --font-display: 'Cormorant Garamond', 'Georgia', serif;
    --font-body: 'Source Serif 4', 'Georgia', serif;
    --font-accent: 'DM Sans', 'Helvetica Neue', sans-serif;

    --content-width: 640px;
    --section-padding: 120px;
    --section-padding-mobile: 80px;

    --scroll-progress: 0;
}

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

/* Base */
html {
    font-size: 18px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-weight: 350;
    color: var(--color-text);
    line-height: 1.85;
    background-color: var(--color-bg-primary);
    overflow-x: hidden;
    position: relative;
}

/* Background gradient transition (controlled by JS via --scroll-progress) */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        var(--color-bg-primary) 0%,
        var(--color-bg-deep) 100%
    );
    opacity: var(--scroll-progress, 0);
    pointer-events: none;
    z-index: -2;
}

/* Washi paper texture overlay */
#washi-texture {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.04;
    background-image:
        radial-gradient(circle at 20% 30%, var(--color-text) 0.5px, transparent 0.5px),
        radial-gradient(circle at 60% 70%, var(--color-text) 0.3px, transparent 0.3px),
        radial-gradient(circle at 80% 20%, var(--color-text) 0.4px, transparent 0.4px),
        radial-gradient(circle at 40% 80%, var(--color-text) 0.3px, transparent 0.3px),
        radial-gradient(circle at 10% 60%, var(--color-text) 0.5px, transparent 0.5px);
    background-size: 120px 100px, 80px 120px, 150px 90px, 100px 140px, 90px 110px;
}

/* Dust particles field */
#dust-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.dust-particle {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background-color: var(--color-gold);
    opacity: 0.1;
    will-change: transform;
}

@keyframes dust-drift {
    0% {
        transform: translateY(-20px) translateX(0);
    }
    25% {
        transform: translateY(25vh) translateX(8px);
    }
    50% {
        transform: translateY(50vh) translateX(-5px);
    }
    75% {
        transform: translateY(75vh) translateX(10px);
    }
    100% {
        transform: translateY(110vh) translateX(3px);
    }
}

/* Navigation */
#site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 28px 40px;
    z-index: 100;
    pointer-events: none;
}

#site-nav > * {
    pointer-events: auto;
}

.nav-wordmark {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: 14px;
    letter-spacing: 0.35em;
    color: var(--color-text);
    text-decoration: none;
    position: relative;
    display: inline-block;
}

.nav-wordmark::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--color-gold);
    transition: width 600ms ease-out;
}

.nav-wordmark:hover::after {
    width: 100%;
}

#nav-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text);
    padding: 8px;
    opacity: 0.6;
    transition: opacity 400ms ease-out;
}

#nav-toggle:hover {
    opacity: 1;
}

/* Nav overlay */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(245, 240, 232, 0.95);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 600ms ease-out, visibility 0s linear 600ms;
}

.nav-overlay.is-open {
    opacity: 1;
    visibility: visible;
    transition: opacity 600ms ease-out, visibility 0s linear 0s;
}

.nav-close {
    position: absolute;
    top: 28px;
    right: 40px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text);
    padding: 8px;
    opacity: 0.6;
    transition: opacity 400ms ease-out;
}

.nav-close:hover {
    opacity: 1;
}

.nav-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 48px;
}

.nav-links a {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: 28px;
    letter-spacing: 0.08em;
    color: var(--color-text);
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 400ms ease-out, color 400ms ease-out;
}

.nav-links a:hover {
    opacity: 1;
    color: var(--color-gold);
}

/* Content column */
.content-column {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* =========================================
   Section 1: Arrival
   ========================================= */
.section-arrival {
    height: 15vh;
    position: relative;
    z-index: 2;
}

.arrival-space {
    height: 100%;
}

/* =========================================
   Section 2: The Line
   ========================================= */
.section-line {
    height: 15vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10%;
    position: relative;
    z-index: 2;
}

.horizon-line {
    width: 100%;
    max-width: 1000px;
    height: 40px;
}

#horizon-path {
    stroke-dasharray: 1250;
    stroke-dashoffset: 1250;
    transition: none;
}

#horizon-path.drawn {
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 3000ms cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

/* =========================================
   Section 3: The Name
   ========================================= */
.section-name {
    height: 30vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 4vh;
    position: relative;
    z-index: 2;
}

.wordmark {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: 20px;
    letter-spacing: 0.35em;
    color: var(--color-text);
    text-transform: uppercase;
    display: flex;
    gap: 0;
}

.letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(-2px);
}

.letter.settled {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 200ms cubic-bezier(0.25, 0.1, 0.25, 1.0),
                transform 200ms cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

/* =========================================
   Section 4: The Vessel
   ========================================= */
.section-vessel {
    padding: var(--section-padding) 24px;
    position: relative;
    z-index: 2;
}

.vessel-container {
    max-width: 840px;
    margin: 0 auto;
    display: flex;
    gap: 60px;
    align-items: flex-start;
}

.vessel-shape {
    flex-shrink: 0;
    width: 220px;
    height: 300px;
    background: linear-gradient(160deg, var(--color-terracotta), var(--color-terracotta-deep));
    border-radius: 45% 55% 60% 40% / 50% 45% 55% 50%;
    position: relative;
    opacity: 0;
    transform: scale(0.97);
    transition: opacity 1500ms ease-out, transform 1500ms ease-out;
}

.vessel-shape.revealed {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.vessel-shape:hover {
    transform: scale(1) rotate(1.5deg);
    transition: transform 600ms ease-out;
}

/* Noise texture overlay on vessel */
.vessel-shape::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background-image:
        radial-gradient(circle at 30% 40%, rgba(255,255,255,0.08) 1px, transparent 1px),
        radial-gradient(circle at 70% 60%, rgba(0,0,0,0.05) 1px, transparent 1px),
        radial-gradient(circle at 50% 20%, rgba(255,255,255,0.06) 0.5px, transparent 0.5px);
    background-size: 8px 8px, 12px 12px, 6px 6px;
    opacity: 0.5;
}

.vessel-text {
    flex: 1;
    padding-top: 20px;
}

.vessel-intro {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 24px;
    line-height: 1.6;
    letter-spacing: 0.02em;
    color: var(--color-text);
    margin-bottom: 32px;
}

.vessel-text p {
    margin-bottom: 24px;
    color: var(--color-text);
}

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

/* =========================================
   Section 5: The Fracture — Kintsugi
   ========================================= */
.section-fracture {
    padding: 80px 0;
    position: relative;
    z-index: 2;
    overflow: visible;
}

.kintsugi-crack {
    width: 100%;
    height: 120px;
    display: block;
}

.crack-path {
    stroke-dasharray: 1500;
    stroke-dashoffset: 1500;
}

.crack-path.animate {
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 2500ms cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.crack-branch {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
}

.crack-branch.animate {
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1800ms cubic-bezier(0.25, 0.1, 0.25, 1.0) 800ms;
}

/* =========================================
   Section 6: The Substance
   ========================================= */
.section-substance {
    padding: var(--section-padding) 24px;
    position: relative;
    z-index: 2;
}

.section-heading {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 36px;
    letter-spacing: 0.02em;
    color: var(--color-text);
    margin-bottom: 32px;
    line-height: 1.3;
}

.prose-block {
    margin-bottom: 24px;
    opacity: 0;
    filter: blur(4px);
    transform: translateY(8px);
    transition: opacity 800ms ease-out, filter 800ms ease-out, transform 800ms ease-out;
}

.prose-block.revealed {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
}

.prose-block p {
    margin-bottom: 20px;
    color: var(--color-text);
    line-height: 1.85;
}

.prose-block p:last-child {
    margin-bottom: 0;
}

.prose-block em {
    font-style: italic;
    color: var(--color-terracotta-deep);
}

/* Separators */
.separator {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 0;
}

/* Second vessel (smaller, different shape) */
.vessel-small {
    width: 140px;
    height: 200px;
    margin: 60px auto;
    border-radius: 55% 45% 50% 50% / 40% 60% 40% 60%;
    background: linear-gradient(140deg, var(--color-terracotta-deep), var(--color-terracotta));
}

/* =========================================
   Section 7: The Quieting
   ========================================= */
.section-quieting {
    padding: 160px 24px;
    position: relative;
    z-index: 2;
}

.quieting-space {
    height: 100px;
}

.quieting-text {
    opacity: 0;
    filter: blur(4px);
    transform: translateY(8px);
    transition: opacity 1200ms ease-out, filter 1200ms ease-out, transform 1200ms ease-out;
}

.quieting-text.revealed {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
}

.quieting-line {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: 22px;
    line-height: 1.7;
    letter-spacing: 0.02em;
    color: var(--color-text);
    text-align: center;
}

.celadon-accent {
    color: var(--color-celadon);
}

/* =========================================
   Section 8: The Rest
   ========================================= */
.section-rest {
    padding: 120px 24px 0;
    position: relative;
    z-index: 2;
    text-align: center;
}

.rest-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 48px;
}

.final-circle {
    opacity: 0;
    transition: opacity 1500ms ease-out;
}

.final-circle.revealed {
    opacity: 1;
}

.final-circle.pulse {
    animation: circle-pulse 4000ms ease-in-out 1;
}

@keyframes circle-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.final-words {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: 24px;
    letter-spacing: 0.15em;
    color: var(--color-text);
    opacity: 0;
    transition: opacity 1500ms ease-out 500ms;
}

.final-words.revealed {
    opacity: 0.7;
}

.final-space {
    height: 240px;
}

/* =========================================
   Captions & Metadata
   ========================================= */
.caption, .meta {
    font-family: var(--font-accent);
    font-weight: 400;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

/* =========================================
   Kintsugi decorative crack accents
   ========================================= */
.kintsugi-accent {
    position: absolute;
    pointer-events: none;
    opacity: 0;
}

.kintsugi-accent.visible {
    opacity: 1;
    transition: opacity 800ms ease-out;
}

/* =========================================
   Scrollbar
   ========================================= */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg-primary);
}

::-webkit-scrollbar-thumb {
    background-color: var(--color-stone);
    border-radius: 3px;
    opacity: 0.4;
}

/* =========================================
   Selection
   ========================================= */
::selection {
    background-color: var(--color-gold-light);
    color: var(--color-text);
}

/* =========================================
   Responsive
   ========================================= */
@media (max-width: 768px) {
    html {
        font-size: 16px;
    }

    :root {
        --section-padding: 80px;
    }

    #site-nav {
        padding: 20px 24px;
    }

    .wordmark {
        font-size: 16px;
    }

    .vessel-container {
        flex-direction: column;
        align-items: center;
        gap: 40px;
    }

    .vessel-shape {
        width: 180px;
        height: 240px;
    }

    .vessel-intro {
        font-size: 20px;
    }

    .section-heading {
        font-size: 28px;
    }

    .quieting-line {
        font-size: 18px;
    }

    .nav-links a {
        font-size: 22px;
    }

    .nav-links {
        gap: 36px;
    }

    .section-quieting {
        padding: 100px 24px;
    }

    .quieting-space {
        height: 60px;
    }

    .vessel-small {
        width: 110px;
        height: 160px;
    }
}

@media (max-width: 480px) {
    .vessel-shape {
        width: 150px;
        height: 200px;
    }

    .final-words {
        font-size: 20px;
    }

    .vessel-intro {
        font-size: 18px;
    }
}
