/* ══════════════════════════════════════════
   mechanic.party — Japanese-Minimal Industrial Craft
   Wabi-sabi workshop aesthetic with ikebana asymmetry
   ══════════════════════════════════════════ */

:root {
    --burnt-persimmon: #C45B28;
    --sumi-ink: #1A1612;
    --washi-cream: #F2E8D5;
    --copper-patina: #5A8F7A;
    --morning-chrome: #D4CFC7;
    --indigo-workshop: #2B3A5C;
    --filament-gold: #E8A84C;
    --washi-aged: #E8DBC4;
    --spring-green: #A8C5A0;
    --space-unit: 0.5rem;
}

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

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

body {
    font-family: 'Source Serif 4', 'Georgia', serif;
    background: linear-gradient(to bottom, var(--washi-cream), var(--washi-aged));
    color: var(--sumi-ink);
    line-height: 1.85;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    min-height: 600vh;
}

/* ── Paper Texture Overlay ── */
.paper-texture {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 256px 256px;
}

/* Intensify texture at edges and corners */
.paper-texture::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 0% 0%, rgba(26, 22, 18, 0.04) 0%, transparent 40%),
        radial-gradient(ellipse at 100% 0%, rgba(26, 22, 18, 0.03) 0%, transparent 40%),
        radial-gradient(ellipse at 0% 100%, rgba(26, 22, 18, 0.035) 0%, transparent 40%),
        radial-gradient(ellipse at 100% 100%, rgba(26, 22, 18, 0.04) 0%, transparent 40%),
        radial-gradient(ellipse at center, transparent 50%, rgba(26, 22, 18, 0.02) 100%);
}

/* ── Tea Stain Aging Effects ── */
.tea-stain {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 998;
}

.tea-stain-1 {
    width: 180px;
    height: 180px;
    top: 15%;
    left: 8%;
    background: radial-gradient(ellipse at center, rgba(200, 170, 120, 0.02) 0%, transparent 70%);
}

.tea-stain-2 {
    width: 140px;
    height: 140px;
    top: 55%;
    right: 12%;
    background: radial-gradient(ellipse at center, rgba(196, 91, 40, 0.015) 0%, transparent 70%);
}

.tea-stain-3 {
    width: 200px;
    height: 200px;
    bottom: 20%;
    left: 40%;
    background: radial-gradient(ellipse at center, rgba(200, 170, 120, 0.018) 0%, transparent 70%);
}

.tea-stain-4 {
    width: 160px;
    height: 160px;
    top: 35%;
    right: 30%;
    background: radial-gradient(ellipse at 40% 60%, rgba(200, 170, 120, 0.012) 0%, transparent 65%);
}

/* ── Hairline Creases ── */
.crease {
    position: fixed;
    pointer-events: none;
    z-index: 997;
    background: var(--sumi-ink);
    opacity: 0.04;
}

.crease-1 {
    width: 1px;
    height: 120vh;
    top: -10vh;
    left: 30%;
    transform: rotate(3deg);
}

.crease-2 {
    width: 1px;
    height: 80vh;
    top: 40vh;
    right: 25%;
    transform: rotate(-2deg);
}

/* ── Dipstick Progress Bar ── */
.dipstick-track {
    position: fixed;
    right: calc(var(--space-unit) * 3);
    top: 10%;
    bottom: 10%;
    width: 2px;
    background: var(--burnt-persimmon);
    opacity: 0.25;
    z-index: 1000;
}

.dipstick-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: var(--filament-gold);
    transition: none;
}

.dipstick-cap {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--filament-gold);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dipstick-cap.visible {
    opacity: 1;
}

/* ── Watermark Kanji ── */
.kanji-watermark {
    position: absolute;
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-size: clamp(15rem, 25vw, 30rem);
    font-weight: 700;
    color: var(--sumi-ink);
    opacity: 0.035;
    pointer-events: none;
    z-index: 0;
    line-height: 1;
    will-change: transform;
    user-select: none;
}

.kanji-1 {
    top: 80vh;
    left: 5%;
}

.kanji-2 {
    top: 220vh;
    right: 3%;
}

.kanji-3 {
    top: 370vh;
    left: 8%;
}

.kanji-4 {
    top: 480vh;
    right: 6%;
}

.kanji-5 {
    top: 560vh;
    left: 15%;
}

