/* ═══════════════════════════════════════════════════════════════════
   MAYU · Design system · v4 (dark warm)
   Shared across every page. Page-specific styles live in each HTML file.
   ═══════════════════════════════════════════════════════════════════ */

/* ─── Tokens ─── */
:root {
    /* Surfaces (darkest → lighter), all warm-brown family */
    --bg-deep:    #1A130D;      /* hero / deepest panels */
    --bg-main:    #221A12;      /* page background */
    --bg-card:    #2B2218;      /* raised surfaces */
    --bg-warm:    #3A2E22;      /* hover / accent panels */
    --line:       rgba(229, 221, 208, 0.10);   /* hairline borders on dark */
    --line-warm:  rgba(229, 221, 208, 0.18);

    /* Text (lighter → dimmer) */
    --text:       #E5DDD0;      /* primary — warm cream */
    --text-mid:   #BFB3A0;      /* secondary */
    --text-dim:   #8A8073;      /* labels, eyebrows, captions */
    --text-faint: #5C5448;      /* very faint, mostly UI chrome */

    /* Accents */
    --accent:     #A88B66;      /* warm tan/bronze — primary accent */
    --accent-hi:  #C9A87C;      /* brighter accent for hover */
    --rust:       #B86F4F;      /* hot accent — rare */
    --olive:      #8C8E66;      /* cool counter-accent — rare */

    /* Type families */
    --serif: 'Cormorant Garamond', 'Tiempos', 'Georgia', serif;
    --sans:  'Inter', -apple-system, 'Söhne', sans-serif;

    /* Layout */
    --max-w:  1440px;
    --gutter: clamp(1.5rem, 4vw, 4rem);
    --row:    clamp(5rem, 10vh, 9rem);
}

/* ─── Reset ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
::selection { background: var(--accent); color: var(--bg-deep); }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    background: var(--bg-main);
}

body {
    background: var(--bg-main);
    color: var(--text);
    font-family: var(--sans);
    font-weight: 400;
    font-size: 0.92rem;
    line-height: 1.65;
    letter-spacing: 0.002em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; transition: color 0.3s; }
button { font-family: inherit; cursor: pointer; background: none; border: 0; color: inherit; }
*:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }

ul { list-style: none; }
input, textarea, select { font-family: inherit; font-size: inherit; }

/* ─── Typography utilities ─── */
.display {
    font-family: var(--serif);
    font-weight: 300;
    line-height: 1.04;
    letter-spacing: -0.005em;
    color: var(--text);
}
.display em {
    font-style: italic;
    color: var(--accent);
}

.eyebrow {
    font-family: var(--sans);
    font-size: 0.66rem;
    font-weight: 500;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.lede {
    font-family: var(--serif);
    font-weight: 300;
    font-size: clamp(1.15rem, 1.6vw, 1.45rem);
    line-height: 1.5;
    color: var(--text-mid);
    max-width: 56ch;
}

.meta {
    font-family: var(--sans);
    font-size: 0.7rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text-dim);
}

/* ─── Layout helpers ─── */
.frame {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

/* ─── Reveal on scroll ─── */
.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 1.1s cubic-bezier(0.22, 1, 0.36, 1),
                transform 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
}

/* ─── Buttons ─── */
.btn {
    display: inline-block;
    font-family: var(--sans);
    font-size: 0.66rem;
    font-weight: 500;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--text);
    padding: 1rem 2rem;
    border: 1px solid var(--text);
    transition: background 0.3s, color 0.3s, border-color 0.3s;
    cursor: pointer;
}
.btn:hover { background: var(--text); color: var(--bg-deep); }

.btn-accent {
    border-color: var(--accent);
    color: var(--accent);
}
.btn-accent:hover { background: var(--accent); color: var(--bg-deep); }

