@font-face {
  font-family: "Departure Mono";
  src: url("assets/fonts/DepartureMono-Regular.otf") format("opentype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Vergilia";
  src: url("assets/fonts/Vergilia.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --screen: #141e30;
  --surface: #202d44;
  --ice: #afd8ff;
  --text: #f2f5ff;
  --muted: #ccd6e8;
  --line: #475b79;
  --mono: "Departure Mono", ui-monospace, monospace;
  --display: "Vergilia", Georgia, serif;
  --bezel: 13px;
}

* { box-sizing: border-box; }
body {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  margin: 0;
  color: var(--text);
  background: radial-gradient(ellipse at 50% 0, #293953, var(--screen) 48rem) fixed;
  font: 1rem/1.65 var(--mono);
  overflow-wrap: break-word;
}
html {
  scroll-padding-top: calc(var(--bezel) + 1rem);
  scrollbar-width: thin;
  scrollbar-color: #617798 var(--screen);
}
[hidden] { display: none !important; }
a { color: inherit; }
button { font: inherit; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--ice);
  outline-offset: 4px;
}
::selection { color: #fff; background: #056bc3; }
h1, h2, p, dl, dd { margin: 0; }
h1 { font-family: var(--display); font-weight: 400; }
h2 { font-size: 1.125rem; line-height: 1.4; }
p, dd, .job-responsibilities, .training { color: var(--muted); }
.layout { width: min(62rem, calc(100% - 5rem)); margin-inline: auto; }
main { flex: 1; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link {
  position: fixed;
  z-index: 4;
  top: calc(var(--bezel) + .5rem);
  left: calc(var(--bezel) + .5rem);
  padding: .5rem .75rem;
  color: var(--screen);
  background: var(--text);
  transform: translateY(-200%);
}
.skip-link:focus { transform: translateY(0); }

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem 1.5rem;
  min-height: 5.5rem;
  padding-top: var(--bezel);
  border-bottom: 1px solid #a5bae0;
  box-shadow: 0 6px 10px -10px #a9ceff;
  font-size: .875rem;
}
.identity {
  display: inline-flex;
  align-items: center;
  gap: .625rem;
  min-height: 2.75rem;
  text-decoration: none;
}
.identity img, .profile-symbol img { image-rendering: pixelated; }
.identity img { object-fit: contain; width: 1.75rem; height: 1.75rem; }
.main-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 clamp(.625rem, 3vw, 2rem);
}
.main-nav a, .footer a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--muted);
  text-decoration: none;
}
.main-nav a:hover, .main-nav a[aria-current], .footer a:hover, .identity:hover { color: var(--ice); }
.main-nav a[aria-current] { text-decoration: underline; text-underline-offset: .35rem; }
.language-switch { display: flex; align-items: center; gap: .25rem; }
.language-switch button {
  min-height: 2.75rem;
  padding: .25rem .5rem;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
}
.language-switch button:hover { color: var(--text); }
.language-switch button[aria-pressed="true"] {
  color: var(--ice);
  border-color: var(--line);
  background: #1c2942;
}

