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

:root {
    --ink: #111111;
    --ink-soft: #3a3a3a;
    --muted: #6b6b6b;
    --paper: #fafaf7;
    --paper-warm: #f3efe7;
    --line: #e8e4dc;
    --accent: #c84e1e;
    --accent-soft: #f6e1d6;
    --rice-blue: #00205B;
    --rice-blue-soft: #e6ecf5;
    --green: #2f7d4f;
    --green-soft: #d8ecd9;
    --gold: #b8860b;
    --gold-soft: #faf0d8;
    --shadow-sm: 0 1px 2px rgba(20,20,20,0.05);
    --shadow: 0 6px 24px rgba(20,20,20,0.07), 0 2px 6px rgba(20,20,20,0.04);
    --shadow-lg: 0 24px 48px rgba(20,20,20,0.12), 0 8px 16px rgba(20,20,20,0.06);
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.55;
    color: var(--ink);
    background: var(--paper);
    font-size: 17px;
}

.serif {
    font-family: 'Instrument Serif', Georgia, serif;
    font-weight: 400;
    letter-spacing: -0.005em;
}

.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }

a {
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s, color 0.2s;
}
a:hover { border-bottom-color: var(--ink); }

/* --- Nav --- */
nav {
    position: sticky;
    top: 0;
    background: rgba(250, 250, 247, 0.85);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
    z-index: 100;
}

nav .container {
    max-width: 980px;
    margin: 0 auto;
    padding: 1.35rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav .logo {
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.015em;
    color: var(--ink);
    border-bottom: none;
}

nav .logo .dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    background: var(--accent);
    border-radius: 50%;
    margin-right: 9px;
    transform: translateY(-2px);
    animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: translateY(-1px) scale(1); }
    50% { opacity: 0.5; transform: translateY(-1px) scale(0.85); }
}

nav ul { list-style: none; display: flex; gap: 1.75rem; align-items: center; }

nav a {
    color: var(--muted);
    font-size: 1rem;
    font-weight: 500;
    border-bottom: 1px solid transparent;
}
nav a:hover { color: var(--ink); border-bottom-color: var(--ink); }

.hamburger { display: none; flex-direction: column; background: transparent; border: none; cursor: pointer; padding: 0; z-index: 101; }
.hamburger span { width: 24px; height: 2px; background: var(--ink); margin: 3px 0; transition: 0.3s; border-radius: 2px; }
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(7px, 7px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(6px, -6px); }

/* --- Layout --- */
.container { max-width: 980px; margin: 0 auto; padding: 0 1.5rem; }
section { padding: 4.5rem 0; }

/* --- Project page hero --- */
.page-hero { padding: 4rem 0 3rem; }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 2rem;
    transition: color 0.2s, gap 0.2s;
    border-bottom: none;
}
.back-link:hover { color: var(--ink); gap: 0.6rem; border-bottom: none; }

.page-hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    line-height: 1.05;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 0.8rem;
}

.page-hero .tagline {
    font-size: 1.15rem;
    color: var(--ink-soft);
    max-width: 700px;
    margin-bottom: 1.5rem;
}

.page-hero .meta { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.5rem; }

.hero-image {
    width: 100%;
    border-radius: 18px;
    overflow: hidden;
    background: #1a1a1a;
    margin-top: 2rem;
    box-shadow: var(--shadow);
    aspect-ratio: 16 / 9;
}
.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* --- Tags --- */
.tag {
    display: inline-flex;
    align-items: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-weight: 500;
    letter-spacing: 0.02em;
}
.tag.done { background: var(--green-soft); color: var(--green); }
.tag.wip { background: #fff3d6; color: #92590e; }
.tag.award { background: var(--accent-soft); color: var(--accent); }
.tag.gold { background: var(--gold-soft); color: var(--gold); }
.tag.neutral { background: var(--paper-warm); color: var(--ink-soft); }

/* --- Award banner --- */
.award-banner {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.2rem;
    align-items: center;
    padding: 1.5rem 1.8rem;
    margin: 2.5rem 0;
    background: linear-gradient(135deg, #fff7eb 0%, var(--gold-soft) 100%);
    border: 1px solid #f0d68a;
    border-radius: 16px;
}
.award-banner .trophy { font-size: 2.5rem; line-height: 1; }
.award-banner h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.2rem; color: var(--ink); }
.award-banner p { font-size: 0.92rem; color: var(--ink-soft); line-height: 1.5; }

/* --- Content --- */
.content { padding: 2rem 0 4rem; }
.content h2 {
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 3rem 0 1rem;
    color: var(--ink);
}
.content h2:first-child { margin-top: 0; }
.content h2 .serif { color: var(--muted); font-size: 0.85em; }
.content h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 1.8rem 0 0.6rem;
    color: var(--ink);
}
.content h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 1.4rem 0 0.5rem;
    color: var(--ink);
}
.content p {
    margin-bottom: 1.1rem;
    color: var(--ink-soft);
    line-height: 1.7;
    font-size: 1rem;
}
.content ul, .content ol {
    margin: 0.5rem 0 1.2rem 1.5rem;
    color: var(--ink-soft);
}
.content li { margin-bottom: 0.5rem; line-height: 1.6; }
.content strong { color: var(--ink); font-weight: 600; }

