/* === FONTS ===
   Loaded via <link> in base.html, not @import — an @import here would hide the
   font request behind CSS parsing and delay first paint. */

/* === VARIABLES === */
:root {
    --bg: #efe7d6;
    --text: #211d16;
    --text-soft: #4c4636;
    --text-muted: #5c5545;
    --text-faint: #8a8168;
    --text-faint-2: #a8968a;
    --accent: #a8632c;
    --accent-soft: #c98a4e;
    --green: #2f9e5f;
    --border: rgba(33, 29, 22, .2);
    --border-soft: rgba(33, 29, 22, .14);
    --border-strong: rgba(33, 29, 22, .28);
    --font-serif: 'Instrument Serif', Georgia, serif;
    --font-sans: 'Archivo', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

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

body {
    background-color: var(--bg);
    font-family: var(--font-sans);
    color: var(--text);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-size: 1rem;
    line-height: 1.7;
    margin: 0;
    padding: 0;
}

.page-wrap {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 40px;
    width: 100%;
}

main {
    flex: 1;
}

main:focus {
    outline: none;
}

/* === FOCUS & SKIP LINK === */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 2px;
}

.skip-link {
    position: absolute;
    left: 12px;
    top: -100px;
    z-index: 100;
    background: var(--text);
    color: var(--bg);
    font: 600 14px/1 var(--font-sans);
    padding: 12px 18px;
    border-radius: 2px;
    transition: top .15s;
}

.skip-link:focus {
    top: 12px;
    color: var(--bg);
}

/* Available to screen readers, invisible on screen. Used for the chart data
   tables, which are the accessible alternative to the SVGs. */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: 400;
    color: var(--text);
    line-height: 1;
    margin: 0 0 1rem;
}

h1 { font-size: 4.2rem; letter-spacing: -.01em; }

p {
    line-height: 1.7;
    color: var(--text-soft);
}

a {
    color: var(--accent);
    text-decoration: none;
}

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

.italic-accent {
    font-style: italic;
    color: var(--accent);
}

/* === NAVBAR === */
.site-nav {
    border-bottom: 1px solid var(--border-soft);
}

.site-nav .nav-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 24px 40px;
    row-gap: 10px;
}

.brand {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font: italic 400 23px/1 var(--font-serif);
    color: var(--text);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 34px;
    align-items: center;
}

.nav-link {
    background: none;
    border: none;
    cursor: pointer;
    font: 500 12px/1 var(--font-sans);
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: 0;
    color: var(--text-muted);
    text-decoration: none;
    transition: color .15s;
}

.nav-link:hover {
    color: var(--accent) !important;
}

.nav-link.active {
    color: var(--text);
}

/* === PAGE HEADER (shared across Experience / Projects / Translations) === */
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 34px;
    padding-top: 48px;
}

.page-head h1 {
    font-size: 4.25rem;
    line-height: .98;
    margin: 0;
}

.page-head p {
    margin: 0 0 8px;
    font-size: .95rem;
    line-height: 1.6;
    color: var(--text-muted);
    max-width: 40ch;
    text-align: right;
}

.kicker {
    font: 600 12px/1 var(--font-sans);
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 22px;
}

.eyebrow {
    font: 600 11px/1 var(--font-sans);
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.eyebrow-tight { margin-bottom: 4px; }
.eyebrow-section { margin-bottom: 18px; }

/* === ERROR PAGES === */
.error-page {
    padding-top: 72px;
    padding-bottom: 90px;
}

.error-headline {
    font-size: 3.4rem;
    max-width: 20ch;
}

.error-lede {
    margin: 22px 0 0;
    font-size: 1.02rem;
    max-width: 46ch;
    color: var(--text-soft);
}

.error-lede a {
    border-bottom: 1px solid var(--accent);
    padding-bottom: 1px;
}

.error-lede a:hover {
    border-bottom-color: var(--text);
}

/* === HOME / HERO === */
.hero {
    display: grid;
    grid-template-columns: .78fr 1fr;
    gap: 56px;
    padding: 52px 0 68px;
    align-items: start;
}

.hero-photo img {
    display: block;
    width: 100%;
    aspect-ratio: .82 / 1;
    object-fit: cover;
    object-position: center 16%;
    border-radius: 3px;
}

.hero-photo-caption {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font: 400 12.5px/1 var(--font-sans);
    color: var(--text-muted);
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border-soft);
}

