@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,300..900&family=Inter:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

:root {
    --cream: #f6f0e4;
    --panel: #ede2cd;
    --ink: #34241e;
    --ink-soft: rgba(52, 36, 30, 0.68);
    --ink-faint: rgba(52, 36, 30, 0.4);
    --clay: #a9673a;
    --clay-deep: #7c4423;
    --clay-glow: rgba(169, 103, 58, 0.4);
    --line: rgba(52, 36, 30, 0.14);

    --font-display: 'Fraunces', serif;
    --font-body: 'Inter', sans-serif;
    --font-data: 'Space Mono', monospace;

    --transition-speed: 0.5s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--cream);
    color: var(--ink);
    overflow-x: hidden;
    scroll-behavior: smooth;
    width: 100%;
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ---------- Loader ---------- */
.loader {
    position: fixed;
    inset: 0;
    background-color: var(--cream);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease-out, visibility 0.5s;
}
.loader.hidden { opacity: 0; visibility: hidden; }
.loader-text {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 3rem;
    letter-spacing: 0.5px;
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    text-shadow: 0 0 8px var(--clay-glow);
}
.loader-text span { opacity: 0; transform: translateY(20px); display: inline-block; }
.loader-bar {
    width: 200px;
    height: 2px;
    background-color: rgba(169, 103, 58, 0.2);
    position: relative;
    overflow: hidden;
}
.loader-bar::after {
    content: '';
    position: absolute;
    top: 0; left: 0; height: 100%; width: 0;
    background-color: var(--clay);
    animation: loading 2.5s ease forwards;
    box-shadow: 0 0 10px var(--clay-glow);
}
@keyframes loading { 0% { width: 0; } 100% { width: 100%; } }

/* ---------- Noise Overlay ---------- */
.noise-overlay {
    position: fixed;
    inset: 0;
    background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAAUVBMVEWFhYWDg4N3d3dtbW17e3t1dXWBgYGHh4d5eXlzc3OLi4ubm5uVlZWPj4+NjY19fX2JiYl/f39ra2uRkZGZmZlpaWmXl5dvb29xcXGTk5NnZ2c4ZZKIAAAAZklEQVR4nO3PsQHAIBADwI1JfGMnvf1XzQDI5GW+iJZfDgAFwPNVcNwvNChSwFxYYCpsUKokldVdpk7FGm7FC5zF1MZrXJVLzDJ6mf9wMb0MXVYuExejy5cLxeRy9DK2WLqsXYYuW5e5y+zojfAO+51qBg0AAAAASUVORK5CYII=');
    pointer-events: none;
    opacity: 0.02;
    z-index: 100;
}

/* ---------- Sidebar ---------- */
#sidebar {
    position: fixed;
    top: 0; left: 0;
    width: 260px;
    height: 100vh;
    background-color: rgba(237, 226, 205, 0.94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 900;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2.5rem 0;
    transform: translateX(-100%);
    transition: transform var(--transition-speed) cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.08);
    border-right: 1px solid var(--line);
}
#sidebar.open { transform: translateX(0); }
.logo-container { display: flex; justify-content: center; align-items: center; padding: 0 1rem 1.5rem; }
.logo { width: 64px; height: 64px; transition: transform 0.3s ease; }
.logo:hover { transform: scale(1.05); }

nav { margin-top: 1rem; flex-grow: 1; }
nav ul { list-style: none; display: flex; flex-direction: column; }
nav li {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0 2rem;
    border-top: 1px solid var(--line);
}
nav li:last-child { border-bottom: 1px solid var(--line); }
.nav-index {
    font-family: var(--font-data);
    font-size: 0.7rem;
    color: var(--ink-faint);
    letter-spacing: 1px;
}
.nav-link {
    flex: 1;
    display: block;
    text-decoration: none;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 500;
    padding: 1rem 0;
    transition: color 0.3s ease;
    position: relative;
    overflow: hidden;
}
.nav-link::after {
    content: attr(data-text);
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    display: flex; align-items: center;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.7, 0, 0.3, 1);
    color: var(--clay);
}
.nav-link:hover::after { transform: translateY(0); }
.nav-link span {
    display: block;
    transition: transform 0.4s cubic-bezier(0.7, 0, 0.3, 1);
}
.nav-link:hover span { transform: translateY(-100%); }

