/* ============================================
   prototype.quest - Workshop Journal Stylesheet
   ============================================ */

/* CSS Custom Properties */
:root {
    --washi: #F7F2E9;
    --kiln-ash: #E8E0D0;
    --deep-umber: #3D2B1F;
    --warm-brown: #6B5744;
    --persimmon: #C2703E;
    --ironwood: #5C3A21;
    --straw: #D4C5A9;
    --moss: #7A8B6F;
    --charcoal-clay: #2E2118;
    --amber-light: #E8C87A;
    --body-brown: #4A3728;
    --code-bg: #F5F0E8;
    --stone: #8B7355;

    --font-display: 'Fraunces', serif;
    --font-body: 'Source Serif 4', serif;
    --font-mono: 'IBM Plex Mono', monospace;

    --spring-ease: cubic-bezier(0.34, 1.56, 0.64, 1);
    --gentle-ease: cubic-bezier(0.25, 0.1, 0.25, 1);
}

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

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

body {
    background-color: var(--washi);
    color: var(--deep-umber);
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.75;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ============================================
   Noise Overlay
   ============================================ */
.noise-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.noise-hero {
    filter: url(#noiseFilterHero);
}

.noise-standard {
    filter: url(#noiseFilter);
}

.noise-strong {
    filter: url(#noiseFilterStrong);
}

.noise-heavy {
    filter: url(#noiseFilterHeavy);
}

/* ============================================
   Grid Pencil Lines
   ============================================ */
.grid-pencil-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background-image:
        repeating-linear-gradient(
            89.5deg,
            transparent,
            transparent calc(100% / 12 - 1px),
            rgba(212, 197, 169, 0.08) calc(100% / 12 - 1px),
            rgba(212, 197, 169, 0.08) calc(100% / 12),
            transparent calc(100% / 12)
        ),
        repeating-linear-gradient(
            0.5deg,
            transparent,
            transparent 79px,
            rgba(212, 197, 169, 0.06) 79px,
            rgba(212, 197, 169, 0.06) 80px,
            transparent 80px
        );
}

.grid-fading {
    mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 100%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 100%);
}

/* ============================================
   Navigation Sidebar
   ============================================ */
#sidebar-nav {
    position: fixed;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.nav-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background-color: var(--straw);
    transform: translateX(-50%);
    z-index: -1;
}

.nav-numeral {
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s var(--spring-ease);
}

.nav-numeral:hover {
    transform: scale(1.2);
}

.numeral-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1.5px solid var(--warm-brown);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 300;
    font-size: 0.85rem;
    color: var(--warm-brown);
    background: var(--washi);
    transition: all 0.4s var(--spring-ease);
}

.nav-numeral.active .numeral-circle {
    background-color: var(--persimmon);
    border-color: var(--persimmon);
    color: var(--washi);
}

.nav-numeral:hover .numeral-circle {
    border-color: var(--persimmon);
    color: var(--persimmon);
}

.nav-numeral.active:hover .numeral-circle {
    color: var(--washi);
}

/* ============================================
   Page Sections (Common)
   ============================================ */
.page-section {
    position: relative;
    min-height: 100vh;
    padding: 6vw;
    overflow: hidden;
}

.section-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
    color: var(--deep-umber);
    letter-spacing: -0.02em;
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
}

.body-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1.05rem, 1.8vw, 1.25rem);
    line-height: 1.75;
    color: var(--body-brown);
    max-width: 38em;
    margin-bottom: 1.5em;
    position: relative;
    z-index: 2;
}

.annotation-text {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: clamp(0.8rem, 1.2vw, 0.95rem);
    color: var(--warm-brown);
    position: relative;
    z-index: 2;
}

/* ============================================
   Registration Marks
   ============================================ */
.reg-mark {
    position: absolute;
    width: 16px;
    height: 16px;
    z-index: 2;
}

.reg-mark::before,
.reg-mark::after {
    content: '';
    position: absolute;
    background-color: var(--straw);
}

.reg-mark::before {
    width: 16px;
    height: 1px;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

.reg-mark::after {
    width: 1px;
    height: 16px;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
}

.reg-mark-tl { top: 12px; left: 12px; }
.reg-mark-tr { top: 12px; right: 12px; }
.reg-mark-bl { bottom: 12px; left: 12px; }
.reg-mark-br { bottom: 12px; right: 12px; }

/* ============================================
   Dimension Lines
   ============================================ */
.dimension-line {
    display: flex;
    align-items: center;
    gap: 8px;
    position: absolute;
    z-index: 2;
}

.dim-arrow {
    display: block;
    width: 20px;
    height: 1px;
    background-color: var(--straw);
    position: relative;
}

.dim-arrow-left::before,
.dim-arrow-right::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 1px;
    background-color: var(--straw);
}

.dim-arrow-left::before {
    left: 0;
    top: -3px;
    transform: rotate(45deg);
    transform-origin: left center;
}

