/* =============================================================
   Westwood Works — Design System Foundation
   -------------------------------------------------------------
   Shared structure for both design proposals (Atelier / Terminal).
   Colour, type and decorative tokens are defined per-proposal in
   proposal-atelier.css and proposal-terminal.css, scoped under
   [data-theme="…"]. This file owns layout, rhythm, components,
   responsiveness and accessibility — never raw colours.
   ============================================================= */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

body {
    font-family: var(--font-body);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

img { max-width: 100%; height: auto; display: block; }

/* === Skip link (a11y) === */
.skip-link {
    position: absolute;
    left: 0;
    top: -3rem;
    z-index: 200;
    background: var(--accent);
    color: var(--accent-contrast);
    padding: 0.6rem 1rem;
    border-radius: 0 0 var(--radius-md) 0;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-decoration: none;
    transition: top 0.15s ease;
}
.skip-link:focus { top: 0; outline: 2px solid var(--accent-strong); outline-offset: 2px; }

/* === Universal focus visibility === */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* === Typography === */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    line-height: 1.18;
    color: var(--text);
    text-wrap: balance;
}

h1 { font-size: clamp(2.2rem, 5vw, 3rem); letter-spacing: var(--display-tracking); }
h2 { font-size: clamp(1.5rem, 3vw, 1.85rem); margin-top: 2.5rem; margin-bottom: 0.9rem; letter-spacing: var(--display-tracking); }
h3 { font-size: 1.2rem; margin-top: 1.75rem; margin-bottom: 0.6rem; color: var(--accent-strong); }
h4 { font-size: 1rem; }

p { color: var(--text-muted); margin-bottom: 1rem; font-size: 1.0625rem; }

a { color: var(--link); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--link-hover); }

strong { font-weight: 600; color: var(--text); }

ul, ol { margin: 0.5rem 0 1rem 1.25rem; }
li { color: var(--text-muted); margin-bottom: 0.35rem; }

code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.15em 0.45em;
    color: var(--accent-strong);
}

hr { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }

pre {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.55;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    color: var(--text);
}
pre code { background: transparent; border: none; padding: 0; color: inherit; font-size: 1em; }

blockquote {
    margin: 1.5rem 0;
    padding: 0.4rem 1.25rem;
    border-left: 3px solid var(--accent);
    color: var(--text-muted);
    font-style: italic;
}

/* Eyebrow — the shared mono label used across both proposals */
.eyebrow {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent-strong);
    margin-bottom: 1rem;
}

/* === Layout === */
.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 1.5rem; }

main { flex: 1 0 auto; }

@media (min-width: 1024px) {
    .container { padding: 0 2rem; }
}

/* === Header === */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 60px;
    gap: 1rem;
}

.logo a {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: var(--logo-tracking);
}
.logo a:hover { color: var(--text); }
.logo-img { width: 28px; height: 28px; border-radius: 6px; transition: var(--transition); }
.logo a:hover .logo-img { transform: scale(1.06); }

.main-nav { display: flex; align-items: center; gap: 0.25rem; }

.main-nav > a {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-muted);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    letter-spacing: 0.02em;
}
.main-nav > a:hover { color: var(--text); background: var(--bg-surface); }
.main-nav > a.active { color: var(--accent-strong); border-color: var(--border); background: var(--bg-surface); }

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 0 9px;
}
.nav-toggle-bar { height: 2px; width: 100%; background: var(--text); border-radius: 2px; transition: var(--transition); }

