:root {
  color-scheme: dark;
  --ink: #17130d;
  --paper: #e8f0ff;
  --paper-deep: #8fa4d8;
  --green: #57d96f;
  --terminal: #9cff9f;
  --terminal-dim: #53b96b;
  --periwinkle: #8ea7ff;
  --violet: #b58cff;
  --electric: #65a7ff;
  --rose: #ff6b6b;
  --cyan: #76d7ce;
  --aqua: #76d7ce;
  --red: #ef5a45;
  --blue: #5f7fe7;
  --shadow: #050505;
  --line: #2f2a20;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #11100e;
  color: var(--paper);
  font-family: "Lucida Console", "Courier New", monospace;
  line-height: 1.55;
}

.inline-link {
  color: var(--cyan);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.inline-link:hover {
  color: var(--violet);
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.screen-grid {
  display: none;
}

.site-shell {
  position: relative;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 64px;
}

section {
  scroll-margin-top: 156px;
}

.topbar,
.panel,
.status-strip,
.item-card,
.mini-card,
.terminal-panel {
  border: 3px solid var(--line);
  box-shadow: 7px 7px 0 var(--shadow);
}

.topbar {
  position: sticky;
  top: 14px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: #17130d;
  padding: 12px 14px;
}

.wordmark {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 42px;
  background: var(--green);
  color: var(--ink);
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: inset -4px -4px 0 rgba(0, 0, 0, 0.22);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.nav-links a,
.command-row a,
.button-link {
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--line);
  padding: 4px 10px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 3px 3px 0 var(--shadow);
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.hero .command-row a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #041207;
  color: var(--terminal);
  border-color: var(--terminal);
  box-shadow: 3px 3px 0 var(--shadow);
}

.contact-icon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
}

.contact-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.contact-github .contact-icon svg {
  fill: currentColor;
  stroke: currentColor;
}

.hero .command-row .contact-email {
  color: var(--terminal);
  border-color: var(--terminal);
  background: #041207;
  box-shadow: 3px 3px 0 var(--shadow);
}

.hero .command-row .contact-github {
  color: #050505;
  border-color: #9cff9f;
  background: var(--terminal);
  box-shadow: 3px 3px 0 var(--shadow);
}

.hero .command-row .contact-linkedin {
  gap: 0;
  padding: 0;
  overflow: hidden;
  color: #050505;
  border-color: #0a66c2;
  background: #f6f9ff;
  box-shadow: 3px 3px 0 var(--shadow);
}

.hero .command-row .contact-linkedin span,
.hero .command-row .contact-linkedin b {
  display: inline-grid;
  place-items: center;
  line-height: 1;
}

.hero .command-row .contact-linkedin span {
  padding: 4px 5px 4px 9px;
}

.hero .command-row .contact-linkedin b {
  align-self: stretch;
  padding: 4px 8px;
  background: #0a66c2;
  color: white;
  font-weight: 900;
}

.hero .command-row a:hover {
  background: #102818;
  color: #efffed;
}

.nav-links a:hover,
.command-row a:hover,
.button-link:hover {
  background: var(--aqua);
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--shadow);
}

.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 30px;
  margin-top: 28px;
  padding: clamp(22px, 4vw, 44px);
  background: #07120a;
  color: var(--terminal);
  border-color: #2c6b3a;
  box-shadow: 7px 7px 0 var(--shadow);
}

.hero::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  border: 4px solid #0c2410;
}

.status-label,
.prompt,
.section-heading p,
.item-card span {
  margin: 0;
  color: #6f8c63;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 860px;
  margin-bottom: 10px;
  font-family: "Lucida Console", "Courier New", monospace;
  font-size: clamp(2.25rem, 6.4vw, 5.3rem);
  line-height: 0.95;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #9ff7ff;
  text-shadow: 2px 2px 0 var(--shadow);
  white-space: nowrap;
}

h1 span:nth-child(2) {
  color: #9ff7ff;
  text-shadow: 2px 2px 0 var(--shadow);
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2.6rem);
  line-height: 1;
  text-transform: uppercase;
}

h3 {
  font-size: 1.02rem;
  line-height: 1.25;
}

.subtitle {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
  padding: 6px 10px;
  background: #171b2d;
  color: #d7ddff;
  font-weight: 900;
  border: 2px solid var(--violet);
  box-shadow: 3px 3px 0 var(--shadow);
}

