/* Styles for the /projects/ archive and case-study pages.
   Same void/amber language as the homepage, minus its WebGL background and
   global effects, so these pages stay light. Tokens come from tokens.css. */

* { box-sizing: border-box; }

html { scroll-padding-top: 84px; }

body {
    margin: 0;
    background: var(--color-void-black);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 1.02rem;
    line-height: 1.65;
}

img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
a:focus-visible, button:focus-visible, video:focus-visible, summary:focus-visible {
    outline: 2px solid var(--color-pure-white);
    outline-offset: 3px;
}

.wrap { width: min(1180px, calc(100vw - 32px)); margin: 0 auto; }

.skip-link { position: absolute; left: 12px; top: -60px; padding: 10px 14px; background: #000; border: 1px solid var(--line-strong); border-radius: 8px; z-index: 50; }
.skip-link:focus { top: 12px; }

/* ---------- header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    border-bottom: 1px solid var(--line);
    background: rgba(0, 0, 0, 0.86);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; min-height: 68px; flex-wrap: wrap; padding: 8px 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 8px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 2px; }
.nav-links a {
    padding: 9px 11px;
    border-radius: 8px;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 600;
    text-decoration: none;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); background: rgba(255, 255, 255, 0.08); }
.nav-links .nav-cta { border: 1px solid rgba(255, 255, 255, 0.5); color: var(--ink); margin-left: 4px; }

/* ---------- type & shared bits ---------- */
h1, h2, h3 { font-family: var(--head); line-height: 1.1; margin: 0; }
h1 { font-size: clamp(2.2rem, 5.4vw, 3.8rem); font-weight: 600; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 600; }
h3 { font-size: 1.1rem; font-weight: 600; }

.eyebrow {
    margin: 0 0 14px;
    font-family: var(--pixel);
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
}
.lede { color: var(--muted); font-size: clamp(1.02rem, 1.5vw, 1.16rem); max-width: 62ch; margin: 18px 0 0; }
.muted { color: var(--muted); }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 22px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: var(--color-pure-white);
    color: #000;
    font-family: var(--head);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
}
.button:hover { opacity: 0.9; }
.button.ghost { background: transparent; color: var(--ink); }
.button.ghost:hover { border-color: var(--color-pure-white); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }

.tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 14px 0 0; padding: 0; list-style: none; }
.tags li {
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    font-size: 0.74rem;
    font-weight: 700;
}

.text-link { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.text-link:hover { text-decoration-color: var(--accent); }

main { padding: 56px 0 96px; }
section + section { margin-top: 72px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }

/* ---------- case study ---------- */
.breadcrumb { margin: 0 0 26px; font-size: 0.86rem; color: var(--muted); }
.breadcrumb a { color: var(--muted); }

.cs-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 40px; align-items: center; }
.cs-media { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #050505; }
.cs-media video, .cs-media img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #050505; }
.cs-media figcaption { padding: 10px 14px; font-size: 0.82rem; color: var(--muted); border-top: 1px solid var(--line); }

.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 48px 0 0; border: 1px solid var(--line); border-radius: 10px; }
.facts div { padding: 16px 18px; border-left: 1px solid var(--line); }
.facts div:first-child { border-left: 0; }
.facts dt { font-family: var(--pixel); font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 6px 0 0; font-weight: 600; font-size: 0.95rem; }

.cs-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.panel { padding: 24px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, 0.02); }
.panel h2 { font-size: 1.25rem; margin-bottom: 12px; }
.panel p { margin: 0; color: var(--muted); }
.panel p + p { margin-top: 12px; }

.checklist { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.checklist li { position: relative; padding-left: 22px; color: var(--muted); }
.checklist li::before { content: "▸"; position: absolute; left: 0; color: var(--accent); }
.checklist strong { color: var(--ink); font-weight: 600; }

/* a simple step diagram, drawn from facts stated in the copy */
.flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.flow li { position: relative; padding: 18px; border: 1px solid var(--line); border-radius: 10px; counter-increment: step; color: var(--muted); font-size: 0.95rem; }
.flow li::before { content: "0" counter(step); display: block; margin-bottom: 8px; font-family: var(--pixel); font-size: 0.7rem; color: var(--accent); }
.flow li strong { display: block; color: var(--ink); margin-bottom: 4px; }

.cs-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cs-nav a { display: block; padding: 18px 20px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; }
.cs-nav a:hover { border-color: var(--line-strong); }
.cs-nav span { display: block; font-size: 0.8rem; color: var(--muted); }
.cs-nav .next { text-align: right; }

.cta { padding: 36px; border: 1px solid var(--line-strong); border-radius: 12px; text-align: center; }
.cta p { color: var(--muted); max-width: 52ch; margin: 12px auto 0; }
.cta .actions { justify-content: center; }

/* ---------- archive ---------- */
.featured-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.featured-grid a { display: block; text-decoration: none; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.featured-grid a:hover { border-color: var(--line-strong); }
.featured-grid img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.featured-grid div { padding: 14px 16px 16px; }
.featured-grid p { margin: 6px 0 0; font-size: 0.86rem; color: var(--muted); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.filters button {
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font: 600 0.84rem var(--font-body);
    cursor: pointer;
}
.filters button:hover { color: var(--ink); border-color: var(--line-strong); }
.filters button[aria-pressed="true"] { background: var(--color-pure-white); border-color: var(--color-pure-white); color: #000; }

.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 0; padding: 0; list-style: none; }
.project-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: rgba(255, 255, 255, 0.02); }
.project-card[hidden] { display: none; }
.project-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #050505; }
.project-card .body { display: flex; flex-direction: column; flex: 1; padding: 16px 18px 18px; }
.project-card .kind { margin: 0 0 6px; font-family: var(--pixel); font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.project-card p { margin: 8px 0 0; color: var(--muted); font-size: 0.93rem; }
.project-card .links { display: flex; flex-wrap: wrap; gap: 4px 16px; line-height: 2; margin-top: auto; padding-top: 14px; font-size: 0.88rem; }
.empty { padding: 28px; border: 1px dashed var(--line-strong); border-radius: 10px; text-align: center; color: var(--muted); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: 0.88rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-footer a { color: var(--muted); display: inline-block; padding: 4px 0; }
.site-footer a:hover { color: var(--ink); }

/* ---------- responsive ---------- */
@media (max-width: 1020px) {
    .cs-hero { grid-template-columns: 1fr; }
    .featured-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .facts div:nth-child(3) { border-left: 0; }
    .facts div:nth-child(n + 3) { border-top: 1px solid var(--line); }
}

@media (max-width: 680px) {
    html { scroll-padding-top: 120px; }
    main { padding-top: 36px; }
    .nav-links { width: 100%; flex-wrap: nowrap; overflow-x: auto; }
    .nav-links a { padding: 8px 7px; font-size: 0.8rem; white-space: nowrap; }
    .nav-links .nav-cta { margin-left: 0; }
    .cs-grid, .featured-grid, .project-grid, .flow, .cs-nav { grid-template-columns: 1fr; }
    .cs-nav .next { text-align: left; }
    .panel, .cta { padding: 20px; }
    .actions .button { flex: 1 1 auto; }
}

/* phones: the sticky header would re-blur the content scrolling under it on every frame */
@media (pointer: coarse), (max-width: 680px) {
    .site-header { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(0, 0, 0, 0.94); }
}