/* ══════════════════════════════════════════
   Breathing Spaces
   ══════════════════════════════════════════ */
.breathing-space {
    min-height: 40vh;
    display: flex;
    align-items: center;
    position: relative;
}

.breathing-space-wide {
    min-height: 50vh;
}

/* ══════════════════════════════════════════
   SECTION 1: Opening Gate
   ══════════════════════════════════════════ */
.opening-gate {
    position: relative;
    min-height: 100vh;
    max-height: 90vh;
    display: flex;
    align-items: center;
    padding: calc(var(--space-unit) * 8) calc(var(--space-unit) * 6);
    overflow: hidden;
}

.gate-layout {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: calc(var(--space-unit) * 8);
    align-items: center;
}

/* Wrench container */
.wrench-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.wrench-svg {
    width: 260px;
    height: 260px;
    animation: wrenchRotate var(--wrench-duration, 60s) linear infinite;
    filter: drop-shadow(0 2px 4px rgba(26, 22, 18, 0.06));
}

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

/* Workbench line */
.workbench-line {
    height: 1px;
    background: linear-gradient(to right, var(--sumi-ink), transparent 80%);
    opacity: 0.15;
    margin-top: calc(var(--space-unit) * 6);
}

/* Vertical calligraphic title */
.gate-right {
    display: flex;
    justify-content: flex-end;
    padding-right: calc(var(--space-unit) * 6);
}

.vertical-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.05em;
}

.title-char {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.4rem, 6vw, 5rem);
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--sumi-ink);
    line-height: 0.95;
    display: block;
}

.title-dot {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.4rem, 6vw, 5rem);
    font-weight: 700;
    color: var(--burnt-persimmon);
    line-height: 0.5;
    display: block;
}

/* ══════════════════════════════════════════
   Flowing Curve Connectors
   ══════════════════════════════════════════ */
.flowing-curve {
    display: block;
    width: 100%;
    height: 120px;
    overflow: visible;
}

.curve-path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
}

/* Tool section connectors */
.tool-connector {
    display: block;
    width: 55%;
    height: 80px;
    margin: calc(var(--space-unit) * 2) auto;
}

/* ══════════════════════════════════════════
   SECTION 2: Workshop Philosophy
   ══════════════════════════════════════════ */
.workshop-philosophy {
    position: relative;
    min-height: 120vh;
    max-width: 1200px;
    margin: 0 auto;
    padding: calc(var(--space-unit) * 16) calc(var(--space-unit) * 4);
    display: flex;
    flex-direction: column;
    gap: calc(var(--space-unit) * 14);
}

.philosophy-block {
    max-width: 500px;
    padding: calc(var(--space-unit) * 6) calc(var(--space-unit) * 8);
    position: relative;
    background: rgba(242, 232, 213, 0.5);
    border-left: 2px solid var(--burnt-persimmon);
}

/* Aged paper texture on blocks */
.philosophy-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 128 128' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 128px 128px;
    pointer-events: none;
}

/* Asymmetric placement like tools on a workbench */
.block-1 {
    align-self: flex-start;
    margin-left: 5%;
}

.block-2 {
    align-self: flex-end;
    margin-right: 5%;
    margin-top: calc(var(--space-unit) * -2);
}

.block-3 {
    align-self: flex-start;
    margin-left: 18%;
}

.philosophy-text {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.2rem, 2.2vw, 1.6rem);
    font-weight: 400;
    color: var(--sumi-ink);
    line-height: 1.75;
    letter-spacing: 0.02em;
}

/* ══════════════════════════════════════════
   SECTION 3: The Tools
   ══════════════════════════════════════════ */
.the-tools {
    position: relative;
    min-height: 160vh;
    max-width: 1000px;
    margin: 0 auto;
    padding: calc(var(--space-unit) * 12) calc(var(--space-unit) * 4);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tool-entry {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(var(--space-unit) * 3);
    padding: calc(var(--space-unit) * 4);
}

.tool-entry-left {
    align-self: flex-start;
    margin-left: 8%;
}

.tool-entry-right {
    align-self: flex-end;
    margin-right: 8%;
}

.tool-visual {
    width: 140px;
    height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s ease;
}

.tool-entry:hover .tool-visual {
    transform: scale(1.04);
}

.tool-illustration {
    width: 100%;
    height: 100%;
}

.tool-label {
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-size: clamp(0.7rem, 1.2vw, 0.9rem);
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--copper-patina);
    text-align: center;
    transition: color 0.3s ease;
}