.hero {
  position: relative;
  isolation: isolate;
  padding-block: clamp(2rem, 4.7vw, 3.75rem);
}
.hero::before {
  position: absolute;
  inset: 44% 0 0;
  z-index: -1;
  content: "";
  background: radial-gradient(circle, #8ba8d455 1px, transparent 1.5px) 0 0 / 1.5rem 1.5rem;
  mask-image: linear-gradient(transparent, #000a 70%, #000);
}
.hero h1 {
  font-size: clamp(2.35rem, 6vw, 4.25rem);
  line-height: 1.16;
  text-align: center;
  text-shadow: 1px 1px #426082, 0 0 1rem #a9cbff38;
}
.hero-rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin-block: 1.5rem;
  color: #cfdef4;
}
.hero-rule::before, .hero-rule::after {
  content: "";
  flex: 1;
  border-top: 1px solid currentColor;
}
.hero-rule span {
  width: .55rem;
  aspect-ratio: 1;
  border: 1px solid currentColor;
  box-shadow: inset 0 0 0 1px var(--screen);
  background: currentColor;
  transform: rotate(45deg);
}
.hero-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(11rem, auto);
  gap: clamp(1.25rem, 4vw, 3rem);
  align-items: center;
}
.hero-copy {
  display: flex;
  align-items: flex-start;
  gap: 1.125rem;
}
.hero-dialogue {
  position: relative;
  min-width: 0;
  padding: .875rem 1rem 1rem;
  border: 1px dashed #a7bde6;
  background: linear-gradient(0deg, #30476c, #1d2a43 68%);
  box-shadow: inset 0 -3px #b5d3ff22;
}
.hero-dialogue::before {
  position: absolute;
  top: 1.1rem;
  right: 100%;
  width: .6rem;
  height: .95rem;
  background: #a7bde6;
  clip-path: polygon(100% 0, 0 50%, 100% 100%);
  content: "";
}
.hero-role {
  padding-right: 1.125rem;
  color: var(--ice);
  font-size: 1.125rem;
  line-height: 1.4;
}
.hero-intro { max-width: 56ch; margin-top: .5rem; color: var(--text); }
.dialogue-cursor {
  position: absolute;
  top: 1.18rem;
  right: 1rem;
  width: .6rem;
  height: .74rem;
  background: var(--ice);
  clip-path: polygon(0 0, 35% 0, 35% 18%, 65% 18%, 65% 34%, 100% 34%, 100% 66%, 65% 66%, 65% 82%, 35% 82%, 35% 100%, 0 100%);
}
.motion-wave .motion-word, .motion-wave .motion-letter { display: inline-block; }
.motion-type .motion-word { white-space: nowrap; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.hero-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .875rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 3px double #d5e3f8;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  max-width: 100%;
  padding: .5rem .875rem;
  border: 1px solid #96accf;
  color: var(--text);
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
  font: .875rem/1.35 var(--mono);
}
.button:hover { border-color: var(--ice); background: #2c405e; }
.button.primary {
  border-color: var(--ice);
  background: var(--ice);
  color: #131d2b;
}
.button.primary:hover { border-color: #c0e1ff; background: #c0e1ff; }
.hero-key {
  justify-content: flex-start;
  gap: .875rem;
  min-height: 4.25rem;
  padding: .875rem 1.125rem;
  border: 2px solid #dce8fa;
  background: #1c2b4599;
  box-shadow: 3px 3px #0b1221;
  text-align: start;
  font-size: 1rem;
}
.hero-key:hover, .hero-key:focus-visible { box-shadow: 3px 3px #506f9b; }
.hero-key:active { box-shadow: inset 2px 2px #0b1221; }
.hero-key [aria-hidden] {
  flex: none;
  width: 2em;
  color: var(--ice);
  text-align: center;
  white-space: nowrap;
}
.hero-key.primary [aria-hidden] { color: inherit; }

.hero-profile {
  display: grid;
  gap: .625rem;
  font-size: .875rem;
}
.hero-profile > div {
  position: relative;
  padding-left: 1rem;
}
.hero-profile > div::before {
  position: absolute;
  top: .375rem;
  left: 0;
  width: .4rem;
  height: .4rem;
  border: 1px solid #a7bde6;
  content: "";
  transform: rotate(45deg);
}
.profile-symbol {
  display: grid;
  place-items: center;
  flex: none;
  width: 4.5rem;
  height: 4.5rem;
  border: 1px solid #b4c7e8;
  background: repeating-linear-gradient(0deg, #324361 0 2px, #273651 2px 4px);
  box-shadow: 3px 3px #0b1221;
}
.profile-symbol img { width: 3rem; height: 3rem; object-fit: contain; }
.hero-profile dt { color: var(--ice); line-height: 1.4; }
.hero-profile dd { color: var(--text); }

.content-section {
  padding-block: clamp(2rem, 5vw, 3.5rem);
}
.content-section h1 {
  margin-bottom: 1.5rem;
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.2;
}
.timeline {
  display: grid;
  gap: .75rem;
}
.job {
  display: grid;
  grid-template-columns: 10.5rem minmax(0, 1fr);
  gap: .5rem 1.25rem;
  padding: 1rem 1.25rem;
  border-left: 2px solid var(--line);
}
.job-current {
  border-left-color: var(--ice);
  background: var(--surface);
}
.job-date {
  margin-top: .125rem;
  color: var(--ice);
  font: .875rem/1.5 var(--mono);
}
.job h2 + p { margin-top: .375rem; }
.job .company { color: var(--ice); font-weight: 600; }
.company + p { margin-top: .5rem; }
.job-responsibilities { margin: .5rem 0 0; padding-left: 1.25rem; }
.job-responsibilities li + li { margin-top: .25rem; }
.earlier-experience { margin-left: .375rem; }
.earlier-experience summary {
  width: fit-content;
  min-height: 2.75rem;
  padding: .5rem;
  color: var(--ice);
  cursor: pointer;
}
.earlier-experience .job { margin-top: .75rem; }

.projects-grid, .stack-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .875rem;
}
.project {
  padding: clamp(1rem, 2.5vw, 1.5rem);
  border: 1px solid var(--line);
  background: var(--surface);
}
.project h2 { color: var(--ice); }
.project p { margin-top: .625rem; }
.stack-list > div {
  padding: .875rem 1rem;
  border-left: 2px solid var(--line);
}
.stack-list dt { font: .875rem/1.5 var(--mono); color: var(--ice); }
.stack-list dd { margin-top: .375rem; }
.education {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: 1.25rem 2.5rem;
}
.degree p { margin-top: .375rem; }
.training { margin: 0; padding: 0; list-style: none; }
.training li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--line);
}
.training li:first-child { padding-top: 0; }
.training time { color: var(--ice); font: .875rem/1.6 var(--mono); }

.about-section p { max-width: 66ch; }
.about-section p + p { margin-top: .625rem; }
.contact-section {
  margin-block: clamp(1.5rem, 4vw, 2.5rem) clamp(2rem, 5vw, 3.5rem);
  padding-inline: clamp(1rem, 4vw, 2.5rem);
  border: 1px solid #728fba;
  background: linear-gradient(130deg, #2b405f, #1d2b43);
  box-shadow: .375rem .375rem #0b1221;
}
.contact-section h1 { margin-bottom: .75rem; }
.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: .25rem 1rem;
  padding-block: .75rem calc(var(--bezel) + 1rem);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font: .875rem/1.5 var(--mono);
}
.screen-effects, .screen-bezel {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.screen-effects {
  inset: var(--bezel);
  overflow: hidden;
  border-radius: 1.25rem;
  background: repeating-linear-gradient(0deg, #03091628 0 1px, transparent 2px 5px);
}
.screen-bezel {
  z-index: 2;
  border: var(--bezel) solid;
  border-color: #a9a392 #ddd7c4 #c5bda3 #d0c9b0;
  border-radius: 1.65rem;
  box-shadow:
    0 0 0 var(--bezel) #c9c1aa,
    inset 0 0 0 2px #0a1019,
    inset 0 3px 19px 9px #060c16ed;
}
.screen-bezel::before {
  position: absolute;
  inset: calc(var(--bezel) * -.66);
  border-radius: 1.55rem;
  box-shadow: inset 2px 2px 2px #1c1916aa, inset -2px -2px 3px #f0ead6;
  content: "";
}
@keyframes scan-band {
  from { transform: translateY(-100%); }
  to { transform: translateY(500%); }
}
@keyframes letter-wave {
  0%, 24%, 100% { transform: translateY(0); }
  12% { transform: translateY(-.07em); }
}
@keyframes letter-appear {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes cursor-tick {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(.25rem); }
}
@media (prefers-reduced-motion: no-preference) {
  .screen-effects::after {
    content: "";
    display: block;
    height: 25%;
    background: linear-gradient(transparent, #afccff15 93%, transparent);
    animation: scan-band 13s linear infinite;
  }
  .motion-wave .motion-letter {
    animation: letter-wave 2.8s steps(6) calc(var(--letter) * .085s) infinite;
  }
  .motion-type .motion-letter {
    animation: letter-appear .1s steps(3) calc(var(--letter) * .013s) both;
  }
  .dialogue-cursor { animation: cursor-tick 2s steps(2) infinite; }
  .hero-key { transition: transform 140ms steps(3), background-color 140ms linear; }
  .hero-key:hover { transform: translateY(-2px); }
  .hero-key:active { transform: translateY(1px); }
}

@media (max-width: 800px) {
  :root { --bezel: 9px; }
  .topbar { padding-top: calc(var(--bezel) + .25rem); }
  .main-nav {
    order: 1;
    width: 100%;
    border-top: 1px solid var(--line);
  }
  .hero-body, .education { grid-template-columns: 1fr; }
  .hero-profile { display: flex; flex-wrap: wrap; column-gap: 1.25rem; }
  .hero-key { gap: .5rem; padding-inline: .625rem; font-size: .875rem; }
}

@media (max-width: 565px) {
  :root { --bezel: 7px; }
  .layout { width: calc(100% - 2.75rem); }
  .topbar { gap: .375rem .5rem; }
  .main-nav { column-gap: .375rem; font-size: .8125rem; }
  .hero { display: flex; flex-direction: column; }
  .hero-body { display: contents; }
  .hero-rule { margin-block: 1.125rem; }
  .hero-dialogue { width: 100%; }
  .hero-dialogue::before, .profile-symbol { display: none; }
  .hero-intro { line-height: 1.5; }
  .hero-profile { order: 1; margin-top: 1.25rem; }
  .hero-actions { gap: .625rem; margin-top: 1.125rem; padding-top: .875rem; }
  .hero-key { flex-direction: column; justify-content: center; padding-inline: .375rem; text-align: center; }
  .projects-grid, .stack-list, .job { grid-template-columns: 1fr; }
  .job { padding-inline: .875rem; }
  .screen-bezel { box-shadow: 0 0 0 var(--bezel) #c9c1aa, inset 0 1px 10px 4px #060c16ed; }
}

@media (max-width: 425px) {
  .main-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media print {
  :root { color-scheme: light; --text: #111; --muted: #333; --ice: #184467; --surface: #fff; --line: #777; }
  body, .hero-dialogue, .contact-section { background: #fff; }
  .layout { width: 100%; }
  .topbar, .skip-link, .hero-actions, .hero::before, .hero-dialogue::before, .profile-symbol,
  .dialogue-cursor, .footer, .screen-effects, .screen-bezel { display: none; }
  .hero, .content-section { padding-block: 1rem; }
  .hero h1 { text-shadow: none; }
  .motion-wave .motion-letter, .motion-type .motion-letter { animation: none; }
  .hero-dialogue, .contact-section { box-shadow: none; }
  .job, .project, .degree { break-inside: avoid; }
  .button, .button.primary { border: 0; background: none; color: var(--text); padding: 0; }
}
