:root {
  color-scheme: dark;
  --bg: #080503;
  --panel: rgba(20, 12, 8, 0.78);
  --panel-strong: rgba(15, 7, 4, 0.94);
  --text: #fff6df;
  --muted: #e0b98c;
  --ember: #ff8a1f;
  --flame: #ffd75c;
  --gold: #ffe895;
  --rose: #ff3f1f;
  --line: rgba(255, 154, 60, 0.28);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 216, 92, 0.18), transparent 24rem),
    radial-gradient(circle at 85% 10%, rgba(255, 92, 31, 0.18), transparent 28rem),
    linear-gradient(135deg, #080503 0%, #160904 42%, #090302 100%);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
  line-height: 1.55;
  word-break: normal;
}

img,
canvas,
svg,
video {
  max-width: 100%;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -3;
  content: "";
  background-image:
    linear-gradient(rgba(255, 216, 92, 0.052) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 103, 31, 0.052) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}

a {
  color: inherit;
}

#matrix-rain {
  position: fixed;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  opacity: 0.7;
}

#spell-particles {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  opacity: 0.72;
  pointer-events: none;
}

.spell-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    conic-gradient(from 40deg at 50% 34%, transparent 0deg, rgba(255, 138, 31, 0.22) 70deg, transparent 132deg, rgba(255, 63, 31, 0.14) 214deg, transparent 292deg),
    radial-gradient(circle at var(--cursor-x, 50%) var(--cursor-y, 40%), rgba(255, 216, 92, 0.2), transparent 22rem);
  mix-blend-mode: screen;
  opacity: 0.8;
}

.rune-field {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.rune-field span {
  position: absolute;
  color: rgba(255, 232, 149, 0.2);
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(0.75rem, 2vw, 1.1rem);
  text-transform: uppercase;
  text-shadow: 0 0 18px rgba(255, 138, 31, 0.42);
  animation: drift-rune 18s linear infinite;
}

.rune-field span:nth-child(1) { left: 8%; top: 18%; animation-delay: -3s; }
.rune-field span:nth-child(2) { left: 78%; top: 24%; animation-delay: -8s; }
.rune-field span:nth-child(3) { left: 16%; top: 78%; animation-delay: -12s; }
.rune-field span:nth-child(4) { left: 62%; top: 68%; animation-delay: -1s; }
.rune-field span:nth-child(5) { left: 88%; top: 84%; animation-delay: -5s; }
.rune-field span:nth-child(6) { left: 42%; top: 38%; animation-delay: -14s; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 5, 3, 0.78);
  backdrop-filter: blur(18px);
}

.brand,
.site-nav,
.hero-actions,
.contact-actions {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  text-decoration: none;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 216, 92, 0.78);
  background: linear-gradient(135deg, rgba(255, 216, 92, 0.22), rgba(255, 103, 31, 0.12));
  color: var(--gold);
  font-family: Cinzel, serif;
  font-size: 1.35rem;
  box-shadow: 0 0 26px rgba(255, 138, 31, 0.28);
}

.site-nav {
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-nav a {
  white-space: nowrap;
  padding: 10px 12px;
  border: 1px solid transparent;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
  text-decoration: none;
  text-transform: uppercase;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a.active {
  border-color: var(--line);
  color: var(--ember);
  outline: 0;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 5px auto;
  background: var(--ember);
}

.section-band {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 96px 0;
}

.page-hero,
.section-band {
  scroll-margin-top: 86px;
}

.hero {
  min-height: calc(100vh - 72px);
  display: grid;
  align-items: center;
}

.page-hero {
  min-height: 58vh;
  display: grid;
  align-content: center;
}

.hero-grid,
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.82fr);
  gap: 44px;
  align-items: center;
  min-width: 0;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--ember);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1,
h2 {
  font-family: Cinzel, serif;
  line-height: 1.04;
}

h1 {
  max-width: 820px;
  margin-bottom: 24px;
  font-size: clamp(3.4rem, 11vw, 8.6rem);
  overflow-wrap: anywhere;
}