/* Link with trailing arrow — used everywhere */
.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--sans);
    font-size: 0.66rem;
    font-weight: 500;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--text);
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--text);
    transition: gap 0.3s, color 0.3s, border-color 0.3s;
}
.link-arrow:hover { gap: 0.9rem; color: var(--accent); border-bottom-color: var(--accent); }
.link-arrow .arr { display: inline-block; transition: transform 0.3s; }
.link-arrow:hover .arr { transform: translateX(4px); }

/* ─── Filter chips (used on Projects + Journal index pages) ─── */
.chips {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--line);
    padding-bottom: 1.4rem;
}
.chip {
    font-size: 0.66rem;
    font-weight: 500;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--text-dim);
    padding: 0.6rem 1.2rem;
    border: 1px solid transparent;
    border-radius: 999px;
    transition: color 0.3s, border-color 0.3s, background 0.3s;
    cursor: pointer;
}
.chip:hover { color: var(--text); }
.chip.active {
    color: var(--text);
    border-color: var(--line-warm);
    background: var(--bg-card);
}

/* ─── Nav (shared across all pages) ─── */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 50;
    padding: 1.4rem var(--gutter);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    color: var(--text);
    background: transparent;
    transition: background 0.4s, padding 0.4s, border-color 0.4s;
    border-bottom: 1px solid transparent;
}
.nav.scrolled,
.nav.solid {
    background: rgba(26, 19, 13, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 0.9rem var(--gutter);
    border-bottom-color: var(--line);
}

.nav-brand {
    display: flex; flex-direction: column;
}
.nav-brand .logo {
    font-family: var(--serif);
    font-weight: 400;
    font-size: 1.35rem;
    letter-spacing: 0.34em;
    line-height: 1;
    padding-left: 0.18em;
    color: var(--text);
}
.nav-menu {
    display: flex;
    gap: clamp(1.4rem, 2.5vw, 3rem);
    justify-content: center;
}
.nav-menu a {
    font-size: 0.66rem;
    font-weight: 500;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    position: relative;
    padding: 0.3rem 0;
}
.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 0; height: 1px;
    background: var(--accent);
    transition: width 0.4s;
}
.nav-menu a:hover::after,
.nav-menu a.current::after { width: 100%; }
.nav-menu a.current { color: var(--accent); }

.nav-end {
    display: flex;
    gap: 1.4rem;
    align-items: center;
    justify-content: flex-end;
}
.nav-burger {
    width: 22px; height: 22px;
    display: flex; flex-direction: column;
    justify-content: center; gap: 4px;
}
.nav-burger span { display: block; height: 1px; background: currentColor; }
.nav-burger span:nth-child(1) { width: 100%; }
.nav-burger span:nth-child(2) { width: 70%; margin-left: auto; }

@media (max-width: 900px) { .nav-menu { display: none; } }

/* Mobile menu sheet */
.nav-sheet {
    position: fixed; inset: 0;
    background: var(--bg-deep);
    color: var(--text);
    z-index: 60;
    padding: 5rem var(--gutter) 2rem;
    display: flex; flex-direction: column; gap: 1.4rem;
    transform: translateY(-100%);
    transition: transform 0.5s cubic-bezier(0.7, 0, 0.3, 1);
}
.nav-sheet.open { transform: translateY(0); }
.nav-sheet a {
    font-family: var(--serif);
    font-weight: 300;
    font-size: 2rem;
    color: var(--text);
}
.nav-sheet a:hover { color: var(--accent); }
.nav-sheet-close {
    position: absolute; top: 1.4rem; right: var(--gutter);
    font-family: var(--serif); font-size: 2rem; line-height: 1;
    color: var(--text);
}
.nav-sheet-social {
    margin-top: auto;
    padding-top: 2rem;
    border-top: 1px solid var(--line);
    display: flex; gap: 1.6rem;
}
.nav-sheet-social a {
    font-family: var(--sans);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text-dim);
}

