/* =========================================================
   lungi.dev — wabi-sabi imperfect ceramic, draped fabric
   ========================================================= */

:root {
    --c-cotton: #f7f2ea;     /* unbleached cotton, primary background */
    --c-bark:   #2d1e0f;     /* indigo bark, primary text */
    --c-terra:  #b85c38;     /* terracotta, primary accent */
    --c-henna:  #4a6741;     /* henna green, secondary accent */
    --c-jute:   #e8d5b7;     /* jute gold, secondary background */
    --c-madder: #7b4a8a;     /* madder purple, tertiary accent */
    --c-handloom: #d4c4a8;   /* handloom tan, borders, dividers */

    --f-display: "Yeseva One", "Times New Roman", serif;
    --f-body:    "Hind", "Inter", system-ui, sans-serif;
    --f-mono:    "Ubuntu Mono", "Menlo", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    background: var(--c-cotton);
    color: var(--c-bark);
    font-family: var(--f-body);
    font-weight: 400;
    line-height: 1.8;
    font-size: 1rem;
    overflow-x: hidden;
    position: relative;
}

/* ---------- block-print background overlay ---------- */
.block-print-overlay {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.5;
    background-color: transparent;
    background-image:
        radial-gradient(circle at 25% 25%, rgba(184, 92, 56, 0.08) 0 1.5px, transparent 2px),
        radial-gradient(circle at 75% 75%, rgba(123, 74, 138, 0.06) 0 1.5px, transparent 2px),
        repeating-linear-gradient(45deg, rgba(45, 30, 15, 0.025) 0 1px, transparent 1px 22px),
        repeating-linear-gradient(-45deg, rgba(74, 103, 65, 0.022) 0 1px, transparent 1px 22px);
    background-size: 38px 38px, 38px 38px, auto, auto;
}

main, .site-header, .site-footer { position: relative; z-index: 1; }

/* ---------- header / nav ---------- */
.site-header {
    padding: 1.4rem 1.6rem 1rem;
    border-bottom: 1px dashed var(--c-handloom);
    background: rgba(247, 242, 234, 0.85);
    backdrop-filter: blur(6px);
}

.site-nav {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--c-bark);
}

.brand-mark {
    display: inline-flex;
    width: 32px; height: 32px;
    align-items: center; justify-content: center;
    transform: rotate(-3deg);
    transition: transform 600ms ease-out;
}
.brand:hover .brand-mark { transform: rotate(3deg) scale(1.05); }

.brand-name {
    font-family: var(--f-display);
    font-size: 1.5rem;
    letter-spacing: 0.5px;
    color: var(--c-bark);
}

.brand-dot { color: var(--c-terra); }

.nav-links {
    list-style: none;
    display: flex;
    gap: 1.6rem;
    flex-wrap: wrap;
}

.nav-links a {
    color: var(--c-bark);
    text-decoration: none;
    font-size: 0.92rem;
    letter-spacing: 0.4px;
    padding: 0.2rem 0;
    position: relative;
    transition: color 350ms ease-out;
}

.nav-links a::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -2px;
    height: 1px;
    background: var(--c-madder);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 380ms ease-out;
}

.nav-links a:hover { color: var(--c-madder); }
.nav-links a:hover::after { transform: scaleX(1); }

/* =========================================================
   HERO -- Tapered Sash
   ========================================================= */
.hero {
    padding: clamp(3rem, 8vh, 5.5rem) 0 clamp(2.4rem, 5vh, 4rem);
    text-align: center;
    position: relative;
}

.hero-sash {
    width: 100%;
    background: linear-gradient(135deg, var(--c-terra) 0%, var(--c-madder) 100%);
    color: var(--c-cotton);
    padding: clamp(2.6rem, 6vw, 4.4rem) clamp(1rem, 4vw, 3rem);
    clip-path: polygon(5% 0, 95% 0, 100% 100%, 0 100%);
    position: relative;
    box-shadow:
        inset 0 6px 22px rgba(0, 0, 0, 0.18),
        inset 0 -4px 18px rgba(0, 0, 0, 0.10);
}

