/* =========================================
   gabs.feedback - Kintsugi / Wabi-sabi
   Palette:
     Raw Umber:        #3D2B1F
     Fired Clay:       #4A3728
     Weathered Stone:  #8B7D6B
     Unbleached Linen: #E8DFD0
     Cracked Plaster:  #F4EDE4
     Kiln Charcoal:    #1E1A17
     Kintsugi Gold:    #C9A84C
     Oxidized Copper:  #5A7D6A
   Fonts:
     Cormorant Garamond 300 (headings)
     Source Serif 4 400 (body)
     IBM Plex Mono 300 (annotations)
   ========================================= */

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

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

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

/* --- Background transition layer --- */
#bg-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    background-color: #F4EDE4;
    transition: background-color 0.1s linear;
}

/* --- Grain texture overlay (feTurbulence) --- */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='g'%3E%3CfeTurbulence baseFrequency='0.45' numOctaves='3' type='fractalNoise' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23g)'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* --- Kintsugi crack overlay (fixed, parallax behind content) --- */
.crack-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.crack-overlay path {
    fill: none;
    stroke: #C9A84C;
    stroke-width: 0.75;
    opacity: 0.4;
    stroke-linecap: round;
}

/* --- Background crack layer (absolute, full document height) --- */
.crack-bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    pointer-events: none;
    z-index: 2;
}

.crack-bg-layer path {
    fill: none;
    stroke: #C9A84C;
    stroke-width: 0.75;
    opacity: 0.4;
    stroke-linecap: round;
}

/* --- Navigation disc --- */
.nav-disc {
    position: fixed;
    top: 24px;
    left: 24px;
    width: 32px;
    height: 32px;
    z-index: 500;
    cursor: pointer;
}

.nav-disc-inner {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #E8DFD0;
    border: 0.75px solid #8B7D6B;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    position: relative;
    z-index: 502;
    /* Ceramic texture feel via subtle inset shadow */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.65' numOctaves='2' type='fractalNoise'/%3E%3C/filter%3E%3Crect width='32' height='32' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
    background-size: cover;
}

.nav-disc:hover .nav-disc-inner {
    box-shadow: 0 0 12px rgba(201, 168, 76, 0.25);
}

.nav-disc.open .nav-disc-inner {
    transform: scale(1.1);
    border-color: #C9A84C;
}