/* CSS-only toggle: the hidden checkbox (sibling) drives the open state — zero JS */
.nav-toggle-cb { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.nav-toggle-cb:checked ~ .nav-toggle .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle-cb:checked ~ .nav-toggle .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle-cb:checked ~ .nav-toggle .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav-toggle-cb:focus-visible ~ .nav-toggle { outline: 2px solid var(--accent-strong); outline-offset: 2px; }

/* === Footer === */
.site-footer {
    flex-shrink: 0;
    margin-top: 5rem;
    padding: 3rem 0 2rem;
    border-top: 1px solid var(--border);
    background: var(--bg-surface);
}
.footer-main { display: grid; grid-template-columns: 2fr 1fr; gap: 3rem; margin-bottom: 2rem; }
.footer-brand-logo { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; }
.footer-logo-img { width: 22px; height: 22px; border-radius: 5px; opacity: 0.9; }
.footer-brand strong { font-family: var(--font-mono); font-size: 0.9rem; color: var(--text); }
.footer-brand p { font-size: 0.875rem; color: var(--text-muted); margin: 0; }
.footer-links { display: flex; gap: 3rem; }
.footer-column h4 {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}
.footer-column ul { list-style: none; margin: 0; }
.footer-column li { margin-bottom: 0.4rem; }
.footer-column a { font-size: 0.875rem; color: var(--text-muted); }
.footer-column a:hover { color: var(--accent-strong); }
.coming-soon { font-size: 0.7rem; color: var(--text-faint); font-family: var(--font-mono); }
.footer-bottom {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-faint);
    font-family: var(--font-mono);
}
.footer-bottom a { color: var(--text-faint); }
.footer-bottom a:hover { color: var(--accent-strong); }

/* === Bricks (sections) === */
.brick { padding: 4.5rem 0; }

/* --- Hero --- */
.brick-hero { padding: 6rem 0 5rem; position: relative; overflow: hidden; }
.hero-content { position: relative; z-index: 1; max-width: 680px; }
.hero-content h1 { margin-bottom: 1.25rem; }
.hero-content p { font-size: 1.18rem; color: var(--text-muted); max-width: 540px; margin-bottom: 0.5rem; }
.hero-content > p:last-of-type { margin-bottom: 2.25rem; }

/* Buttons (shared shape; colour comes from each proposal) */
.hero-content a,
.cta-content a {
    display: inline-flex;
    align-items: center;
    padding: 0.65rem 1.4rem;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    margin-right: 0.75rem;
    margin-bottom: 0.5rem;
    transition: var(--transition);
}
.hero-content a:hover, .cta-content a:hover { transform: translateY(-1px); }

/* --- About --- */
.brick-about h2 { margin-top: 0; }
.brick-about p { font-size: 1.0625rem; max-width: 720px; }

/* --- Values --- */
.values-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.values-grid > h2 { grid-column: 1 / -1; margin: 0 0 1.5rem; }
.value-card { display: flex; flex-direction: column; gap: 0.5rem; padding: 1.75rem 1.5rem; }
.value-card h3 { margin: 0; font-size: 0.95rem; }
.value-card p { margin: 0; font-size: 0.9rem; }

/* --- CTA --- (the .container becomes the visual card) */
.brick-cta .container { text-align: center; border-radius: var(--radius-lg); padding: 3.5rem 2rem; }
.cta-content { max-width: 620px; margin: 0 auto; }
.cta-content h2 { margin-top: 0; }
.cta-content p { margin-bottom: 1.75rem; }

/* --- Title (interior pages) --- */
.brick-title { padding: 4.5rem 0 3rem; position: relative; overflow: hidden; }
.brick-title .container { position: relative; z-index: 1; }
.brick-title h1 { margin-bottom: 0.6rem; }
.brick-title p { font-size: 1.18rem; color: var(--text-muted); max-width: 620px; }

/* --- Content / Projects / Contact --- */
.brick-content .container,
.brick-projects .container,
.brick-contact .container { max-width: 760px; }

.content-wrapper h2,
.projects-wrapper h2,
.contact-wrapper h2 {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    font-size: 1.4rem;
}
.content-wrapper h2:first-child,
.projects-wrapper h2:first-child,
.contact-wrapper h2:first-child { border-top: none; padding-top: 0; margin-top: 0; }