/* subtle weft lines on the sash */
.hero-sash::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.045) 0 1px,
            transparent 1px 6px
        ),
        repeating-linear-gradient(
            0deg,
            rgba(0, 0, 0, 0.06) 0 1px,
            transparent 1px 12px
        );
    clip-path: inherit;
    pointer-events: none;
}

.hero-sash-inner {
    position: relative;
    max-width: 760px;
    margin: 0 auto;
}

.hero-eyebrow {
    font-family: var(--f-body);
    font-size: 0.85rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(247, 242, 234, 0.78);
    margin-bottom: 0.8rem;
}

.hero-title {
    font-family: var(--f-display);
    font-weight: 400;
    font-size: clamp(2.6rem, 7vw, 4.8rem);
    line-height: 1.05;
    color: var(--c-cotton);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    letter-spacing: 0.5px;
}

.dot-accent { color: var(--c-jute); }

.hero-subtitle {
    margin-top: 0.9rem;
    font-size: 1.05rem;
    color: rgba(247, 242, 234, 0.92);
    font-style: italic;
}

.hero-meta {
    margin-top: clamp(1.5rem, 3vh, 2.4rem);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem 1.2rem;
}

.meta-pill {
    font-family: var(--f-mono);
    font-size: 0.82rem;
    color: var(--c-bark);
    background: var(--c-jute);
    padding: 0.35rem 0.9rem;
    border: 1px solid var(--c-handloom);
    border-radius: 999px;
    letter-spacing: 0.3px;
}
.meta-pill em { color: var(--c-terra); font-style: normal; margin-right: 0.3rem; }

/* =========================================================
   WAVY DIVIDERS
   ========================================================= */
.wavy-divider {
    width: 100%;
    line-height: 0;
    margin-top: -2px;
    margin-bottom: -2px;
}

.wavy-divider svg {
    width: 100%;
    height: 24px;
    display: block;
}

/* =========================================================
   STRIPS (sections)
   ========================================================= */
.strip {
    padding: clamp(3rem, 6vh, 5rem) 1.4rem;
    position: relative;
    box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.04);
    margin-top: -10px;       /* organic-flow overlap */
    margin-bottom: -10px;
}

.strip-cotton { background: var(--c-cotton); }
.strip-jute   { background: var(--c-jute); }

/* alternating subtle block-print pattern bias */
.strip-jute::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.35;
    background-image:
        radial-gradient(circle at 50% 50%, rgba(45,30,15,0.04) 0 1.5px, transparent 2px);
    background-size: 28px 28px;
}

.strip-inner {
    max-width: 720px;
    margin: 0 auto;
    text-align: justify;
    text-justify: inter-word;
    position: relative;
    z-index: 1;
}

.strip-inner > p { margin-bottom: 1.1rem; }

.kicker {
    font-family: var(--f-mono);
    font-size: 0.78rem;
    color: var(--c-terra);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 1rem !important;
}

.section-title {
    font-family: var(--f-display);
    font-weight: 400;
    font-size: clamp(2rem, 5vw, 3.2rem);
    line-height: 1.15;
    color: var(--c-bark);
    text-align: center;
    margin-bottom: 1.6rem;
    letter-spacing: 0.4px;
}

.strip-inner em { color: var(--c-madder); font-style: italic; }
.strip-inner strong { color: var(--c-terra); font-weight: 600; }

.strip-inner code {
    font-family: var(--f-mono);
    background: rgba(184, 92, 56, 0.08);
    color: var(--c-terra);
    padding: 0.05rem 0.35rem;
    border-radius: 3px;
    font-size: 0.92em;
}

/* =========================================================
   LOOM (swatch grid)
   ========================================================= */
.loom {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0;
    margin: 2rem 0 0;
    border: 1px solid var(--c-handloom);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.06);
}

.swatch {
    appearance: none;
    -webkit-appearance: none;
    border: none;
    background: transparent;
    color: var(--c-bark);
    cursor: pointer;
    padding: 1.4rem 0.9rem;
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    font-family: var(--f-body);
    border-right: 1px solid rgba(255,255,255,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.2);
    position: relative;
    overflow: hidden;
    transition: transform 380ms ease-out, filter 380ms ease-out;
}

