:root {
  --bg: #16181b;
  --panel: #1e2125;
  --panel-2: #24282d;
  --line: rgba(255, 255, 255, 0.08);
  --line-soft: rgba(255, 255, 255, 0.05);
  --text: #eef1f0;
  --text-dim: #9aa4a9;
  --text-faint: #5f676c;
  --amber: #ff8a3d;
  --amber-dim: rgba(255, 138, 61, 0.15);
  --cyan: #5fd3d9;
  --cyan-dim: rgba(95, 211, 217, 0.15);
  --radius: 2px;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}
a {
  color: inherit;
}
.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  z-index: 1;
}
h1,
h2,
h3 {
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.01em;
}
.mono {
  font-family: "JetBrains Mono", monospace;
}

/* focus visibility */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

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

/* ---------- NAV ---------- */
nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(22, 24, 27, 0.82);
  border-bottom: 1px solid var(--line);
}
nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-mark {
  font-family: "JetBrains Mono";
  font-size: 13px;
  color: var(--cyan);
  letter-spacing: 0.05em;
}
.nav-links {
  display: flex;
  gap: 28px;
  font-size: 13px;
  font-family: "JetBrains Mono";
  letter-spacing: 0.03em;
}
.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-links a:hover {
  color: var(--amber);
}
@media (max-width: 640px) {
  .nav-links {
    display: none;
  }
}

/* ---------- HERO ---------- */
header.hero {
  position: relative;
  padding: 120px 0 90px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: var(--cyan);
  opacity: 0.7;
}
.corner.tl {
  top: 28px;
  left: 28px;
  border-top: 1px solid;
  border-left: 1px solid;
}
.corner.tr {
  top: 28px;
  right: 28px;
  border-top: 1px solid;
  border-right: 1px solid;
}
.corner.bl {
  bottom: 28px;
  left: 28px;
  border-bottom: 1px solid;
  border-left: 1px solid;
}
.corner.br {
  bottom: 28px;
  right: 28px;
  border-bottom: 1px solid;
  border-right: 1px solid;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 48px;
  align-items: center;
}
@media (max-width: 800px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .gizmo-box {
    display: none;
  }
}

.eyebrow {
  font-family: "JetBrains Mono";
  font-size: 12px;
  color: var(--amber);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--amber);
  display: inline-block;
  box-shadow: 0 0 8px var(--amber);
}

.hero h1 {
  font-size: clamp(40px, 6vw, 68px);
  font-weight: 600;
  line-height: 1.03;
}
.hero h1 span {
  color: var(--text-faint);
}
.hero p.lede {
  margin-top: 20px;
  max-width: 520px;
  color: var(--text-dim);
  font-size: 17px;
}

.hero-meta {
  margin-top: 32px;
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}
.hero-meta div {
  font-family: "JetBrains Mono";
  font-size: 12px;
}
.hero-meta .k {
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
  display: block;
  margin-bottom: 4px;
}
.hero-meta .v {
  color: var(--text);
}

.gizmo-box {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(var(--line-soft) 1px, transparent 1px) 0 0/16px 16px,
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px) 0 0/16px 16px;
  position: relative;
}
.gizmo {
  perspective: 600px;
}
.cube {
  width: 70px;
  height: 70px;
  position: relative;
  transform-style: preserve-3d;
  animation: spin 16s linear infinite;
}
.cube div {
  position: absolute;
  width: 70px;
  height: 70px;
  border: 1px solid var(--cyan);
  background: rgba(95, 211, 217, 0.04);
}
.cube .f1 {
  transform: translateZ(35px);
}
.cube .f2 {
  transform: rotateY(180deg) translateZ(35px);
}
.cube .f3 {
  transform: rotateY(90deg) translateZ(35px);
}
.cube .f4 {
  transform: rotateY(-90deg) translateZ(35px);
}
.cube .f5 {
  transform: rotateX(90deg) translateZ(35px);
}
.cube .f6 {
  transform: rotateX(-90deg) translateZ(35px);
}
@keyframes spin {
  from {
    transform: rotateX(-18deg) rotateY(0);
  }
  to {
    transform: rotateX(-18deg) rotateY(360deg);
  }
}
.gizmo-caption {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: "JetBrains Mono";
  font-size: 10px;
  color: var(--text-faint);
  letter-spacing: 0.08em;
}

.btn-row {
  margin-top: 36px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.btn {
  font-family: "JetBrains Mono";
  font-size: 13px;
  padding: 12px 22px;
  border: 1px solid var(--amber);
  color: var(--amber);
  text-decoration: none;
  transition: all 0.2s;
  letter-spacing: 0.02em;
  background: transparent;
}
.btn:hover {
  background: var(--amber);
  color: #16181b;
}
.btn.ghost {
  border-color: var(--line);
  color: var(--text-dim);
}
.btn.ghost:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: transparent;
}

