@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600;700&family=Lobster&display=swap');

:root {
    color-scheme: dark;
    --page: #050505;
    --paper: #090909;
    --ink: #fff;
    --muted: #c6c6c6;
    --line: #f2f2f2;
    --accent: #ff0050;
    --accent-soft: #26000d;
    --blue: #3000ff;
    --shadow: 3px 3px #ff0050, -3px -3px #3000ff;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); font-family: 'IBM Plex Mono', Consolas, monospace; }
button, input, select { font: inherit; }
button { color: inherit; }
a { color: inherit; }
.hidden { display: none !important; }

.site-header { position: relative; z-index: 1; min-height: 82px; padding: 0 max(24px, calc((100% - 1280px) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 2px solid #fff; background: #000; color: #fff; box-shadow: 2px 2px #ff0050, -2px -2px #3000ff; }
.wordmark { color: inherit; text-decoration: none; font: 30px 'Lobster', 'Brush Script MT', cursive; text-shadow: 2px 2px 4px #ff0080, -2px -2px 4px #3000ff; }
.wordmark span { color: #fff; font: 500 11px 'IBM Plex Mono', Consolas, monospace; text-shadow: none; }
.header-note { color: #ddd; font-size: 11px; }
.site-nav { display: flex; align-items: center; gap: 8px; }
.nav-link { padding: 8px 9px; border: 1px solid transparent; color: #fff; text-decoration: none; font-size: 11px; white-space: nowrap; transition: background 150ms ease; }
.nav-link:hover, .nav-link[aria-current="page"] { border-color: #fff; box-shadow: 2px 2px #ff0050, -2px -2px #3000ff; }
.home-link { padding: 9px 15px; border: 1px solid #fff; box-shadow: 2px 2px #ff0050, -2px -2px #3000ff; color: #fff; text-decoration: none; font-size: 12px; transition: background 150ms ease; }
.home-link:hover { background: #ff0050; }
.eyebrow { margin: 0 0 12px; color: #ff4b82; font-size: 10px; font-weight: 700; text-transform: uppercase; }
a:focus-visible, button:focus-visible { outline: 3px solid #ff4b82; outline-offset: 4px; }

/* Home page */
.hero { position: relative; display: flex; min-height: clamp(390px, calc(100svh - 250px), 650px); align-items: center; overflow: hidden; padding: 60px max(28px, calc((100% - 1280px) / 2)); border-bottom: 2px solid #fff; background: #101010 url('assets/opel-omega/thumb.jpg') center 56% / cover no-repeat; }
.hero::before { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.46); content: ''; }
.hero-content { position: relative; z-index: 1; max-width: 760px; }
.hero h1 { margin: 0; font: 76px/1.1 'Lobster', 'Brush Script MT', cursive; text-shadow: 3px 3px 5px #ff0080, -3px -3px 5px #3000ff; }
.role { margin: 13px 0 18px; color: #ff4b82; font-size: 15px; font-weight: 600; }
.intro { max-width: 610px; margin: 0; color: #f1f1f1; font-size: 12px; line-height: 1.9; text-shadow: 1px 1px 3px #000; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 30px; }
.action-link { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; gap: 10px; padding: 0 17px; border: 2px solid #fff; background: #050505; box-shadow: 3px 3px #ff0050, -3px -3px #3000ff; text-decoration: none; font-size: 11px; font-weight: 600; transition: background 150ms ease, transform 150ms ease; }
.action-link:hover { transform: translateY(-2px); background: #ff0050; }
.hero-index { position: absolute; right: max(28px, calc((100% - 1280px) / 2)); bottom: 20px; z-index: 1; padding: 8px 11px; border: 1px solid #fff; background: #000; box-shadow: 2px 2px #ff0050, -2px -2px #3000ff; color: #fff; font-size: 10px; }
.next-strip { max-width: 1280px; margin: 0 auto; padding: 22px 28px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.next-label { margin: 0; color: var(--muted); font-size: 10px; }
.next-link { color: #ff4b82; text-decoration: none; font-size: 11px; font-weight: 700; }
.next-link:hover { color: #fff; text-shadow: 1px 1px #3000ff; }
footer { padding: 16px 24px; border-top: 1px solid #fff; color: #aaa; font-size: 10px; text-align: center; }

/* Project gallery */
.page-shell { max-width: 1280px; min-height: calc(100vh - 82px); margin: 0 auto; padding: 54px 28px 80px; }
.gallery-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.gallery-heading h1, .detail-heading h1 { margin: 0; font: 48px/1.15 'Lobster', 'Brush Script MT', cursive; text-shadow: 2px 2px 4px #ff0080, -2px -2px 4px #3000ff; }
.gallery-intro { max-width: 620px; margin: 14px 0 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.project-total { display: flex; align-items: baseline; gap: 9px; padding: 8px 12px; border: 1px solid #fff; box-shadow: 2px 2px #ff0050, -2px -2px #3000ff; color: var(--muted); font-size: 11px; white-space: nowrap; }
.project-total strong { color: #fff; font: 700 29px 'IBM Plex Mono', Consolas, monospace; text-shadow: 2px 2px #ff0050; }
.gallery-toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 25px; padding: 14px; background: #000; border: 2px solid #fff; border-radius: 0; box-shadow: 3px 3px #ff0050, -3px -3px #3000ff; }
.search-control { position: relative; flex: 1; min-width: 160px; }
.search-control input, .sort-control select { width: 100%; height: 42px; border: 1px solid #fff; border-radius: 0; background: #050505; color: #fff; outline: none; }
.search-control input { padding: 0 14px 0 40px; }
.search-control input::placeholder { color: #999; }
.search-control input:focus, .sort-control select:focus { border-color: #ff0050; box-shadow: 2px 2px #ff0050, -2px -2px #3000ff; }
.search-mark { position: absolute; top: 9px; left: 14px; color: #ff4b82; font-size: 19px; pointer-events: none; }
.sort-control { display: flex; align-items: center; gap: 10px; color: #ddd; font-size: 11px; white-space: nowrap; }
.sort-control select { width: 150px; padding: 0 10px; }
.category-control select { width: 180px; }
.results-summary { min-width: 105px; margin: 0; color: #ddd; font-size: 10px; text-align: right; }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 25px; }
.project-card { display: flex; min-width: 0; flex-direction: column; padding: 0; overflow: hidden; border: 2px solid #fff; border-radius: 0; background: #050505; box-shadow: 3px 3px #ff0050, -3px -3px #3000ff; text-align: left; cursor: pointer; transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease; }
.project-card:hover { transform: translateY(-3px); background: #ff0050; box-shadow: 5px 5px #ff0050, -5px -5px #3000ff; }
.project-card:focus-visible, .back-button:focus-visible { outline: 3px solid #ff4b82; outline-offset: 4px; }
.project-cover { position: relative; display: grid; width: 100%; aspect-ratio: 1.42; overflow: hidden; place-items: center; border-bottom: 2px solid #fff; background: #111; }
.cover-fallback { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: 20px; background: repeating-linear-gradient(135deg, #080808 0, #080808 18px, #101010 18px, #101010 19px); color: #fff; }
.cover-fallback span { color: #ff4b82; font-size: 9px; font-weight: 700; text-transform: uppercase; }
.cover-fallback strong { max-width: 80%; font: 23px/1.2 'Lobster', 'Brush Script MT', cursive; text-shadow: 2px 2px #ff0050, -2px -2px #3000ff; }
.project-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 350ms ease; }
.project-cover img.contain { object-fit: contain; }
.project-card:hover .project-cover img { transform: scale(1.035); }
.cover-index { position: absolute; top: 12px; right: 12px; z-index: 1; display: grid; width: 32px; height: 32px; place-items: center; border: 1px solid #fff; background: #000; color: #fff; font: 600 11px 'IBM Plex Mono', Consolas, monospace; }
.project-card-body { display: flex; flex: 1; flex-direction: column; padding: 17px 17px 15px; }
.project-card h2 { margin: 0; font: 600 14px/1.5 'IBM Plex Mono', Consolas, monospace; }
.project-card p { margin: 9px 0 18px; color: #c6c6c6; font-size: 11px; line-height: 1.7; }
.project-card:hover p { color: #fff; }
.project-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; }
.project-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.project-badge { display: inline-flex; align-items: center; min-height: 22px; padding: 0 7px; border: 1px solid #fff; border-radius: 0; background: #000; color: #fff; font-size: 9px; font-weight: 600; }
.project-badge.model { box-shadow: 1px 1px #3000ff; }
.project-badge.video { box-shadow: 1px 1px #ff0050; }
.project-badge.category { border-color: #ff4b82; color: #ffb4c8; }
.card-action { color: #ff4b82; font-size: 10px; font-weight: 700; white-space: nowrap; }
.project-card:hover .card-action { color: #fff; text-shadow: 1px 1px #3000ff; }
.empty-state { grid-column: 1 / -1; padding: 56px 24px; border: 1px dashed #fff; border-radius: 0; box-shadow: 2px 2px #ff0050, -2px -2px #3000ff; color: var(--muted); text-align: center; }
.detail-view { padding-top: 2px; }
.back-button { display: inline-flex; align-items: center; gap: 9px; margin: 0 0 34px; padding: 8px 12px; border: 1px solid #fff; background: #000; box-shadow: 2px 2px #ff0050, -2px -2px #3000ff; color: #fff; font-size: 11px; font-weight: 600; cursor: pointer; }
.back-button:hover { background: #ff0050; }
.detail-heading { max-width: 820px; margin-bottom: 32px; }
.detail-heading h1 { font-size: 42px; }
.detail-description { margin: 13px 0 0; color: var(--muted); font-size: 17px; line-height: 1.75; }
.detail-badges { margin-top: 17px; }
.project-content { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 25px; }
.project-content.single-column { grid-template-columns: minmax(0, 1fr); }
.model-panel, .media-panel { min-width: 0; }
#cad-viewer { width: 100%; height: auto; aspect-ratio: 4 / 3; overflow: hidden; border: 2px solid #fff; border-radius: 0; background: #050505; box-shadow: 3px 3px #ff0050, -3px -3px #3000ff; cursor: grab; }
#cad-viewer:active { cursor: grabbing; }
.viewer-hint { margin: 12px 0 0; color: var(--muted); font-size: 10px; text-align: center; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid #fff; }
.section-heading h2 { margin: 0; font: 22px 'Lobster', 'Brush Script MT', cursive; text-shadow: 1px 1px #ff0050, -1px -1px #3000ff; }
.section-heading span { color: var(--muted); font-size: 10px; }
.media-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.media-image-button { display: block; width: 100%; padding: 0; overflow: hidden; border: 2px solid #fff; background: #050505; box-shadow: 2px 2px #ff0050, -2px -2px #3000ff; cursor: zoom-in; }
.media-image-button:focus-visible { outline: 3px solid #ff4b82; outline-offset: 5px; }
.media-image, .media-video { display: block; width: 100%; overflow: hidden; border: 2px solid #fff; border-radius: 0; background: #050505; box-shadow: 2px 2px #ff0050, -2px -2px #3000ff; }
.media-image { width: 100%; height: auto; max-height: 900px; border: 0; box-shadow: none; object-fit: contain; }
.media-video { aspect-ratio: 16 / 9; }
.image-lightbox { position: relative; width: min(94vw, 1400px); max-width: none; max-height: 94vh; padding: 20px; border: 2px solid #fff; background: #050505; color: #fff; box-shadow: 4px 4px #ff0050, -4px -4px #3000ff; }
.image-lightbox::backdrop { background: rgba(0, 0, 0, 0.9); }
.lightbox-close { position: absolute; top: 8px; right: 8px; z-index: 1; width: 40px; height: 40px; border: 1px solid #fff; background: #000; color: #fff; font-size: 24px; line-height: 1; cursor: pointer; }
.lightbox-close:hover { background: #ff0050; }
.lightbox-image { display: block; width: auto; height: auto; max-width: 100%; max-height: calc(94vh - 86px); margin: 6px auto 10px; object-fit: contain; }
.lightbox-caption { margin: 0; color: var(--muted); font-size: 12px; text-align: center; }
.viewer-message { display: grid; height: 100%; place-items: center; color: #fff; font-size: 12px; }

/* CV */
.cv-shell { max-width: 1180px; }
.cv-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.cv-title { margin: 0; font: 52px/1.1 'Lobster', 'Brush Script MT', cursive; text-shadow: 2px 2px #ff0080, -2px -2px #3000ff; }
.cv-role { margin: 10px 0 0; color: #ff4b82; font-size: 14px; }
.cv-print { min-height: 42px; padding: 0 14px; border: 1px solid #fff; background: #050505; box-shadow: 2px 2px #ff0050, -2px -2px #3000ff; color: #fff; font-size: 12px; cursor: pointer; }
.cv-print:hover { background: #ff0050; }
.cv-contact { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-bottom: 32px; padding: 17px 0; border-top: 1px solid #fff; border-bottom: 1px solid #fff; color: var(--muted); font-size: 13px; }
.cv-contact a { color: #fff; text-decoration-color: #ff0050; text-underline-offset: 3px; }
.cv-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 34px; }
.cv-sidebar { grid-column: 1; grid-row: 1; padding-right: 24px; border-right: 1px solid #fff; }
.cv-main { grid-column: 2; grid-row: 1; min-width: 0; }
.cv-section + .cv-section { margin-top: 36px; }
.cv-section h2 { margin: 0 0 16px; padding-bottom: 9px; border-bottom: 1px solid #fff; font: 25px 'Lobster', 'Brush Script MT', cursive; text-shadow: 1px 1px #ff0050, -1px -1px #3000ff; }
.cv-profile { margin: 0; color: #dedede; font-size: 14px; line-height: 1.75; }
.cv-education + .cv-education { margin-top: 20px; }
.cv-education h3, .cv-entry h3, .cv-project h3 { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.5; }
.cv-school, .cv-entry-subtitle { margin: 4px 0; color: #ddd; font-size: 13px; line-height: 1.6; }
.cv-date, .cv-location { color: #bcbcbc; font-size: 12px; }
.cv-list { display: grid; gap: 8px; margin: 0; padding-left: 19px; color: #ddd; font-size: 13px; line-height: 1.7; }
.cv-skills { display: flex; flex-direction: column; gap: 11px; margin: 0; padding: 0; list-style: none; color: #ddd; font-size: 13px; line-height: 1.65; }
.cv-languages { display: grid; gap: 10px; margin: 0; color: #ddd; font-size: 13px; }
.cv-entry, .cv-project { padding: 0 0 18px; border-bottom: 1px solid #494949; }
.cv-entry + .cv-entry, .cv-project + .cv-project { margin-top: 18px; }
.cv-entry-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.cv-entry-heading .cv-date { flex: none; text-align: right; }
.cv-entry p, .cv-project p { margin: 8px 0 0; color: #d4d4d4; font-size: 13px; line-height: 1.7; }
.cv-entry .cv-list, .cv-project .cv-list { margin-top: 7px; }
.cv-skills-line { color: #ff9ab6 !important; }
.cv-compact-experience { margin-top: 20px; color: #bdbdbd; font-size: 12px; line-height: 1.8; }
@media print {
    @page { size: A4; margin: 14mm; }
    body.cv-page { background: #fff; color: #111; font-family: Arial, sans-serif; }
    .cv-page .site-header, .cv-page .cv-print, .cv-page footer { display: none !important; }
    .cv-page .page-shell { width: 100%; max-width: none; min-height: 0; padding: 0; }
    .cv-page .cv-title, .cv-page .cv-section h2 { color: #111; text-shadow: none; }
    .cv-page .cv-role, .cv-page .cv-contact, .cv-page .cv-contact a, .cv-page .cv-profile, .cv-page .cv-school, .cv-page .cv-date, .cv-page .cv-location, .cv-page .cv-list, .cv-page .cv-skills, .cv-page .cv-languages, .cv-page .cv-entry p, .cv-page .cv-project p, .cv-page .cv-compact-experience { color: #222 !important; }
    .cv-page .cv-contact, .cv-page .cv-sidebar, .cv-page .cv-section h2, .cv-page .cv-entry, .cv-page .cv-project { border-color: #888; }
    .cv-page .cv-skills-line { color: #222 !important; }
    .cv-page .cv-entry, .cv-page .cv-project, .cv-page .cv-education { break-inside: avoid; }
}

@media (max-width: 980px) {
    .gallery-toolbar { flex-wrap: wrap; }
    .search-control { flex-basis: 100%; }
    .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .project-content { grid-template-columns: minmax(0, 1fr); }
    .cv-layout { grid-template-columns: minmax(0, 1fr); }
    .cv-main, .cv-sidebar { grid-column: 1; grid-row: auto; }
    .cv-sidebar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; padding: 24px 0 0; border-top: 1px solid #fff; border-right: 0; }
    .cv-sidebar .cv-section + .cv-section { margin-top: 0; }
}

@media (max-width: 620px) {
    .site-header { min-height: 68px; padding: 8px 14px; gap: 8px; }
    .wordmark { font-size: 23px; }
    .wordmark span { display: none; }
    .site-nav { gap: 3px; }
    .nav-link { padding: 5px 6px; font-size: 9px; }
    .header-note { display: none; }
    .hero { min-height: clamp(410px, calc(100svh - 250px), 560px); padding: 45px 20px 70px; background-position: 57% center; }
    .hero h1 { font-size: 54px; }
    .role { max-width: 310px; font-size: 12px; line-height: 1.7; }
    .intro { max-width: 340px; font-size: 10px; }
    .hero-actions { gap: 14px; }
    .action-link { min-height: 44px; padding: 0 12px; font-size: 10px; }
    .hero-index { right: 20px; bottom: 16px; }
    .next-strip { align-items: flex-start; flex-direction: column; gap: 10px; padding: 18px 20px; }
    .page-shell { padding: 36px 16px 56px; }
    .gallery-heading { align-items: flex-start; margin-bottom: 24px; }
    .gallery-heading h1 { font-size: 39px; }
    .gallery-intro { max-width: 300px; font-size: 11px; }
    .project-total { gap: 5px; padding-top: 28px; font-size: 11px; }
    .project-total strong { font-size: 22px; }
    .gallery-toolbar { flex-wrap: wrap; gap: 10px; padding: 10px; }
    .search-control { flex-basis: 100%; }
    .sort-control { flex: 0 0 100%; min-width: 0; justify-content: space-between; }
    .sort-control select { width: auto; min-width: 0; flex: 1; max-width: none; }
    .results-summary { flex: 0 0 100%; text-align: left; }
    .project-grid { grid-template-columns: 1fr; gap: 15px; }
    .project-cover { aspect-ratio: 1.55; }
    .project-card-body { padding: 15px; }
    .detail-heading h1 { font-size: 35px; }
    .cv-shell { padding-top: 32px; }
    .cv-toolbar { align-items: flex-start; }
    .cv-title { font-size: 42px; }
    .cv-role { max-width: 250px; font-size: 12px; line-height: 1.6; }
    .cv-contact { gap: 10px 16px; }
    .cv-layout { gap: 26px; }
    .cv-sidebar { grid-template-columns: minmax(0, 1fr); gap: 22px; }
    .cv-entry-heading { align-items: flex-start; }
    .cv-entry-heading .cv-date { max-width: 120px; }
    .back-button { margin-bottom: 26px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}