.hero h1 {
    font-size: 4.5rem;
    line-height: .96;
    margin-bottom: 22px;
}

.hero-lede {
    margin: 0 0 30px;
    font-size: 1.06rem;
    line-height: 1.7;
    color: var(--text-soft);
    max-width: 48ch;
}

.hero-ctas {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 36px;
}

.btn-solid {
    display: inline-block;
    font: 600 14px/1 var(--font-sans);
    background: var(--text);
    color: var(--bg);
    padding: 15px 26px;
    border-radius: 2px;
    text-decoration: none;
}

.btn-solid:hover {
    color: var(--bg);
    opacity: .88;
}

.btn-text {
    font: italic 400 17px/1 var(--font-serif);
    color: var(--text-muted);
    text-decoration: none;
}

.btn-text:hover {
    color: var(--accent);
}

.recent-list a {
    display: flex;
    align-items: baseline;
    gap: 16px;
    padding: 15px 0;
    border-top: 1px solid var(--border-strong);
    text-decoration: none;
    color: inherit;
}

.recent-date {
    font: italic 400 20px/1 var(--font-serif);
    color: var(--accent);
    width: 56px;
    flex: none;
}

.recent-role {
    flex: 1;
    font: 600 15px/1.3 var(--font-sans);
    color: var(--text);
}

.recent-role span {
    font-weight: 400;
    color: var(--text-muted);
}

/* === EXPERIENCE TIMELINE === */
.timeline {
    margin-top: 0;
}

.timeline-entry {
    border-top: 1px solid var(--border);
}

.timeline-entry:last-child {
    border-bottom: 1px solid var(--border);
}

.timeline-header {
    background: none;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
    display: grid;
    grid-template-columns: 190px 1fr auto;
    gap: 30px;
    align-items: center;
    padding: 24px 0;
    font-family: var(--font-sans);
    color: var(--text);
}

.timeline-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.timeline-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 4px;
}

.timeline-header-dates {
    font: italic 400 15px/1.2 var(--font-serif);
    color: var(--accent);
}

.timeline-header-mid {
    text-align: left;
}

.timeline-company {
    font: 400 24px/1.1 var(--font-serif);
    color: var(--text);
}

.timeline-role {
    font: 600 14px/1 var(--font-sans);
    color: var(--text-muted);
}

.timeline-summary {
    display: block;
    margin-top: 4px;
    font: 400 14px/1.5 var(--font-sans);
    color: var(--text-muted);
}

.timeline-sign {
    font: 400 22px/1 var(--font-serif);
    color: var(--accent);
}

/* Collapsed/expanded via grid rows rather than display:none, so the change can
   animate and multiple entries can stay open at once. */
.timeline-body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .28s ease;
}

.timeline-entry.open > .timeline-body {
    grid-template-rows: 1fr;
}

.timeline-body-inner {
    display: grid;
    grid-template-columns: 190px 1fr;
    gap: 30px;
    min-height: 0;
    overflow: hidden;
}

.timeline-entry.open .timeline-body-inner {
    padding-bottom: 30px;
}

.timeline-blurb {
    margin: 0 0 16px;
    font-size: .95rem;
    line-height: 1.7;
    color: var(--text-soft);
    max-width: 66ch;
}

.timeline-bullets {
    margin: 0 0 18px;
    padding-left: 20px;
}

.timeline-bullets li {
    font-size: .875rem;
    line-height: 1.7;
    color: var(--text-soft);
    margin-bottom: 6px;
    max-width: 64ch;
}

.tech-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tech-tag {
    font: 500 12px/1 var(--font-sans);
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 6px 11px;
    border-radius: 2px;
    white-space: nowrap;
}

/* === PROJECTS === */
.project-feature {
    display: block;
    width: 100%;
    text-decoration: none;
    color: inherit;
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 36px;
}

.project-feature-copy {
    padding: 36px 34px;
    text-align: left;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font: 600 11px/1 var(--font-sans);
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 18px;
}

.status-pill-sentence {
    letter-spacing: .04em;
    text-transform: none;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    display: inline-block;
}

