/* Shared foundation for every public page: design tokens, fonts, base elements, nav, footer and
   the few components used on more than one page. Page-specific rules live in each app's own CSS.
   Dark theme only, by design (issue #97). */

@font-face {
    font-family: "Archivo";
    src: url("../fonts/archivo-latin-wght.cd56e2ec63d7.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "JetBrains Mono";
    src: url("../fonts/jetbrains-mono-latin-wght.b058178d7f30.woff2") format("woff2");
    font-weight: 100 800;
    font-style: normal;
    font-display: swap;
}

:root {
    color-scheme: dark;
    --ground: #0e1318;
    --stage: #10171d;
    --panel: #151c23;
    --line: #26313c;
    --line-strong: #3a4856;
    --text: #e8ecf0;
    --text-soft: #c9d1d9;
    --muted: #9aa7b4;
    --node: #6cb6ff;
    --accent: #f5a524;
    --font-body: "Archivo", "Helvetica Neue", Arial, sans-serif;
    --font-mono: "JetBrains Mono", Menlo, Consolas, monospace;
    --page-width: 1180px;
    --gutter: 24px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--ground);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
}

h1,
h2,
h3,
p {
    margin: 0;
}

h1,
h2,
h3 {
    font-weight: 800;
    letter-spacing: -0.01em;
    text-wrap: balance;
}

img {
    max-width: 100%;
}

a {
    color: var(--text);
}

a:hover {
    color: #ffffff;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    padding: 12px 16px;
    background: var(--accent);
    color: var(--ground);
    font-weight: 600;
    z-index: 10;
}

.skip-link:focus {
    left: 8px;
    top: 8px;
    color: var(--ground);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* Page column */
.site {
    max-width: calc(var(--page-width) + 2 * var(--gutter));
    margin: 0 auto;
    padding: 0 var(--gutter) 40px;
    display: flex;
    flex-direction: column;
    gap: 56px;
}

/* Flex children default to min-width: auto, which lets wide content push the page sideways. */
.site > * {
    min-width: 0;
}

/* Nav */
.site-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    padding: 22px 0;
    border-bottom: 1px solid var(--line);
}

.site-brand {
    font-weight: 800;
    font-size: 18px;
    letter-spacing: 0.02em;
    text-decoration: none;
}

.site-nav-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 28px;
    font-size: 15px;
}

.site-nav-links a {
    text-decoration: none;
    padding: 12px 0;
}

.site-nav-links a:hover {
    color: var(--accent);
}

.site-nav-links a.btn {
    padding: 11px 18px;
}

/* Second row of links for a section of the site (films) */
.subnav {
    display: flex;
    flex-wrap: wrap;
    gap: 0 20px;
    margin-top: -40px;
    font-family: var(--font-mono);
    font-size: 13px;
}

.subnav a {
    color: var(--muted);
    text-decoration: none;
    padding: 10px 0;
}

.subnav a:hover {
    color: var(--accent);
}

.subnav span {
    padding: 10px 0;
    color: var(--line-strong);
}

/* Footer */
.site-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 32px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
    font-size: 15px;
}

.site-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0 28px;
}

.site-footer-links a {
    padding: 12px 0;
}

.site-footer-note {
    flex: 1 1 100%;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 12px;
}

/* Shared components */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    border: 1px solid var(--line-strong);
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
}

.btn:hover {
    border-color: var(--node);
}

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--ground);
}

.btn-primary:hover {
    color: var(--ground);
    border-color: var(--accent);
    filter: brightness(1.08);
}

.btn-outline {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-small {
    gap: 8px;
    padding: 11px 18px;
}

.mono-label {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.section-title {
    font-size: 30px;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    padding: 28px;
}

.page-title {
    font-size: clamp(36px, 5vw, 56px);
    line-height: 1.02;
    letter-spacing: -0.02em;
}

.section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0 24px;
}

.section-more {
    padding: 12px 0;
    color: var(--accent);
    font-weight: 600;
}

.lede {
    color: var(--text-soft);
    max-width: 68ch;
}

/* Project rows: year, title, one line, language */
.rows {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid var(--line);
}

.row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 24px;
    padding: 16px 0;
    border-top: 1px solid var(--line);
    text-decoration: none;
}

.row:hover .row-title {
    color: var(--accent);
}

.row-year {
    flex: 0 0 48px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--muted);
}

.row-title {
    flex: 1 1 200px;
    font-size: 18px;
    font-weight: 600;
}

.row-desc {
    flex: 3 1 360px;
    color: var(--muted);
}

.row-lang {
    flex: 0 0 104px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--node);
}

/* Admin-authored rich text (CKEditor output) */
.rich {
    color: var(--text-soft);
    max-width: 75ch;
}

.rich p,
.rich ul,
.rich ol {
    margin: 0 0 1em;
}

.rich > :last-child {
    margin-bottom: 0;
}

.rich a {
    color: var(--node);
}

.rich a:hover {
    color: var(--accent);
}

.rich img {
    height: auto;
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}