/* ─── Footer (shared across all pages) ─── */
footer {
    background: var(--bg-deep);
    color: var(--text);
    padding: clamp(4rem, 8vw, 6rem) var(--gutter) 1.8rem;
    border-top: 1px solid var(--line);
}
.foot {
    max-width: var(--max-w);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr 1.2fr;
    gap: clamp(2rem, 3vw, 3rem);
}
.foot-brand .logo {
    font-family: var(--serif);
    font-weight: 400;
    font-size: 1.45rem;
    letter-spacing: 0.34em;
    line-height: 1;
    padding-left: 0.18em;
    margin-bottom: 1rem;
    display: inline-block;
    color: var(--text);
}
.foot-brand p {
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--text-mid);
    max-width: 24ch;
    margin-bottom: 2.4rem;
}
.foot-brand .social {
    display: flex;
    gap: 1.8rem;
}
.foot-brand .social a {
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text-mid);
}
.foot-brand .social a:hover { color: var(--text); }

.foot-col h4 {
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    margin-bottom: 1.4rem;
    color: var(--text-dim);
}
.foot-col ul { display: flex; flex-direction: column; gap: 0.7rem; }
.foot-col a {
    font-family: var(--serif);
    font-weight: 400;
    font-size: 1rem;
    color: var(--text-mid);
}
.foot-col a:hover { color: var(--text); }

.foot-bottom {
    max-width: var(--max-w);
    margin: clamp(2.8rem, 5vw, 4rem) auto 0;
    padding-top: 1.4rem;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text-dim);
}
.foot-bottom .links { display: flex; gap: 1.6rem; }
.foot-bottom a:hover { color: var(--text); }

@media (max-width: 1100px) {
    .foot { grid-template-columns: 1fr 1fr 1fr; gap: 2.4rem; }
    .foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
    .foot { grid-template-columns: 1fr 1fr; }
    .foot-brand { grid-column: 1 / -1; }
    .foot-bottom { flex-direction: column; gap: 1rem; }
}

/* ─── Form elements (used on Contact page) ─── */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.4rem;
}
.form-row { grid-column: 1 / -1; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }

.field label {
    display: block;
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
}
.field input,
.field textarea,
.field select {
    width: 100%;
    background: transparent;
    color: var(--text);
    border: 0;
    border-bottom: 1px solid var(--line-warm);
    padding: 0.7rem 0;
    font-family: var(--sans);
    font-size: 0.95rem;
    transition: border-color 0.3s;
    -webkit-appearance: none;
    appearance: none;
}
.field input::placeholder,
.field textarea::placeholder {
    color: var(--text-faint);
}
.field input:focus,
.field textarea:focus,
.field select:focus {
    outline: none;
    border-bottom-color: var(--accent);
}
.field textarea {
    resize: vertical;
    min-height: 120px;
}
.field select {
    cursor: pointer;
    background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%),
                      linear-gradient(-45deg, transparent 50%, var(--text-dim) 50%);
    background-position: calc(100% - 16px) 1.2rem,
                         calc(100% - 10px) 1.2rem;
    background-size: 6px 6px;
    background-repeat: no-repeat;
    padding-right: 28px;
}
.field select option {
    background: var(--bg-card);
    color: var(--text);
}

/* ─── Skip link (a11y) ─── */
.skip-link {
    position: absolute; top: -100%; left: 1rem;
    padding: 0.7rem 1.2rem;
    background: var(--accent); color: var(--bg-deep);
    font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase;
    z-index: 200;
}
.skip-link:focus { top: 1rem; }

/* ═══════════════════════════════════════
   JOURNAL ARTICLE PAGE
   ═══════════════════════════════════════ */
.article-page-main { background: var(--bg-main); padding-top: clamp(6rem, 12vh, 8rem); }

