/* Throndev portfolio — one stylesheet for every page.
   Soft structuralism: a silver-grey ground, bold grotesk type, and white
   surfaces set inside soft trays. No gradients anywhere. */

:root {
    --bg: #dfe2e5;
    --surface: #ffffff;
    --surface-2: #e6e7e6;
    --ink: #14171a;
    --muted: #57616a;
    --accent: #06656b;
    --accent-ink: #ffffff;
    --bright: #2fd0d4;
    --line: rgba(20, 23, 26, 0.09);
    --shell: rgba(20, 23, 26, 0.04);
    --rest: 0 1px 2px rgba(20, 23, 26, 0.05), 0 18px 36px -28px rgba(20, 23, 26, 0.22);
    --lifted: 0 2px 4px rgba(20, 23, 26, 0.05), 0 44px 70px -38px rgba(20, 23, 26, 0.38);

    --font-display: 'Cabinet Grotesk', 'Satoshi', system-ui, sans-serif;
    --font-text: 'Satoshi', system-ui, sans-serif;

    --step-small: 0.8125rem;
    --step-body: 0.9375rem;
    --step-lead: 1.0625rem;
    --step-title: 1.0625rem;
    --step-head: clamp(1.5rem, 1.2rem + 0.9vw, 1.875rem);
    --step-display: clamp(2rem, 1.4rem + 1.8vw, 2.875rem);

    --margin: clamp(16px, 3vw, 32px);
    --gutter: 16px;
    --page: min(1040px, 100% - 2 * var(--margin));
    --section: clamp(56px, 6vw, 88px);

    --r-shell: 0px;
    --r-core: 0px;

    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-spring: cubic-bezier(0.32, 0.72, 0, 1);
    --t-press: 140ms;
    --t-hover: 220ms;
    --t-reveal: 900ms;
}

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

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

body {
    margin: 0;
    min-height: 100dvh;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-text);
    font-size: var(--step-body);
    line-height: 1.6;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.04;
    text-wrap: balance;
}

a { color: inherit; text-decoration: none; }

::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 6px; }

[hidden] { display: none !important; }

.skip {
    position: absolute;
    left: var(--margin);
    top: -100px;
    z-index: 20;
    padding: 12px 18px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 700;
}
.skip:focus { top: 12px; }

/* ── Shared pieces ──────────────────────────────────────── */

.grid,
.cards,
.filters,
.panel,
.gallery,
.next,
.outro,
.footer {
    width: var(--page);
    margin-inline: auto;
}

.grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--gutter);
}

.section { padding-top: var(--section); }

.text-link {
    text-decoration: underline;
    text-decoration-color: var(--line);
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.25em;
    transition: color var(--t-hover) var(--ease-out), text-decoration-color var(--t-hover) var(--ease-out);
}
.text-link:hover { color: var(--accent); text-decoration-color: currentColor; }

/* Pill button; its arrow sits in a nested circle that moves on hover. */
.button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 5px 5px 5px 18px;
    border: 0;
    border-radius: 999px;
    background: var(--ink);
    color: var(--surface);
    font: inherit;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    transition: transform 500ms var(--ease-spring), background-color 500ms var(--ease-spring), color 500ms var(--ease-spring), box-shadow 500ms var(--ease-spring);
}
.button::after {
    content: '\2197';
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    font-size: 0.8125rem;
    font-weight: 500;
    transition: transform 600ms var(--ease-spring), background-color 500ms var(--ease-spring);
}
.button:hover { box-shadow: var(--lifted); }
.button:hover::after { transform: translate(3px, -3px) scale(1.06); background: var(--bright); color: #041011; }
.button:active { transform: scale(0.97); }

.button--ghost {
    background: var(--surface);
    box-shadow: inset 0 0 0 1px var(--line), var(--rest);
    color: var(--ink);
}
.button--ghost::after { background: rgba(20, 23, 26, 0.07); }
.button--ghost:hover { box-shadow: inset 0 0 0 1px var(--line), var(--lifted); }
.button--ghost:hover::after { background: var(--ink); color: var(--surface); }

/* A tray with the surface set inside it: outer shell, inner core, concentric corners. */
.bezel,
.card {
    padding: 5px;
    border-radius: var(--r-shell);
    background: var(--shell);
    box-shadow: inset 0 0 0 1px var(--line);
}
.bezel-core,
.card-core {
    height: 100%;
    overflow: hidden;
    border-radius: var(--r-core);
    background: var(--surface);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), var(--rest);
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips li {
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(20, 23, 26, 0.06);
    color: #4d565e;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.5;
}

/* ── Navigation: a floating pill ────────────────────────── */

.nav {
    position: sticky;
    top: 12px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(24px, 6vw, 88px);
    width: max-content;
    max-width: calc(100% - 2 * var(--margin));
    margin: 12px auto 0;
    padding: 5px 5px 5px 20px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.74);
    box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(255, 255, 255, 0.9), var(--rest);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    backdrop-filter: blur(20px) saturate(160%);
}
.wordmark { font-family: var(--font-display); font-weight: 800; font-size: 1.0625rem; letter-spacing: -0.01em; }