.content-wrapper ul, .projects-wrapper ul { list-style: none; margin: 0.5rem 0 1rem; }
.content-wrapper li, .projects-wrapper li {
    position: relative;
    padding-left: 1.5rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
}
.content-wrapper li::before, .projects-wrapper li::before {
    content: var(--list-marker, "–");
    position: absolute;
    left: 0;
    color: var(--accent-strong);
    font-family: var(--font-mono);
}

.contact-wrapper a { font-family: var(--font-mono); }

/* === Notes section === */
.notes-intro { max-width: 820px; margin: 0 auto; padding: 4.5rem 1.5rem 2rem; }
.notes-intro h1 { margin-bottom: 0.6rem; }
.notes-intro > p { color: var(--text-muted); font-size: 1.15rem; max-width: 620px; }

.note-list {
    list-style: none;
    max-width: 820px;
    margin: 1.5rem auto 5rem;
    padding: 0 1.5rem;
}
.note-list-item {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 1.75rem;
    padding: 1.75rem 0;
    border-top: 1px solid var(--border);
}
.note-list-item:last-child { border-bottom: 1px solid var(--border); }
.note-list-date {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-faint);
    letter-spacing: 0.04em;
    padding-top: 0.4rem;
}
.note-list-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    line-height: 1.3;
    margin: 0 0 0.5rem;
    letter-spacing: var(--display-tracking);
}
.note-list-title a { color: var(--text); }
.note-list-title a:hover { color: var(--accent-strong); }
.note-list-summary { margin: 0; color: var(--text-muted); font-size: 0.98rem; }

.note-header { max-width: 720px; margin: 0 auto; padding: 4.5rem 1.5rem 1.5rem; }
.note-crumb {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-faint);
    margin-bottom: 1.25rem;
    letter-spacing: 0.04em;
}
.note-crumb a { color: var(--text-faint); }
.note-crumb a:hover { color: var(--accent-strong); }
.note-header h1 { font-size: clamp(2rem, 4vw, 2.5rem); margin-bottom: 0.75rem; }
.note-meta {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-faint);
    letter-spacing: 0.04em;
}
.note-meta span + span::before { content: "·"; padding: 0 0.5rem; opacity: 0.5; }

.note-body { max-width: 720px; margin: 0 auto; padding: 1rem 1.5rem 3rem; }
.note-body h2 { margin-top: 2.75rem; font-size: 1.45rem; }
.note-body h3 { margin-top: 2rem; }
.note-body p, .note-body li { font-size: 1.0625rem; line-height: 1.7; }
.note-body ul, .note-body ol { padding-left: 1.25rem; }
.note-body a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

.note-back {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 1.5rem 5rem;
    border-top: 1px solid var(--border);
    text-align: center;
}
.note-back a {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
}
.note-back a:hover { color: var(--accent-strong); }

@media (max-width: 640px) {
    .note-list-item { grid-template-columns: 1fr; gap: 0.4rem; }
    .note-list-date { padding-top: 0; }
}

/* === Responsive === */
@media (max-width: 820px) {
    .nav-toggle { display: flex; }
    .main-nav {
        position: fixed;
        inset: 60px 0 auto 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
        padding: 1rem 1.5rem 1.5rem;
        background: var(--header-bg);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--border);
        transform: translateY(-130%);
        transition: transform 0.25s ease;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }
    .nav-toggle-cb:checked ~ .main-nav { transform: translateY(0); }
    .main-nav > a { padding: 0.75rem 0.5rem; font-size: 0.95rem; }
    .values-grid { grid-template-columns: 1fr; }
    .footer-main { grid-template-columns: 1fr; gap: 2rem; }
    .footer-bottom { flex-direction: column; gap: 0.5rem; }
    .brick-cta { padding: 2.5rem 1.5rem; }
}

/* Touch targets ≥ 44px on coarse pointers */
@media (pointer: coarse) {
    .main-nav > a { min-height: 44px; display: inline-flex; align-items: center; }
}