.project-feature-title {
    font: 400 34px/1.1 var(--font-serif);
    color: var(--text);
    margin-bottom: 12px;
}

.project-feature-copy p {
    margin: 0 0 22px;
    font-size: .95rem;
    line-height: 1.65;
    color: var(--text-soft);
}

.project-feature-link {
    display: inline-block;
    font: 600 13px/1 var(--font-sans);
    color: var(--accent);
    margin-top: 22px;
}

.project-feature-links {
    display: flex;
    flex-wrap: wrap;
    column-gap: 24px;
}

.project-feature-links .project-feature-link {
    text-decoration: none;
}

.project-feature-links .project-feature-link:hover {
    text-decoration: underline;
}

.project-feature-media {
    min-height: 250px;
    background-color: rgba(33, 29, 22, .035);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 34px;
    border-left: 1px solid var(--border);
}

/* The report's first page, cropped to its title block like a sheet on a desk. */
.meld-feature-media {
    padding: 30px 34px 0;
    align-items: flex-start;
    overflow: hidden;
}

.meld-feature-media img {
    display: block;
    width: min(100%, 360px);
    height: 230px;
    object-fit: cover;
    object-position: top;
    box-shadow: 0 4px 18px rgba(33, 29, 22, .12);
}

.amoki-feature-media {
    background: #f8eed8;
    padding: 22px 26px 0;
}

.amoki-preview {
    width: 100%;
    height: 100%;
    min-height: 270px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.amoki-preview-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #6e624d;
    font: 600 11px/1.2 var(--font-sans);
    letter-spacing: .04em;
}

.amoki-preview-brand img {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    box-shadow: 0 5px 12px rgba(71, 56, 31, .16);
}

.amoki-preview-screens {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 12px;
    padding-top: 18px;
}

.amoki-preview-screens img {
    width: min(38%, 142px);
    height: 232px;
    object-fit: cover;
    object-position: top;
    border: 4px solid #fff8e8;
    border-bottom: 0;
    border-radius: 17px 17px 0 0;
    box-shadow: 0 -2px 18px rgba(71, 56, 31, .14);
}

.amoki-preview-screens img:first-child {
    height: 252px;
}

.tr-preview {
    width: 100%;
}

.tr-preview-row {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.tr-preview-value {
    font: 400 32px/1 var(--font-serif);
    color: var(--text);
}

.tr-preview-label {
    font: 600 10px/1 var(--font-sans);
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-top: 8px;
}

.tr-preview-bars {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 70px;
}

.tr-preview-bar {
    flex: 1;
    background: var(--accent-soft);
    border-radius: 1px 1px 0 0;
}

.tr-preview-caption {
    margin-top: 14px;
    font: 500 11px/1.4 var(--font-mono);
    color: var(--text-faint);
    text-align: center;
}

.project-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    margin-bottom: 44px;
}

.project-card {
    display: block;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 24px;
    text-decoration: none;
    color: inherit;
}

.project-card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 8px;
}

.project-card-title {
    font: 400 24px/1.1 var(--font-serif);
    color: var(--text);
}

.project-card-year {
    font: 500 12px/1 var(--font-sans);
    color: var(--text-faint);
}

.project-card p {
    margin: 0 0 16px;
    font-size: .875rem;
    line-height: 1.65;
    color: var(--text-muted);
}

.project-card-link {
    font: 600 13px/1 var(--font-sans);
    color: var(--accent);
}

.project-card-span {
    grid-column: 1 / -1;
}

.project-card-bottom {
    margin-top: 22px;
}

.project-card-wide {
    grid-column: 1 / -1;
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.project-card-wide-body {
    padding: 24px 24px 20px;
}

.project-screenshots-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--border);
    border-top: 1px solid var(--border);
}

.project-screenshots-grid img {
    width: 100%;
    height: 210px;
    object-fit: cover;
    object-position: top;
    display: block;
}

.games-lede {
    margin: 0 0 18px;
    font-size: .8rem;
    line-height: 1.5;
    color: var(--text-faint);
    max-width: 60ch;
}

.games-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 22px;
}

.game-card {
    display: block;
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}