.dim-arrow-left::after {
    content: '';
    position: absolute;
    left: 0;
    top: 3px;
    width: 6px;
    height: 1px;
    background-color: var(--straw);
    transform: rotate(-45deg);
    transform-origin: left center;
}

.dim-arrow-right::before {
    content: '';
    position: absolute;
    right: 0;
    top: -3px;
    width: 6px;
    height: 1px;
    background-color: var(--straw);
    transform: rotate(-45deg);
    transform-origin: right center;
}

.dim-arrow-right::after {
    right: 0;
    top: 3px;
    transform: rotate(45deg);
    transform-origin: right center;
}

.dim-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--straw);
    white-space: nowrap;
}

.hero-dimension {
    bottom: 6vw;
    right: 6vw;
}

.workshop-dimension {
    bottom: 4vw;
    left: 50%;
    transform: translateX(-50%);
}

/* ============================================
   Section Dividers
   ============================================ */
.section-divider {
    padding: 0 6vw;
    height: 40px;
    display: flex;
    align-items: center;
    background-color: var(--washi);
}

.divider-line {
    width: 100%;
    height: 4px;
    color: #8B7355;
}

/* ============================================
   Rock Garden Dividers
   ============================================ */
.rock-garden-divider {
    padding: 40px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--washi);
}

.rock-garden-svg {
    width: min(600px, 80vw);
    height: auto;
}

/* ============================================
   Section 1: Hero / The Question
   ============================================ */
.hero-section {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    min-height: 100vh;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: right;
    max-width: 70%;
    padding-bottom: 4vh;
}

.hero-headline {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(2.4rem, 6vw, 4.8rem);
    color: var(--deep-umber);
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 0.5em;
}

.headline-dot {
    color: var(--persimmon);
}

.hero-subtitle {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 300;
    font-size: clamp(1.1rem, 2.2vw, 1.6rem);
    color: var(--warm-brown);
    letter-spacing: -0.01em;
}

/* ============================================
   Section 2: The Material
   ============================================ */
.material-section {
    min-height: 90vh;
    display: flex;
    align-items: flex-start;
    padding-top: 12vh;
}

.material-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4vw;
    width: 100%;
    position: relative;
    z-index: 2;
}

.material-text {
    max-width: 32em;
}

.margin-annotation {
    display: block;
    margin-top: 2rem;
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 300;
    font-size: clamp(0.85rem, 1.2vw, 1rem);
    color: var(--warm-brown);
    opacity: 0.75;
    padding-left: 1.5em;
    border-left: 1px solid var(--straw);
}

.material-illustration {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Compass Tool Illustration */
.tool-compass {
    position: relative;
    width: 120px;
    height: 180px;
    transition: transform 0.5s var(--spring-ease);
}

.tool-compass:hover {
    transform: rotate(-3deg);
}

.compass-pivot {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--ironwood);
}

.compass-arm {
    position: absolute;
    width: 2px;
    height: 160px;
    top: 5px;
    left: 50%;
    background-color: var(--ironwood);
    transform-origin: top center;
}

.compass-arm-left {
    transform: translateX(-50%) rotate(-12deg);
}

.compass-arm-right {
    transform: translateX(-50%) rotate(12deg);
}

.compass-arc {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 40px;
    border: 1.5px solid var(--straw);
    border-radius: 0 0 50% 50%;
    border-top: none;
}

/* ============================================
   Section 3: The Workshop
   ============================================ */
.workshop-section {
    min-height: 100vh;
    padding-top: 8vh;
}

.workshop-title {
    text-align: center;
    margin-bottom: 4rem;
}

.workshop-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: auto auto;
    gap: 24px;
    position: relative;
    z-index: 2;
}

.workshop-card {
    background-color: var(--kiln-ash);
    padding: 2.5rem;
    position: relative;
    transition: transform 0.5s var(--spring-ease), box-shadow 0.5s var(--spring-ease);
    box-shadow: 0 2px 8px rgba(62, 43, 31, 0.08);
}

.workshop-card:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 24px rgba(62, 43, 31, 0.15);
}

.card-1 {
    grid-column: 1 / 5;
    clip-path: polygon(1px 0, 100% 2px, calc(100% - 1px) calc(100% - 2px), 0 calc(100% - 1px));
}

.card-2 {
    grid-column: 5 / 9;
    margin-top: 3rem;
    clip-path: polygon(0 1px, calc(100% - 2px) 0, 100% calc(100% - 1px), 2px 100%);
}

.card-3 {
    grid-column: 9 / 13;
    margin-top: -1rem;
    clip-path: polygon(2px 0, 100% 1px, calc(100% - 1px) 100%, 0 calc(100% - 2px));
}

.card-inner {
    position: relative;
    z-index: 2;
}

.card-number {
    display: block;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    color: var(--persimmon);
}

.card-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.3rem, 2.5vw, 1.8rem);
    color: var(--deep-umber);
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