.article-back { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--gutter) 2rem; }
.article-back a { display: inline-flex; align-items: center; gap: 0.6rem; font-size: 0.66rem; font-weight: 500; letter-spacing: 0.24em; text-transform: uppercase; color: var(--text-dim); transition: color 0.3s, gap 0.3s; }
.article-back a:hover { color: var(--accent); gap: 0.9rem; }
.article-back .arr { display: inline-block; transition: transform 0.3s; }
.article-back a:hover .arr { transform: translateX(-4px); }

.article-head { max-width: 760px; margin: 0 auto clamp(2.4rem, 5vw, 3.6rem); padding: 0 var(--gutter); }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.7rem; margin-bottom: 1.6rem; font-size: 0.66rem; font-weight: 500; letter-spacing: 0.24em; text-transform: uppercase; }
.article-meta .tag { color: var(--accent); }
.article-meta .dot, .article-meta .date, .article-meta .read-time { color: var(--text-dim); }
.article-head h1 { font-family: var(--serif); font-weight: 300; font-size: clamp(2.4rem, 5.4vw, 4rem); line-height: 1.04; letter-spacing: -0.008em; color: var(--text); margin-bottom: 1.2rem; }
.standfirst { font-family: var(--serif); font-weight: 300; font-style: italic; font-size: clamp(1.2rem, 1.8vw, 1.5rem); line-height: 1.4; color: var(--text-mid); margin-bottom: 1.4rem; max-width: 50ch; }
.byline { font-size: 0.78rem; color: var(--text-dim); }
.byline a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line); transition: border-color 0.3s; }
.byline a:hover { border-color: var(--accent); }

.article-hero { margin: clamp(2.4rem, 5vh, 4rem) auto clamp(3rem, 6vh, 5rem); }
.article-hero img { width: 100%; height: auto; display: block; max-height: 70vh; object-fit: cover; }

.article-body { max-width: 680px; margin: 0 auto; padding: 0 var(--gutter); }
.article-body p, .article-body ul, .article-body ol { font-family: var(--serif); font-weight: 400; font-size: clamp(1.05rem, 1.2vw, 1.2rem); line-height: 1.65; color: var(--text-mid); }
.article-body p { margin-bottom: 1.4rem; }
.article-body p:first-of-type::first-letter { font-family: var(--serif); font-weight: 300; font-size: 3.6em; line-height: 0.9; float: left; margin: 0.1em 0.1em 0 -0.05em; color: var(--accent); }
.article-body h2 { font-family: var(--serif); font-weight: 400; font-style: italic; font-size: clamp(1.5rem, 2.4vw, 1.9rem); line-height: 1.2; color: var(--text); margin: 3rem 0 1.2rem; }
.article-body a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--accent); transition: color 0.3s, border-color 0.3s; }
.article-body a:hover { color: var(--accent); }
.article-body strong { color: var(--text); font-weight: 500; }
.article-body em { font-style: italic; }
.article-body ul, .article-body ol { padding-left: 1.6rem; margin: 0 0 1.6rem; }
.article-body li { margin-bottom: 0.7rem; padding-left: 0.3rem; }

.stat-block { margin: clamp(2.4rem, 5vw, 3.6rem) 0; padding: clamp(2.2rem, 5vw, 3.2rem) clamp(1.6rem, 4vw, 2.6rem); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; }
.stat-block .figure { font-family: var(--serif); font-weight: 300; font-size: clamp(4.4rem, 11vw, 7.6rem); line-height: 0.95; color: var(--accent); letter-spacing: -0.02em; }
.stat-block .figure .pct { font-size: 0.5em; vertical-align: 0.32em; margin-left: 0.05em; }
.stat-block .label { font-family: var(--serif); font-style: italic; font-size: clamp(1.05rem, 1.5vw, 1.25rem); color: var(--text-mid); margin-top: 1.1rem; max-width: 40ch; margin-left: auto; margin-right: auto; }
.stat-block .src { font-size: 0.66rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--text-dim); margin-top: 1.2rem; }
.stat-block .src a { color: var(--text-dim); border-bottom: 1px solid var(--line); }
.stat-block .src a:hover { color: var(--accent); border-color: var(--accent); }