.swatch::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(0deg, rgba(0,0,0,0.05) 0 1px, transparent 1px 5px),
        repeating-linear-gradient(90deg, rgba(255,255,255,0.06) 0 1px, transparent 1px 5px);
    pointer-events: none;
    opacity: 0.7;
}

.swatch:hover { transform: translateY(-2px); filter: brightness(1.05); }
.swatch.is-active { transform: translateY(-2px) scale(1.02); filter: brightness(1.08); box-shadow: 0 8px 22px rgba(0,0,0,0.12); z-index: 2; }

.swatch-name {
    font-family: var(--f-display);
    font-size: 1.1rem;
    line-height: 1.1;
    position: relative; z-index: 1;
}
.swatch-hex {
    font-family: var(--f-mono);
    font-size: 0.78rem;
    opacity: 0.85;
    position: relative; z-index: 1;
    letter-spacing: 0.5px;
}

.swatch-1 { background: var(--c-bark);   color: var(--c-cotton); }
.swatch-2 { background: var(--c-terra);  color: var(--c-cotton); }
.swatch-3 { background: var(--c-henna);  color: var(--c-cotton); }
.swatch-4 { background: var(--c-madder); color: var(--c-cotton); }
.swatch-5 { background: var(--c-jute);   color: var(--c-bark); }
.swatch-6 { background: var(--c-handloom); color: var(--c-bark); }

.thread-reader {
    margin-top: 1.6rem;
    padding: 1.4rem 1.6rem;
    background: var(--c-cotton);
    border: 1px solid var(--c-handloom);
    border-left: 4px solid var(--c-terra);
    border-radius: 2px;
    min-height: 110px;
    text-align: left;
    transition: border-left-color 500ms ease-out, background 500ms ease-out;
}

.thread-reader .thread-default {
    color: var(--c-bark);
    opacity: 0.7;
    font-style: italic;
    text-align: center;
    margin: 0;
}

.thread-reader h3 {
    font-family: var(--f-display);
    font-weight: 400;
    font-size: 1.4rem;
    color: var(--c-bark);
    margin-bottom: 0.4rem;
}

.thread-reader p { margin: 0; line-height: 1.7; }

/* =========================================================
   CODE KNOT
   ========================================================= */
.code-knot {
    margin: 1.8rem 0;
    background: var(--c-bark);
    border-radius: 4px;
    padding: 1.4rem 1.4rem 1.4rem 1.6rem;
    overflow-x: auto;
    box-shadow:
        inset 0 4px 14px rgba(0,0,0,0.4),
        0 4px 14px rgba(0,0,0,0.08);
    border: 1px solid var(--c-handloom);
    position: relative;
}

.code-knot::before {
    content: "drape.js";
    position: absolute;
    top: 0.5rem; right: 0.9rem;
    font-family: var(--f-mono);
    font-size: 0.7rem;
    color: var(--c-handloom);
    letter-spacing: 0.5px;
    opacity: 0.7;
}

.code-knot pre {
    margin: 0;
    text-align: left;
}

.code-knot code {
    font-family: var(--f-mono);
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--c-cotton);
    background: transparent;
    padding: 0;
}