.sidebar-footer {
    text-align: center;
    font-family: var(--font-data);
    font-size: 0.7rem;
    letter-spacing: 2px;
    color: var(--ink-faint);
    text-transform: uppercase;
}

/* ---------- Menu Toggle (custom hamburger) ---------- */
.menu-toggle-container { position: fixed; top: 2rem; right: 2rem; z-index: 999; }
#menu-toggle {
    background: var(--cream);
    border: 1px solid var(--line);
    border-radius: 50%;
    cursor: pointer;
    width: 52px;
    height: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
#menu-toggle:hover { transform: scale(1.06); box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.bun {
    display: block;
    width: 20px;
    height: 2px;
    background-color: var(--ink);
    border-radius: 2px;
    transition: transform 0.35s cubic-bezier(0.7,0,0.3,1), opacity 0.25s ease, width 0.3s ease;
}
.bun-bottom { width: 14px; align-self: center; }
#sidebar.open ~ .menu-toggle-container .bun-top { transform: translateY(7px) rotate(45deg); }
#sidebar.open ~ .menu-toggle-container .bun-mid { opacity: 0; }
#sidebar.open ~ .menu-toggle-container .bun-bottom { width: 20px; transform: translateY(-7px) rotate(-45deg); }

/* ---------- Main / Sections ---------- */
main { min-height: 100vh; width: 100%; position: relative; display: flex; flex-direction: column; align-items: center; }
section { min-height: 100vh; width: 100%; position: relative; display: flex; justify-content: center; align-items: center; padding: 6rem 0; overflow: hidden; }
.section-container { width: 82%; max-width: 1180px; margin: 0 auto; padding: 1rem; position: relative; z-index: 5; }
.section-heading { text-align: center; margin-bottom: 3.5rem; }
.section-eyebrow {
    display: inline-block;
    font-family: var(--font-data);
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--clay);
    margin-bottom: 0.75rem;
}
.section-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 2.75rem;
    position: relative;
    display: inline-block;
}
.section-title::before {
    content: attr(data-text);
    position: absolute;
    left: 0; top: 0;
    color: transparent;
    -webkit-text-stroke: 1px rgba(169, 103, 58, 0.18);
    z-index: -1;
    transform: translate(-8px, 8px);
}

/* ---------- Home ---------- */
#home { background-color: var(--cream); }
.curve-ambient {
    position: absolute;
    right: -5%;
    bottom: 6%;
    width: 65%;
    max-width: 800px;
    height: auto;
    opacity: 0.5;
    pointer-events: none;
}
.curve-ambient path {
    fill: none;
    stroke: var(--clay);
    stroke-width: 1.5;
    stroke-linecap: round;
    opacity: 0.25;
}
.hero-content { text-align: center; position: relative; z-index: 5; width: 100%; display: flex; flex-direction: column; align-items: center; }
.welcome-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 1.15rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin-bottom: 1.25rem;
    display: flex; justify-content: center; flex-wrap: wrap; gap: 0.3rem;
}
.welcome-text span { opacity: 0; transform: translateY(20px); display: inline-block; }
.brand-text {
    font-family: var(--font-display);
    font-optical-sizing: auto;
    font-weight: 600;
    font-size: 7.5rem;
    letter-spacing: 1px;
    margin-bottom: 1.25rem;
    display: flex; justify-content: center; gap: 0.15rem;
    text-shadow: 0 0 24px rgba(169, 103, 58, 0.25);
}
.brand-text span { opacity: 0; transform: translateY(30px); display: inline-block; }
.motto-text {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 400;
    font-size: 1.6rem;
    color: var(--clay-deep);
    margin-bottom: 3rem;
    display: flex; justify-content: center; flex-wrap: wrap; gap: 0.3rem;
}
.motto-text span { opacity: 0; transform: translateY(20px); display: inline-block; }

