/* ---------- Tokens ---------- */
:root {
    --bg: #EDF0F2;
    --surface: #FFFFFF;
    --text: #18202B;
    --muted: #556070;
    --rule: #C9D0D8;
    --accent: #5B3FA8;
    --accent-text: #FFFFFF;
    --status: #9C4A0C;
    --footer-bg: #18202B;
    --footer-text: #EDF0F2;
    --footer-muted: #B9C2CE;

    --font: 'Schibsted Grotesk', 'Helvetica Neue', Arial, sans-serif;
    --container: 1120px;
    --gutter: clamp(20px, 4vw, 32px);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #14171D;
        --surface: #1B1F27;
        --text: #E7EAEE;
        --muted: #A3ACB9;
        --rule: #333A46;
        --accent: #A58BEA;
        --accent-text: #14171D;
        --status: #E39A62;
        --footer-bg: #0E1014;
        --footer-text: #E7EAEE;
        --footer-muted: #A3ACB9;
    }
}

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

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 18px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
    margin: 0;
    line-height: 1.15;
}

p {
    margin: 0;
}

img {
    max-width: 100%;
    vertical-align: middle;
}

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

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

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

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding-left: var(--gutter);
    padding-right: var(--gutter);
}

.skip-link {
    position: absolute;
    left: 8px;
    top: -48px;
    padding: 8px 14px;
    background: var(--accent);
    color: var(--accent-text);
    border-radius: 6px;
    z-index: 10;
}

.skip-link:focus {
    top: 8px;
}

/* ---------- Header ---------- */
.site-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px 16px;
    padding-top: 24px;
    padding-bottom: 24px;
}

.wordmark {
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0 28px;
    font-size: 16px;
    font-weight: 500;
}

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

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

/* ---------- Hero ---------- */
.hero {
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding-top: clamp(40px, 8vw, 72px);
    padding-bottom: clamp(72px, 10vw, 112px);
}

.hero h1 {
    font-size: clamp(52px, 10vw, 96px);
    line-height: 0.98;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.hero-lead {
    font-size: clamp(24px, 3.4vw, 34px);
    line-height: 1.25;
    font-weight: 500;
    max-width: 24ch;
}

.hero-sub {
    color: var(--muted);
    max-width: 46ch;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.button {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 0 24px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
}

.button-primary {
    background: var(--accent);
    color: var(--accent-text);
}

.button-primary:hover {
    background: var(--text);
    color: var(--bg);
}

.button-secondary {
    border: 2px solid var(--text);
    color: var(--text);
}

.button-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.hero-links {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 16px;
}

.hero-links img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.hero-links a {
    padding: 10px 0;
}

/* ---------- Sections ---------- */
.section {
    padding: clamp(64px, 9vw, 96px) 0;
}

.section-surface {
    background: var(--surface);
}

.section-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: clamp(32px, 5vw, 56px);
}

.section-header h2,
.site-footer h2 {
    font-size: clamp(34px, 5vw, 44px);
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.section-header p {
    color: var(--muted);
    max-width: 52ch;
}

/* ---------- Projects ---------- */
.project-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
    gap: 48px;
}

.project {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-top: 28px;
    border-top: 1px solid var(--rule);
}

.project h3 {
    font-size: clamp(24px, 3vw, 28px);
    font-weight: 700;
}

.project-status {
    font-size: 15px;
    font-weight: 600;
    color: var(--status);
}

.project-tech {
    font-size: 16px;
    color: var(--muted);
}

.project-link {
    align-self: flex-start;
    padding: 10px 0;
    font-weight: 600;
}

/* Used once media is added back to a project */
.project-media {
    margin: 0 0 8px;
    aspect-ratio: 4 / 3;
    border-radius: 8px;
    overflow: hidden;
    background: var(--rule);
}

.project-media img,
.project-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ---------- Experience ---------- */
.timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 36px;
}

.timeline li {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 40px;
}

.timeline-dates {
    flex: 0 0 200px;
    color: var(--muted);
    font-size: 16px;
    font-variant-numeric: tabular-nums;
}

.timeline li > div {
    flex: 1 1 420px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.timeline h3 {
    font-size: 22px;
    font-weight: 700;
}

.timeline li p:not(.timeline-dates) {
    max-width: 60ch;
}

/* ---------- Footer ---------- */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: clamp(56px, 8vw, 80px) 0;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 32px;
}

.footer-inner > div:first-child {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-inner p {
    color: var(--footer-muted);
    max-width: 44ch;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0 28px;
    font-size: 17px;
    font-weight: 600;
}

.footer-links a {
    color: var(--footer-text);
    padding: 10px 0;
}

.footer-links a:hover {
    color: var(--footer-muted);
}