/* --- Stat boxes --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}
.stat-box {
    background: white;
    padding: 1.4rem 1.2rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    text-align: left;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}
.stat-box:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: var(--ink-soft);
}
.stat-box .number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--ink);
    display: block;
    letter-spacing: -0.03em;
}
.stat-box .label { color: var(--muted); font-size: 0.82rem; margin-top: 0.3rem; line-height: 1.3; }
.stat-box .sublabel { color: var(--muted); font-size: 0.72rem; margin-top: 0.4rem; font-family: 'JetBrains Mono', monospace; }

/* --- Highlight box --- */
.highlight-box {
    background: white;
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    padding: 1.4rem 1.6rem;
    border-radius: 10px;
    margin: 2rem 0;
}
.highlight-box h3 { margin-top: 0; margin-bottom: 0.5rem; }
.highlight-box p:last-child { margin-bottom: 0; }

/* --- Mission box --- */
.mission-box {
    background: var(--ink);
    color: white;
    padding: 1.8rem 2rem;
    border-radius: 16px;
    margin: 2rem 0;
}
.mission-box .label {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: rgba(255,255,255,0.55);
    margin-bottom: 0.6rem;
}
.mission-box p {
    font-size: 1.12rem;
    color: white;
    margin: 0;
    line-height: 1.55;
}

/* --- Images --- */
.image-container { margin: 2rem 0; text-align: center; }
.image-container img {
    width: 100%;
    border-radius: 14px;
    box-shadow: var(--shadow);
    display: block;
    background: var(--paper-warm);
    transition: transform 0.5s, box-shadow 0.5s;
}
.image-container:hover img {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.image-caption {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 1rem;
    color: var(--muted);
    margin-top: 0.7rem;
}
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}
.two-col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
}

/* --- Table --- */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 1.5rem 0;
    background: white;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    font-size: 0.95rem;
}
th, td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--line);
    color: var(--ink-soft);
}
th {
    background: var(--paper-warm);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--ink);
}
tr:last-child td { border-bottom: none; }
tr:hover { background: var(--paper); }
td.num { font-family: 'JetBrains Mono', monospace; text-align: right; color: var(--ink); }
tr.total td { font-weight: 700; background: var(--paper-warm); color: var(--ink); }

/* --- Timeline --- */
.timeline {
    position: relative;
    margin: 2rem 0;
    padding-left: 1.5rem;
    border-left: 2px solid var(--line);
}
.timeline-item {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 1.6rem;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.95rem;
    top: 0.4rem;
    width: 11px;
    height: 11px;
    background: var(--paper);
    border: 2px solid var(--accent);
    border-radius: 50%;
}
.timeline-item.done::before { background: var(--accent); }
.timeline-item h4 { font-size: 1rem; font-weight: 600; color: var(--ink); margin: 0 0 0.25rem; }
.timeline-item p { font-size: 0.92rem; margin-bottom: 0; }
.timeline-item .date {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: var(--muted);
    margin-bottom: 0.25rem;
}

/* --- Section eyebrow --- */
.section-eyebrow {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

/* --- CTA row --- */
.cta-row { display: flex; flex-wrap: wrap; gap: 0.7rem; margin: 1.5rem 0; }
.cta-row a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.1rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    background: white;
    transition: transform 0.2s, background 0.2s, color 0.2s, border-color 0.2s;
}
.cta-row a:hover {
    transform: translateY(-2px);
    background: var(--ink);
    border-color: var(--ink);
    color: white;
    border-bottom: 1px solid var(--ink);
}

/* --- Reveal --- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* --- Footer --- */
footer {
    border-top: 1px solid var(--line);
    padding: 1.8rem 0;
    color: var(--muted);
    font-size: 0.85rem;
}
footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

/* --- Mobile --- */
@media (max-width: 768px) {
    body { font-size: 16px; }
    section { padding: 3rem 0; }
    .page-hero { padding: 2.5rem 0 2rem; }
    .page-hero h1 { font-size: 2rem; }
    nav ul {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: var(--paper);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        padding: 1.5rem 0;
        gap: 1rem;
        border-bottom: 1px solid var(--line);
        box-shadow: 0 6px 12px rgba(0,0,0,0.05);
    }
    nav ul.active { left: 0; }
    .hamburger { display: flex; }
    .two-col-grid { grid-template-columns: 1fr; }
    .award-banner { grid-template-columns: 1fr; text-align: center; }
    .award-banner .trophy { margin: 0 auto; }
}