.c-key { color: #d4a8c4; }     /* soft madder for keywords */
.c-fn  { color: #e8b48a; }     /* terracotta-tinted for functions */
.c-arg { color: #a8c4a0; }     /* henna for args */
.c-str { color: #e8d5b7; }     /* jute for strings */
.c-num { color: #d4c4a8; }     /* handloom for numbers */
.c-com { color: #8a7a68; font-style: italic; }

/* =========================================================
   PROVERB
   ========================================================= */
.proverb {
    margin: 2.2rem auto 0;
    padding: 1.6rem 1.6rem 1.4rem;
    background: rgba(255,255,255,0.4);
    border-top: 1px solid var(--c-handloom);
    border-bottom: 1px solid var(--c-handloom);
    text-align: center;
    position: relative;
}

.proverb-quote {
    font-family: var(--f-display);
    font-size: 3rem;
    color: var(--c-terra);
    line-height: 0.6;
    display: block;
    height: 1.2rem;
    opacity: 0.9;
}

.proverb p {
    font-family: var(--f-display);
    font-size: 1.2rem;
    line-height: 1.4;
    color: var(--c-bark);
    text-align: center !important;
    margin: 0.4rem 0 0.6rem !important;
    font-weight: 400;
}

.proverb-source {
    font-family: var(--f-mono);
    font-size: 0.78rem;
    color: var(--c-madder);
    letter-spacing: 0.06em;
}

/* =========================================================
   HEM LIST
   ========================================================= */
.hem-list {
    list-style: none;
    margin: 1.8rem 0;
    padding: 0;
}

.hem-list li {
    display: grid;
    grid-template-columns: 14px 130px 1fr;
    gap: 0.9rem;
    align-items: baseline;
    padding: 1rem 0;
    border-bottom: 1px dashed var(--c-handloom);
    text-align: left;
}

.hem-list li:last-child { border-bottom: none; }

.hem-marker {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--c-terra);
    box-shadow: 0 0 0 3px rgba(184,92,56,0.15);
    margin-top: 0.5rem;
}
.hem-list li:nth-child(2) .hem-marker { background: var(--c-henna); box-shadow: 0 0 0 3px rgba(74,103,65,0.18); }
.hem-list li:nth-child(3) .hem-marker { background: var(--c-madder); box-shadow: 0 0 0 3px rgba(123,74,138,0.18); }

.hem-label {
    font-family: var(--f-display);
    font-size: 1.15rem;
    color: var(--c-bark);
    line-height: 1.2;
}

.hem-detail {
    font-size: 0.97rem;
    line-height: 1.7;
    color: var(--c-bark);
}

.thread-link {
    color: var(--c-madder);
    text-decoration: none;
    border-bottom: 1px solid rgba(123,74,138,0.4);
    padding-bottom: 1px;
    transition: color 360ms ease-out, border-color 360ms ease-out;
}
.thread-link:hover { color: var(--c-terra); border-color: var(--c-terra); }

.closing-note {
    margin-top: 1.6rem;
    font-style: italic;
    color: var(--c-bark);
    opacity: 0.85;
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
    padding: clamp(2.4rem, 5vh, 3.6rem) 1.4rem clamp(1.6rem, 3vh, 2.4rem);
    background: var(--c-bark);
    color: var(--c-cotton);
    text-align: center;
    box-shadow: inset 0 8px 24px rgba(0,0,0,0.25);
}

.footer-inner { max-width: 720px; margin: 0 auto; }

.footer-mark { display: flex; justify-content: center; margin-bottom: 0.8rem; }

.footer-line {
    font-family: var(--f-display);
    font-size: 1.1rem;
    color: var(--c-cotton);
    margin-bottom: 0.4rem;
}

.footer-line.tiny {
    font-family: var(--f-body);
    font-size: 0.78rem;
    color: var(--c-handloom);
    letter-spacing: 0.04em;
    margin-top: 0.6rem;
    margin-bottom: 0;
}

.site-footer .brand-dot { color: var(--c-terra); }

/* =========================================================
   FADE-REVEAL animations
   ========================================================= */
[data-reveal] {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 600ms ease-out, transform 600ms ease-out;
}
[data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 720px) {
    .nav-links { gap: 1rem; font-size: 0.85rem; }
    .hero-sash { clip-path: polygon(2% 0, 98% 0, 100% 100%, 0 100%); }
    .strip-inner { text-align: left; }
    .hem-list li { grid-template-columns: 14px 1fr; }
    .hem-list .hem-detail { grid-column: 2; margin-top: 0.2rem; }
    .hem-list .hem-marker { grid-row: 1; }
    .hem-list .hem-label { grid-row: 1; grid-column: 2; }
    .loom { grid-template-columns: repeat(2, 1fr); }
}