.nav-menu {
    position: absolute;
    top: -8px;
    left: -8px;
    width: 220px;
    height: 220px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.nav-disc.open .nav-menu {
    opacity: 1;
    pointer-events: auto;
}

.nav-link {
    position: absolute;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 13px;
    letter-spacing: 0.04em;
    color: #8B7D6B;
    text-decoration: none;
    transition: color 0.3s ease, text-decoration-color 0.3s ease;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 4px;
    text-decoration-thickness: 1px;
    white-space: nowrap;
}

.nav-link:hover {
    color: #3D2B1F;
    text-decoration-color: #C9A84C;
}

.nav-link[data-index="0"] { top: 4px; left: 52px; }
.nav-link[data-index="1"] { top: 44px; left: 60px; }
.nav-link[data-index="2"] { top: 84px; left: 56px; }
.nav-link[data-index="3"] { top: 124px; left: 48px; }
.nav-link[data-index="4"] { top: 164px; left: 52px; }

/* --- Sections (organic-flow grid) --- */
.section {
    position: relative;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr min(65ch, 90%) 1fr;
    z-index: 10;
}

.content-column {
    grid-column: 2;
    position: relative;
}

/* --- Opening section --- */
.section-opening {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    min-height: 100vh;
}

.opening-content {
    text-align: center;
    opacity: 0;
}

.site-title {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-weight: 300;
    font-size: 56px;
    letter-spacing: 0.02em;
    line-height: 1.15;
    color: #3D2B1F;
    margin-bottom: 1rem;
    text-transform: none;
}

.site-subtitle {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 14px;
    letter-spacing: 0.04em;
    color: #8B7D6B;
    opacity: 0;
}

/* --- Philosophy section --- */
.section-philosophy {
    padding-top: 8rem;
    padding-bottom: 5rem;
    background-color: transparent;
}

/* --- Practice section --- */
.section-practice {
    padding-top: 5rem;
    padding-bottom: 5rem;
    background-color: transparent;
}

/* --- Leave a mark section --- */
.section-mark {
    padding-top: 3rem;
    padding-bottom: 8rem;
    background-color: transparent;
}

/* --- Closing section (dark background region) --- */
.section-closing {
    padding-top: 5rem;
    padding-bottom: 8rem;
    background-color: transparent;
}

/* --- Typography --- */
.section-heading {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-weight: 300;
    font-size: 48px;
    letter-spacing: 0.02em;
    line-height: 1.15;
    color: #3D2B1F;
    margin-bottom: 2rem;
    text-transform: none;
}

.body-text {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.75;
    color: #4A3728;
    max-width: 65ch;
    margin-bottom: 1.5em;
}

/* Dark background text adjustments (Kiln Charcoal #1E1A17 region) */
.section-closing .section-heading,
.dark-text .section-heading {
    color: #E8DFD0;
}

.section-closing .body-text,
.dark-text .body-text {
    color: #E8DFD0;
}

.section-closing .margin-note,
.dark-text .margin-note {
    color: #8B7D6B;
}

.section-closing .annotation-line {
    background-color: #8B7D6B;
}

/* --- Margin notes (vertical text, whispered annotations) --- */
.margin-note {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 14px;
    color: #8B7D6B;
    opacity: 0.7;
    grid-column: 1 / -1;
    position: absolute;
    top: 50%;
}

.vertical-text {
    writing-mode: vertical-rl;
    transform: translateY(-50%);
}

/* --- Margin annotations (potter's notation marks) --- */
.margin-annotation {
    position: absolute;
    left: -40px;
    top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.annotation-dot {
    width: 8px;
    height: 8px;
    flex-shrink: 0;
}

.annotation-line {
    display: block;
    width: 24px;
    height: 1px;
    background-color: #8B7D6B;
    opacity: 0.3;
}

/* --- Ceramic fragment dividers --- */
.ceramic-divider {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    height: 60px;
    position: relative;
    z-index: 10;
    padding: 0 2rem;
}

.shard {
    width: 50px;
    height: 35px;
    opacity: 0.7;
}

/* --- Ceramic surface (interactive "leave a mark") --- */
.ceramic-surface {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 2;
    background-color: #E8DFD0;
    border: 0.5px solid #8B7D6B;
    cursor: crosshair;
    overflow: hidden;
    margin-top: 2rem;
}

.ceramic-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.ceramic-message {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 13px;
    letter-spacing: 0.04em;
    color: #8B7D6B;
    opacity: 0;
    transition: opacity 1.2s ease;
    text-align: center;
    white-space: nowrap;
}

.ceramic-message.visible {
    opacity: 1;
}

/* --- Fade-in animation (Intersection Observer driven) --- */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Hover behaviors --- */
a {
    color: #4A3728;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 4px;
    text-decoration-thickness: 1px;
    transition: text-decoration-color 0.3s ease, color 0.3s ease;
}

a:hover {
    text-decoration-color: #C9A84C;
    color: #5A7D6A;
}

/* --- Closing symbol --- */
.closing-mark {
    grid-column: 2;
    display: flex;
    justify-content: center;
    padding-top: 5rem;
}

.closing-symbol {
    width: 40px;
    height: 40px;
}

/* --- Crack path styles --- */
.crack-path {
    fill: none;
    stroke: #C9A84C;
    stroke-width: 0.75;
    stroke-linecap: round;
}

.crack-path-opening {
    fill: none;
    stroke: #C9A84C;
    stroke-width: 1;
    stroke-linecap: round;
    opacity: 0.6;
}

/* --- Dark region utility (for Kiln Charcoal #1E1A17 backgrounds) --- */
.section.dark-region .section-heading {
    color: #E8DFD0;
}

.section.dark-region .body-text {
    color: #E8DFD0;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .site-title {
        font-size: 36px;
    }

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

    .body-text {
        font-size: 16px;
    }

    .margin-note {
        display: none;
    }

    .margin-annotation {
        display: none;
    }

    .nav-link[data-index="0"] { top: 4px; left: 44px; }
    .nav-link[data-index="1"] { top: 36px; left: 50px; }
    .nav-link[data-index="2"] { top: 68px; left: 46px; }
    .nav-link[data-index="3"] { top: 100px; left: 40px; }
    .nav-link[data-index="4"] { top: 132px; left: 44px; }

    .ceramic-message {
        white-space: normal;
        width: 80%;
    }

    .section {
        min-height: auto;
    }

    .section-opening {
        min-height: 100vh;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 28px;
    }

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

    .ceramic-divider {
        gap: 0.75rem;
    }

    .shard {
        width: 35px;
        height: 25px;
    }
}