.nav-links { display: flex; align-items: center; gap: 22px; font-size: 0.875rem; font-weight: 500; }
.nav-links a:not(.button) {
    padding-block: 8px;
    color: var(--muted);
    transition: color 400ms var(--ease-spring);
}
.nav-links a:not(.button):hover,
.nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links .button { padding: 4px 4px 4px 14px; gap: 8px; }
.nav-links .button::after { width: 24px; height: 24px; }

/* ── Home: hero ─────────────────────────────────────────── */

.hero { align-items: center; row-gap: 48px; padding-top: clamp(40px, 5vw, 72px); }
.hero-copy { grid-column: 1 / 7; }
.hero-copy h1 { font-size: var(--step-display); line-height: 0.96; }
.hero-sub { margin-top: 12px; max-width: 44ch; font-size: var(--step-lead); line-height: 1.45; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 22px; }

.hero-media { grid-column: 7 / 13; }
.hero-media .bezel-core { position: relative; aspect-ratio: 16 / 10; background: #000; }
.hero-media video { width: 100%; height: 100%; object-fit: cover; }
.hero-caption {
    position: absolute;
    left: 14px;
    bottom: 14px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(7, 9, 12, 0.72);
    color: #ffffff;
    font-size: var(--step-small);
    font-weight: 500;
}

/* ── Section heads ──────────────────────────────────────── */

.section-head { align-items: end; row-gap: 18px; }
.section-head h2 { grid-column: 1 / 8; font-size: var(--step-head); }

.more { display: flex; justify-content: center; width: var(--page); margin: 28px auto 0; }

/* ── Cards ──────────────────────────────────────────────── */

.cards {
    display: grid;
    gap: 16px;
    margin-top: 24px;
}
.cards--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
    display: block;
    transition: transform 500ms var(--ease-spring), box-shadow 500ms var(--ease-spring);
}
.card-core { display: flex; flex-direction: column; }
.card:hover,
.card:focus-visible { transform: translateY(-8px); }
.card:hover .card-core,
.card:focus-visible .card-core { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), var(--lifted); }
.card-core { transition: box-shadow 700ms var(--ease-spring); }

.frame { overflow: hidden; background: var(--surface-2); }
.frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1100ms var(--ease-spring);
}
.card .frame { aspect-ratio: 16 / 10; flex: none; }
.cards--4 .card .frame { aspect-ratio: 5 / 4; }
.card:hover .frame img { transform: scale(1.06); }
.frame--blank {
    display: grid;
    place-items: center;
    padding: 18px;
    color: var(--muted);
    font-family: var(--font-display);
    font-size: var(--step-title);
    font-weight: 700;
    text-align: center;
}

.card-body { display: flex; flex-direction: column; flex: 1; padding: 14px 14px 16px; }
.card-body h2,
.card-body h3 { font-size: var(--step-title); line-height: 1.12; letter-spacing: -0.01em; }
.card-meta { margin-top: 8px; color: var(--accent); font-size: var(--step-small); font-weight: 500; }
.card-line { margin-top: 8px; margin-bottom: 14px; color: var(--muted); font-size: 0.875rem; line-height: 1.5; }
.card-body .chips { margin-top: auto; }