.subtitle span + span {
  color: var(--terminal);
}

.subtitle span + span::before {
  content: "// ";
  color: var(--electric);
}

.hero-copy > p:not(.kicker, .subtitle) {
  max-width: 700px;
  font-size: 1.03rem;
  color: #f4fff0;
}

.command-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.portrait-card {
  align-self: start;
  margin: 0;
  padding: 12px;
  background: #020a04;
  border: 3px solid var(--terminal);
  box-shadow: 6px 6px 0 var(--shadow);
}

.portrait-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  image-rendering: auto;
  border: 2px solid #060606;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 22px 0 50px;
  background: var(--line);
}

.status-strip div {
  min-height: 88px;
  padding: 15px;
  background: #242018;
}

.status-strip strong {
  display: block;
  margin-top: 8px;
  color: var(--green);
  text-transform: uppercase;
}

.section-block {
  display: grid;
  grid-template-columns: minmax(140px, 190px) minmax(0, 1fr);
  gap: 28px;
  margin-top: 50px;
}

.section-heading {
  position: sticky;
  top: 96px;
  align-self: start;
}

.section-heading h2 {
  margin: 6px 0 0;
  max-width: 100%;
  font-size: clamp(1.35rem, 2.7vw, 2.2rem);
  overflow-wrap: anywhere;
}

.stack,
.tile-grid {
  display: grid;
  gap: 16px;
}

.item-card,
.mini-card,
.terminal-panel {
  background: #241f17;
  padding: 20px;
  min-width: 0;
}

.item-card *,
.mini-card * {
  max-width: 100%;
}

.item-card h3 a,
.item-card h3 {
  color: var(--aqua);
}

.clickable-card {
  cursor: pointer;
}

.clickable-card:hover,
.clickable-card:focus-visible {
  transform: translate(2px, 2px);
  box-shadow: 5px 5px 0 var(--shadow);
  border-color: var(--cyan);
  outline: none;
}

.item-card p,
.mini-card p,
.terminal-panel p {
  color: #d9e5ff;
  overflow-wrap: anywhere;
}

.item-card strong {
  color: #f6f9ff;
  font-weight: 900;
}