.workshop-card .reg-mark-tl { top: 8px; left: 8px; }
.workshop-card .reg-mark-br { bottom: 8px; right: 8px; }

/* ============================================
   Section 4: The Process
   ============================================ */
.process-section {
    min-height: 90vh;
    padding-top: 8vh;
}

.process-title {
    margin-bottom: 3rem;
    padding-left: 8vw;
}

.process-steps {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.process-step {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    max-width: 48em;
}

.step-1 { margin-left: 4vw; }
.step-2 { margin-left: 12vw; }
.step-3 { margin-left: 8vw; }
.step-4 { margin-left: 18vw; }
.step-5 { margin-left: 10vw; }

.step-number {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--persimmon);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 1.1rem;
    color: var(--persimmon);
    background: var(--washi);
}

.step-content {
    flex: 1;
}

.step-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    color: var(--deep-umber);
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.step-code {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.25em 0.75em;
    background-color: var(--code-bg);
    border: 1px solid var(--straw);
    font-size: 0.8rem;
}

/* ============================================
   Section 5: The Refinement
   ============================================ */
.refinement-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.refinement-panel {
    position: relative;
    z-index: 2;
    background-color: var(--kiln-ash);
    padding: 5rem 4rem;
    max-width: 48em;
    text-align: center;
    clip-path: polygon(2px 0, calc(100% - 1px) 1px, 100% calc(100% - 2px), 1px calc(100% - 1px));
    box-shadow: 0 4px 16px rgba(62, 43, 31, 0.1);
    transition: transform 0.5s var(--spring-ease), box-shadow 0.5s var(--spring-ease);
}

.refinement-panel:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 24px rgba(62, 43, 31, 0.15);
}

.pull-quote {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 300;
    font-size: clamp(1.3rem, 2.8vw, 2rem);
    color: var(--deep-umber);
    line-height: 1.6;
    letter-spacing: -0.01em;
}

/* Hand Plane Tool Illustration */
.tool-hand-plane {
    position: relative;
    width: 140px;
    height: 50px;
    margin: 3rem auto 0;
    transition: transform 0.5s var(--spring-ease);
}

.tool-hand-plane:hover {
    transform: rotate(2deg);
}

.plane-body {
    position: absolute;
    bottom: 6px;
    left: 10px;
    width: 120px;
    height: 24px;
    background-color: var(--ironwood);
    border-radius: 2px;
}

.plane-handle {
    position: absolute;
    top: 0;
    left: 50px;
    width: 40px;
    height: 20px;
    background-color: var(--ironwood);
    border-radius: 10px 10px 0 0;
}

.plane-blade {
    position: absolute;
    bottom: 0;
    left: 40px;
    width: 3px;
    height: 16px;
    background-color: var(--straw);
    transform: rotate(-8deg);
}

.plane-sole {
    position: absolute;
    bottom: 0;
    left: 8px;
    width: 124px;
    height: 6px;
    background-color: var(--charcoal-clay);
    border-radius: 0 0 1px 1px;
}

/* ============================================
   Section 6: Footer / The Mark
   ============================================ */
.footer-section {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-content {
    text-align: center;
    position: relative;
    z-index: 2;
}

.footer-domain {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    color: var(--deep-umber);
    letter-spacing: -0.02em;
    margin-bottom: 2rem;
}

.footer-garden {
    padding: 20px 0;
}

.footer-garden .rock-garden-svg {
    width: min(300px, 60vw);
}

.footer-links {
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-separator {
    color: var(--straw);
    font-size: 1.2rem;
}

.footer-colophon {
    margin-top: 2rem;
    font-size: 0.75rem;
    color: var(--straw);
    opacity: 0.8;
}

/* ============================================
   Dotted Fold Lines
   ============================================ */
.material-section::after,
.process-section::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 0;
    border-top: 1px dashed var(--straw);
    z-index: 1;
    opacity: 0.5;
}

.material-section::after {
    bottom: 15%;
}

.process-section::after {
    top: 40%;
}

/* ============================================
   Reveal Animations
   ============================================ */
.reveal-element {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s var(--gentle-ease), transform 0.8s var(--gentle-ease);
}

.reveal-element.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 900px) {
    #sidebar-nav {
        display: none;
    }

    .material-grid {
        grid-template-columns: 1fr;
    }

    .material-illustration {
        display: none;
    }

    .workshop-grid {
        grid-template-columns: 1fr;
    }

    .card-1,
    .card-2,
    .card-3 {
        grid-column: 1 / -1;
        margin-top: 0;
    }

    .step-1,
    .step-2,
    .step-3,
    .step-4,
    .step-5 {
        margin-left: 0;
    }

    .page-section {
        padding: 4vw;
    }

    .refinement-panel {
        padding: 3rem 2rem;
    }
}

@media (max-width: 600px) {
    .hero-content {
        max-width: 90%;
    }

    .workshop-card {
        padding: 1.5rem;
    }

    .process-step {
        gap: 1rem;
    }

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