h2 {
  margin-bottom: 18px;
  font-size: clamp(2rem, 5vw, 4.2rem);
  overflow-wrap: anywhere;
}

h3 {
  margin-bottom: 10px;
  color: #ffffff;
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.hero-lead,
.section-heading p,
.split p,
.contact p {
  color: var(--muted);
  font-size: 1.08rem;
  overflow-wrap: anywhere;
}

.hero-lead {
  max-width: 680px;
  margin-bottom: 28px;
  font-size: clamp(1.08rem, 2.2vw, 1.45rem);
}

.button {
  min-height: 46px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  justify-content: center;
}

.button.primary {
  border-color: rgba(255, 138, 31, 0.78);
  background: linear-gradient(90deg, rgba(255, 103, 31, 0.24), rgba(255, 216, 92, 0.18));
  color: #ffffff;
  box-shadow: 0 0 34px rgba(255, 103, 31, 0.25);
}

.button.secondary {
  background: rgba(255, 255, 255, 0.035);
}

.hero-actions,
.contact-actions {
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
}

.contact-actions .button {
  max-width: 100%;
}

@media (hover: none), (pointer: coarse) {
  .project-card,
  .arcane-terminal {
    transform: none !important;
  }
}

.arcane-terminal {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  border: 1px solid rgba(255, 154, 60, 0.34);
  background: linear-gradient(160deg, rgba(15, 7, 4, 0.95), rgba(48, 15, 4, 0.78));
  box-shadow: var(--shadow), inset 0 0 70px rgba(255, 103, 31, 0.12);
  transform-style: preserve-3d;
}

.arcane-terminal::after {
  position: absolute;
  inset: 0;
  content: "";
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 7px);
  pointer-events: none;
}

.terminal-top {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 9px;
  align-items: center;
  height: 44px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
}

.terminal-top span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--rose);
}

.terminal-top span:nth-child(2) {
  background: var(--gold);
}

.terminal-top span:nth-child(3) {
  background: var(--ember);
}

.terminal-top strong {
  margin-left: auto;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
}

.sigil {
  position: relative;
  width: min(74vw, 360px);
  height: min(74vw, 360px);
  margin: 42px auto 22px;
}