.chart { margin: clamp(2.4rem, 5vw, 3.6rem) 0; padding: clamp(1.8rem, 4vw, 2.4rem) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.chart figcaption { padding: 0; margin: 0 0 1.6rem; font-size: 0.66rem; font-weight: 500; letter-spacing: 0.24em; text-transform: uppercase; color: var(--text-dim); text-align: left; max-width: none; }
.chart .row { display: grid; grid-template-columns: 130px 1fr 90px; align-items: center; gap: clamp(0.8rem, 2vw, 1.4rem); margin-bottom: 0.85rem; }
.chart .row:last-of-type { margin-bottom: 0; }
.chart .row .label { font-size: 0.78rem; color: var(--text-mid); letter-spacing: 0.1em; text-transform: uppercase; }
.chart .bar { height: 14px; background: rgba(168, 139, 102, 0.10); position: relative; overflow: hidden; }
.chart .bar .fill { display: block; height: 100%; background: var(--accent); width: 0; transition: width 1.4s cubic-bezier(0.22, 1, 0.36, 1); }
.chart.visible .bar .fill { width: var(--w); }
.chart .row .num { font-family: var(--serif); font-size: clamp(0.95rem, 1.3vw, 1.1rem); color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.chart .caption { font-family: var(--serif); font-style: italic; font-size: 0.92rem; color: var(--text-dim); margin-top: 1.4rem; line-height: 1.45; }
@media (max-width: 540px) {
    .chart .row { grid-template-columns: 88px 1fr 64px; gap: 0.7rem; }
    .chart .row .label { font-size: 0.66rem; }
}

.pullquote { margin: clamp(2.6rem, 5vw, 4rem) 0; padding: 0 0 0 clamp(1.4rem, 3vw, 2.4rem); border-left: 2px solid var(--accent); }
.pullquote p { font-family: var(--serif); font-style: italic; font-weight: 300; font-size: clamp(1.4rem, 2.4vw, 1.9rem); line-height: 1.35; color: var(--text); margin: 0; }

.sources { max-width: 680px; margin: clamp(4rem, 8vh, 6rem) auto 0; padding: clamp(2rem, 4vw, 2.8rem) var(--gutter) 0; border-top: 1px solid var(--line); }
.sources h3 { font-size: 0.66rem; font-weight: 500; letter-spacing: 0.26em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 1.4rem; }
.sources ol { list-style: decimal; padding-left: 1.4rem; margin: 0; }
.sources li { font-size: 0.86rem; line-height: 1.55; color: var(--text-mid); margin-bottom: 0.7rem; padding-left: 0.3rem; }
.sources a { color: var(--text-mid); text-decoration: none; border-bottom: 1px solid var(--line); transition: color 0.3s, border-color 0.3s; }
.sources a:hover { color: var(--accent); border-color: var(--accent); }

.article-disclaimer { max-width: 680px; margin: clamp(2rem, 4vh, 3rem) auto 0; padding: 1.4rem var(--gutter); font-size: 0.78rem; font-style: italic; line-height: 1.5; color: var(--text-dim); }

.article-foot { max-width: var(--max-w); margin: clamp(3rem, 6vh, 5rem) auto 0; padding: clamp(3rem, 6vh, 5rem) var(--gutter); border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 1.5rem; }
.article-foot .label { font-size: 0.66rem; font-weight: 500; letter-spacing: 0.24em; text-transform: uppercase; color: var(--text-dim); }
.article-foot a { font-family: var(--serif); font-weight: 300; font-size: clamp(1.3rem, 2.2vw, 1.7rem); color: var(--text); transition: color 0.3s, gap 0.3s; display: inline-flex; align-items: center; gap: 0.6rem; }
.article-foot a:hover { color: var(--accent); gap: 0.9rem; }
