:root {
  color-scheme: dark;
  --bg: #090b0e;
  --panel: #10151a;
  --line: #2c3841;
  --ink: #f2f7fa;
  --muted: #b5c1cb;
  --accent: #c6f778;
  --blue: #7ed4ff;
  font: 100%/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--bg); min-height: 100svh; display: flex; flex-direction: column; }
main { flex: 1; }
a { color: inherit; text-underline-offset: .24em; }
a:hover { color: var(--accent); }
::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
img { display: block; max-width: 100%; height: auto; }
figure, dl, dd { margin: 0; }
h1, h2, h3 { margin: 0; line-height: 1.09; letter-spacing: -.035em; overflow-wrap: anywhere; text-wrap: balance; }
h1 { font-size: clamp(2.6rem, 7.5vw, 5.9rem); }
h2 { font-size: clamp(1.55rem, 4vw, 2.65rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.55rem); }
p { margin: .7rem 0 0; }
p, dd { overflow-wrap: anywhere; }
ul, ol { padding-inline-start: 1.25rem; }
.shell { width: min(72rem, 100% - 2rem); margin-inline: auto; }
.skip { position: fixed; inset: .5rem auto auto .5rem; z-index: 5; background: var(--bg); padding: .55rem .9rem; transform: translateY(-150%); }
.skip:focus { transform: none; }
.top { background: #0c1014; border-bottom: 1px solid var(--line); }
.header { display: grid; grid-template-columns: minmax(0, 1fr) auto; min-height: 4rem; align-items: center; gap: 0 .65rem; }
.wordmark { font-size: 1.05rem; font-weight: 760; text-decoration: none; letter-spacing: -.025em; }
.nav { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 0 .6rem; flex-wrap: wrap; border-top: 1px solid var(--line); }
.nav a, .languages a { display: inline-flex; align-items: center; min-height: 2.75rem; text-decoration: none; font-size: .86rem; font-weight: 640; color: var(--muted); }
.nav a[aria-current] { color: var(--ink); box-shadow: inset 0 -2px var(--accent); }
.nav a:hover, .languages a:hover { color: var(--accent); }
.languages { display: flex; gap: .2rem; }
.languages a { padding-inline: .56rem; }
.languages a[aria-current] { color: var(--accent); text-decoration: underline; }
.hero { display: grid; gap: 2rem; padding-block: clamp(2.75rem, 8vw, 6.4rem) 2rem; border-bottom: 1px solid var(--line); }
.hero h1 { font-weight: 790; }
.hero h1 span { color: var(--accent); }
.lead { max-width: 62ch; font-size: clamp(1.06rem, 2.2vw, 1.26rem); color: var(--muted); margin-top: 1rem; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.4rem; }
.action { display: inline-flex; align-items: center; min-height: 2.75rem; padding: .55rem .96rem; background: #182027; color: var(--ink); border: 1px solid var(--line); border-radius: .3rem; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.action:hover { border-color: var(--accent); }
.action.primary { background: var(--accent); border-color: var(--accent); color: #151e0b; }
.action.primary:hover { background: #dcfbb7; }
.hero-visual { min-width: 0; position: relative; overflow: hidden; background: #101923; border: 1px solid #374652; border-radius: .65rem; display: grid; }
.hero-visual > img { width: 100%; max-height: 29rem; object-fit: cover; }
.page-heading { padding-block: clamp(2.7rem, 8vw, 5rem) 1.35rem; border-bottom: 1px solid var(--line); }
.section { padding-block: clamp(1.45rem, 5vw, 3.1rem); }
.section + .section { border-top: 1px solid var(--line); }
.split { display: grid; gap: clamp(1.6rem, 5vw, 3.2rem); }
.row { padding-block: 1rem; border-bottom: 1px solid var(--line); }
.row a, .article-link { text-decoration: none; }
.row p, .empty, .articles p, figcaption { color: var(--muted); }
.text-link { display: inline-flex; align-items: center; min-height: 2.75rem; margin-top: .45rem; color: var(--accent); font-weight: 660; }
.prose { max-width: 70ch; }
.prose > p:first-child { margin-top: 0; }
.prose > p + p { margin-top: 1rem; }
blockquote { margin: 1.35rem 0 0; padding: .9rem 1rem; border: 1px solid var(--line); background: var(--panel); border-radius: .35rem; color: var(--blue); }
pre { overflow: auto; max-width: 100%; padding: .8rem 1rem; background: #111923; border: 1px solid var(--line); border-radius: .35rem; tab-size: 4; font-size: .88rem; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; color: #d7f1ff; }
.tags, .skills { list-style: none; padding: 0; }
.tags { display: flex; flex-wrap: wrap; gap: .6rem; }
.tags li { border: 1px solid var(--line); padding: .2rem .5rem; border-radius: .3rem; }
.skills li { border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: .6rem; padding-block: .55rem; }
progress { max-width: 47%; margin-left: auto; accent-color: var(--accent); }
.table-scroll { overflow: auto; margin-top: .8rem; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { border-bottom: 1px solid var(--line); padding: .55rem .5rem; }
th { color: var(--blue); }
.portrait img { max-width: min(15rem, 100%); margin-bottom: 1.15rem; border-radius: .35rem; }
.gallery-grid, .articles { display: grid; gap: 1.05rem; }
.articles { margin-top: .8rem; }
.articles article { min-width: 0; padding-block: .75rem 1rem; border-top: 1px solid var(--line); }
.articles img, .gallery-grid img, .detail-image, .project-image, .article-image { border: 1px solid var(--line); border-radius: .4rem; }
.articles img { margin-bottom: .8rem; width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.articles h2 { font-size: clamp(1.25rem, 2.4vw, 1.75rem); }
.article-image { width: 100%; }
figure + p { margin-top: 1.25rem; }
figcaption { margin-top: .55rem; font-size: .92rem; }
.project-image { max-width: min(100%, 30rem); margin-bottom: .65rem; }
.contact form { display: grid; gap: .85rem; }
.contact h2, .about-grid h2 { margin-bottom: .8rem; }
.contact address { display: grid; gap: .55rem; font-style: normal; }
.contact label { display: grid; gap: .25rem; font-weight: 600; }
.contact input, .contact textarea { color: var(--ink); background: var(--panel); border: 1px solid #465563; border-radius: .25rem; padding: .6rem .7rem; font: inherit; width: 100%; min-width: 0; }
.contact button { justify-self: start; }
.feedback { margin: 0; color: var(--blue); }
.footer { border-top: 1px solid var(--line); margin-top: 2rem; color: var(--muted); }
.footer .shell { display: flex; justify-content: space-between; gap: .65rem; flex-wrap: wrap; padding-block: 1.1rem; }
@media (min-width: 36rem) {
  .shell { width: min(72rem, 100% - 3rem); }
  .nav { justify-content: flex-start; gap: 1.25rem; }
  .articles, .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 52rem) {
  .header { grid-template-columns: auto 1fr auto; gap: 1.4rem; }
  .nav { grid-column: 2; grid-row: 1; justify-content: end; border-top: 0; gap: clamp(.65rem, 2vw, 1.5rem); }
  .languages { grid-column: 3; grid-row: 1; }
  .hero { grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr); align-items: center; gap: 2.35rem; }
  .split { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
  .articles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.memory { display: block; perspective: 1000px; }
.memory-inner { display: grid; transform-style: preserve-3d; transition: transform .35s ease-out; }
.memory-inner > * { grid-area: 1 / 1; backface-visibility: hidden; }
.memory-back { transform: rotateY(180deg); align-content: center; padding: .9rem; border-radius: .4rem; background: #dce7d2; color: #24301e; font-family: "Bradley Hand", cursive; overflow-wrap: anywhere; }
.memory:focus-visible .memory-inner { transform: rotateY(180deg); }
@media (hover: hover) and (pointer: fine) {
  .memory:hover .memory-inner { transform: rotateY(180deg); }
}
.lightbox { width: min(60rem, calc(100% - 1rem)); max-height: calc(100svh - 1rem); padding: clamp(.8rem, 3vw, 1.5rem); border-radius: .55rem; border: 1px solid var(--line); color: var(--ink); background: var(--bg); }
.lightbox::backdrop { background: #000e; }
.lightbox img { width: 100%; max-height: 65svh; object-fit: contain; margin-top: .8rem; }
@media (prefers-reduced-motion: reduce) { .memory-inner { transition: none; } }

/* OLED theme */
:root {
  --bg: #000;
  --panel: #11120f;
  --line: #292a25;
  --ink: #f4f4ee;
  --muted: #b7b7ae;
  --accent: #d6fa77;
  --blue: #dce9bd;
}
body { isolation: isolate; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(36rem circle at var(--glow-x, 72%) var(--glow-y, 20%), #a7c54a20, transparent 97%); }
.top { background: #070707f2; }
.header { min-height: 4.65rem; }
.wordmark { display: inline-flex; align-items: center; gap: .65rem; width: fit-content; }
.brand-mark { display: inline-grid; place-items: center; border-radius: .5rem; border: 1px solid #35372d; color: var(--accent); width: 2.05rem; height: 2.05rem; font: 750 .8rem/1 ui-monospace, monospace; flex: none; }
.hero { padding-block: clamp(3.4rem, 8vw, 7.5rem); }
.hero-kicker { margin: 0 0 .9rem; text-transform: uppercase; letter-spacing: .115em; color: #e5f6b9; font: 700 .82rem/1.6 ui-monospace, monospace; }
.hero h1 { font-size: clamp(2.95rem, 7.6vw, 7rem); line-height: .95; letter-spacing: -.068em; }
.hero h1 span { color: inherit; }
.hero .lead { margin-top: 1.5rem; }
.hero-visual { border: 0; border-radius: 0; background: transparent; overflow: visible; }
.hero-visual figcaption { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .35rem 1rem; margin: 0; padding: .48rem 0; border-bottom: 1px solid var(--line); font: 500 .78rem/1.55 ui-monospace, monospace; }
.action { border-radius: .55rem; background: #171815; }
.action.primary { background: #e7fbb5; border-color: #e7fbb5; color: #0b0d07; }
.portrait { max-width: min(14.5rem, 100%); margin-inline: auto; }
.portrait img { width: 100%; margin-bottom: 0; border: 1px solid var(--line); border-radius: .65rem; }
.portrait figcaption { color: var(--ink); font-weight: 660; }
.profile-data { max-width: min(14.5rem, 100%); margin: .8rem auto 0; color: var(--muted); }
.profile-data dd { font-variant-numeric: tabular-nums; color: var(--ink); }
.about-grid h2 { margin-top: 1.5rem; }
pre { background: #10110f; }
.contact input, .contact textarea { border-color: #47493d; }
@media (min-width: 52rem) {
  .hero h1 span { display: block; }
  .about-grid { grid-template-columns: minmax(12rem, .58fr) minmax(0, 1.42fr); }
  .portrait, .profile-data { margin-inline: 0; }
}
@media (prefers-reduced-motion: reduce) { body::before { display: none; } }

.hero { padding-block: clamp(3.15rem, 7.2vw, 6.5rem); }
.hero h1 { letter-spacing: -.052em; }
.hero .lead { max-width: 51ch; line-height: 1.62; }
.hero-visual figcaption { font-family: inherit; letter-spacing: .025em; }
.nav a, .action, .article-link { transition: color .16s ease, background-color .16s ease, border-color .16s ease; }
.article-link { display: block; }
.articles { row-gap: 1.75rem; }
.articles article { padding-top: .9rem; }
.articles img { margin-bottom: .95rem; aspect-ratio: 16 / 10; object-fit: contain; background: #131410; }
.articles p { line-height: 1.58; }
.article-image { height: auto; }
.article-link:hover img { border-color: #667147; }
@media (prefers-reduced-motion: reduce) { .nav a, .action, .article-link { transition: none; } }

.racing-gallery { gap: clamp(1.2rem, 3vw, 2.3rem); }
.racing-gallery figure { min-width: 0; }
.racing-gallery .memory-inner { aspect-ratio: 1; }
.racing-gallery .memory-inner > img { width: 100%; height: 100%; object-fit: contain; background: #10110f; }
.racing-gallery .memory-back { display: grid; align-content: center; gap: .75rem; padding: clamp(.85rem, 4vw, 2.35rem); background: #e8e4d5; color: #302e26; font-family: "Bradley Hand", "Segoe Print", cursive; font-size: clamp(1rem, 2vw, 1.6rem); line-height: 1.38; }
.racing-gallery .memory-back > :first-child { font-family: system-ui, sans-serif; font-size: .78rem; font-weight: 680; text-transform: uppercase; letter-spacing: .085em; }
.racing-gallery figcaption { display: grid; gap: .25rem; }
.racing-gallery figcaption strong { color: var(--ink); }
.racing-gallery .text-link { justify-self: start; margin-top: 0; }
.steps li { margin-block: .8rem; padding-inline-start: .4rem; }
.racing-gallery .replay-link { display: inline-grid; place-items: center; justify-self: start; width: 2.75rem; min-height: 2.75rem; margin-top: .15rem; border: 1px solid var(--line); border-radius: .35rem; color: #ed3838; }
.racing-gallery .replay-link:hover { color: #ff5555; background: #1d1313; border-color: #573232; }

.schedule-section { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.65rem; }
.schedule-table { min-width: 42rem; }
.schedule-table thead { background: var(--panel); }
.schedule-table td, .schedule-table th { padding: .62rem .7rem; vertical-align: top; }
.schedule-table tbody th { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--muted); }
.schedule-table td { width: 17.5%; line-height: 1.35; }

.hero-portrait { width: min(100%, 24rem); margin-inline: auto; }
.hero-visual.hero-portrait > img { width: 100%; height: auto; max-height: none; border: 1px solid var(--line); border-radius: .55rem; }
.featured-work img { border-radius: .42rem; }
@media (min-width: 52rem) { .hero-portrait { justify-self: end; margin-inline: 0; } }
@media (prefers-reduced-motion: no-preference) {
  .hero > div, .hero-portrait { animation: hero-enter .38s ease-out both; }
  .hero-portrait { animation-delay: .06s; }
}
@keyframes hero-enter {
  from { opacity: .72; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: no-preference) {
  .scroll-revealed { animation: scroll-reveal .42s cubic-bezier(.2,.7,.3,1); }
}
@keyframes scroll-reveal {
  from { opacity: .68; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