.tool-entry:hover .tool-label {
    color: var(--filament-gold);
}

/* ══════════════════════════════════════════
   SECTION 4: Seasons of Repair
   ══════════════════════════════════════════ */
.seasons-section {
    position: relative;
    min-height: 140vh;
    padding: calc(var(--space-unit) * 16) 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.season-band {
    position: relative;
    min-height: 35vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.season-wash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip-path: inset(0 100% 0 0);
    transition: clip-path 1.2s ease-out;
}

.season-band.season-visible .season-wash {
    clip-path: inset(0 0 0 0);
}

.season-spring .season-wash {
    background: rgba(168, 197, 160, 0.15);
}

.season-summer .season-wash {
    background: rgba(232, 168, 76, 0.12);
}

.season-autumn .season-wash {
    background: rgba(196, 91, 40, 0.10);
}

.season-winter .season-wash {
    background: rgba(43, 58, 92, 0.08);
}

.season-content {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: calc(var(--space-unit) * 8) calc(var(--space-unit) * 8);
}

.season-spring .season-content {
    padding-left: 12%;
}

.season-summer .season-content {
    padding-left: 28%;
}

.season-autumn .season-content {
    padding-left: 15%;
}

.season-winter .season-content {
    padding-left: 32%;
}

.season-name {
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-size: clamp(0.7rem, 1.2vw, 0.9rem);
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    display: block;
    margin-bottom: calc(var(--space-unit) * 2);
}

.season-spring .season-name { color: var(--copper-patina); }
.season-summer .season-name { color: var(--filament-gold); }
.season-autumn .season-name { color: var(--burnt-persimmon); }
.season-winter .season-name { color: var(--indigo-workshop); }

.season-text {
    font-family: 'Source Serif 4', 'Georgia', serif;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    font-weight: 400;
    line-height: 1.85;
    color: var(--sumi-ink);
    max-width: 520px;
}

.season-winter .season-text {
    color: var(--indigo-workshop);
}

.season-motif {
    position: absolute;
    right: 10%;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    opacity: 0.7;
}

/* ══════════════════════════════════════════
   SECTION 5: Closing Scroll
   ══════════════════════════════════════════ */
.closing-scroll {
    position: relative;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(var(--space-unit) * 20) calc(var(--space-unit) * 4);
}

.closing-brush {
    position: absolute;
    left: 15%;
    top: 0;
    width: 40px;
    height: 100%;
    opacity: 0.6;
}

.closing-column {
    position: relative;
    z-index: 1;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: calc(var(--space-unit) * 7);
    margin-left: 12%;
}

.closing-line {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    font-weight: 400;
    font-style: italic;
    color: var(--sumi-ink);
    line-height: 1.5;
    letter-spacing: 0.02em;
}

.closing-line-last {
    font-style: normal;
    font-weight: 700;
    color: var(--burnt-persimmon);
}

.closing-sigil {
    display: flex;
    justify-content: flex-start;
    padding: calc(var(--space-unit) * 2) 0;
}

.sigil-mark {
    width: 40px;
    height: 40px;
}

.closing-domain {
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-size: clamp(0.7rem, 1.2vw, 0.9rem);
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--burnt-persimmon);
    opacity: 0.5;
    margin-top: calc(var(--space-unit) * 2);
}

/* ══════════════════════════════════════════
   Bounce-Enter Animation
   ══════════════════════════════════════════ */
[data-bounce] {
    opacity: 0;
    transform: translateY(40px);
}

