@font-face {
  font-family: "JBlack";
  src: url("assets/fonts/JBLACK.TTF") format("truetype");
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0d1017;
  --panel: #141a24;
  --panel-2: #f4efe4;
  --ink: #f8fafc;
  --muted: #a7b0bc;
  --line: rgba(255, 255, 255, 0.14);
  --accent: #66d3cc;
  --gold: #e0b15e;
  --red: #d65b5b;
  --green: #78b76b;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(102, 211, 204, 0.12), transparent 35%),
    radial-gradient(circle at 80% 10%, rgba(224, 177, 94, 0.10), transparent 30%),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

body.intro-active {
  overflow-x: hidden;
}

.intro-loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow: hidden;
  background: transparent;
  pointer-events: none;
}

.intro-curtain {
  position: absolute;
  z-index: 1;
  inset: -256px 0 -36vh;
  background: #020304;
  transform: translateY(0);
  -webkit-mask-image: url("assets/fade-to-black.png"), linear-gradient(#000, #000);
  mask-image: url("assets/fade-to-black.png"), linear-gradient(#000, #000);
  -webkit-mask-size: 256px 256px, 100% calc(100% - 256px);
  mask-size: 256px 256px, 100% calc(100% - 256px);
  -webkit-mask-position: 0 0, 0 256px;
  mask-position: 0 0, 0 256px;
  -webkit-mask-repeat: repeat-x, no-repeat;
  mask-repeat: repeat-x, no-repeat;
}

.intro-curtain::before,
.intro-curtain::after {
  content: "";
  position: absolute;
  top: 210px;
  left: 0;
  right: 0;
  height: 220px;
  opacity: 0.9;
  background:
    radial-gradient(22px 105px at 8% 0, #020304 0 70%, transparent 72%),
    radial-gradient(16px 78px at 18% 6px, #020304 0 68%, transparent 70%),
    radial-gradient(26px 150px at 32% -10px, #020304 0 66%, transparent 68%),
    radial-gradient(14px 92px at 48% 4px, #020304 0 70%, transparent 72%),
    radial-gradient(30px 165px at 63% -18px, #020304 0 67%, transparent 69%),
    radial-gradient(18px 88px at 80% 10px, #020304 0 70%, transparent 72%),
    radial-gradient(24px 130px at 92% -4px, #020304 0 68%, transparent 70%);
}

.intro-curtain::after {
  top: 236px;
  opacity: 0.58;
  transform: translateX(9%);
  filter: blur(2px);
}

.intro-active .intro-curtain {
  animation: curtain-melt 2950ms cubic-bezier(0.72, 0.02, 0.22, 1) 0ms forwards;
}

.intro-name {
  position: fixed;
  z-index: 2;
  left: var(--intro-name-left, 50%);
  top: var(--intro-name-top, 50%);
  width: var(--intro-name-width, auto);
  height: var(--intro-name-height, auto);
  color: var(--accent);
  font-family: var(--intro-name-font-family, Arial, Helvetica, sans-serif);
  font-size: var(--intro-name-font-size, clamp(44px, 11vw, 148px));
  font-weight: var(--intro-name-font-weight, 900);
  line-height: var(--intro-name-line-height, 0.92);
  letter-spacing: var(--intro-name-letter-spacing, 0);
  text-align: var(--intro-name-text-align, left);
  transform-origin: top left;
}

.intro-active .intro-name {
  animation:
    intro-pop 600ms cubic-bezier(0.2, 0.9, 0.25, 1.25) both,
    intro-fade 2250ms linear 2400ms forwards;
}

body.intro-active .hero.section-reveal {
  opacity: 1;
  transform: none;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 56px);
  background: rgba(13, 16, 23, 0.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.mark {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  color: var(--accent);
  text-decoration: none;
  font-weight: 800;
}

.site-header nav,
.site-footer,
.project-links,
.hero-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.site-header nav a,
.site-footer a,
.project-links a,
.resume-link,
.button {
  color: var(--ink);
  text-decoration: none;
}

.site-header nav a {
  color: var(--muted);
  font-size: 13px;
}

.site-header nav a:hover,
.site-footer a:hover,
.project-links a:hover,
.resume-link:hover {
  color: var(--accent);
}

main {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}

.hero {
  min-height: 82vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.82fr);
  align-items: center;
  gap: clamp(26px, 5vw, 70px);
  padding: 56px 0 42px;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0 0 10px;
}

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

.hero h1 {
  margin-bottom: 4px;
  font-size: clamp(54px, 11vw, 130px);
  line-height: 0.88;
  letter-spacing: 0;
}

.lead {
  max-width: 760px;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 22px);
}

.resume-link {
  display: inline-block;
  margin-bottom: 24px;
  color: var(--gold);
  font-size: 17px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.button-primary {
  border-color: transparent;
  background: var(--accent);
  color: #071013;
}

.shadow-logo-card {
  min-height: 420px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, 0.20);
  background:
    linear-gradient(rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.60)),
    url("assets/img/shadowspawner.jpg") center / cover;
  color: white;
  text-decoration: none;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.shadow-logo {
  font-family: "JBlack", Impact, "Arial Black", sans-serif;
  font-size: clamp(34px, 4.4vw, 58px);
  line-height: 0.9;
  text-align: center;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.55);
  white-space: nowrap;
}

.shadow-logo-card span:last-child {
  color: var(--panel-2);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stack-section,
.project,
.site-footer {
  border-top: 1px solid var(--line);
}

.stack-section {
  padding: 72px 0;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(280px, 1fr);
  gap: 28px;
  align-items: end;
  margin-bottom: 26px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(30px, 5vw, 62px);
  line-height: 0.95;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.tool-grid span {
  min-height: 98px;
  display: grid;
  place-items: center;
  gap: 9px;
  padding: 15px 8px;
  color: var(--muted);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  text-align: center;
}

.tool-logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.26));
}

.projects {
  display: grid;
}

.project {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(330px, 0.9fr);
  gap: clamp(24px, 4vw, 54px);
  align-items: center;
  padding: 72px 0;
}

.project:nth-child(even) .project-media {
  order: 2;
}

.project-media {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #06080d;
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 9;
}

.project-media img,
.project-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.world-map-preview {
  display: grid;
  place-items: center;
  grid-template-columns: repeat(5, 72px);
  grid-auto-rows: 64px;
  justify-content: center;
  align-content: center;
  gap: 0 5px;
  background:
    linear-gradient(135deg, rgba(102, 211, 204, 0.18), rgba(224, 177, 94, 0.08)),
    #0b121b;
  text-decoration: none;
}

.preview-hex {
  width: 74px;
  aspect-ratio: 1.1547;
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
  border: 2px solid rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.12);
}

.preview-hex:nth-child(even) {
  transform: translateY(32px);
}

.preview-grass { background: #7fb069; }
.preview-forest { background: #245d38; }
.preview-mountain { background: #9da3a9; }
.preview-water { background: #315f9f; }
.preview-swamp { background: #526b35; }
.preview-hills { background: #c39a42; }
.preview-desert { background: #d7b579; }

.preview-token {
  position: absolute;
  width: 34px;
  height: 34px;
  border: 3px solid #071013;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(102, 211, 204, 0.18), 0 18px 34px rgba(0, 0, 0, 0.35);
}

.project-copy h2 {
  margin-bottom: 5px;
  font-size: clamp(30px, 4.4vw, 58px);
  line-height: 0.96;
  letter-spacing: 0;
}

.shadow-project-link {
  color: var(--ink);
  text-decoration: none;
}

.shadow-project-link:hover {
  color: var(--accent);
}

.project-subtitle {
  color: var(--gold);
  font-size: 14px;
}

.project-copy p:not(.eyebrow):not(.project-subtitle),
.project-copy li {
  color: #dbe3ea;
}

.project-copy ul {
  padding-left: 18px;
  margin: 14px 0 0;
}

.project-copy li + li {
  margin-top: 8px;
}

.project-links {
  margin-top: 18px;
}

.project-links a {
  border-bottom: 1px solid currentColor;
  color: var(--accent);
  font-weight: 800;
}

.project-compact {
  grid-template-columns: minmax(330px, 0.85fr) minmax(0, 1fr);
}

.performance-panel {
  padding: clamp(22px, 4vw, 46px);
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(224, 177, 94, 0.16), rgba(102, 211, 204, 0.09));
  box-shadow: var(--shadow);
}

.performance-panel h2 {
  margin-bottom: 24px;
  font-size: clamp(34px, 5vw, 66px);
  line-height: 0.95;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.metric-row span {
  min-height: 88px;
  display: grid;
  align-content: center;
  padding: 12px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(0, 0, 0, 0.16);
}

.metric-row strong {
  display: block;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.1;
}

.site-footer {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  justify-content: space-between;
  padding: 34px 0 46px;
  color: var(--muted);
}

.section-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 650ms ease, transform 650ms ease;
}

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

@keyframes intro-pop {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.86);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes intro-fade {
  0% {
    opacity: 1;
  }
  40% {
    opacity: 0.5;
  }
  to {
    opacity: 0;
  }
}

@keyframes curtain-melt {
  0% {
    transform: translateY(0);
    filter: blur(0);
  }
  64% {
    filter: blur(0.5px);
  }
  to {
    transform: translateY(132vh);
    filter: blur(1.5px);
  }
}

.code-page {
  background: #0b0f16;
}

.code-shell {
  width: min(1000px, calc(100% - 30px));
  padding: 50px 0;
}

.back-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 800;
}

.code-shell pre {
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--line);
  background: #05070b;
  color: #dff8f6;
  font-size: 13px;
  line-height: 1.55;
}

.map-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 0%, rgba(102, 211, 204, 0.15), transparent 31%),
    radial-gradient(circle at 85% 8%, rgba(224, 177, 94, 0.12), transparent 28%),
    #090d14;
}

.map-shell {
  width: min(1320px, calc(100% - 32px));
  padding: 52px 0 72px;
}

.map-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 28px;
  margin-bottom: 28px;
}

.map-hero h1 {
  max-width: 860px;
  margin-bottom: 12px;
  font-size: clamp(42px, 7vw, 84px);
  line-height: 0.93;
}

.map-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.map-app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: stretch;
}

.map-stage,
.map-panel {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  box-shadow: var(--shadow);
}

.map-stage {
  min-height: 560px;
}

#world-map-canvas {
  display: block;
  width: 100%;
  height: auto;
  min-height: 520px;
}

.map-panel {
  display: grid;
  align-content: start;
  gap: 24px;
  padding: 20px;
}

.map-panel h2 {
  margin-bottom: 8px;
  font-size: 32px;
}

.map-panel p:not(.eyebrow) {
  color: var(--muted);
}

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

.map-nudge-grid button {
  min-height: 42px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.map-nudge-grid button:hover,
.map-nudge-grid button:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

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

.terrain-legend span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #dbe3ea;
  font-size: 13px;
  font-weight: 700;
}

.terrain-swatch {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0, 0, 0, 0.4);
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
}

.terrain-grass { background: #7fb069; border-color: #4f7b48; }
.terrain-forest { background: #245d38; border-color: #163a23; }
.terrain-mountain { background: #9da3a9; border-color: #5f6670; }
.terrain-water { background: #315f9f; border-color: #17365e; }
.terrain-swamp { background: #526b35; border-color: #344621; }
.terrain-hills { background: #c39a42; border-color: #836023; }
.terrain-desert { background: #d7b579; border-color: #9a7441; }

.map-note {
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.illustration-page {
  background: #06050a;
}

.illustration-hero {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 72px 0 32px;
}

.illustration-hero h1 {
  max-width: 820px;
  font-size: clamp(44px, 8vw, 92px);
  line-height: 0.9;
}

.gallery-grid {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto 80px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.gallery-item {
  position: relative;
  min-height: 220px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: #15101f;
  cursor: zoom-in;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 450ms ease;
}

.gallery-item:hover img {
  transform: scale(1.04);
}

.gallery-item span {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.62);
  color: white;
  font-size: 12px;
  font-weight: 800;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 30px;
  background: rgba(0, 0, 0, 0.86);
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: min(96vw, 1200px);
  max-height: 86vh;
  object-fit: contain;
  background: #120a21;
}

.lightbox button {
  position: fixed;
  top: 20px;
  right: 24px;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
  color: white;
  font-size: 26px;
  cursor: pointer;
}

@media (max-width: 900px) {
  .hero,
  .project,
  .project-compact,
  .map-hero,
  .map-app,
  .section-heading {
    grid-template-columns: 1fr;
  }

  .project:nth-child(even) .project-media {
    order: 0;
  }

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

  .metric-row {
    grid-template-columns: 1fr;
  }

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

  .map-controls {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  main,
  .site-footer,
  .illustration-hero,
  .gallery-grid,
  .map-shell {
    width: min(100% - 24px, 1180px);
  }

  .site-header {
    align-items: flex-start;
  }

  .site-header nav {
    justify-content: flex-end;
  }

  .shadow-logo-card {
    min-height: 300px;
  }

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

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

  .world-map-preview {
    grid-template-columns: repeat(4, 54px);
    grid-auto-rows: 48px;
  }

  .preview-hex {
    width: 56px;
  }

  .preview-hex:nth-child(even) {
    transform: translateY(24px);
  }

  .terrain-legend {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .section-reveal,
  .gallery-item img {
    transition: none;
  }
}