/* ── Home: about ────────────────────────────────────────── */

.about { grid-column: 1 / 13; }
.about .bezel-core {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 28px;
    align-items: center;
    padding: 28px;
}
.about img {
    width: 132px;
    aspect-ratio: 276 / 315;
    border-radius: 18px;
    object-fit: cover;
    image-rendering: pixelated;
}
.about h2 { font-size: var(--step-head); }
.about-text { margin-top: 12px; max-width: 62ch; font-size: var(--step-body); line-height: 1.6; color: var(--muted); }
.about .chips { margin-top: 18px; }
.about .chips li { padding: 4px 11px; color: var(--ink); }

/* ── Contact: a photograph and a card, the same size ────── */

.contact { align-items: center; row-gap: 40px; }
.contact-copy { grid-column: 1 / 6; }
.contact-copy h1,
.contact-copy h2 { font-size: var(--step-head); }
.contact-copy p { margin-top: 20px; max-width: 30ch; font-size: var(--step-lead); color: var(--muted); }

.contact-pair {
    grid-column: 6 / 13;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--gutter);
}
.contact-photos { position: relative; min-height: 100%; }
.contact-photos img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1600ms ease;
}
.contact-photos img.is-on { opacity: 1; }

.contact-card { display: flex; flex-direction: column; padding: 18px; }
.contact-card li { display: flex; flex-direction: column; padding-block: 8px; }
.contact-card li + li { border-top: 1px solid var(--line); }
.contact-card li span { color: var(--muted); font-size: var(--step-small); }
.contact-card li a { font-weight: 500; }
.contact-card .button { justify-content: space-between; margin-top: 22px; }

.contact--page { padding-top: clamp(40px, 5vw, 72px); }

/* ── Footer ─────────────────────────────────────────────── */

.footer {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 10px 24px;
    margin-top: var(--section);
    padding-block: 18px 22px;
    border-top: 1px solid var(--line);
    font-size: var(--step-small);
    color: var(--muted);
}
.footer nav { display: flex; gap: 24px; color: var(--ink); }
.footer nav a { transition: color var(--t-hover) var(--ease-out); }
.footer nav a:hover { color: var(--accent); }
.footer .year { text-align: right; }

/* ── Index pages: Work and Games ────────────────────────── */

