@font-face {
  font-family: "Rajdhani";
  src: url("../fonts/Rajdhani-Bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}
:root { --paper: #151d28; --ink: #e5e7eb; --accent: #facc15; --line: #334155; --muted: #94a3b8; --panel: #1e2936; }
* { box-sizing: border-box; }
html { color-scheme: dark; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "Rajdhani", Arial, Helvetica, sans-serif; font-weight: 700; line-height: 1.65; }
::selection { background: var(--accent); color: var(--paper); }
a { transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease; }
main > *, .hero > * { min-width: 0; }
a { color: inherit; text-underline-offset: 5px; }
a:hover { color: var(--accent); }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 5px; }
.site-header, main, footer { margin-inline: auto; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.site-header { border-top: 3px solid var(--accent); }
.brand { font-family: "Rajdhani", Arial, Helvetica, sans-serif; font-size: clamp(26px, 2.5vw, 34px); font-weight: 700; text-decoration: none; letter-spacing: 0; line-height: 1.2; }
.brand span, h1 span { color: var(--accent); }
nav { display: flex; flex-wrap: wrap; }
nav a {
  font-size: 14px;
  text-decoration: none;
  padding: 7px 10px;
  border: 1px solid transparent;
}
nav a:hover, nav a:focus-visible {
  color: var(--accent);
  background-color: #facc150d;
  border-color: #facc154d;
  text-shadow: 0 0 12px #facc1570;
}
nav a[aria-current="page"] {
  color: var(--accent);
  background-color: #facc1514;
  border-color: #facc1570;
  box-shadow: inset 0 -2px var(--accent), 0 0 16px #facc1526;
  text-shadow: 0 0 10px #facc1580;
}
nav a { min-height: 44px; display: inline-flex; align-items: center; }
nav a[aria-current] { font-weight: 700; }
.skip-link { position: absolute; top: -100px; left: 12px; padding: 12px; background: var(--panel); z-index: 2; }
.skip-link:focus { top: 10px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: "Rajdhani", Arial, Helvetica, sans-serif; font-weight: 700; }
h1 { font-size: clamp(36px, 5.6vw, 72px); line-height: 1.2; letter-spacing: -.015em; margin-bottom: 28px; }
h2 { font-size: clamp(25px, 3vw, 36px); line-height: 1.25; letter-spacing: 0; }
h3 { font-size: 21px; line-height: 1.3; }
.eyebrow { color: var(--accent); font-size: 16px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; margin-bottom: 22px; }
.eyebrow, .muted, .note, dt, footer {
  font-family: "Rajdhani", Arial, Helvetica, sans-serif;
}
.lead { font-size: 19px; color: var(--muted); max-width: 650px; }
.hero { display: grid; grid-template-columns: 1.4fr 1fr; align-items: center; padding: 82px 0; }
.button { display: inline-flex; gap: 32px; padding: 14px 22px; background: var(--accent); color: var(--paper); text-decoration: none; font-size: 14px; }
.button:hover { background: var(--panel); color: var(--ink); }
.button { border: 1px solid var(--accent); font-weight: 700; }
.text-link { font-size: 14px; font-weight: 700; }
.profile-panel { color: var(--ink); border-radius: 2px; }
.profile-panel {
  position: relative;
  border-top: 2px solid var(--accent);
  background-image: linear-gradient(135deg, #facc1509, transparent 65%);
}
.profile-panel::after {
  content: "";
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 20px;
  height: 20px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  pointer-events: none;
}
.profile-panel .eyebrow { color: var(--accent); }
.profile-panel p:not(.eyebrow) { color: var(--muted); }
.profile-panel a { color: var(--ink); font-size: 14px; }
.monogram { font-size: clamp(85px, 12vw, 160px); line-height: 1.3; font-weight: 700; letter-spacing: -.08em; padding: 20px 0 35px; }
.monogram span { color: var(--accent); }
.monogram { text-shadow: 0 0 40px #facc1512; border-bottom: 1px solid var(--line); margin-bottom: 25px; }
.section { padding: 52px 0; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; }
.muted, .note { color: var(--muted); font-size: 14px; }
.page-heading { padding: 75px 0 35px; border-bottom: 1px solid var(--line); }
.page-heading { position: relative; }
.page-heading::after { content: ""; position: absolute; bottom: -1px; left: 0; height: 2px; background: var(--accent); }
.split { display: grid; grid-template-columns: 1fr 1.4fr; border-bottom: 1px solid var(--line); }
.split p { max-width: 650px; }
.education { margin: 0; }
.education-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.education-layout > * { min-width: 0; }
.education-layout .graduation-photo { margin: 0; }
@media (max-width: 850px) {
  .education-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
}
/* Editor-inspired syntax colors distinguish labels, disciplines, and schools. */
.education dt { color: #c586c0; }
.education dd { color: #9cdcfe; }
.education dd span { color: #ce9178; }
html[data-theme="light"] .education dt { color: #7a3e91; }
html[data-theme="light"] .education dd { color: #005a8c; }
html[data-theme="light"] .education dd span { color: #8d421c; }
.education > div { display: grid; grid-template-columns: 1fr 2fr; gap: 25px; border-bottom: 1px solid var(--line); }
dt { color: var(--muted); }
dd { margin: 0; font-size: 19px; }
dd span { display: block; color: var(--muted); font-size: 14px; }
dd span:not(:last-child) { margin-bottom: 18px; }
.tags { display: flex; flex-wrap: wrap; list-style: none; padding: 0; }
.tags li { border-radius: 2px; }
.skill-list article { display: grid; border-bottom: 1px solid var(--line); }
.note { margin-top: 25px; }
.email { display: inline-block; font-size: clamp(23px, 4.5vw, 55px); letter-spacing: -.04em; font-weight: 700; margin-bottom: 20px; overflow-wrap: anywhere; }
.contact-panel > p:not(.eyebrow) { color: var(--muted); }
.contact-form { max-width: 650px; margin-block: 32px; }
.contact-form[hidden], .contact-form [hidden] { display: none; }
.form-field { margin-bottom: 24px; }
.form-field label { display: block; margin-bottom: 8px; }
.form-field input, .form-field textarea {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  color: var(--ink);
  font: 16px/1.5 Arial, Helvetica, sans-serif;
}
.form-field textarea { resize: vertical; }
.form-field [aria-invalid="true"] { border: 2px solid var(--accent); }
.field-error { color: var(--accent); margin-block: 8px 0; }
.form-field .muted { margin-block: 8px 0; }
.contact-form button { font: inherit; cursor: pointer; min-height: 44px; }
.form-field input:focus-visible, .form-field textarea:focus-visible,
.contact-form button:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
#contact-status { margin-block: 20px 12px; }
footer { border-top: 1px solid var(--line); padding: 26px 0; display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 12px; }
footer p { margin: 0; }
@media (max-width: 850px) {
  .site-header { flex-direction: column; align-items: flex-start; gap: 15px; }
  .hero { gap: 35px; padding: 50px 0; }
}
@media (max-width: 580px) {
  .contact-panel { padding: 25px 18px; }
  nav { gap: 18px; }
  nav a { font-size: 13px; }
  .hero, .split, .education > div, .skill-list article { grid-template-columns: 1fr; }
  .hero { gap: 35px; }
  .profile-panel { padding: 28px; }
  .monogram { font-size: 95px; padding: 0 0 15px; }
   .split { gap: 15px; }
  .section { padding: 35px 0; }
  .page-heading { padding-top: 45px; }
  .section-heading { display: block; }
  .education > div, .skill-list article { gap: 10px; }
  footer { flex-wrap: wrap; }
  footer span { width: 100%; }
}
/* HUD details frame the content without adding simulated system activity. */
nav { counter-reset: navigation; gap: 18px; }
nav a { gap: 7px; }
nav a::before {
  counter-increment: navigation;
  content: "0" counter(navigation);
  color: var(--muted);
  font: 700 10px "Rajdhani", Arial, Helvetica, sans-serif;
}
nav a[aria-current]::before { color: var(--accent); }
.brand::before { content: "["; color: var(--accent); margin-right: 10px; font-weight: 700; }
.profile-panel, .contact-panel { position: relative; }
 .contact-panel {
  background-image: linear-gradient(135deg, #facc1506, transparent 45%);
}
 .contact-panel::after {
  position: absolute;
  border-top: 1px solid var(--accent);
  border-right: 1px solid var(--accent);
  pointer-events: none;
}
.profile-panel .monogram {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  font-size: clamp(64px, 8vw, 100px);
}
.profile-panel { background-color: var(--panel); }
.page-heading { padding-right: 240px; isolation: isolate; }
.page-heading::before {
  content: "";
  position: absolute;
  z-index: -1;
  right: 0;
  top: 35px;
  width: 225px;
  height: 225px;
  background: url("../images/hud-ring.svg") center / contain no-repeat;
  pointer-events: none;
}
.section-heading { border-bottom: 1px solid var(--line); padding-bottom: 15px; }
.section-heading h2 { margin-bottom: 0; }
.education > div, .skill-list article { border-left: 2px solid var(--line); padding-left: 22px; }
.education > div:hover, .skill-list article:hover { border-left-color: var(--accent); }
.tags li { border-left: 2px solid #facc1566; }
.button { border-radius: 0; box-shadow: 4px 4px 0 #facc1520; }
.linkedin-button {
  background: #132638;
  color: #a9d3ff;
  border-color: #70b5f9;
  box-shadow: 4px 4px 0 #70b5f933;
}
.linkedin-button:hover { background: #203d55; color: #e3f1ff; }
html[data-theme="light"] .linkedin-button {
  background: #0a66c2;
  color: #fff;
  border-color: #0a66c2;
  box-shadow: 4px 4px 0 #0a66c233;
}
html[data-theme="light"] .linkedin-button:hover { background: #084d94; }
@media (max-width: 1050px) {
  .site-header { flex-direction: column; align-items: flex-start; gap: 15px; }
}
@media (max-width: 850px) {
  .hero { grid-template-columns: 1.2fr 1fr; }
  .profile-panel { padding: 22px; }
  .page-heading { padding-right: 150px; }
  .page-heading::before { width: 140px; height: 140px; top: 60px; opacity: .4; }
}
@media (max-width: 580px) {
  nav { gap: 7px 16px; }
  nav a { gap: 5px; }
  .hero { grid-template-columns: 1fr; }
  .profile-panel .monogram { max-width: 280px; margin-inline: auto; font-size: 80px; }
  .page-heading { padding-right: 0; min-height: 0; }
  .page-heading::before { display: none; }
}
/* Editor-inspired project entries with room for screenshots and source links. */
.workspace-heading { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 16px; margin-bottom: 28px; }
.workspace-heading .eyebrow { margin-bottom: 10px; }
.workspace-heading h2 { margin-bottom: 0; }
 .project-visual > p { font-family: "Rajdhani", Arial, Helvetica, sans-serif; }
.code-projects { display: grid; }
.code-project { min-width: 0; }
.code-project-body { display: grid; grid-template-columns: 1.2fr 1fr; }
.project-brief { min-width: 0; }
.project-brief .eyebrow { margin-bottom: 12px; }
.project-brief h3 { font-size: clamp(23px, 3vw, 30px); }
.project-brief h3 > span { color: var(--accent); margin-left: 4px; }
.project-brief > p:not(.eyebrow) { color: var(--muted); font-size: 14px; }
.code-key { color: var(--accent); }
.project-visual { min-width: 0; display: flex; flex-direction: column; border-left: 1px solid var(--line); }
.project-visual > p { color: var(--muted); margin: 16px 0 0; font-size: 11px; }
@media (max-width: 760px) {
  .code-project-body { grid-template-columns: 1fr; }
  .project-visual { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 400px) {
  .project-brief, .project-visual { padding: 18px; }
}
/* Center each skill group within its content column. */
.skill-list article {
  align-items: center;
}
.skill-list article > div {
  min-width: 0;
  text-align: center;
}
.skill-list article > div .tags {
  justify-content: center;
  margin-bottom: 0;
}
/* Translucent category plaques keep skill labels prominent and easy to read. */
.skill-list article > .eyebrow {
  position: relative;
  align-self: center;
  display: block;
  margin: 0;
  color: var(--accent);
  line-height: 1.6;
  letter-spacing: .045em;
  text-transform: none;
  overflow-wrap: anywhere;
  border-left: 3px solid var(--accent);
}
.skill-list article > .eyebrow::after {
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 10px;
  height: 10px;
  border-right: 1px solid var(--accent);
  border-bottom: 1px solid var(--accent);
  pointer-events: none;
}
@media (max-width: 850px) {
  .skill-list article > .eyebrow { padding: 18px 16px; }
}
@media (max-width: 580px) {
  .skill-list article > .eyebrow { margin-bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  a { transition: none; }
}
/* A quieter reading rhythm: one chapter at a time, with HUD detail at the opening. */
body {
  /* A page-color layer fades the faint grid away toward the right. */
  background-image: radial-gradient(ellipse at 85% 0%, #33415555, transparent 55%),
    linear-gradient(90deg, transparent 10%, var(--paper) 92%),
    linear-gradient(#94a3b80f 1px, transparent 1px),
    linear-gradient(90deg, #94a3b80f 1px, transparent 1px);
  background-size: auto, auto, 48px 48px, 48px 48px;
}
.site-header, main, footer { width: min(1080px, 88%); }
.site-header { padding-block: 24px; }
nav a::before, .brand::before { content: none; }
.hero { min-height: 72vh; padding-block: 90px; gap: 64px; }
.hero .text-link { display: inline-block; margin-top: 20px; }
.profile-panel {
  border: 0;
  background: none;
  box-shadow: none;
  padding: 0;
}
.profile-panel p:not(.eyebrow) { max-width: none; text-align: center; font-size: 18px; }
.profile-panel::after,
.contact-panel::after, .section-heading::before { content: none; }
.section { padding-block: 90px; }
.story-chapter { max-width: 780px; border-top: 1px solid var(--line); }
.story-chapter h2 { max-width: 650px; font-size: clamp(30px, 4vw, 46px); }
.story-chapter .lead { margin-bottom: 28px; }
.perspective-chapter { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); max-width: none; gap: 56px; align-items: center; }
.perspective-chapter .portrait-frame { width: 100%; max-width: none; margin: 0; box-shadow: 8px 8px 0 #0002, 0 0 28px #facc1509; }
.perspective-chapter .portrait-frame img { aspect-ratio: 3 / 2; object-fit: contain; }
.portrait-mark { display: flex; justify-content: space-between; gap: 16px; padding: 2px 4px 12px; color: var(--accent); font: 12px/1.5 Consolas, "Courier New", monospace; letter-spacing: .08em; }
.portrait-frame figcaption { border-top: 1px solid var(--line); margin-top: 12px; }

.service-chapter .portrait-frame { max-width: 380px; justify-self: center; }
/* The portrait asset contains the crop; keep it in normal flow on all screens. */
.service-chapter .portrait-frame img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}
@media (max-width: 850px) {
  .perspective-chapter { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .perspective-chapter .portrait-frame { max-width: 560px; }
}
.page-heading { padding-block: 90px 70px; min-height: 0; }
.section-heading { border: 0; padding: 0; margin-bottom: 36px; }
.split { gap: 70px; }
.education > div { border-left: 0; padding: 28px 0; }
.skill-list { padding-block: 20px 0; }
.skill-list article { padding: 70px 0; border-left: 0; }
.skill-list article > .eyebrow {
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  font-size: 16px;
  text-align: left;
}
.skill-list article > .eyebrow::after { content: none; }
.skill-list h2 { margin-bottom: 18px; }
.skill-context { color: var(--muted); margin-bottom: 24px; }
.tags { gap: 10px 22px; }
.tags li { border: 0; border-bottom: 1px solid var(--line); background: none; padding: 8px 0; }
.code-projects { gap: 0; }
.code-project { background: none; box-shadow: none; border: 0; border-bottom: 1px solid var(--line); padding-block: 55px; }
.code-project-body { gap: 48px; align-items: center; }
.project-brief { padding: 0; }
.project-visual { border: 0; padding: 0; background: none; gap: 24px; }
.contact-panel { margin-block: 70px 90px; padding: 0 0 0 28px; border: 0; border-left: 2px solid var(--accent); background: none; box-shadow: none; }
.story-next { border-top: 1px solid var(--line); padding-block: 60px 85px; margin-top: 35px; }
.story-next h2 { max-width: 650px; margin-bottom: 24px; }
footer { padding-block: 30px; }
@media (max-width: 850px) {
  .hero { gap: 32px; }
  .split { gap: 30px; }
}
@media (max-width: 580px) {
  .hero { min-height: 0; padding-block: 64px; }
  .hero .profile-panel { display: none; }
  .section { padding-block: 58px; }
  .page-heading { padding-block: 60px 42px; }
  .skill-list { padding-block: 0; }
  .skill-list article { padding-block: 44px; gap: 24px; }
  .skill-list article > .eyebrow { margin-bottom: 0; text-align: center; }
  .code-project { padding-block: 40px; }
  .code-project-body { gap: 24px; }
  .project-brief, .project-visual { padding: 0; }
  .contact-panel { margin-block: 50px; padding-left: 18px; }
  .story-next { padding-block: 44px 60px; }
  footer { flex-direction: column; gap: 12px; }
}
/* Projects unfold as three chapters; source previews work without JavaScript. */
.chapter-nav {
  position: sticky;
  top: 12px;
  z-index: 3;
  display: flex;
  gap: 8px;
  padding: 12px;
  margin: 36px 0 20px;
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: 0 10px 30px #0003;
}
.chapter-nav a { flex: 1; justify-content: center; text-align: center; }
.chapter-nav a span { color: var(--accent); margin-right: 8px; }
.chapter-progress { position: absolute; inset: auto 0 -2px; height: 2px; background: var(--line); }
.chapter-progress span { display: block; height: 100%; background: var(--accent); transform: scaleX(var(--reading-progress, 0)); transform-origin: left; }
.projects-page .code-project { padding-block: 100px; scroll-margin-top: 115px; }
.projects-page .code-project-body { grid-template-columns: minmax(0, .9fr) minmax(0, 1.2fr); align-items: start; gap: 60px; }
.projects-page .project-brief { position: sticky; top: 125px; padding: 24px 0; isolation: isolate; }
.projects-page .project-brief h3 { font-size: clamp(36px, 4.5vw, 60px); line-height: 1.1; margin-bottom: 28px; }
.projects-page .project-brief > p:not(.eyebrow) { font-size: 17px; }
.projects-page .project-brief .chapter-hook { color: var(--ink); font-size: 24px; max-width: 320px; line-height: 1.3; margin-bottom: 36px; }
.chapter-instrument { position: relative; width: 140px; height: 140px; margin-bottom: 32px; opacity: .55; background: url("../images/hud-ring.svg") center / contain no-repeat; }
.chapter-instrument::after { content: ""; position: absolute; left: 145px; top: 50%; width: min(10vw, 100px); height: 16px; border-top: 1px solid var(--accent); border-right: 1px solid var(--line); pointer-events: none; }
.project-flow { counter-reset: sequence; list-style: none; padding: 0; margin: 32px 0 0; border-left: 1px solid var(--line); }
.project-flow li { padding: 12px 16px; font: 14px/1.5 Consolas, "Courier New", monospace; color: var(--muted); }
.project-flow li::before { counter-increment: sequence; content: "0" counter(sequence) " / "; color: var(--accent); }
.projects-page .project-visual { gap: 56px; padding-block: 24px; }
@media (prefers-reduced-motion: no-preference) {
  .projects-page.story-motion [data-reveal] { opacity: .45; transform: translateY(24px); transition: opacity 650ms ease, transform 650ms ease; }
  .projects-page.story-motion [data-reveal].is-revealed { opacity: 1; transform: none; }
}
@media (max-width: 850px) {
  .projects-page .code-project-body { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .projects-page .project-brief { position: relative; top: auto; }
  .projects-page .project-brief .chapter-hook { max-width: none; }
  .projects-page .code-project { padding-block: 60px; }
  .chapter-nav a { font-size: 13px; padding: 8px 4px; }
  .chapter-nav a span { margin-right: 3px; }
}
@media (max-height: 760px) {
  .projects-page .project-brief { position: relative; top: auto; }
}
@media (max-width: 580px) {
  .chapter-nav { top: 0; gap: 4px; padding: 6px; }
  .chapter-nav a { flex-direction: column; gap: 2px; }
  .projects-page .project-brief > p:not(.eyebrow) { font-size: 16px; }
  .chapter-instrument { width: 100px; height: 100px; }
  .chapter-instrument::after { left: 105px; width: 60px; }
}
.projects-page .interactive-project .code-project-body {
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(20px, 4vw, 36px);
  text-align: center;
}
.projects-page .interactive-project .project-brief {
  position: static;
  padding: 0;
}
.projects-page .interactive-project .project-brief h3 { margin-bottom: 12px; }
.project-hud {
  display: grid;
  grid-template-columns: 1fr 48px 1fr;
  align-items: center;
  gap: 12px;
  width: min(100%, 260px);
  margin: 0 auto 12px;
}
.project-hud::before,
.project-hud::after {
  content: "";
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent));
  opacity: .55;
}
.project-hud::after { transform: scaleX(-1); }
.project-hud span {
  aspect-ratio: 1;
  background: url("../images/hud-ring.svg") center / contain no-repeat;
}
.projects-page .interactive-project .project-visual {
  align-items: center;
  gap: clamp(28px, 5vw, 48px);
  padding: 0;
}
.game-player {
  width: 100%;
  max-width: 960px;
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: clamp(8px, 2vw, 20px);
  border: 1px solid var(--line);
  background: var(--panel);
}
.game-player p { margin: 0; color: var(--muted); }
.game-player.game-video { display: none; }
@media (max-width: 580px),
       (max-width: 850px) and (pointer: coarse),
       (max-height: 580px) and (pointer: coarse) {
  .game-player:not(.game-video) { display: none; }
  .game-player.game-video {
    display: grid;
    padding: 20px;
  }
}
.project-game {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 8 / 5;
  border: 1px solid var(--line);
  background: var(--paper);
}
.game-launch {
  display: grid;
  place-items: center;
  text-decoration: none;
}
.game-launch:is(:hover, :focus-visible) .button {
  background: var(--panel);
  color: var(--ink);
}
.project-demo {
  width: min(100%, 960px);
  min-width: 0;
  padding: clamp(14px, 3vw, 28px);
  border: 1px solid var(--line);
  background: var(--panel);
  text-align: left;
}
.project-demo h4 { margin: 0 0 16px; font-size: 1.35rem; }
.demo-fields,
.sorting-results {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 16px;
}
.demo-fields .form-field { margin: 0; }
.demo-fields label,
.demo-fields p { margin: 0 0 6px; }
.demo-fields p { color: var(--muted); }
.demo-fields select {
  display: block;
  width: 100%;
  min-height: 50px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font: 16px/1.5 Arial, Helvetica, sans-serif;
}
.sorting-results { margin-top: 16px; }
.sorting-results[hidden] { display: none; }
.sorting-result {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--paper);
}
.sorting-result output,
#sorting-current {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  overflow-wrap: anywhere;
  font: 1rem/1.5 Consolas, "Courier New", monospace;
  user-select: all;
}
.sorting-pass { margin: 0; }
.sorting-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sorting-actions button {
  min-height: 44px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.sorting-actions button:disabled { opacity: .55; cursor: default; }
.sorting-actions button:enabled:hover { border-color: var(--accent); }
.sorting-actions button:focus-visible,
.demo-fields select:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (max-width: 580px) {
  .demo-fields,
  .sorting-results { grid-template-columns: minmax(0, 1fr); }
}
.news-demo h4 { margin-bottom: 6px; }
.news-demo .demo-fields { margin-block: 16px; }
.demo-note { margin: 0; color: var(--muted); }
.news-results {
  margin: 8px 0 0;
  padding-inline-start: 2.25rem;
}
.news-results li {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.news-results li::marker { color: var(--accent); }
.news-results time { color: var(--muted); font: .875rem Consolas, "Courier New", monospace; }
.news-results h5 { margin: 4px 0; font-size: 1.0625rem; }
.news-results p { margin: 0; }
.project-source {
  width: min(100%, 720px);
  min-width: 0;
  color-scheme: dark;
  border: 1px solid #435063;
  background: #171c24;
  color: #e5e7eb;
  text-align: left;
}
.project-source summary {
  display: block;
  cursor: pointer;
}
.project-source summary::-webkit-details-marker { display: none; }
.project-source summary:focus-visible,
.project-source-full:focus-visible { outline: 2px solid #facc15; outline-offset: -3px; }
.source-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 10px 16px;
  border-bottom: 1px solid #435063;
  background: #232b37;
}
.source-toolbar .source-filename {
  margin: 0;
  color: #c5e6ff;
  font: 700 .9rem/1.5 Consolas, "Courier New", monospace;
}
.source-action { color: #facc15; font-size: .875rem; }
.source-collapse,
.project-source[open] .source-expand,
.project-source[open] .project-source-preview { display: none; }
.project-source[open] .source-collapse { display: inline; }
.project-source-preview,
.project-source-full {
  padding: 16px;
  font: .875rem/1.65 Consolas, "Courier New", monospace;
  tab-size: 4;
}
.project-source-preview {
  display: block;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.project-source-full {
  max-height: min(60vh, 30rem);
  margin: 0;
  overflow: auto;
}
@media (max-width: 850px) {
  .project-source-full {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
}
.projects-page :is(.game-player, .project-demo, .project-source) {
  position: relative;
  box-shadow: 0 0 0 0 transparent;
}
.projects-page :is(.game-player, .project-demo, .project-source)::before,
.projects-page :is(.game-player, .project-demo, .project-source)::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: solid var(--accent);
  opacity: .55;
  pointer-events: none;
}
.projects-page :is(.game-player, .project-demo, .project-source)::before {
  inset: -1px auto auto -1px;
  border-width: 2px 0 0 2px;
}
.projects-page :is(.game-player, .project-demo, .project-source)::after {
  inset: auto -1px -1px auto;
  border-width: 0 2px 2px 0;
}
.projects-page :is(.game-player, .project-demo, .project-source):focus-within,
.projects-page .project-source[open] {
  border-color: var(--accent);
  box-shadow: 0 0 16px #facc152e;
}
.projects-page :is(.game-player, .project-demo, .project-source):focus-within::before,
.projects-page :is(.game-player, .project-demo, .project-source):focus-within::after,
.projects-page .project-source[open]::before,
.projects-page .project-source[open]::after {
  width: 28px;
  height: 24px;
  opacity: 1;
}
@media (hover: hover) {
  .projects-page :is(.game-player, .project-demo, .project-source):hover {
    border-color: var(--accent);
    box-shadow: 0 0 16px #facc152e;
  }
  .projects-page :is(.game-player, .project-demo, .project-source):hover::before,
  .projects-page :is(.game-player, .project-demo, .project-source):hover::after {
    width: 28px;
    height: 24px;
    opacity: 1;
  }
}
@media (prefers-reduced-motion: no-preference) {
  html:not([data-hud-paused]) .projects-page :is(.game-player, .project-demo, .project-source) {
    transition: border-color 220ms ease, box-shadow 220ms ease;
  }
  html:not([data-hud-paused]) .projects-page :is(.game-player, .project-demo, .project-source)::before,
  html:not([data-hud-paused]) .projects-page :is(.game-player, .project-demo, .project-source)::after {
    transition: width 220ms ease, height 220ms ease, opacity 220ms ease;
  }
  html:not([data-hud-paused]) .projects-page.story-motion .project-brief:has(h3.is-revealed) .project-hud span {
    animation: project-hud-reveal 520ms ease-out both;
  }
}
@keyframes project-hud-reveal {
  from { opacity: .35; transform: rotate(-48deg) scale(.85); }
}
.source-comment { color: #9bb98a; }
.source-string { color: #e8aa91; }
.source-keyword { color: #8ac5ff; }
.source-type { color: #79d9c0; }
.source-number { color: #c5daa0; }
.work-source {
  width: 100%;
  max-width: 560px;
  margin: 0;
  justify-self: center;
  align-self: center;
}
.work-source .project-source-preview { margin: 0; }
/* The homepage moves from background, to service, to the work itself. */
.home-page .story-chapter { padding-block: 100px; scroll-margin-top: 110px; align-items: start; }
.home-page .story-chapter > div:first-child { position: sticky; top: 115px; padding-block: 18px; }
.home-page .chapter-instrument { width: 100px; height: 100px; margin-block: 24px 32px; }
.home-page .chapter-instrument::after { left: 105px; width: 75px; }
.home-page .service-chapter > div:first-child { grid-column: 2; grid-row: 1; }
.home-page .service-chapter > figure { grid-column: 1; grid-row: 1; }
.home-page .portrait-frame { align-self: center; }
@media (prefers-reduced-motion: no-preference) {
  .home-page.story-motion [data-reveal] { opacity: .45; transform: translateY(28px); transition: opacity 700ms ease, transform 700ms ease; }
  .home-page.story-motion .is-revealed { opacity: 1; transform: none; }
  .home-page.story-motion .portrait-frame { transform: translateY(calc((var(--chapter-progress, .5) - .5) * -64px)) rotate(calc((var(--chapter-progress, .5) - .5) * 1.4deg)); }
  .home-page.story-motion .service-chapter .portrait-frame { transform: translateY(calc((var(--chapter-progress, .5) - .5) * 64px)) rotate(calc((var(--chapter-progress, .5) - .5) * -1.4deg)); }
  .home-page.story-motion .chapter-instrument { animation: hud-orbit 90s linear infinite; }
}
@media (max-width: 850px) {
  .home-page .story-chapter { padding-block: 60px; }
  .home-page .story-chapter > div:first-child { position: relative; top: auto; }
  .home-page .service-chapter > div:first-child, .home-page .service-chapter > figure { grid-column: auto; grid-row: auto; }
}
@media (max-height: 760px) { .home-page .story-chapter > div:first-child { position: relative; top: auto; } }
/* Interactive skill chapters share the project reading-progress behavior. */
.skills-page .skill-list article { padding-block: 100px; scroll-margin-top: 120px; align-items: start; gap: 64px; }
.skills-page .skill-copy { padding-block: 24px; }
.skills-page .skill-copy h2 { font-size: clamp(32px, 4vw, 48px); }
.skills-page .skill-copy .chapter-instrument { margin-inline: auto; }
.skills-page .skill-visual { position: sticky; top: 115px; }
.skill-hint { color: var(--muted); font-size: 14px; }
.skill-explorer { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; list-style: none; padding: 0; margin: 28px 0 0; text-align: left; }
.skill-explorer li { min-width: 0; }
.skill-explorer details { border: 1px solid var(--line); border-top: 2px solid var(--accent); background: var(--panel); }
.skill-explorer summary { padding: 16px; cursor: pointer; font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }
.skill-explorer summary::marker { color: var(--accent); }
.skill-explorer summary:hover { color: var(--accent); }
.skill-explorer summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.skill-explorer details[open] { border-color: var(--accent); box-shadow: 4px 4px 0 #facc1514; }
.skill-explorer details p { padding-inline: 16px; margin-bottom: 18px; color: var(--muted); font-size: 15px; }
.skill-explorer details a { display: inline-block; margin: 0 16px 18px; font-weight: 700; font-size: 14px; }
@media (prefers-reduced-motion: no-preference) {
  .skills-page.story-motion [data-reveal] { opacity: .45; transform: translateY(24px); transition: opacity 650ms ease, transform 650ms ease; }
  .skills-page.story-motion .is-revealed { opacity: 1; transform: none; }
  .skills-page.story-motion .skill-visual .hud-picture { transform: translateY(calc((var(--chapter-progress, .5) - .5) * -48px)) rotate(calc((var(--chapter-progress, .5) - .5) * 1.4deg)); }
  .skills-page.story-motion .chapter-instrument { animation: hud-orbit 90s linear infinite reverse; }
}
@media (max-width: 850px) {
  .skills-page .skill-list article { grid-template-columns: minmax(0, 1fr); padding-block: 60px; gap: 32px; }
  .skills-page .skill-visual { position: relative; top: auto; }
  .skills-page .hud-picture { max-width: 460px; margin-inline: auto; }
}
@media (max-height: 760px) { .skills-page .skill-visual { position: relative; top: auto; } }
@media (max-width: 580px) { .skill-explorer { grid-template-columns: minmax(0, 1fr); } }
/* HUD accents frame the story without interrupting the reading column. */
.profile-panel .monogram { position: relative; isolation: isolate; background: none; }
.profile-panel .monogram::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("../images/hud-ring.svg") center / contain no-repeat;
  pointer-events: none;
}
.page-heading.picture-heading::before { content: ""; width: 56px; height: 56px; top: 16px; opacity: .6; }
.motion-toggle {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.motion-toggle[hidden] { display: none; }
.motion-toggle:hover { border-color: var(--accent); }
.motion-toggle:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
@keyframes hud-orbit { to { transform: rotate(360deg); } }
@keyframes hud-glow { from { opacity: .55; } to { opacity: 1; } }
@keyframes hud-rail-drift { to { background-position: center 440px; } }
@keyframes hud-rail-glow { from { opacity: .45; } to { opacity: .75; } }
@media (prefers-reduced-motion: no-preference) {
  .page-heading::before { animation: hud-orbit 80s linear infinite; }
  .profile-panel .monogram::before { animation: hud-orbit 100s linear infinite reverse; }
  .hud-picture::before, .hud-picture::after { animation: hud-glow 5s ease-in-out infinite alternate; }
  main::before, main::after {
    animation: hud-rail-drift 32s linear infinite, hud-rail-glow 8s ease-in-out infinite alternate;
  }
  main::after { animation-direction: reverse, alternate-reverse; }
  html[data-hud-paused] .page-heading::before,
  html[data-hud-paused] .profile-panel .monogram::before,
  html[data-hud-paused] .hud-picture::before,
  html[data-hud-paused] .hud-picture::after,
  html[data-hud-paused] main::before,
  html[data-hud-paused] main::after { animation-play-state: paused; }
}
.skill-list article { grid-template-columns: 1fr 1.2fr; gap: 64px; }
.skill-list article > .skill-visual { text-align: left; }
.skill-visual > .eyebrow { margin-bottom: 20px; font-size: 17px; }
.hud-picture {
  position: relative;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-top: 2px solid #facc1590;
  background: var(--panel);
  box-shadow: 8px 8px 0 #0002;
}
.hud-picture::before, .hud-picture::after {
  content: "";
  position: absolute;
  width: 28px;
  height: 28px;
  pointer-events: none;
}
.hud-picture::before { top: -2px; left: -1px; border-top: 2px solid var(--accent); border-left: 2px solid var(--accent); }
.hud-picture::after { bottom: -1px; right: -1px; border-bottom: 2px solid var(--accent); border-right: 2px solid var(--accent); }
.hud-picture img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.hud-picture.contact-photo img { aspect-ratio: auto; object-fit: contain; }
.hud-picture.background-portrait { margin: 24px 0 0; }
.hud-picture.background-portrait img { aspect-ratio: auto; object-fit: contain; }
.hud-picture.design-artwork img {
  aspect-ratio: auto;
  object-fit: contain;
}
.skills-page .skill-list .design-chapter { grid-template-columns: minmax(0, 1fr); }
.design-description { color: #a9d3ff; }
html[data-theme="light"] .design-description { color: #005a8c; }
.design-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-block-start: 20px;
}
.artwork-preview { display: block; }
.design-artwork::before, .design-artwork::after { animation: none; }

@media (prefers-reduced-motion: no-preference) {
  html:not([data-hud-paused]) .design-artwork::before,
  html:not([data-hud-paused]) .design-artwork::after {
    transition: width 220ms ease-out, height 220ms ease-out;
  }

  html:not([data-hud-paused]) .design-artwork:has(.artwork-preview:is(:focus-visible, :active))::before,
  html:not([data-hud-paused]) .design-artwork:has(.artwork-preview:is(:focus-visible, :active))::after {
    width: 44px;
    height: 44px;
  }
}

@media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
  html:not([data-hud-paused]) .artwork-preview img { transition: transform 220ms ease-out; }
  html:not([data-hud-paused]) .design-artwork:hover .artwork-preview img { transform: scale(1.025); }

  html:not([data-hud-paused]) .design-artwork:hover::before,
  html:not([data-hud-paused]) .design-artwork:hover::after {
    width: 44px;
    height: 44px;
  }
}

.artwork-viewer {
  width: min(46rem, calc(100% - 24px));
  max-height: calc(100% - 24px);
  padding: 12px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
}
.artwork-viewer::backdrop { background: #000d; }
.artwork-viewer form { display: flex; justify-content: flex-end; }
.artwork-viewer figure { margin: 8px 0; text-align: center; }
.artwork-viewer img {
  display: block;
  width: 100%;
  height: min(65dvh, 44rem);
  object-fit: contain;
  touch-action: pan-y pinch-zoom;
}
.artwork-viewer figcaption { padding-block: 8px; }
.artwork-controls { display: flex; justify-content: space-between; gap: 8px; }
.artwork-viewer button {
  min-height: 44px;
  padding: 6px 10px;
  color: inherit;
  background: var(--paper);
  border: 1px solid var(--line);
  cursor: pointer;
}
.artwork-viewer button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
html:has(.artwork-viewer[open]) { overflow: hidden; }
@media (max-width: 580px) {
  .design-gallery { grid-template-columns: minmax(0, 1fr); }
}
.hud-picture figcaption { padding-top: 12px; color: var(--muted); font: 700 11px/1.6 "Rajdhani", Arial, Helvetica, sans-serif; }
.picture-heading { display: grid; grid-template-columns: 1.2fr 1fr; gap: 60px; align-items: center; padding-right: 0; }
.picture-heading::before { content: none; }
.skill-list article:nth-child(2) { background: linear-gradient(90deg, transparent, #facc1505); }
@media (max-width: 850px) {
  .skill-list article, .picture-heading { gap: 32px; }
}
@media (max-width: 580px) {
  .skill-list article, .picture-heading { grid-template-columns: 1fr; }
  .skill-list article > .skill-visual { text-align: center; }
  .skill-visual > .eyebrow { font-size: 16px; }
  .picture-heading { padding-top: 60px; }
  .hud-picture { max-width: 400px; width: 100%; margin-inline: auto; }
}
main { position: relative; }
main::before, main::after {
  content: "";
  position: absolute;
  top: 70px;
  bottom: 70px;
  width: 20px;
  background: url("../images/hud-rail.svg") top center / 20px 440px repeat-y;
  opacity: .65;
  pointer-events: none;
}
main::before { right: calc(100% + 24px); }
main::after { left: calc(100% + 24px); transform: scaleX(-1); }
.site-header {
  background: linear-gradient(90deg, #facc1508, transparent 55%);
  border-bottom-color: #64748b;
}
.page-heading::before { opacity: .45; }
.page-heading::after { width: 85px; box-shadow: 94px 0 #facc1570, 110px 0 #facc1530; }
.story-chapter, .story-next, .code-project { position: relative; }
.story-chapter::before, .story-next::before, .code-project::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 32px;
  height: 16px;
  border-top: 2px solid #facc1590;
  border-right: 1px solid #facc1560;
  pointer-events: none;
}
.story-next { background: linear-gradient(110deg, #facc1507, transparent 65%); }
.project-brief .eyebrow { font-size: 18px; }
.contact-panel::after {
  content: "";
  top: 0;
  right: 0;
  width: 28px;
  height: 28px;
}
@media (max-width: 1050px) {
  main::before, main::after { display: none; }
}
@media (max-width: 580px) {
  .page-heading { padding-top: 90px; }
  .page-heading::before {
    display: block;
    width: 56px;
    height: 56px;
    top: 18px;
    opacity: .6;
  }
  .story-next { padding-right: 12px; }
}

/* Move the initials independently of the surrounding HUD ring. */
.profile-panel .monogram { perspective: 650px; }
.monogram-letters {
  display: inline-block;
  font-weight: inherit;
  transform-origin: center;
}
@keyframes monogram-depth {
  0%, 100% {
    transform: translateZ(0) rotateX(0);
    text-shadow: 0 2px 4px #0006;
  }
  50% {
    transform: translateZ(75px) rotateX(-6deg);
    text-shadow: 0 14px 16px #0009, 0 0 22px #facc1530;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .monogram-letters { animation: monogram-depth 4.5s ease-in-out infinite; }
  html[data-hud-paused] .monogram-letters { animation-play-state: paused; }
}

/* Shared light theme colors. */
html[data-theme="light"] {
  color-scheme: light;
  --paper: #f4f6f8;
  --ink: #17202d;
  --accent: #855700;
  --line: #8c9bad;
  --muted: #475569;
  --panel: #e4eaf0;
}
.theme-toggle {
  flex-shrink: 0;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
html[data-theme="light"] nav a:hover,
html[data-theme="light"] nav a:focus-visible,
html[data-theme="light"] nav a[aria-current="page"] {
  border-color: var(--accent);
  background: #8557000d;
  text-shadow: none;
  box-shadow: inset 0 -2px var(--accent);
}
html[data-theme="light"] .site-header { border-bottom-color: var(--line); }
html[data-theme="light"] .code-key { color: var(--accent); }
html[data-theme="light"] .profile-panel .monogram::before,
html[data-theme="light"] .page-heading::before,
html[data-theme="light"] main::before,
html[data-theme="light"] main::after { filter: brightness(.55); }
@media (min-width: 1051px) {
  .site-header { flex-wrap: wrap; }
}

.language-toggle {
  flex-shrink: 0;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.language-toggle[hidden] { display: none; }
.language-toggle:hover { border-color: var(--accent); }
.language-toggle:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.language-toggle, .theme-toggle {
  position: relative;
  min-height: 36px;
  padding: 5px 44px 5px 8px;
  font-size: 14px;
  line-height: 1.4;
  white-space: nowrap;
}
.language-toggle::before, .theme-toggle::before {
  content: "";
  position: absolute;
  right: 8px;
  top: calc(50% - 8px);
  width: 28px;
  height: 16px;
  border: 1px solid var(--muted);
  border-radius: 12px;
  background: var(--paper);
  pointer-events: none;
}
.language-toggle::after, .theme-toggle::after {
  content: "";
  position: absolute;
  right: 23px;
  top: calc(50% - 5px);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  pointer-events: none;
}
.language-toggle[aria-checked="true"]::before, html[data-theme="light"] .theme-toggle::before { border-color: var(--accent); }
.language-toggle[aria-checked="true"]::after, html[data-theme="light"] .theme-toggle::after { transform: translateX(12px); background: var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  .language-toggle::after, .theme-toggle::after { transition: transform 160ms ease, background-color 160ms ease; }
}

.home-page .hero { grid-template-columns: minmax(0, 1.4fr) minmax(0, .65fr) minmax(0, 1fr); gap: 28px; }
.hero-character {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: 300px;
  justify-self: center;
  align-self: start;
  margin-top: 12px;
  transform: translateX(-40px);
}
.hero-character::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 25% -25% -5%;
  background: radial-gradient(ellipse, #facc1538, #facc1514 42%, transparent 70%);
  pointer-events: none;
}
.hero-character img { display: block; width: 100%; height: auto; }
.character-body { clip-path: inset(51% 0 0); }
.character-balloon {
  position: absolute;
  inset: 0;
  clip-path: inset(0 0 49%);
  transform-origin: 51% 51%;
}
@keyframes balloon-sway {
  0%, 100% { transform: rotate(-6deg); }
  50% { transform: rotate(6deg); }
}
@media (prefers-reduced-motion: no-preference) {
  .character-balloon { animation: balloon-sway 5s ease-in-out infinite; }
  html[data-hud-paused] .character-balloon { animation-play-state: paused; }
}
@media (min-width: 851px) {
  .home-page .hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, .65fr) minmax(0, 1fr);
    row-gap: 24px;
  }
  .home-page .hero > div:first-child { display: contents; }
  .home-page .hero .eyebrow { grid-column: 1 / -1; grid-row: 1; margin: 0; }
  .home-page .hero h1 { grid-column: 1; grid-row: 2; margin: 0; }
  .home-page .hero-character {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
    margin-top: 0;
    transform: translateX(-24px);
  }
  .home-page .hero .profile-panel { grid-column: 3; grid-row: 2; }
  .home-page .hero .lead { grid-column: 1 / 3; grid-row: 3; margin: 0; }
  .home-page .hero .text-link { grid-column: 1 / 3; grid-row: 4; margin-top: 0; justify-self: start; }
}
@media (max-width: 850px) {
  .home-page .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .home-page .hero > div:first-child { grid-column: 1 / -1; }
  .hero-character { max-width: 242px; align-self: center; margin-top: 0; transform: none; }
}
@media (max-width: 580px) {
  .home-page .hero { gap: 24px 16px; }
  .home-page .hero .profile-panel { display: block; padding: 12px; }
  .home-page .hero .monogram { font-size: 48px; }
  .home-page .hero .profile-panel p { font-size: 16px; }
  .hero-character { max-width: 194px; }
}

/* About page instruments sit beside content and remain still. */
.about-page .hud-picture { transform-origin: center; }
.about-page .interests-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: center; }
.about-page .interests-layout > * { min-width: 0; }
.about-page .interests-photo img { aspect-ratio: auto; object-fit: contain; }
@media (max-width: 850px) {
  .about-page .interests-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: no-preference) {
  .about-page.story-motion .hud-picture[data-reveal] {
    opacity: .5;
    transform: translateY(24px) scale(.97);
    transition: opacity 700ms ease, transform 700ms ease;
  }
  .about-page.story-motion .hud-picture.is-revealed {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
  .about-page.story-motion .hud-picture.is-revealed:hover {
    transform: translateY(-5px) scale(1.01);
  }
}
.about-page .story-chapter { max-width: none; scroll-margin-top: 130px; }
.about-page .about-service { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.about-page .education-layout { margin-bottom: 28px; }
.about-page .chapter-nav { z-index: 3; }
@media (prefers-reduced-motion: no-preference) {
  .about-page.story-motion [data-reveal] { transition: opacity 600ms ease, transform 600ms ease; opacity: .5; transform: translateY(18px); }
  .about-page.story-motion .is-revealed { opacity: 1; transform: none; }
}
@media (max-width: 850px) {
  .about-page .about-service { grid-template-columns: minmax(0, 1fr); }
}
.about-sections {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 36px;
}
.about-sections a {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  text-decoration: none;
}
.about-sections a > span:first-child {
  color: var(--accent);
  font: 12px Consolas, "Courier New", monospace;
}
.about-sections a:hover { border-color: var(--accent); }
.about-page .about-console {
  position: relative;
  padding: clamp(20px, 4vw, 40px);
  margin-bottom: 36px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, #facc1506, transparent 45%), var(--panel);
  scroll-margin-top: 130px;
}
.about-console::before, .about-console::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  pointer-events: none;
}
.about-console::before { top: -1px; left: -1px; border-top: 2px solid var(--accent); border-left: 2px solid var(--accent); }
.about-console::after { bottom: -1px; right: -1px; border-bottom: 2px solid var(--accent); border-right: 2px solid var(--accent); }
.about-brief { min-width: 0; }
.about-instrument {
  width: 120px;
  height: 120px;
  margin-bottom: 28px;
  background: url("../images/hud-ring.svg") center / contain no-repeat;
  opacity: .65;
}
.about-page .education > div { border-left: 2px solid var(--line); padding-left: 16px; }
.about-page .education > div:first-child { border-left-color: var(--accent); }
.about-page .tags {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  counter-reset: interest;
  gap: 16px;
  margin: 0;
}
.about-page .tags li {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  justify-content: center;
  gap: 12px;
  min-width: 0;
  min-height: 116px;
  padding: 22px 24px;
  counter-increment: interest;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--paper);
  overflow-wrap: anywhere;
}
.about-page .tags li:last-child { grid-column: 1 / -1; }
.about-page .tags li::after {
  content: "";
  position: absolute;
  top: -1px;
  right: -1px;
  width: 14px;
  height: 14px;
  border-top: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
  pointer-events: none;
}
.about-page .tags li::before {
  content: counter(interest, decimal-leading-zero);
  color: var(--accent);
  font: 12px Consolas, "Courier New", monospace;
}
@media (max-width: 580px) {
  .about-sections { gap: 4px; }
  .about-sections a { flex-basis: 40%; padding: 8px; }
  .about-page .tags { grid-template-columns: minmax(0, 1fr); }
  .about-page .tags li { min-height: 104px; padding: 20px 18px; }
  .about-page .education > div { grid-template-columns: minmax(0, 1fr); }
  .about-instrument { width: 88px; height: 88px; }
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.menu-toggle[hidden], .site-header nav[hidden] { display: none; }
.menu-toggle:hover { border-color: var(--accent); }
.menu-toggle:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.menu-icon {
  width: 18px;
  height: 14px;
  border-block: 2px solid currentColor;
  background: linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat;
}
.menu-toggle[aria-expanded="true"] .menu-icon {
  border: 0;
  background: linear-gradient(45deg, transparent 45%, currentColor 46% 54%, transparent 55%),
    linear-gradient(-45deg, transparent 45%, currentColor 46% 54%, transparent 55%);
}
@media (max-width: 850px) {
  .site-header { position: relative; }
  .menu-toggle { position: absolute; top: 24px; right: 0; }
  .site-header > .brand, .site-header .header-identity { padding-right: 100px; }
  .site-header nav {
    width: 100%;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    border: 1px solid var(--line);
    background: var(--panel);
  }
  .site-header nav a { width: 100%; padding: 10px 12px; }
}

/* Align the home identity with the shared page headers. */
.site-header.home-header {
  text-align: left;
}
.header-identity { position: relative; isolation: isolate; padding-block: 12px; max-width: 100%; }
.home-header .brand { max-width: 100%; text-shadow: 0 0 6px var(--paper), 0 0 12px var(--paper); }
.home-header .header-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.header-code {
  position: absolute;
  z-index: -1;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: max-content;
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  opacity: .24;
  font: 10px/1.5 Consolas, "Courier New", monospace;
  /* Reserve a quiet band behind the name, with code visible above and below. */
  mask-image: linear-gradient(to bottom, #000 0%, #000 28%, transparent 39%, transparent 61%, #000 72%, #000 100%);
  text-align: left;
  pointer-events: none;
  user-select: none;
}
.header-code-key { color: var(--accent); }
.header-code-string { color: #9cdcfe; }
html[data-theme="light"] .header-code-string { color: #005a8c; }
@keyframes header-code-write {
  0%, 10% { clip-path: inset(0 100% 0 0); }
  65%, 100% { clip-path: inset(0 0 0 0); }
}
@media (prefers-reduced-motion: no-preference) {
  .header-code { animation: header-code-write 20s steps(60, end) infinite; }
  html[data-hud-paused] .header-code { animation-play-state: paused; }
}
@media (max-width: 1050px) {
  .site-header.home-header { align-items: flex-start; }
  .home-header .header-controls { justify-content: flex-start; }
}

/* Keep the balloon character beside the contact fields without covering them. */
.contact-form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 5vw, 72px);
}
.contact-form-layout .contact-form { width: 100%; min-width: 0; }
.contact-character { position: relative; width: 100%; max-width: 320px; justify-self: center; }
.contact-character img { display: block; width: 100%; height: auto; }
@media (max-width: 700px) {
  .contact-form-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .contact-character { max-width: 180px; margin-bottom: 28px; }
}

/* Reserve the controls' space while their scripts initialize. Visibility keeps
   these unavailable controls out of keyboard and accessibility navigation. */
html[data-js] .site-header .language-toggle[hidden],
html[data-js] .site-header .theme-toggle[hidden] {
  display: inline-block;
  visibility: hidden;
}
@media (max-width: 850px) {
  /* Collapse only the initial layout; the ready menu handles later resizes.
     Without JavaScript, keep the page links visible as the fallback. */
  html[data-js] .site-header:not([data-navigation-ready]) nav {
    display: none;
  }
}