[data-bounce].bounce-visible {
    animation: bounceEnter 700ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes bounceEnter {
    0% {
        opacity: 0;
        transform: translateY(40px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Title character stagger delays */
.vertical-title [data-bounce]:nth-child(1) { animation-delay: 0ms; }
.vertical-title [data-bounce]:nth-child(2) { animation-delay: 60ms; }
.vertical-title [data-bounce]:nth-child(3) { animation-delay: 120ms; }
.vertical-title [data-bounce]:nth-child(4) { animation-delay: 180ms; }
.vertical-title [data-bounce]:nth-child(5) { animation-delay: 240ms; }
.vertical-title [data-bounce]:nth-child(6) { animation-delay: 300ms; }
.vertical-title [data-bounce]:nth-child(7) { animation-delay: 360ms; }
.vertical-title [data-bounce]:nth-child(8) { animation-delay: 420ms; }
.vertical-title [data-bounce]:nth-child(9) { animation-delay: 480ms; }
.vertical-title [data-bounce]:nth-child(10) { animation-delay: 540ms; }
.vertical-title [data-bounce]:nth-child(11) { animation-delay: 600ms; }
.vertical-title [data-bounce]:nth-child(12) { animation-delay: 660ms; }
.vertical-title [data-bounce]:nth-child(13) { animation-delay: 720ms; }
.vertical-title [data-bounce]:nth-child(14) { animation-delay: 780ms; }

/* ══════════════════════════════════════════
   Responsive: Tablet (768px)
   ══════════════════════════════════════════ */
@media (max-width: 768px) {
    .gate-layout {
        grid-template-columns: 1fr;
        gap: calc(var(--space-unit) * 4);
    }

    .gate-right {
        justify-content: center;
        padding-right: 0;
    }

    .vertical-title {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0;
    }

    .title-char,
    .title-dot {
        font-size: clamp(2rem, 5vw, 3rem);
    }

    .wrench-svg {
        width: 200px;
        height: 200px;
    }

    .philosophy-block {
        max-width: 85%;
        padding: calc(var(--space-unit) * 4) calc(var(--space-unit) * 5);
    }

    .block-1 { margin-left: 3%; }
    .block-2 { margin-right: 5%; }
    .block-3 { margin-left: 8%; }

    .tool-entry-left { margin-left: 3%; }
    .tool-entry-right { margin-right: 3%; }

    .season-content {
        padding: calc(var(--space-unit) * 6) calc(var(--space-unit) * 4);
    }

    .season-spring .season-content,
    .season-summer .season-content,
    .season-autumn .season-content,
    .season-winter .season-content {
        padding-left: calc(var(--space-unit) * 6);
    }

    .season-motif {
        right: 5%;
        width: 45px;
        height: 45px;
    }

    .closing-column {
        margin-left: 5%;
    }

    .closing-brush {
        left: 5%;
    }

    .dipstick-track {
        right: calc(var(--space-unit) * 2);
    }

    .breathing-space {
        min-height: 30vh;
    }

    .breathing-space-wide {
        min-height: 35vh;
    }
}

/* ══════════════════════════════════════════
   Responsive: Mobile (480px)
   ══════════════════════════════════════════ */
@media (max-width: 480px) {
    .opening-gate {
        padding: calc(var(--space-unit) * 4) calc(var(--space-unit) * 2);
    }

    .wrench-svg {
        width: 160px;
        height: 160px;
    }

    .philosophy-block {
        margin-left: 2% !important;
        margin-right: 2% !important;
        padding: calc(var(--space-unit) * 3) calc(var(--space-unit) * 4);
        max-width: 92%;
    }

    .workshop-philosophy {
        gap: calc(var(--space-unit) * 10);
    }

    .tool-entry-left,
    .tool-entry-right {
        margin-left: 5%;
        margin-right: auto;
    }

    .tool-visual {
        width: 110px;
        height: 190px;
    }

    .tool-connector {
        width: 80%;
    }

    .season-content {
        padding: calc(var(--space-unit) * 4) calc(var(--space-unit) * 3);
    }

    .season-spring .season-content,
    .season-summer .season-content,
    .season-autumn .season-content,
    .season-winter .season-content {
        padding-left: calc(var(--space-unit) * 4);
    }

    .season-motif {
        display: none;
    }

    .closing-scroll {
        padding: calc(var(--space-unit) * 10) calc(var(--space-unit) * 3);
    }

    .closing-column {
        margin-left: 3%;
        gap: calc(var(--space-unit) * 5);
    }

    .closing-brush {
        left: 2%;
    }

    .kanji-watermark {
        font-size: clamp(8rem, 20vw, 15rem);
    }

    .dipstick-track {
        right: calc(var(--space-unit) * 1);
    }

    .breathing-space {
        min-height: 20vh;
    }

    .breathing-space-wide {
        min-height: 25vh;
    }
}