/* ---------- SECTION SHARED ---------- */
section {
  padding: 88px 0;
  border-bottom: 1px solid var(--line);
}
.sec-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 44px;
}
.sec-head .tag {
  font-family: "JetBrains Mono";
  font-size: 12px;
  color: var(--cyan);
  letter-spacing: 0.1em;
}
.sec-head h2 {
  font-size: 30px;
  font-weight: 600;
}
.sec-head .rule {
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ---------- ABOUT ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 56px;
}
@media (max-width: 760px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
}
.about-grid p {
  color: var(--text-dim);
  margin-bottom: 16px;
  max-width: 56ch;
}
.stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.chip {
  font-family: "JetBrains Mono";
  font-size: 11.5px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  color: var(--text-dim);
  letter-spacing: 0.02em;
}
.edu-block {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 22px;
  margin-top: 8px;
}
.edu-block .k {
  font-family: "JetBrains Mono";
  font-size: 10px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.edu-block .v {
  font-size: 14.5px;
  color: var(--text);
}

/* ---------- PROJECTS ---------- */
.proj {
  border: 1px solid var(--line);
  background: var(--panel);
  margin-bottom: 28px;
  position: relative;
}
.proj-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
  flex-wrap: wrap;
  gap: 10px;
}
.proj-file {
  font-family: "JetBrains Mono";
  font-size: 12.5px;
  color: var(--amber);
}
.proj-file .ext {
  color: var(--text-faint);
}
.proj-idx {
  font-family: "JetBrains Mono";
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.08em;
}

.proj-body {
  padding: 32px 28px;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 36px;
}
@media (max-width: 820px) {
  .proj-body {
    grid-template-columns: 1fr;
  }
}

.proj-body h3 {
  font-size: 22px;
  margin-bottom: 6px;
  font-weight: 600;
}
.proj-sub {
  font-family: "JetBrains Mono";
  font-size: 12px;
  color: var(--cyan);
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}
.proj-body p {
  color: var(--text-dim);
  font-size: 14.5px;
  margin-bottom: 14px;
}
.proj-body ul {
  margin: 0 0 14px 18px;
  color: var(--text-dim);
  font-size: 14.5px;
}
.proj-body ul li {
  margin-bottom: 6px;
}
.proj-body h4.mini {
  font-family: "JetBrains Mono";
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin: 18px 0 8px;
}
.proj-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.proj-stack span {
  font-family: "JetBrains Mono";
  font-size: 11px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  color: var(--text-dim);
}

/* media slot */
.slot {
  border: 1px dashed rgba(255, 255, 255, 0.18);
  aspect-ratio: 16/10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  padding: 16px;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}
.slot::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(45deg, #232629 25%, transparent 25%),
    linear-gradient(-45deg, #232629 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #232629 75%),
    linear-gradient(-45deg, transparent 75%, #232629 75%);
  background-size: 18px 18px;
  background-position:
    0 0,
    0 9px,
    9px -9px,
    -9px 0px;
  opacity: 0.35;
}
.slot .slot-label {
  position: relative;
  font-family: "JetBrains Mono";
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.03em;
}
.slot .slot-file {
  position: relative;
  font-family: "JetBrains Mono";
  font-size: 10.5px;
  color: var(--amber);
}
.slot .slot-icon {
  position: relative;
  font-size: 22px;
  opacity: 0.7;
}
.slot-filled {
  border: 1px solid var(--line);
  background: #000;
}
.slot-filled::before {
  content: none;
}
.slot-filled video,
.slot-filled img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-note {
  font-family: "JetBrains Mono";
  font-size: 10.5px;
  color: var(--text-faint);
  margin-top: 8px;
  text-align: center;
}

/* bar description panel styling (project 5 flavor) */
.render-desc {
  border-left: 2px solid var(--cyan);
  padding-left: 14px;
  margin-top: 14px;
  color: var(--text-dim);
  font-size: 13.5px;
}

/* ---------- CONTACT ---------- */
.contact {
  text-align: center;
  padding-top: 70px;
}
.contact h2 {
  font-size: 34px;
  margin-bottom: 14px;
}
.contact p {
  color: var(--text-dim);
  max-width: 44ch;
  margin: 0 auto 30px;
}
.contact-links {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
}

footer {
  padding: 36px 0;
  text-align: center;
  font-family: "JetBrains Mono";
  font-size: 11px;
  color: var(--text-faint);
}

/* ---------- GALLERY PAGE ---------- */
.gallery-header {
  padding: 64px 0 48px;
  border-bottom: 1px solid var(--line);
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: "JetBrains Mono";
  font-size: 12px;
  color: var(--text-dim);
  text-decoration: none;
  letter-spacing: 0.03em;
  margin-bottom: 28px;
  transition: color 0.2s;
}
.back-link:hover {
  color: var(--amber);
}
.gallery-header h1 {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 600;
}
.gallery-header p {
  margin-top: 14px;
  max-width: 56ch;
  color: var(--text-dim);
  font-size: 15.5px;
}

.masonry {
  column-count: 3;
  column-gap: 22px;
}
@media (max-width: 900px) {
  .masonry {
    column-count: 2;
  }
}
@media (max-width: 600px) {
  .masonry {
    column-count: 1;
  }
}
.masonry-item {
  break-inside: avoid;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.masonry-item img {
  width: 100%;
  display: block;
}
.masonry-cap {
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}
.masonry-file {
  font-family: "JetBrains Mono";
  font-size: 12px;
  color: var(--amber);
}
.masonry-file .ext {
  color: var(--text-faint);
}
.masonry-label {
  font-family: "JetBrains Mono";
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}