.page-head { padding-top: clamp(40px, 5vw, 72px); row-gap: 12px; }
.page-head h1 { grid-column: 1 / 13; font-size: var(--step-display); line-height: 0.96; }
.page-head p { grid-column: 1 / 9; max-width: 52ch; font-size: var(--step-lead); color: var(--muted); }

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 24px;
}
.filters button {
    padding: 6px 14px;
    border: 0;
    border-radius: 999px;
    background: var(--surface);
    box-shadow: inset 0 0 0 1px var(--line);
    color: var(--muted);
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: color var(--t-hover) var(--ease-out), box-shadow var(--t-hover) var(--ease-out), transform var(--t-press) var(--ease-out);
}
.filters button:hover { color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.filters button:active { transform: scale(0.96); }
.filters button[aria-pressed="true"] { background: var(--ink); box-shadow: var(--rest); color: var(--surface); font-weight: 700; }

.filters + .cards { margin-top: 20px; }

.empty { width: var(--page); margin: 40px auto 0; color: var(--muted); }
.outro { margin-top: 40px; font-size: var(--step-lead); color: var(--muted); }
.outro a { color: var(--ink); }

/* ── Project page ───────────────────────────────────────── */

.project-top { padding-top: clamp(40px, 5vw, 72px); align-items: start; row-gap: 24px; }
.project-intro { grid-column: 1 / 13; }
.project-intro h1 { font-size: var(--step-display); line-height: 0.98; }
.project-intro .project-meta { margin-top: 16px; color: var(--accent); font-weight: 500; }
.project-lead {
    grid-column: 1 / 13;
    padding: 7px;
    border-radius: var(--r-shell);
    background: var(--shell);
    box-shadow: inset 0 0 0 1px var(--line);
}
.project-lead img,
.project-lead video { width: 100%; max-height: 60svh; border-radius: var(--r-core); object-fit: cover; background: #000; }
.project-summary { grid-column: 1 / 9; }
.project-summary .project-about { font-size: var(--step-lead); line-height: 1.45; max-width: 46ch; }
.project-summary .chips { margin-top: 22px; }
.project-links { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; margin-top: 30px; }

/* A portrait picture stands beside the text instead of above it. */
.project-top.is-tall .project-summary { grid-column: 1 / 7; grid-row: 2; }
.project-top.is-tall .project-lead { grid-column: 8 / 13; grid-row: 2; }
.project-top.is-tall .project-lead img { max-height: none; }

.project-body { align-items: start; row-gap: 32px; padding-top: 56px; }
.project-body h2,
.gallery h2 { font-size: var(--step-head); margin-bottom: 14px; }
.project-role { grid-column: 1 / 7; }
.project-role p { max-width: 62ch; color: var(--muted); }
.project-list { grid-column: 8 / 13; }
.project-list li { display: flex; gap: 12px; padding-block: 10px; }
.project-list li + li { border-top: 1px solid var(--line); }
.project-list li::before { content: ''; flex: none; width: 7px; height: 7px; margin-top: 0.62em; border-radius: 50%; background: var(--accent); }

.gallery { padding-top: 56px; }
.gallery-items { columns: 3 240px; column-gap: var(--gutter); }
.gallery-items > * { break-inside: avoid; margin-bottom: var(--gutter); overflow: hidden; border-radius: var(--r-core); background: var(--surface); }
.gallery-items img,
.gallery-items video { width: 100%; }
.gallery-items .embed { aspect-ratio: 16 / 9; }
.gallery-items .embed iframe { width: 100%; height: 100%; border: 0; }

.next {
    display: block;
    margin-top: 56px;
    padding: 24px;
    border-radius: var(--r-shell);
    background: var(--surface);
    box-shadow: inset 0 0 0 1px var(--line);
    transition: transform 600ms var(--ease-spring), box-shadow 600ms var(--ease-spring);
}
.next p { margin-top: 12px; color: var(--muted); }
.next h2 { font-size: var(--step-head); transition: color var(--t-hover) var(--ease-out); }
.next:hover { transform: translateY(-4px); box-shadow: inset 0 0 0 1px rgba(20, 23, 26, 0.4); }
.next:hover h2 { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
    .contact-photos img { transition: none; }
}

/* ── Narrower screens ───────────────────────────────────── */

@media (max-width: 1100px) {
    .cards--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cards--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hero-copy { grid-column: 1 / 13; }
    .hero-media { grid-column: 1 / 13; }
    .contact-copy,
    .contact-pair { grid-column: 1 / 13; }
}

@media (max-width: 900px) {
    .section-head h2,
    .section-head .section-side,
    .page-head p { grid-column: 1 / 13; justify-self: start; }

    .project-summary,
    .project-role,
    .project-list { grid-column: 1 / 13; }
    .project-top.is-tall .project-summary,
    .project-top.is-tall .project-lead { grid-column: 1 / 13; grid-row: auto; }
}

@media (max-width: 640px) {
    .nav { width: auto; margin-inline: var(--margin); padding-left: 16px; gap: 10px; }
    .nav-links { gap: 12px; font-size: 0.875rem; }
    .nav-links .button { padding: 8px 14px; }
    .nav-links .button::after { display: none; }

    .project-intro h1 { font-size: 1.75rem; }

    .cards--3,
    .cards--4,
    .contact-pair { grid-template-columns: minmax(0, 1fr); }
    .contact-photos { min-height: 260px; }

    .about .bezel-core { grid-template-columns: minmax(0, 1fr); }

    .footer { grid-template-columns: 1fr; }
    .footer nav { flex-wrap: wrap; }
    .footer .year { text-align: left; }
}