.ring,
.core {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.ring {
  border: 1px solid rgba(255, 138, 31, 0.58);
  border-radius: 50%;
  box-shadow: inset 0 0 28px rgba(255, 103, 31, 0.18), 0 0 34px rgba(255, 216, 92, 0.18);
}

.ring::before,
.ring::after {
  position: absolute;
  width: 16px;
  height: 16px;
  content: "";
  border: 1px solid var(--gold);
  background: rgba(255, 209, 102, 0.16);
  transform: rotate(45deg);
}

.ring::before {
  top: -8px;
}

.ring::after {
  bottom: -8px;
}

.ring-a {
  animation: spin 18s linear infinite;
}

.ring-b {
  inset: 34px;
  border-color: rgba(255, 216, 92, 0.5);
  animation: spin 11s linear infinite reverse;
}

.ring-c {
  inset: 74px;
  border-style: dashed;
  border-color: rgba(255, 63, 31, 0.64);
  animation: pulse 2.6s ease-in-out infinite;
}

.core {
  color: var(--ember);
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(1.8rem, 7vw, 4.2rem);
  text-shadow: 0 0 30px rgba(255, 103, 31, 0.86);
}

pre {
  position: relative;
  z-index: 1;
  width: calc(100% - 40px);
  margin: 0 auto 30px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid rgba(255, 154, 60, 0.3);
  background:
    linear-gradient(135deg, rgba(255, 138, 31, 0.07), rgba(255, 63, 31, 0.045)),
    rgba(9, 4, 2, 0.9);
  color: #ffe895;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.83rem;
  line-height: 1.55;
  white-space: pre;
  tab-size: 2;
  box-shadow: inset 0 0 36px rgba(255, 103, 31, 0.09);
}

.code-copy {
  position: sticky;
  top: 10px;
  left: calc(100% - 78px);
  z-index: 2;
  display: block;
  width: 68px;
  min-height: 34px;
  margin: 10px 10px -44px auto;
  border: 1px solid rgba(255, 216, 92, 0.48);
  background: rgba(20, 8, 3, 0.92);
  color: var(--gold);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 0 22px rgba(255, 103, 31, 0.18);
}

.code-copy:hover,
.code-copy:focus-visible {
  border-color: rgba(255, 216, 92, 0.86);
  color: #ffffff;
  outline: 0;
}

pre code {
  display: block;
  min-width: max-content;
  padding: 54px 18px 18px;
  font-family: inherit;
  white-space: pre;
}

.hljs {
  background: transparent;
  color: #ffe895;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-built_in,
.hljs-name,
.hljs-tag {
  color: #ff8a1f;
}

.hljs-string,
.hljs-attr,
.hljs-symbol,
.hljs-bullet,
.hljs-addition {
  color: #ffd75c;
}

.hljs-title,
.hljs-section,
.hljs-selector-id,
.hljs-selector-class {
  color: #ffb347;
}

.hljs-number,
.hljs-literal,
.hljs-variable,
.hljs-template-variable {
  color: #ff6b2a;
}

.hljs-comment,
.hljs-quote,
.hljs-deletion,
.hljs-meta {
  color: #d39a73;
}

.hljs-emphasis {
  font-style: italic;
}

.hljs-strong {
  font-weight: 700;
}

.section-heading {
  max-width: 820px;
  margin-bottom: 34px;
}

.inventory-grid,
.project-grid,
.experiment-row {
  display: grid;
  gap: 18px;
  min-width: 0;
}

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

.inventory article,
.experiment-row article,
.timeline article,
.project-card,
.travel-grid article,
.spell-panel,
.cv-grid article,
.quote-track blockquote {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.inventory article,
.experiment-row article,
.timeline article,
.travel-grid article,
.spell-panel,
.cv-grid article,
.quote-track blockquote {
  padding: 24px;
}

ul {
  padding-left: 20px;
  margin-bottom: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

li + li {
  margin-top: 10px;
}

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

.project-card {
  position: relative;
  min-height: 270px;
  padding: 22px;
  overflow: hidden;
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
  transform: perspective(900px) rotateX(var(--tilt-y, 0deg)) rotateY(var(--tilt-x, 0deg));
  min-width: 0;
}

.project-card::before {
  position: absolute;
  inset: auto -40% -40% auto;
  width: 180px;
  height: 180px;
  content: "";
  border: 1px solid rgba(255, 209, 102, 0.3);
  transform: rotate(45deg);
}

.project-card:hover,
.project-card:focus-visible {
  border-color: rgba(255, 138, 31, 0.78);
  background: rgba(42, 16, 6, 0.92);
  outline: 0;
  transform: translateY(-6px);
}

.project-card span {
  color: var(--gold);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
}

.project-card p,
.experiment-row p,
.timeline p {
  margin-bottom: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.project-card.hot {
  grid-column: span 2;
  background: linear-gradient(135deg, rgba(255, 138, 31, 0.2), rgba(255, 63, 31, 0.12)), var(--panel-strong);
}

.skill-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.skill-cloud span {
  padding: 9px 12px;
  border: 1px solid rgba(255, 216, 92, 0.3);
  background: rgba(255, 103, 31, 0.11);
  color: #fff0bf;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
}

.timeline {
  display: grid;
  gap: 14px;
}

.timeline time {
  color: var(--gold);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.experiment-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.travel-grid,
.cv-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  min-width: 0;
}

.about-section {
  align-items: stretch;
}

.spell-panel {
  position: relative;
  overflow: hidden;
}

.spell-panel::before,
.spell-panel::after {
  position: absolute;
  content: "";
  border: 1px solid rgba(255, 209, 102, 0.24);
  transform: rotate(45deg);
}

.spell-panel::before {
  width: 220px;
  height: 220px;
  right: -88px;
  top: -88px;
}

.spell-panel::after {
  width: 120px;
  height: 120px;
  left: -48px;
  bottom: -48px;
}

.cookie-orbit {
  position: relative;
  display: grid;
  width: min(100%, 360px);
  aspect-ratio: 1;
  margin: 28px auto 0;
  place-items: center;
  border: 1px dashed rgba(255, 138, 31, 0.5);
  border-radius: 50%;
}

.cookie-orbit span {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold), #7a4e10);
  box-shadow: 0 0 26px rgba(255, 209, 102, 0.55);
  animation: orbit-cookie 8s linear infinite;
}

.cookie-orbit span:nth-child(2) { animation-delay: -2.6s; }
.cookie-orbit span:nth-child(3) { animation-delay: -5.2s; }

.cookie-orbit strong {
  color: var(--ember);
  font-family: "JetBrains Mono", monospace;
}

.quote-track {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.quote-track blockquote {
  margin: 0;
  color: var(--muted);
  font-size: 1.04rem;
}

.legacy-content {
  padding-top: 26px;
}

.legacy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.legacy-card {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(255, 138, 31, 0.08), rgba(255, 216, 92, 0.035)),
    var(--panel);
  box-shadow: var(--shadow);
}

.legacy-card h2,
.legacy-card h3 {
  margin-bottom: 12px;
}

.legacy-card p,
.legacy-card li {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.legacy-card p:last-child,
.legacy-card ul:last-child {
  margin-bottom: 0;
}

.legacy-card ul {
  margin-top: 0;
}

.legacy-button-text {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid rgba(255, 138, 31, 0.45);
  color: var(--gold);
  font-family: "JetBrains Mono", monospace;
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 700ms ease, transform 700ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.contact {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  border-top: 1px solid var(--line);
}

.contact > div:first-child {
  max-width: 660px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 28px 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
}

.site-footer span {
  overflow-wrap: anywhere;
}

@media (max-width: 860px) {
  .site-header {
    min-height: 64px;
  }

  .site-nav {
    gap: 4px;
  }

  .site-nav a {
    padding: 8px 9px;
    font-size: 0.76rem;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  50% {
    opacity: 0.45;
    transform: scale(0.94);
  }
}

@keyframes drift-rune {
  0% {
    opacity: 0;
    transform: translate3d(0, 40px, 0) rotate(0deg);
  }
  20%,
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(24px, -70px, 0) rotate(18deg);
  }
}

@keyframes orbit-cookie {
  from {
    transform: rotate(0deg) translateX(130px) rotate(0deg);
  }
  to {
    transform: rotate(360deg) translateX(130px) rotate(-360deg);
  }
}

@media (max-width: 980px) {
  .hero-grid,
  .split,
  .inventory-grid,
  .experiment-row,
  .travel-grid,
  .cv-grid,
  .quote-track,
  .legacy-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 720px) {
  .site-header {
    padding: 0 18px;
  }

  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    top: 64px;
    right: 18px;
    display: none;
    width: min(320px, calc(100vw - 36px));
    max-height: calc(100svh - 76px);
    overflow: auto;
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    border: 1px solid var(--line);
    background: rgba(18, 8, 3, 0.97);
    box-shadow: var(--shadow);
  }

  .site-nav.is-open {
    display: flex;
  }

  .section-band {
    width: min(100% - 28px, 1180px);
    padding: 70px 0;
  }

  .brand {
    min-width: 0;
  }

  .brand span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hero {
    min-height: auto;
  }

  .hero-grid {
    gap: 28px;
  }

  h1 {
    font-size: clamp(2.45rem, 14vw, 4.2rem);
  }

  h2 {
    font-size: clamp(1.85rem, 10vw, 3rem);
  }

  .hero-lead,
  .section-heading p,
  .split p,
  .contact p {
    font-size: 1rem;
  }

  .hero-actions,
  .contact-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .arcane-terminal {
    min-height: 420px;
  }

  .sigil {
    width: min(72vw, 280px);
    height: min(72vw, 280px);
    margin-top: 28px;
  }

  .ring-b {
    inset: 26px;
  }

  .ring-c {
    inset: 58px;
  }

  pre {
    font-size: 0.72rem;
  }

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

  .project-card.hot {
    grid-column: auto;
  }

  .contact,
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 420px) {
  .site-header {
    padding: 0 12px;
  }

  .section-band {
    width: min(100% - 20px, 1180px);
    padding: 58px 0;
  }

  h1 {
    font-size: clamp(2.15rem, 13vw, 3.4rem);
  }

  .project-card,
  .legacy-card,
  .timeline article,
  .inventory article,
  .experiment-row article,
  .travel-grid article,
  .spell-panel,
  .cv-grid article,
  .quote-track blockquote {
    padding: 18px;
  }

  .project-card {
    min-height: 220px;
  }

  .site-footer {
    padding: 22px 14px;
  }
}

@media (max-width: 940px) and (orientation: landscape) and (max-height: 540px) {
  .site-header {
    min-height: 56px;
    padding: 0 16px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
    font-size: 1.05rem;
  }

  .site-nav a {
    padding: 7px 9px;
    font-size: 0.72rem;
  }

  .brand {
    flex: 0 1 auto;
  }

  .section-band {
    width: min(100% - 28px, 1180px);
    padding: 42px 0;
  }

  .hero {
    min-height: calc(100svh - 56px);
    align-items: start;
    padding-top: 28px;
    padding-bottom: 28px;
  }

  .page-hero {
    min-height: calc(100svh - 56px);
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 0.72fr);
    gap: 20px;
  }

  h1 {
    margin-bottom: 14px;
    font-size: clamp(2.1rem, 8vw, 4rem);
  }

  h2 {
    font-size: clamp(1.65rem, 5vw, 2.6rem);
  }

  .hero-lead,
  .section-heading p,
  .split p,
  .contact p {
    font-size: 0.95rem;
  }

  .button {
    min-height: 38px;
    padding: 9px 12px;
    font-size: 0.74rem;
  }

  .arcane-terminal {
    min-height: 280px;
  }

  .terminal-top {
    height: 34px;
  }

  .sigil {
    width: min(32vw, 180px);
    height: min(32vw, 180px);
    margin: 18px auto 12px;
  }

  .ring-b {
    inset: 20px;
  }

  .ring-c {
    inset: 44px;
  }

  pre {
    width: calc(100% - 24px);
    max-height: 96px;
    margin-bottom: 14px;
    font-size: 0.68rem;
  }

  .project-grid,
  .inventory-grid,
  .experiment-row,
  .travel-grid,
  .cv-grid,
  .quote-track {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-card {
    min-height: 170px;
    padding: 16px;
  }

  .project-card.hot {
    grid-column: span 2;
  }

  .timeline article,
  .inventory article,
  .experiment-row article,
  .travel-grid article,
  .spell-panel,
  .cv-grid article,
  .quote-track blockquote {
    padding: 18px;
  }

  .contact {
    align-items: flex-start;
  }

  .contact-actions {
    gap: 8px;
  }
}

@media (max-width: 720px) and (orientation: landscape) and (max-height: 540px) {
  .nav-toggle {
    display: block;
  }

  .site-nav {
    top: 56px;
    right: 16px;
    width: min(360px, calc(100vw - 32px));
    max-height: calc(100svh - 68px);
    overflow: auto;
  }

  .hero-grid,
  .split {
    grid-template-columns: 1fr 1fr;
  }

  .contact {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .hero-actions {
    gap: 8px;
  }
}

@media (max-width: 560px) and (orientation: landscape) and (max-height: 420px) {
  .hero-grid,
  .split,
  .contact {
    grid-template-columns: 1fr;
  }

  .arcane-terminal {
    min-height: 250px;
  }

  .sigil {
    width: min(42vw, 150px);
    height: min(42vw, 150px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  #matrix-rain {
    display: none;
  }
}

#matrix-rain {
  opacity: 0.88;
}

@property --angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

::selection {
  background: rgba(255, 138, 31, 0.85);
  color: #140600;
}

html {
  scrollbar-color: #b34a10 rgba(20, 10, 5, 0.9);
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #0d0704;
}

::-webkit-scrollbar-thumb {
  border: 2px solid #0d0704;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffd75c, #ff8a1f 45%, #c23a0e);
}

body::after {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  content: "";
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  box-shadow: inset 0 0 220px rgba(0, 0, 0, 0.62);
  mix-blend-mode: overlay;
  opacity: 0.16;
  animation: grain-shift 900ms steps(3) infinite;
}

.scroll-ember {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 90;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #ffe895, #ff8a1f 55%, #ff3f1f);
  box-shadow: 0 0 14px rgba(255, 138, 31, 0.9);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

.spell-glow {
  transition: opacity 420ms ease;
}

body.casting .spell-glow {
  opacity: 1;
}

.reveal {
  filter: blur(7px);
  transition: opacity 800ms ease, transform 800ms ease, filter 800ms ease;
}

.reveal.is-visible {
  filter: blur(0);
}

.hero-title.reveal,
.page-hero h1.reveal {
  filter: blur(9px) drop-shadow(0 0 26px rgba(255, 138, 31, 0.35));
}

.hero-title.reveal.is-visible,
.page-hero h1.reveal.is-visible {
  filter: drop-shadow(0 0 26px rgba(255, 138, 31, 0.4));
}

.legacy-grid .reveal:nth-child(8n + 2),
.project-grid .reveal:nth-child(8n + 2),
.quote-track .reveal:nth-child(8n + 2) {
  transition-delay: 70ms;
}

.legacy-grid .reveal:nth-child(8n + 3),
.project-grid .reveal:nth-child(8n + 3),
.quote-track .reveal:nth-child(8n + 3) {
  transition-delay: 140ms;
}

.legacy-grid .reveal:nth-child(8n + 4),
.project-grid .reveal:nth-child(8n + 4),
.quote-track .reveal:nth-child(8n + 4) {
  transition-delay: 210ms;
}

.legacy-grid .reveal:nth-child(8n + 5),
.project-grid .reveal:nth-child(8n + 5),
.quote-track .reveal:nth-child(8n + 5) {
  transition-delay: 280ms;
}

.legacy-grid .reveal:nth-child(8n + 6),
.project-grid .reveal:nth-child(8n + 6),
.quote-track .reveal:nth-child(8n + 6) {
  transition-delay: 350ms;
}

.legacy-grid .reveal:nth-child(8n + 7) {
  transition-delay: 420ms;
}

.legacy-grid .reveal:nth-child(8n) {
  transition-delay: 490ms;
}

.hero-title,
.page-hero h1 {
  background: linear-gradient(100deg, #fff6df 0%, #ffd75c 22%, #ff8a1f 48%, #ff3f1f 72%, #ffd75c 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: ember-slide 9s ease-in-out infinite alternate, candle-flicker 3.4s linear infinite;
  filter: drop-shadow(0 0 26px rgba(255, 138, 31, 0.35));
}

.hero {
  position: relative;
  min-height: calc(100svh - 72px);
  padding-top: 24px;
  padding-bottom: 96px;
}

.hero-eyebrow {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  margin: 0 0 18px;
  color: var(--flame);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: lowercase;
}

.hero-eyebrow::before {
  content: "λ";
  color: var(--ember);
  text-shadow: 0 0 12px rgba(255, 138, 31, 0.9);
  animation: candle-flicker 2.2s linear infinite;
}

.hero-lead {
  max-width: 620px;
}

.sigil-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: min(84vw, 480px);
  transform: perspective(900px) rotateX(var(--tilt-y, 0deg)) rotateY(var(--tilt-x, 0deg));
  transform-style: preserve-3d;
}

.sigil {
  width: min(64vw, 380px);
  height: min(64vw, 380px);
  margin: 0;
}

.ring {
  backdrop-filter: blur(1px);
}

.ring-c {
  border-color: rgba(255, 216, 92, 0.55);
}

.rune-orbit {
  position: absolute;
  inset: 0;
  animation: spin 46s linear infinite;
}

.rune-orbit.reverse {
  animation-direction: reverse;
  animation-duration: 64s;
}

.rune-orbit span {
  position: absolute;
  top: 50%;
  left: 50%;
  color: var(--gold);
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(0.85rem, 2.4vw, 1.25rem);
  text-shadow: 0 0 14px rgba(255, 170, 60, 0.85);
  transform: translate(-50%, -50%) rotate(var(--a)) translateY(calc(min(64vw, 380px) * -0.47)) rotate(calc(-1 * var(--a)));
}

.rune-orbit.reverse span {
  color: var(--flame);
  font-size: clamp(0.7rem, 2vw, 1rem);
  transform: translate(-50%, -50%) rotate(var(--a)) translateY(calc(min(64vw, 380px) * -0.36)) rotate(calc(-1 * var(--a)));
}

.core {
  animation: candle-flicker 2.8s linear infinite;
}

.hero-actions .button {
  position: relative;
  overflow: hidden;
}

.button.primary {
  background: linear-gradient(110deg, rgba(255, 103, 31, 0.3), rgba(255, 216, 92, 0.16), rgba(255, 103, 31, 0.3));
  background-size: 200% 100%;
  animation: ember-slide 7s linear infinite alternate;
}

.button.primary::after,
.button.secondary::after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -80%;
  width: 46%;
  content: "";
  background: linear-gradient(105deg, transparent, rgba(255, 240, 190, 0.28), transparent);
  transform: skewX(-22deg);
  transition: left 480ms ease;
}

.button.primary:hover::after,
.button.primary:focus-visible::after,
.button.secondary:hover::after,
.button.secondary:focus-visible::after {
  left: 130%;
}

.site-nav a {
  position: relative;
}

.site-nav a::after {
  position: absolute;
  right: 12px;
  bottom: 4px;
  left: 12px;
  height: 2px;
  content: "";
  background: linear-gradient(90deg, transparent, #ffb347, #ff3f1f, transparent);
  opacity: 0;
  transform: scaleX(0.2);
  transition: opacity 220ms ease, transform 260ms ease;
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after,
.site-nav a.active::after {
  opacity: 1;
  transform: scaleX(1);
}

.legacy-card,
.quote-track blockquote,
.inventory article,
.timeline article,
.travel-grid article,
.cv-grid article,
.experiment-row article,
.spell-panel {
  position: relative;
  border: 1px solid transparent;
  background:
    linear-gradient(135deg, rgba(30, 14, 7, 0.94), rgba(16, 8, 4, 0.96)) padding-box,
    conic-gradient(from var(--angle, 210deg), rgba(255, 154, 60, 0.55), rgba(120, 52, 14, 0.35) 28%, rgba(255, 216, 92, 0.65) 52%, rgba(120, 52, 14, 0.3) 74%, rgba(255, 154, 60, 0.55)) border-box;
  transition: transform 260ms ease, box-shadow 260ms ease;
}

.legacy-card::before,
.quote-track blockquote::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
  background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 30%), rgba(255, 176, 72, 0.16), transparent 65%);
  opacity: 0;
  transition: opacity 320ms ease;
}

.legacy-card > *,
.quote-track blockquote > * {
  position: relative;
  z-index: 1;
}

.legacy-card:hover,
.quote-track blockquote:hover,
.inventory article:hover,
.timeline article:hover,
.travel-grid article:hover,
.cv-grid article:hover,
.experiment-row article:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow), 0 0 42px rgba(255, 116, 32, 0.2);
}

.legacy-card:hover::before,
.quote-track blockquote:hover::before {
  opacity: 1;
}

.legacy-card:hover,
.legacy-card:focus-within,
.project-card:hover,
.arcane-terminal:hover {
  animation: angle-turn 3.2s linear infinite;
}

.legacy-card h2::after,
.section-heading h2::after,
.page-hero h1::after {
  display: block;
  width: 120px;
  height: 1px;
  margin-top: 16px;
  content: "";
  background: linear-gradient(90deg, #ff8a1f, rgba(255, 216, 92, 0.7) 45%, transparent);
  box-shadow: 0 0 10px rgba(255, 138, 31, 0.6);
}

.brand-mark {
  animation: brand-pulse 4.5s ease-in-out infinite;
}

.scroll-cue {
  position: absolute;
  bottom: 26px;
  left: 50%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-decoration: none;
  text-transform: uppercase;
  transform: translateX(-50%);
}

.scroll-cue i {
  position: relative;
  width: 1px;
  height: 54px;
  overflow: hidden;
  background: rgba(255, 176, 72, 0.25);
}

.scroll-cue i::after {
  position: absolute;
  top: -40%;
  left: 0;
  width: 100%;
  height: 40%;
  content: "";
  background: linear-gradient(180deg, transparent, #ffd75c);
  animation: cue-drop 1.8s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

@keyframes angle-turn {
  to {
    --angle: 570deg;
  }
}

@keyframes ember-slide {
  to {
    background-position: 100% 0;
  }
}

@keyframes candle-flicker {
  0%, 100% {
    opacity: 1;
  }
  8% {
    opacity: 0.86;
  }
  12% {
    opacity: 0.97;
  }
  30% {
    opacity: 0.82;
  }
  34% {
    opacity: 1;
  }
  57% {
    opacity: 0.9;
  }
  61% {
    opacity: 0.98;
  }
  83% {
    opacity: 0.87;
  }
}

@keyframes brand-pulse {
  0%, 100% {
    box-shadow: 0 0 22px rgba(255, 138, 31, 0.3);
  }
  50% {
    box-shadow: 0 0 38px rgba(255, 170, 60, 0.65);
  }
}

@keyframes cue-drop {
  0% {
    top: -40%;
  }
  70%, 100% {
    top: 110%;
  }
}

@keyframes grain-shift {
  0% {
    transform: translate(0, 0);
  }
  33% {
    transform: translate(-3%, 2%);
  }
  66% {
    transform: translate(2%, -3%);
  }
  100% {
    transform: translate(0, 0);
  }
}

@media (max-width: 720px) {
  .hero {
    min-height: auto;
    padding-bottom: 72px;
  }

  .sigil-stage {
    order: -1;
    min-height: 0;
  }

  .scroll-cue {
    display: none;
  }

  body::after {
    opacity: 0.1;
  }
}

pre {
  width: 100%;
  margin: 0 0 22px;
  padding-top: 40px;
  overflow: hidden;
  border-radius: 4px;
}

pre::before {
  content: "</> " attr(data-lang);
  position: absolute;
  top: 0;
  right: 88px;
  left: 14px;
  z-index: 2;
  display: flex;
  align-items: center;
  height: 39px;
  color: #ffb347;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  white-space: nowrap;
  overflow: hidden;
  pointer-events: none;
}

pre::after {
  content: "";
  position: absolute;
  top: 39px;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  pointer-events: none;
  box-shadow: inset 0 14px 16px -12px rgba(0, 0, 0, 0.72), inset 0 -16px 16px -14px rgba(0, 0, 0, 0.78);
}

pre code {
  max-height: min(540px, 72vh);
  overflow: auto;
  padding: 18px;
  scrollbar-width: thin;
  scrollbar-color: #b34a10 rgba(255, 255, 255, 0.04);
  overscroll-behavior: contain;
}

pre code::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

pre code::-webkit-scrollbar-track {
  background: transparent;
}

pre code::-webkit-scrollbar-thumb {
  border: 0;
  border-radius: 6px;
  background: linear-gradient(180deg, #ffb347, #c23a0e);
}

.code-copy {
  position: absolute;
  top: 5px;
  right: 5px;
  left: auto;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  min-width: 68px;
  min-height: 29px;
  margin: 0;
  padding: 0 13px;
  border-radius: 3px;
  transition: transform 160ms ease, background 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.code-copy:hover,
.code-copy:focus-visible {
  transform: translateY(-1px);
}

.code-copy.is-done {
  border-color: rgba(255, 216, 92, 0.95);
  background: rgba(64, 34, 4, 0.95);
  color: #ffe895;
  box-shadow: 0 0 24px rgba(255, 170, 60, 0.55);
}

.code-copy.is-fail {
  border-color: rgba(255, 80, 50, 0.9);
  color: #ff9a7a;
}

@media (max-width: 940px) and (orientation: landscape) and (max-height: 540px) {
  pre {
    max-height: none;
    padding-top: 36px;
  }

  pre::before {
    height: 35px;
  }

  pre code {
    max-height: 160px;
  }
}