.game-card-media {
    position: relative;
    aspect-ratio: 16 / 9;
    background-image: repeating-linear-gradient(135deg, #e4dbc7, #e4dbc7 11px, #ded4be 11px, #ded4be 22px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-card-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.game-card-body {
    padding: 20px 22px;
}

.game-card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.game-card-title {
    font: 400 22px/1.1 var(--font-serif);
    color: var(--text);
}

.game-card-year {
    font: 500 12px/1 var(--font-sans);
    color: var(--text-faint);
}

.game-card p {
    margin: 8px 0 12px;
    font-size: .82rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.game-card-p-last {
    margin-bottom: 0;
}

.game-card-link {
    display: inline-block;
    font: 600 13px/1 var(--font-sans);
    color: var(--accent);
}

.project-card-wide-lede {
    max-width: 70ch;
    margin-bottom: 0;
}

.project-card-wide-body .tech-tags {
    margin-top: 14px;
}

/* === CONTACT === */
/* The page is intentionally short; centring it in the available height makes the
   whitespace read as deliberate instead of like a truncated page. */
.contact-hero {
    padding: 80px 0 90px;
    min-height: calc(100vh - 210px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.contact-hero h1 {
    font-size: 4.6rem;
    line-height: .98;
    margin: 0 0 42px;
    max-width: 16ch;
}

.contact-list {
    list-style: none;
    margin: 0;
    padding: 0;
    width: min(100%, 620px);
    border-top: 1px solid var(--border-soft);
}

.contact-list li {
    border-bottom: 1px solid var(--border-soft);
}

.contact-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    align-items: baseline;
    gap: 24px;
    padding: 18px 0;
    color: inherit;
    text-decoration: none;
}

.contact-label {
    font: 600 11px/1 var(--font-sans);
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.contact-value {
    font: 400 22px/1.25 var(--font-serif);
    color: var(--text);
    overflow-wrap: anywhere;
    transition: color .18s ease;
}

.contact-row:hover .contact-value,
.contact-row:focus-visible .contact-value {
    color: var(--accent);
}

.contact-row:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

/* === FOOTER === */
.site-footer {
    border-top: 1px solid var(--border-soft);
    margin-top: auto;
    background-color: var(--bg);
    padding: 0;
}

.site-footer .footer-inner {
    max-width: 1080px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 26px 40px;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-brand {
    font: italic 400 18px/1 var(--font-serif);
    color: var(--text);
}

.footer-contact {
    font: 400 13px/1 var(--font-sans);
    color: var(--text-faint);
}

.footer-meta {
    display: flex;
    align-items: center;
    gap: 16px;
}

.footer-copyright {
    font: 400 12px/1 var(--font-mono);
    color: var(--text-faint-2);
}

/* === BLINKING CURSOR === */
.blink-cursor {
    display: inline-block;
    width: .5em;
    height: .95em;
    background-color: var(--accent);
    margin-left: .1em;
    vertical-align: text-bottom;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Once typing finishes the cursor stops competing for attention. */
.blink-cursor-done {
    animation: none;
    opacity: .35;
}

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }

    .blink-cursor {
        animation: none;
        opacity: .35;
    }
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
    .hero,
    .project-grid,
    .project-feature,
    .project-screenshots-grid {
        grid-template-columns: 1fr;
    }

    .page-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-head p {
        text-align: left;
    }

    .timeline-header,
    .timeline-body-inner {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .contact-hero {
        min-height: 0;
        display: block;
    }
}

@media (max-width: 640px) {
    .page-wrap { padding: 0 20px; }
    .site-nav .nav-inner { padding: 18px 20px; }
    .nav-links { gap: 18px; }
    h1, .hero h1, .page-head h1, .contact-hero h1, .error-headline { font-size: 2.4rem; }
    .site-footer .footer-inner { padding: 20px; }
    .contact-row { grid-template-columns: 96px 1fr; gap: 12px; }

    /* At full width the portrait's .82/1 ratio ran ~820px tall, pushing the
       name, tagline and CTAs off the first screen entirely. */
    .hero {
        gap: 28px;
        padding: 28px 0 48px;
    }

    .hero-photo img {
        aspect-ratio: 4 / 3;
        max-height: 38vh;
        object-position: center 22%;
    }

    .error-page {
        padding-top: 40px;
        padding-bottom: 60px;
    }
}