.meta-link {
  color: var(--cyan);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.link-row a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 9px;
  border: 2px solid var(--cyan);
  background: #07120a;
  color: #f4fff0;
  box-shadow: 3px 3px 0 #050505;
  font-size: 0.82rem;
  font-weight: 900;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.link-row a:hover {
  color: var(--ink);
  background: var(--cyan);
}

.link-icon {
  display: inline-grid;
  place-items: center;
  width: 25px;
  height: 25px;
  padding: 4px;
  background: #172143;
  color: #dbe3ff;
  border: 1px solid var(--violet);
  box-shadow: none;
}

.link-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.link-icon.youtube {
  background: #ff0033;
  color: white;
  border-color: rgba(255, 255, 255, 0.72);
}

.link-icon.arxiv {
  background: white;
  color: #b31b1b;
  border-color: rgba(255, 255, 255, 0.68);
  width: 25px;
  height: 25px;
  padding: 2px;
}

.link-icon.arxiv .arxiv-mark {
  fill: none;
  stroke: none;
}

.link-icon.arxiv .arxiv-mark path {
  fill: none;
  stroke-width: 4.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.link-icon.arxiv .arxiv-mark .red {
  stroke: #b31b1b;
}

.link-icon.arxiv .arxiv-mark .gray {
  stroke: #aaa8a2;
}

.tile-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-more {
  grid-column: 1 / -1;
  display: grid;
  justify-items: center;
  margin-top: -34px;
  position: relative;
  z-index: 1;
}

.project-peek {
  width: 100%;
  height: 96px;
  overflow: hidden;
  opacity: 0.42;
  pointer-events: none;
}

.project-peek .mini-card {
  min-height: 210px;
  transform: translateY(22px);
  border-color: var(--terminal);
  background: #241f17;
}

.project-more:has(.project-toggle[aria-expanded="true"]) .project-peek,
.project-more.is-open .project-peek {
  display: none;
}

.project-toggle {
  width: 82px;
  height: 40px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  cursor: pointer;
  color: var(--terminal);
  background: #07120a;
  border: 2px solid var(--terminal);
  box-shadow: 4px 4px 0 var(--shadow);
  font-family: inherit;
  font-weight: 900;
  line-height: 1;
  margin-top: -24px;
}

.project-toggle:hover {
  background: #102818;
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--shadow);
}

.toggle-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.project-more .arrow {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  background: transparent;
  color: var(--terminal);
  border: 0;
  font-size: 1.35rem;
  line-height: 1;
  text-shadow: none;
}

.project-toggle[aria-expanded="true"] .arrow {
  transform: rotate(180deg);
}

.more-grid {
  margin-top: 18px;
  width: 100%;
}

.mini-card {
  min-height: 210px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.mini-card:nth-child(1) {
  border-color: var(--green);
}

.mini-card:nth-child(2) {
  border-color: var(--aqua);
}

.mini-card:nth-child(3) {
  border-color: var(--red);
}

.mini-card:nth-child(4) {
  border-color: var(--blue);
}

.mini-card:nth-child(5) {
  border-color: var(--periwinkle);
}

.mini-card:nth-child(6) {
  border-color: var(--rose);
}

.terminal-panel {
  width: min(900px, 100%);
  margin: 48px auto 0;
  background: #10140f;
  border-color: var(--green);
}

.terminal-panel h2 {
  color: var(--green);
}

.prompt {
  color: var(--green);
}

.button-link {
  display: inline-block;
  margin-top: 12px;
}

.cv-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cv-preview-link {
  display: block;
  margin-top: 18px;
}

.cv-preview {
  display: block;
  width: 100%;
  max-width: 780px;
  height: auto;
  background: #0b0b0b;
  border: 2px solid var(--terminal);
  box-shadow: 5px 5px 0 var(--shadow);
}

.cv-viewer {
  max-width: 980px;
}

.cv-preview-full {
  max-width: none;
  width: 100%;
  margin-top: 18px;
}

.article-shell {
  max-width: 880px;
  margin: 30px auto 0;
  padding: clamp(20px, 4vw, 46px);
  background: #0a100c;
  border: 3px solid var(--cyan);
  box-shadow: 7px 7px 0 var(--shadow);
}

.article-shell h1 {
  white-space: normal;
  max-width: 760px;
  margin-bottom: 10px;
  font-size: clamp(2rem, 6vw, 4.8rem);
}

.article-shell .kicker {
  margin: 0;
  color: var(--violet);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.article-subtitle {
  display: inline-block;
  margin-bottom: 28px;
  padding: 6px 10px;
  color: #d7ddff;
  border: 2px solid var(--violet);
  background: #171b2d;
  box-shadow: 3px 3px 0 var(--shadow);
  font-weight: 900;
}

.article-shell p {
  max-width: 74ch;
  color: #f6f9ff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.02rem, 1.7vw, 1.18rem);
  line-height: 1.75;
}

.article-shell .kicker,
.article-actions,
.article-shell .article-subtitle {
  font-family: "Lucida Console", "Courier New", monospace;
}

.article-shell a {
  color: var(--cyan);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.math-block {
  max-width: 100%;
  margin: 20px 0;
  padding: 12px 14px;
  overflow-x: auto;
  color: #f6f9ff;
  background: #050505;
  border-left: 3px solid var(--terminal);
}

.katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 0;
}

.katex {
  font-size: 1.04em;
}

.article-actions a {
  text-decoration: none;
}

.pnt-reader .article-actions {
  margin: 10px 0 18px;
}

.pdf-scroll {
  display: grid;
  gap: 14px;
  max-height: min(760px, 78vh);
  margin: 18px 0 34px;
  padding: 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #050505;
  border: 3px solid var(--cyan);
  box-shadow: 5px 5px 0 var(--shadow);
}

.pdf-scroll img {
  display: block;
  width: min(100%, 900px);
  height: auto;
  margin: 0 auto;
  background: #f6f6f6;
  border: 2px solid #1b1b1b;
}

@media (max-width: 820px) {
  .topbar,
  .status-strip,
  .section-block {
    display: block;
  }

  .hero {
    display: flex;
    flex-direction: column;
  }

  .nav-links {
    margin-top: 12px;
    justify-content: flex-start;
  }

  .portrait-card {
    order: -1;
    max-width: 220px;
    margin: 0 0 24px;
  }

  .status-strip div + div {
    border-top: 3px solid var(--line);
  }

  .section-heading {
    position: static;
    margin-bottom: 16px;
  }

  .tile-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    white-space: normal;
  }
}
