/* iisugi.com - Wabi-sabi imperfection */

/* === Color Reference ===
   #F5F0E8 - Aged Parchment (Background)
   #EDE6D8 - Warm Ivory (Background Alt)
   #3D2B1F - Deep Umber (Text Primary)
   #5C4A3A - Warm Brown (Text Secondary)
   #9E8B7A - Muted Tan (Text Tertiary)
   #7A8B6F - Patina Green (Accent)
   #B85C3A - Kiln Red (Accent Warm)
   #8B7355 - Soft Brown (Border/Lines)
   #B8860B - Kintsugi Gold
=== */

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

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: #9E8B7A transparent;
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: #9E8B7A;
    border-radius: 3px;
}

::selection {
    background-color: #7A8B6F;
    color: #FFFFFF;
}

body {
    background-color: #F5F0E8;
    color: #5C4A3A;
    font-family: 'Source Serif 4', 'Georgia', serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.85;
    overflow-x: hidden;
    position: relative;
}

/* === Washi Paper Texture Overlay === */
#paper-texture {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.09;
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(139, 115, 85, 0.03) 2px,
            rgba(139, 115, 85, 0.03) 3px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 3px,
            rgba(139, 115, 85, 0.02) 3px,
            rgba(139, 115, 85, 0.02) 4px
        ),
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 8px,
            rgba(61, 43, 31, 0.01) 8px,
            rgba(61, 43, 31, 0.01) 9px
        ),
        radial-gradient(ellipse at 20% 50%, rgba(139, 115, 85, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 30%, rgba(122, 139, 111, 0.03) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 80%, rgba(158, 139, 122, 0.03) 0%, transparent 45%);
}

/* === Grid Layout (Ma principle) === */
.content-section {
    display: grid;
    grid-template-columns: 1fr minmax(300px, 640px) 1fr;
    padding: 0 24px;
}

.content-block {
    grid-column: 2;
}

/* === Navigation === */
#nav {
    position: fixed;
    top: 32px;
    left: 36px;
    z-index: 100;
    opacity: 0;
    transition: opacity 1s ease-in;
}

#nav.visible {
    opacity: 1;
}

#nav-logo {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 300;
    font-style: italic;
    font-size: 16px;
    color: #3D2B1F;
    text-decoration: none;
    letter-spacing: -0.01em;
    position: relative;
}

#nav-logo::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: #8B7355;
    transition: width 300ms ease;
}

#nav-logo:hover::after {
    width: 100%;
}

/* === Scroll Progress === */
#scroll-progress {
    position: fixed;
    top: 0;
    right: 16px;
    width: 1px;
    height: 100vh;
    background-color: rgba(158, 139, 122, 0.15);
    z-index: 100;
}

#scroll-progress-fill {
    width: 100%;
    height: 0%;
    background-color: #9E8B7A;
    transition: height 100ms linear;
}

/* === Hero Section === */
#hero {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

#hero-title {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 300;
    font-style: italic;
    font-size: 56px;
    color: #3D2B1F;
    letter-spacing: -0.01em;
    opacity: 0;
    transition: opacity 2s ease-in;
}

#hero-title.visible {
    opacity: 1;
}

#hero-line {
    opacity: 0;
}

#hero-line line {
    stroke-dasharray: 120;
    stroke-dashoffset: 120;
}

#hero-line.animate line {
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1.5s ease-in-out;
}

#hero-line.animate {
    opacity: 1;
    transition: opacity 0.3s ease-in;
}

/* === Typography === */
h2 {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 300;
    font-style: italic;
    font-size: 32px;
    color: #3D2B1F;
    letter-spacing: -0.01em;
    margin-bottom: 24px;
    line-height: 1.3;
}

p {
    color: #5C4A3A;
    font-family: 'Source Serif 4', 'Georgia', serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.85;
    max-width: 600px;
}

.meta-label {
    font-family: 'IBM Plex Sans', 'Helvetica Neue', sans-serif;
    font-weight: 300;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #9E8B7A;
    display: block;
    margin-bottom: 16px;
}

.closing-text {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 300;
    font-style: italic;
    font-size: 22px;
    color: #9E8B7A;
    margin-top: 32px;
}

/* === Fade Reveal === */
.fade-reveal {
    opacity: 0;
    transition: opacity 1.2s ease-in-out;
}

.fade-reveal.revealed {
    opacity: 1;
}

/* === Kintsugi Lines === */
.kintsugi-line {
    width: 100%;
    padding: 0;
    overflow: hidden;
    margin: 40px 0;
}

.kintsugi-line svg {
    width: 100%;
    height: 8px;
    display: block;
}

.kintsugi-line path {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    transition: stroke-dashoffset 2s ease-in-out;
}

.kintsugi-line.revealed path,
.kintsugi-line.animate path {
    stroke-dashoffset: 0;
}

/* === Ensō === */
.enso-container {
    display: flex;
    justify-content: center;
    padding: 40px 0;
}

.enso {
    display: block;
}

.enso-final {
    margin: 0 auto;
    display: block;
}

/* === Nature Watermarks === */
.nature-watermark {
    position: fixed;
    pointer-events: none;
    z-index: 0;
}

.nature-watermark-left {
    left: 5vw;
    top: 40vh;
}

.nature-watermark-right {
    right: 6vw;
    bottom: 20vh;
}

/* === Background Shift Between Sections === */
body {
    transition: background-color 2s ease;
}

body.alt-bg {
    background-color: #EDE6D8;
}

/* === Link Styling === */
a {
    color: #5C4A3A;
    text-decoration: none;
    position: relative;
}

a:not(#nav-logo)::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: #8B7355;
    transition: width 300ms ease;
}

a:not(#nav-logo):hover::after {
    width: 100%;
}

/* === Hand-drawn horizontal rules (irregular SVG) === */
.hand-drawn-rule {
    width: 100%;
    height: 2px;
    opacity: 0.3;
}

/* === Responsive === */
@media (max-width: 768px) {
    #hero-title {
        font-size: 40px;
    }

    h2 {
        font-size: 26px;
    }

    p {
        font-size: 16px;
    }

    .content-section {
        grid-template-columns: 1fr minmax(280px, 1fr) 1fr;
        padding: 0 20px;
    }

    .content-block {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    #nav {
        top: 20px;
        left: 20px;
    }

    .nature-watermark {
        display: none;
    }
}
