:root {
  color-scheme: dark;
  --background: #17232b;
  --surface: #202f39;
  --text: #f1f3ef;
  --muted: #b1bec6;
  --accent: #95d9e7;
  --line: #35444e;
  --radius: 8px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 32px; }
body { margin: 0; background: var(--background); color: var(--text); font-family: 'Rubik', sans-serif; font-size: 16px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 5px; }
a:hover { color: var(--text); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 2px; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.25; font-weight: 500; }
h2 { font-size: 24px; }
h3 { font-size: 18px; }
::selection { color: var(--background); background: var(--accent); }
.wrap { width: min(1040px, calc(100% - 80px)); margin-inline: auto; }
.muted { color: var(--muted); }
.accent { color: var(--accent); }
.skip-link { position: absolute; top: -100px; left: 24px; padding: 12px 20px; background: var(--text); color: var(--background); z-index: 10; }
.skip-link:focus { top: 12px; color: var(--background); }
.site-header { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding-block: 32px; }
.wordmark { font-size: 18px; font-weight: 500; color: var(--text); text-decoration: none; white-space: nowrap; }
.wordmark span { color: var(--accent); margin-left: 6px; }
nav { display: flex; gap: 30px; }
nav a { color: var(--muted); font-size: 14px; text-decoration: none; padding-block: 8px; }
nav a:hover { color: var(--accent); }
.hero { padding-top: 48px; }
.intro-label { color: var(--accent); font-size: 15px; margin-bottom: 22px; }
.hero h1 { font-size: clamp(38px, 5.5vw, 64px); font-weight: 500; letter-spacing: -1px; }
.hero-bottom { margin-top: 20px; }
.hero-description { color: var(--muted); font-size: 19px; line-height: 1.65; max-width: 620px; text-wrap: pretty; }
.hero-actions { display: flex; align-items: center; gap: 28px; margin-top: 20px; }
.button { display: inline-flex; align-items: center; justify-content: space-between; gap: 32px; border-radius: 4px; padding: 14px 22px; font-size: 15px; font-weight: 500; background: var(--accent); color: var(--background); text-decoration: none; transition: background 150ms; }
.button:hover { color: var(--background); background: #b5e8f1; }
.text-link { font-size: 15px; }
.railway { margin-top: 32px; overflow: hidden; }
.train-scene { height: 56px; display: flex; align-items: end; justify-content: center; overflow: hidden; }
.train-scene img { width: auto; height: auto; max-width: 72%; max-height: 56px; animation: train-journey 12s cubic-bezier(.4, 0, .2, 1) infinite; }
.train-scene.is-paused img { animation-play-state: paused; }
@keyframes train-journey {
  0% { transform: translateX(var(--train-entry, calc(50vw + 100%))); }
  28%, 72% { transform: translateX(0); }
  100% { transform: translateX(var(--train-exit, calc(-50vw - 100%))); }
}
.train-toggle { display: block; margin: 8px 0 0 auto; padding: 4px 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
.train-toggle:hover { color: var(--text); }
.train-toggle[hidden] { display: none; }
.railway-track { height: 5px; border-top: 1px solid #7f939e; border-bottom: 2px solid var(--line); }
.section { padding-block: 48px; border-bottom: 1px solid var(--line); }
.section-heading { margin-bottom: 24px; }
.section-heading > p { margin-top: 12px; color: var(--muted); }
#projects > .section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; }
.featured-project { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.featured-project[hidden] { display: none; }
.project-filters { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-bottom: 28px; }
.project-filters[hidden] { display: none; }
.project-filters button { padding: 8px 0; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; }
.project-filters button:hover { color: var(--text); }
.project-filters button[aria-pressed="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.projects-empty { color: var(--muted); }
.featured-project--text { grid-template-columns: minmax(0, 1fr); }
.featured-project--text .featured-content { max-width: 680px; }
.featured-image { overflow: hidden; background: #101719; border-radius: var(--radius); }
.featured-image img { width: 100%; height: 300px; object-fit: cover; object-position: left top; transition: transform 200ms; }
.featured-image:hover img { transform: scale(1.025); }
.featured-content { align-self: center; }
.project-category { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.status { color: var(--accent); margin-left: 8px; }
.featured-content h3 { font-size: 28px; margin-bottom: 16px; }
.featured-content > p:not(.project-category) { color: var(--muted); }
.project-links { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-top: 24px; font-size: 14px; }
.project-links.inline { flex-direction: row; flex-wrap: wrap; gap: 10px 24px; margin-top: 0; }
.project-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 40px; row-gap: 32px; }
.featured-project:not([hidden]) + .project-grid:has(> .project:not([hidden])) { margin-top: 36px; }
.project { display: flex; gap: 22px; align-items: flex-start; }
.project:not(:has(> img))::before { content: ''; width: 56px; height: 56px; flex: 0 0 56px; }
.project[hidden] { display: none; }
.projects-more { margin-top: 28px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 4px; background: transparent; color: var(--accent); font: inherit; font-size: 14px; cursor: pointer; }
.projects-more:hover { background: var(--surface); border-color: var(--accent); }
.projects-more[hidden] { display: none; }
.project h3:focus { outline: 2px solid var(--accent); outline-offset: 5px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.project > img { width: 56px; height: 56px; flex: 0 0 56px; object-fit: contain; object-position: left top; border-radius: 6px; }
.project > div { min-width: 0; }
.project p { color: var(--muted); font-size: 14px; margin-block: 8px; }
.project p.project-category { font-size: 12px; margin: 4px 0 0; }
.project a, .project-note { font-size: 14px; }
.project-resources { display: flex; flex-wrap: wrap; gap: 24px; font-size: 14px; margin-top: 28px; }
.split-section { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; }
.split-section .section-heading { margin-bottom: 0; }
.job + .job { margin-top: 28px; }
.job-heading { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
.job-heading h3 { font-size: 17px; }
.date { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.role { color: var(--accent); font-size: 14px; margin-top: 6px; }
.job > p:not(.role) { color: var(--muted); font-size: 14px; margin-top: 14px; }
.job > p.technologies { font-size: 12px; }
.job-details { margin: 12px 0 0; padding-left: 20px; color: var(--muted); font-size: 14px; }
.job-details li + li { margin-top: 6px; }
.job-details strong { color: var(--text); font-weight: 500; }
dl { margin: 0; }
.skills-list > div { display: grid; grid-template-columns: 144px 1fr; gap: 20px; margin-bottom: 16px; font-size: 14px; }
.skills-list > div:last-child { margin-bottom: 0; }
dt { color: var(--muted); }
dd { margin: 0; }
.contact-email { display: inline-block; font-size: 24px; margin-bottom: 24px; text-decoration: none; }
.contact-list { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 28px; }
.contact-list dt { font-size: 12px; margin-bottom: 4px; }
.contact-list dd { font-size: 14px; overflow-wrap: anywhere; }
.contact-list a { text-decoration: none; }
.contact-list a:hover { text-decoration: underline; }
.site-footer { display: flex; justify-content: space-between; gap: 24px; padding-block: 28px; font-size: 12px; color: var(--muted); }
.site-footer a { color: var(--muted); text-decoration: none; }
nav a[aria-current] { color: var(--text); text-decoration: underline; }
.blog-main { padding-block: 48px 64px; min-height: 65vh; }
.blog-heading { max-width: 720px; margin-bottom: 48px; }
.blog-heading h1 { font-size: clamp(36px, 5vw, 52px); margin-bottom: 16px; }
.blog-heading > p { color: var(--muted); font-size: 18px; }
.post-list { max-width: 760px; }
.post-summary + .post-summary { margin-top: 32px; }
.post-summary--image { display: grid; grid-template-columns: 144px minmax(0, 1fr); gap: 24px; align-items: start; }
.post-summary-content { min-width: 0; }
.post-thumbnail { display: block; overflow: hidden; border-radius: var(--radius); }
.post-thumbnail img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; object-position: var(--post-image-position, center); }
.post-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); font-size: 12px; }
.post-summary h2, .post-summary h3 { font-size: 20px; line-height: 1.4; margin-top: 8px; }
.post-summary h2 a, .post-summary h3 a { color: var(--text); text-decoration: none; }
.post-summary h2 a:hover, .post-summary h3 a:hover { color: var(--accent); text-decoration: underline; }
.post-summary-content > p:not(.post-meta) { color: var(--muted); font-size: 14px; margin-top: 10px; }
.post-hero { margin: 0 0 36px; }
.post-hero img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; object-position: var(--post-image-position, center); border-radius: var(--radius); }
.post-hero figcaption, .prose figcaption { color: var(--muted); font-size: 13px; line-height: 1.6; margin-top: 10px; }
.blog-article { max-width: 760px; margin-inline: auto; }
.article-heading { margin-bottom: 36px; }
.back-link { display: inline-block; font-size: 14px; margin-bottom: 28px; }
.article-heading h1 { font-size: clamp(30px, 4vw, 44px); margin-top: 16px; text-wrap: pretty; }
.prose { line-height: 1.8; overflow-wrap: anywhere; }
.prose p, .prose ul, .prose ol, .prose pre, .prose blockquote, .prose table { margin-block: 20px; }
.prose h2 { margin-top: 40px; font-size: 26px; }
.prose h3 { margin-top: 28px; font-size: 21px; }
.prose h4, .prose h5, .prose h6 { margin-block: 24px 12px; font-size: 18px; }
.prose li + li { margin-top: 8px; }
.prose ul, .prose ol { padding-left: 24px; }
.prose img { height: auto; border-radius: var(--radius); }
.prose figure { margin: 28px 0; }
.prose figure img { display: block; }
.prose video { display: block; max-width: 100%; height: auto; border-radius: var(--radius); }
.prose pre { padding: 20px; background: var(--surface); overflow-x: auto; border-radius: var(--radius); }
.prose code { font-size: .9em; }
.prose :not(pre) > code { background: var(--surface); padding: 2px 5px; border-radius: 3px; }
.prose blockquote { margin-inline: 0; padding-left: 20px; border-left: 2px solid var(--accent); color: var(--muted); }
.prose hr { margin-block: 36px; border: 0; border-top: 1px solid var(--line); }
.prose table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.prose th, .prose td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.article-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 14px; }
.service-hero { padding-block: 72px 56px; max-width: 800px; }
.service-hero h1 { font-size: clamp(36px, 5vw, 60px); margin-bottom: 24px; }
.service-hero > p:not(.intro-label) { color: var(--muted); font-size: 19px; margin-bottom: 28px; }
.system-list { list-style: none; padding: 0; margin: 0 0 24px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 32px; }
.service-description { color: var(--muted); }
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.gallery a { display: block; border-radius: var(--radius); overflow: hidden; }
.gallery img { width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; transition: transform 200ms; }
.gallery a:hover img { transform: scale(1.025); }

@media (max-width: 1000px) {
  .split-section { grid-template-columns: 210px minmax(0, 1fr); gap: 32px; }
  .job-heading { flex-direction: column; gap: 4px; }
  .featured-project { gap: 28px; }
  .project-grid { column-gap: 32px; }
  .hero-description { font-size: 18px; }
}
@media (max-width: 700px) {
  .post-summary--image { grid-template-columns: 1fr; gap: 16px; }
  .post-thumbnail img { aspect-ratio: 16 / 9; }
  .wrap { width: calc(100% - 40px); }
  .site-header { flex-wrap: wrap; gap: 16px; padding-block: 24px; }
  nav { width: 100%; justify-content: space-between; gap: 12px; }
  nav a { font-size: 13px; }
  .hero { padding-top: 28px; }
  .intro-label { font-size: 13px; margin-bottom: 20px; }
  .hero h1 { letter-spacing: -1px; }
  .hero-bottom { margin-top: 16px; }
  .hero-actions { gap: 24px; flex-wrap: wrap; }
  .button { padding: 12px 16px; gap: 20px; font-size: 14px; }
  .text-link { font-size: 14px; }
  .railway { margin-top: 32px; }
  .train-scene { height: 48px; }
  .train-scene img { max-width: 100%; max-height: 48px; }
  .section { padding-block: 36px; }
  h2 { font-size: 23px; }
  #projects > .section-heading { display: block; }
  .section-heading > p { font-size: 14px; }
  .featured-project { grid-template-columns: 1fr; gap: 24px; }
  .featured-image img { height: 240px; }
  .featured-content h3 { font-size: 26px; }
  .project-grid { grid-template-columns: 1fr; gap: 28px; }
  .featured-project:not([hidden]) + .project-grid:has(> .project:not([hidden])) { margin-top: 32px; }
  .project { gap: 16px; }
  .split-section { grid-template-columns: 1fr; gap: 24px; }
  .skills-list > div { grid-template-columns: 110px minmax(0, 1fr); gap: 16px; }
  .contact-list { gap: 20px; }
  .contact-email { margin-bottom: 28px; }
  .service-hero { padding-block: 40px; }
  .system-list { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-template-columns: 1fr; gap: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