.hero-stats {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    padding: 1.5rem 2.5rem;
    border: 1px solid var(--line);
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.35);
}
.hero-stat { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; }
.hero-stat-value {
    font-family: var(--font-data);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--clay);
}
.hero-stat-label {
    font-size: 0.75rem;
    color: var(--ink-soft);
    max-width: 140px;
    text-align: center;
    line-height: 1.3;
}
.hero-stat-divider { width: 1px; height: 36px; background: var(--line); }

/* ---------- Philosophy ---------- */
#philosophy { background-color: var(--panel); }
.philosophy-grid { display: flex; gap: 5rem; align-items: center; }
.philosophy-text { flex: 1; }
.philosophy-text p {
    margin-bottom: 1.4rem;
    line-height: 1.8;
    font-size: 1.1rem;
    color: var(--ink-soft);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}
.philosophy-text p:last-child { margin-bottom: 0; }
.highlight { color: var(--clay-deep); font-weight: 600; }

.philosophy-visual { flex: 1.2; opacity: 0; transform: translateY(20px); transition: all 0.6s ease; }
.curve-card {
    background: var(--cream);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 2rem 1.5rem 1rem;
    box-shadow: 0 12px 30px rgba(52, 36, 30, 0.06);
}
.curve-caption {
    font-family: var(--font-data);
    font-size: 0.8rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--ink-soft);
    text-align: center;
    margin-bottom: 1rem;
}
.curve-chart { width: 100%; height: auto; overflow: visible; }
.curve-baseline { stroke: var(--line); stroke-width: 1; }
.curve-path {
    fill: none;
    stroke: var(--clay);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-dasharray: 900;
    stroke-dashoffset: 900;
    transition: stroke-dashoffset 1.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.curve-chart.in-view .curve-path { stroke-dashoffset: 0; }
.curve-point circle { fill: var(--cream); stroke: var(--clay); stroke-width: 2; opacity: 0; transition: opacity 0.4s ease; transition-delay: calc(var(--d) * 0.3s + 0.4s); }
.curve-point-final { fill: var(--clay); }
.curve-chart.in-view .curve-point circle { opacity: 1; }
.curve-point text {
    font-family: var(--font-data);
    font-size: 11px;
    fill: var(--ink-faint);
    text-anchor: middle;
    opacity: 0;
    transition: opacity 0.4s ease;
    transition-delay: calc(var(--d) * 0.3s + 0.5s);
}
.curve-chart.in-view .curve-point text { opacity: 1; }
.curve-value { fill: var(--clay); font-weight: 700; font-size: 13px; }
.curve-value-final { fill: var(--clay-deep); font-size: 15px; }

/* ---------- Feed ---------- */
#feed { background-color: var(--cream); }
.posts-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    width: 100%;
}
.post-item {
    position: relative;
    background-color: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(52, 36, 30, 0.05);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
    opacity: 0;
    transform: translateY(20px);
}
.post-item:hover { transform: translateY(-6px); box-shadow: 0 14px 30px rgba(52, 36, 30, 0.1), 0 0 20px rgba(169, 103, 58, 0.12); }
.post-volume {
    position: absolute;
    top: 1rem; left: 1rem;
    z-index: 2;
    font-family: var(--font-data);
    font-size: 0.7rem;
    letter-spacing: 1px;
    background: var(--clay);
    color: var(--cream);
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
}
.post-content { display: flex; justify-content: center; align-items: center; width: 100%; }
.feed-cta {
    display: inline-block;
    margin: 3.5rem auto 0;
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.15rem;
    color: var(--clay-deep);
    text-decoration: none;
    border-bottom: 1px solid var(--clay-deep);
    padding-bottom: 3px;
    transition: opacity 0.3s ease;
}
.feed-cta:hover { opacity: 0.65; }
.feed-foot { width: 100%; text-align: center; }

