@font-face {
  font-family: "Press Start 2P";
  src: url("/assets/fonts/press-start-2p.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Deltarune UI";
  src: url("/assets/fonts/8bitOperatorPlus-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --dark-paper: #171b23;
  color-scheme: light;
  --paper: #fff;
  --ink: #20252c;
  --quiet: #606a78;
  --blue: #254edb;
  --rule: #dbe2ef;
  --soft: #f3f6fd;
  --selection: #dbe7ff;
  --pixel-font: "Press Start 2P", monospace;
  --body-font: Arial, Helvetica, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: var(--dark-paper);
  --ink: #e3e7ef;
  --quiet: #a6afc0;
  --blue: #8eb4ff;
  --rule: #343e50;
  --soft: #202938;
  --selection: #30466a;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 24px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.9 var(--body-font); }
::selection { background: var(--selection); color: var(--ink); }
[hidden] { display: none !important; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 4px; overflow-wrap: anywhere; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 5px; }
button { font: inherit; color: var(--ink); cursor: pointer; }
p { margin: 0 0 19px; }
p:last-child { margin-bottom: 0; }
h1, h2, h3 { font-family: var(--pixel-font); font-weight: 400; overflow-wrap: anywhere; }
h1 { font-size: 18px; line-height: 1.9; margin: 0 0 25px; }
h2 { font-size: 13px; line-height: 1.9; margin: 0 0 22px; }
h3 { color: var(--blue); font-size: 12px; line-height: 1.9; margin: 0 0 12px; }
h4 { font: 400 16px/1.9 var(--body-font); margin: 0 0 8px; }
h3 a { text-decoration: none; }
h3 a:hover { text-decoration: underline; }
main:focus { outline: none; }
main figure { margin: 24px 0; }
main figure img { display: block; max-width: 100%; height: auto; }
.site-shell { width: min(100%, 930px); margin: 0 auto; padding: 54px 35px 26px; }
.site-header { display: flex; gap: 24px; align-items: start; justify-content: space-between; padding-bottom: 25px; border-bottom: 1px solid var(--rule); }
.site-name { display: inline-block; font: 400 24px/1.6 var(--pixel-font); letter-spacing: -1px; text-decoration: none; }
.site-name:hover { text-decoration: underline; }
.site-subtitle { color: var(--quiet); font-size: 13px; margin: 10px 0 0; }
.copy-email { background: var(--paper); border: 1px solid var(--rule); border-radius: 0; padding: 7px 11px; font-size: 12px; min-height: 36px; white-space: nowrap; }
.copy-email:hover { background: var(--soft); border-color: var(--blue); }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 11px; flex: none; min-height: 46px; margin: 3px 2px 0; padding: 7px 13px; border: 3px solid #fff; border-radius: 0; box-shadow: 0 0 0 2px #000; background: #000; color: #fff; font: 400 22px/1 "Deltarune UI", monospace; white-space: nowrap; touch-action: manipulation; }
.theme-toggle:hover { color: #ffff00; }
.theme-toggle:disabled { cursor: wait; }
.theme-soul, .theme-soul-placeholder { display: block; flex: none; width: 16px; height: 15px; }
.theme-soul { background: #ff2235; transform-origin: center; clip-path: polygon(0 14%,14% 14%,14% 0,43% 0,43% 14%,57% 14%,57% 0,86% 0,86% 14%,100% 14%,100% 43%,86% 43%,86% 57%,71% 57%,71% 71%,57% 71%,57% 86%,43% 86%,43% 71%,29% 71%,29% 57%,14% 57%,14% 43%,0 43%); }
.theme-soul.is-flying { position: fixed; z-index: 10001; pointer-events: none; }
.theme-transition { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 10000; pointer-events: none; image-rendering: pixelated; }
.site-nav { display: flex; flex-wrap: wrap; gap: 5px 24px; padding: 17px 0 29px; }
.site-nav a { display: inline-flex; align-items: center; min-height: 40px; font: 400 10px/1.9 var(--pixel-font); text-decoration: none; }
.site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 7px; }
.site-nav a:hover { text-decoration: underline; }
.intro-layout { display: grid; grid-template-columns: minmax(0, 1fr) 180px; gap: 42px; align-items: start; }
.intro-copy { min-width: 0; }
.intro-copy p { max-width: 590px; }
.portrait { display: block; width: 180px; height: 180px; max-width: 100%; object-fit: cover; object-position: 55% 30%; image-rendering: pixelated; }
.portrait-link { display: block; width: 180px; max-width: 100%; }
.intro-layout > .portrait-link { grid-column: 2; grid-row: 1; }
.intro-layout > .intro-copy { grid-column: 1; grid-row: 1; }
.portrait-link:focus-visible { outline-offset: 6px; }
.accent { color: var(--blue); }
.quiet, .eyebrow, .row-label, .file-type { color: var(--quiet); }
.quiet, .small-link, .eyebrow, .row-label, .file-type { font-size: 13px; }
.intro-links { margin-top: 25px; }
.section-block { margin-top: 43px; }
.section-heading { display: flex; align-items: baseline; gap: 15px; justify-content: space-between; }
.section-heading .small-link { white-space: nowrap; }
.work-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; padding: 21px 0 22px; border-top: 1px solid var(--rule); }
.work-row:last-child { border-bottom: 1px solid var(--rule); }
.work-row p { color: var(--quiet); font-size: 14px; line-height: 1.85; margin: 0; max-width: 550px; }
.row-label { white-space: nowrap; padding-top: 1px; }
.home-teaching p { max-width: 660px; }
.site-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px 24px; margin-top: 57px; padding-top: 18px; border-top: 1px solid var(--rule); color: var(--quiet); font-size: 12px; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.file-type { font-size: .9em; }
.page-intro { max-width: 690px; }
.about-intro { margin-top: 4px; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 25px; padding: 22px 0; border-top: 1px solid var(--rule); }
.timeline-date { font: 400 13px/1.9 var(--body-font); color: var(--quiet); }
.timeline h3 { margin-bottom: 7px; }
.timeline p { margin-bottom: 7px; }
.text-list > div { border-top: 1px solid var(--rule); padding: 22px 0; }
.text-list p { margin-bottom: 10px; }
.page-index { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 27px 0 8px; padding: 12px 0; border-block: 1px solid var(--rule); font-size: 13px; }
.page-index a { display: inline-flex; align-items: center; min-height: 30px; }
.project { border-top: 1px solid var(--rule); padding: 25px 0 29px; scroll-margin-top: 25px; }
.project p { max-width: 730px; }
.project .eyebrow { margin-bottom: 13px; font-size: 12px; }
.project h3 { font-size: 13px; margin-bottom: 16px; }
.project-links { margin-top: 18px; font-size: 13px; }
.course-materials { margin-top: 21px; padding: 14px 17px; border-left: 2px solid var(--rule); background: var(--soft); }
.resource { padding: 20px 0; border-top: 1px solid var(--rule); }
.resource p { color: var(--quiet); font-size: 14px; }
.note { margin-top: 32px; padding: 18px 0; border-top: 1px solid var(--rule); font-size: 14px; }
.contact-list { max-width: 650px; margin-top: 38px; }
.contact-list section { border-top: 1px solid var(--rule); padding: 26px 0; }
.contact-list h2 { margin-bottom: 17px; }
.contact-email { font: 400 16px/2 var(--body-font); }
.copy-email { display: block; margin-top: 16px; }
.copy-status { min-height: 0; margin: 8px 0 0; }
.copy-status:empty { display: none; }
.link-list { list-style: none; padding: 0; margin: 0; }
.link-list li + li { margin-top: 9px; }
.location { margin-top: 25px; }
.skip-link { position: absolute; left: 18px; top: -100px; padding: 8px 14px; background: var(--paper); color: var(--blue); border: 1px solid var(--blue); z-index: 2; }
.skip-link:focus { top: 12px; }

@media (max-width: 650px) {
  .site-shell { padding: 29px 22px 22px; }
  .site-header { gap: 12px; align-items: start; }
  .site-header > div { min-width: 0; }
  .site-name { font-size: 19px; line-height: 1.8; letter-spacing: -.7px; }
  .site-subtitle { font-size: 12px; margin-top: 7px; }
  .theme-toggle { font-size: 18px; padding: 6px 8px; min-width: 83px; min-height: 44px; gap: 7px; }
  .theme-soul, .theme-soul-placeholder { width: 12px; height: 12px; }
  .site-nav { gap: 0 20px; padding: 13px 0 27px; }
  .site-nav a { min-height: 44px; font-size: 10px; }
  .intro-layout { grid-template-columns: minmax(0, 1fr) 100px; gap: 23px; }
  .portrait, .portrait-link { width: 100px; height: 100px; }
  h1 { font-size: 15px; }
  h2 { font-size: 12px; }
  .intro-copy p { margin-bottom: 18px; }
  .section-block { margin-top: 35px; }
  .work-row { gap: 12px; }
  .row-label { font-size: 11px; }
  .timeline li { grid-template-columns: 1fr; gap: 7px; }
  .timeline-date { font-size: 12px; }
  .project h3 { font-size: 12px; }
  .page-index { gap: 3px 20px; }
  .site-footer { margin-top: 40px; }
}

@media (max-width: 480px) {
  .site-header { align-items: start; }
  .site-header > div { min-width: 0; }
  .site-name { font-size: clamp(13px, 4.3vw, 17px); line-height: 1.8; letter-spacing: -.5px; max-width: 225px; white-space: nowrap; }
  .site-nav { gap: 0 19px; }
  .intro-layout { display: block; position: relative; }
  .intro-layout .portrait-link, .about-intro > .portrait { margin: 0 0 24px; }
  .intro-layout .portrait-link { float: right; margin: 0 0 16px 20px; width: 88px; height: 88px; }
  .intro-layout .portrait-link .portrait { width: 88px; height: 88px; }
  .intro-layout::after { content: ""; display: block; clear: both; }
  .intro-copy h1 { margin-bottom: 21px; }
  .work-row { display: block; }
  .row-label { display: inline-block; margin-top: 8px; font-size: 12px; }
  .section-heading { flex-wrap: wrap; gap: 0 12px; margin-bottom: 12px; }
  .section-heading h2 { margin-bottom: 7px; }
  .section-heading .small-link { margin-bottom: 5px; }
  .about-intro { display: flex; flex-direction: column-reverse; }
  .about-intro > .portrait { width: 120px; height: 120px; margin-bottom: 20px; }
  .contact-email { font-size: 16px; }
  .page-index a { min-height: 44px; }
}

@media (pointer: coarse) {
  .theme-toggle, .copy-email { min-height: 44px; }
  .footer-links a { min-height: 44px; display: inline-flex; align-items: center; }
}

/* Optional local-editor typography. Existing content keeps its original styles. */
.text-heading-2 { font: 400 13px var(--pixel-font); color: var(--ink); }
.text-heading-3 { font: 400 12px var(--pixel-font); color: var(--blue); }
.text-normal { font: 400 16px var(--body-font); color: var(--ink); }
.text-heading-2, .text-heading-3, .text-normal { line-height: inherit; }
.leading-100 { line-height: 1 !important; }
.leading-125 { line-height: 1.25 !important; }
.leading-150 { line-height: 1.5 !important; }
.leading-175 { line-height: 1.75 !important; }
.leading-200 { line-height: 2 !important; }
.leading-250 { line-height: 2.5 !important; }
.space-after-0 { margin-bottom: 0 !important; }
.space-after-8 { margin-bottom: 8px !important; }
.space-after-19 { margin-bottom: 19px !important; }
.space-after-32 { margin-bottom: 32px !important; }
.space-after-48 { margin-bottom: 48px !important; }

/* Project dates use a local decorative icon and the site's existing palette. */
.project:has(> .project-date) > .eyebrow { margin-bottom: 10px; }
.project h3:has(+ .project-date) { margin-bottom: 8px; }
.project .project-date { display: flex; align-items: center; gap: 7px; margin: 0 0 15px; color: var(--quiet); font: 400 12px/1.9 var(--body-font); }
.project-date::before { content: ""; display: block; width: 15px; height: 15px; flex: 0 0 15px; background-color: var(--blue); -webkit-mask: url("/assets/icons/calendar-range.svg") center / contain no-repeat; mask: url("/assets/icons/calendar-range.svg") center / contain no-repeat; }

.contact-icons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.contact-icons a { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; color: var(--blue); }
.contact-icons a:hover { background: var(--soft); }
.contact-icons svg { width: 20px; height: 20px; }