/* ---------- Shop ---------- */
#shop { background-color: var(--panel); }
.merch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
    width: 100%;
}
.merch-item {
    background-color: var(--cream);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 2rem 1.75rem;
    text-align: center;
    box-shadow: 0 6px 20px rgba(52, 36, 30, 0.05);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
    opacity: 0;
    transform: translateY(20px);
    position: relative;
}
.merch-item:hover { transform: translateY(-6px); box-shadow: 0 14px 30px rgba(52, 36, 30, 0.1), 0 0 20px rgba(169, 103, 58, 0.12); }
.merch-badge {
    width: 76px; height: 76px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: rgba(169, 103, 58, 0.1);
    display: flex; align-items: center; justify-content: center;
}
.merch-icon { display: block; position: relative; }
.merch-icon-tee {
    width: 34px; height: 30px;
    background: var(--clay);
    clip-path: polygon(30% 0%, 50% 12%, 70% 0%, 100% 22%, 82% 38%, 74% 32%, 74% 100%, 26% 100%, 26% 32%, 18% 38%, 0% 22%);
}
.merch-icon-cap {
    width: 40px; height: 26px; position: relative;
}
.merch-icon-cap::before {
    content: '';
    position: absolute;
    top: 0; left: 6px;
    width: 28px; height: 20px;
    background: var(--clay);
    border-radius: 50% 50% 0 0;
}
.merch-icon-cap::after {
    content: '';
    position: absolute;
    bottom: 0; right: 0;
    width: 20px; height: 6px;
    background: var(--clay);
    border-radius: 0 0 4px 4px;
}
.merch-icon-journal {
    width: 30px; height: 34px;
    background: var(--clay);
    border-radius: 2px 5px 5px 2px;
    position: relative;
}
.merch-icon-journal::before {
    content: '';
    position: absolute;
    left: 5px; top: 0;
    width: 2px; height: 100%;
    background: var(--cream);
    opacity: 0.6;
}
.merch-status {
    font-family: var(--font-data);
    font-size: 0.65rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--clay);
    margin-bottom: 0.75rem;
}
.merch-title { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; margin-bottom: 0.4rem; }
.merch-price { font-family: var(--font-data); color: var(--clay-deep); font-size: 1.05rem; font-weight: 700; margin-bottom: 1rem; }
.merch-description { color: var(--ink-soft); font-size: 0.92rem; margin-bottom: 1.5rem; line-height: 1.6; }
.merch-button {
    display: block;
    width: 100%;
    padding: 0.85rem;
    background-color: transparent;
    border: 1px solid var(--clay);
    color: var(--clay-deep);
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.75rem;
}
.merch-button:hover { background-color: var(--clay); color: var(--cream); box-shadow: 0 0 14px var(--clay-glow); }

/* ---------- Footer ---------- */
.site-footer {
    width: 100%;
    padding: 3rem 2rem;
    background: var(--ink);
    color: var(--cream);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
}
.footer-brand { font-family: var(--font-display); font-size: 1.3rem; letter-spacing: 1px; }
.footer-motto { font-style: italic; font-size: 0.9rem; opacity: 0.65; }
.footer-link { color: var(--clay-glow); font-family: var(--font-data); font-size: 0.8rem; text-decoration: none; margin-top: 0.5rem; }
.footer-link:hover { text-decoration: underline; }

/* ---------- Media Queries ---------- */
@media screen and (max-width: 992px) {
    .philosophy-grid { flex-direction: column; gap: 3rem; }
    .brand-text { font-size: 4.5rem; }
    .section-container { width: 100%; padding: 1rem; }
    .curve-ambient { display: none; }
}
@media screen and (max-width: 768px) {
    .brand-text { font-size: 3.2rem; }
    .welcome-text { font-size: 0.9rem; letter-spacing: 2px; }
    .motto-text { font-size: 1.2rem; }
    .section-title { font-size: 2.1rem; }
    .philosophy-text p { font-size: 1rem; }
    .hero-stats { flex-direction: column; gap: 1rem; border-radius: 20px; padding: 1.5rem; }
    .hero-stat-divider { display: none; }
    section { padding: 5rem 0; }
}
@media screen and (max-width: 576px) {
    .brand-text { font-size: 2.4rem; }
    .section-title { font-size: 1.8rem; }
    section { padding: 4rem 0; }
    .section-container { padding: 0.5rem; }
    .site-footer { padding: 2.5rem 1.5rem; }
}