:root {
  color-scheme: dark;
  --ink: #f6f2e8;
  --ink-soft: #c8c0b2;
  --muted: #8f887c;
  --bg: #0f100d;
  --panel: rgba(31, 32, 27, 0.74);
  --panel-strong: rgba(39, 40, 34, 0.94);
  --line: rgba(246, 242, 232, 0.14);
  --green: #96f2b2;
  --cyan: #7bdff2;
  --coral: #ff8b6b;
  --amber: #f5c96b;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  --radius: 8px;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 12% 18%, rgba(150, 242, 178, 0.13), transparent 28rem),
    radial-gradient(circle at 92% 12%, rgba(255, 139, 107, 0.11), transparent 24rem),
    linear-gradient(135deg, #0f100d 0%, #161713 46%, #111310 100%);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(246, 242, 232, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(246, 242, 232, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black 0%, transparent 86%);
}

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

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

button {
  font: inherit;
}

#signal-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.46;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 16px;
  z-index: 5;
  display: grid;
  grid-template-columns: max-content minmax(520px, 1fr);
  align-items: center;
  gap: 18px;
  margin: 16px 0 54px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 16, 13, 0.7);
  backdrop-filter: blur(18px);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.2);
}

.brand,
.site-nav,
.hero-actions,
.hero-meta,
.tag-row,
.site-footer {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--green), var(--cyan));
  color: #10120f;
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
}

.site-nav {
  width: 100%;
  justify-self: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.03);
}

.site-nav a {
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
  transition: color 180ms ease, background 180ms ease;
}

.site-nav a {
  flex: 1;
  text-align: center;
  white-space: nowrap;
}

.nav-label-short {
  display: none;
}

.site-nav a:hover,
.site-nav a.active {
  background: rgba(246, 242, 232, 0.08);
  color: var(--ink);
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
  gap: 28px;
  align-items: stretch;
}

.hero {
  min-height: 620px;
  align-items: center;
  padding: 14px 0 44px;
}

.hero-copy {
  align-self: center;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--green);
  font-family: "JetBrains Mono", monospace;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
}

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

h1 {
  max-width: 820px;
  margin-bottom: 22px;
  font-size: clamp(48px, 7vw, 88px);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(32px, 4vw, 54px);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 22px;
  line-height: 1.15;
}

.hero-text,
.resume-copy p:not(.eyebrow) {
  max-width: 680px;
  color: var(--ink-soft);
  font-size: 19px;
  line-height: 1.72;
}

.hero-actions {
  gap: 12px;
  flex-wrap: wrap;
  margin: 32px 0 22px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
  font-weight: 800;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button.primary {
  background: var(--ink);
  color: #11120f;
}

.button.secondary {
  background: rgba(246, 242, 232, 0.06);
  color: var(--ink);
}

.hero-meta {
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 14px;
}

.hero-meta span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.16);
}

.glass-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-panel {
  align-self: center;
  min-height: 440px;
  overflow: hidden;
}

.terminal-top {
  display: flex;
  gap: 8px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
}

.terminal-top span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-top span:nth-child(1) {
  background: var(--coral);
}

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

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

.terminal-body {
  padding: 26px;
  font-family: "JetBrains Mono", monospace;
}

.terminal-body h2 {
  font-family: Inter, sans-serif;
  font-size: clamp(38px, 5vw, 58px);
}

.terminal-body p {
  color: var(--ink-soft);
}

.muted {
  color: var(--coral);
}

.terminal-line {
  position: relative;
  padding-left: 18px;
  line-height: 1.7;
}

.terminal-line::before {
  content: ">";
  position: absolute;
  left: 0;
  color: var(--green);
}

.code-card {
  margin-top: 34px;
  padding: 18px;
  border: 1px solid rgba(150, 242, 178, 0.25);
  border-radius: 7px;
  background: rgba(150, 242, 178, 0.07);
}

.code-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--green);
  font-size: 13px;
}

.code-card strong {
  display: block;
  color: var(--ink);
  line-height: 1.55;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 8px 0 104px;
}

.metrics article {
  min-height: 148px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(246, 242, 232, 0.05);
}

.metrics span {
  display: block;
  margin-bottom: 14px;
  color: var(--amber);
  font-family: "JetBrains Mono", monospace;
  font-size: 34px;
  font-weight: 800;
}

.metrics p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.5;
}

.content-section {
  padding: 86px 0;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 28px;
  margin-bottom: 28px;
}

.section-heading h2 {
  max-width: 760px;
}

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

.timeline-item {
  display: grid;
  grid-template-columns: minmax(220px, 0.45fr) minmax(0, 1fr);
  gap: 28px;
  padding: 24px;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.timeline-item:hover,
.project-card:hover {
  transform: translateY(-4px);
  border-color: rgba(150, 242, 178, 0.34);
  background: var(--panel-strong);
}

.role-date {
  margin-bottom: 12px;
  color: var(--cyan);
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  font-weight: 700;
}

.role-title {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

ul {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-soft);
  line-height: 1.72;
}

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

.project-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.carousel-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(246, 242, 232, 0.06);
  color: var(--ink);
  cursor: pointer;
  font-family: "JetBrains Mono", monospace;
  font-size: 18px;
  font-weight: 800;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, opacity 180ms ease;
}

.carousel-button:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(150, 242, 178, 0.34);
  background: rgba(150, 242, 178, 0.1);
}

.carousel-button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.project-carousel {
  overflow: hidden;
}

.project-grid {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 2px 2px 12px;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.project-grid::-webkit-scrollbar {
  display: none;
}

.project-card {
  flex: 0 0 calc((100% - 16px) / 2);
  min-width: 0;
  min-height: 330px;
  padding: 26px;
  scroll-snap-align: start;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.project-index {
  width: fit-content;
  margin-bottom: 58px;
  color: var(--coral);
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  font-weight: 800;
}

.project-card p,
.stack-board p {
  color: var(--ink-soft);
  line-height: 1.7;
}

.tag-row {
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 26px;
}

.tag-row span {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
}

.stack-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  background: var(--line);
}

.stack-board div {
  min-height: 210px;
  padding: 24px;
  background: rgba(25, 26, 22, 0.9);
}

.stack-board h3 {
  color: var(--amber);
  font-family: "JetBrains Mono", monospace;
  font-size: 16px;
}

.resume-section {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(280px, 0.45fr);
  gap: 28px;
  align-items: center;
}

.resume-preview.glass-card {
  display: block;
  overflow: hidden;
  padding: 12px;
  background: rgba(246, 242, 232, 0.16);
  transform: rotate(1.5deg);
  transition: transform 220ms ease;
}

.resume-preview:hover {
  transform: rotate(0deg) translateY(-4px);
}

.resume-preview.glass-card img {
  width: 100%;
  border-radius: 5px;
  background: #fbfaf6;
  box-shadow: 0 0 0 1px rgba(15, 16, 13, 0.12), 0 18px 40px rgba(0, 0, 0, 0.2);
}

.site-footer {
  justify-content: space-between;
  gap: 16px;
  padding: 34px 0 52px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 10;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-strong);
  color: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 900px) {
  .page-shell {
    width: min(100% - 28px, 720px);
  }

  .site-header {
    position: relative;
    top: 0;
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 28px;
  }

  .site-nav {
    order: 3;
    width: 100%;
    justify-content: space-between;
    overflow-x: auto;
  }

  .section-grid,
  .resume-section,
  .timeline-item,
  .stack-board,
  .metrics {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 40px;
  }

  .hero-panel {
    min-height: auto;
  }

  .section-heading {
    display: flex;
    align-items: end;
  }

  .project-card {
    min-height: auto;
  }

  .project-index {
    margin-bottom: 34px;
  }

  .project-grid {
    gap: 14px;
  }

  .project-card {
    flex-basis: 100%;
  }
}

@media (max-width: 720px) {
  .site-nav .nav-label-long {
    display: none !important;
  }

  .site-nav .nav-label-short {
    display: inline !important;
  }
}

@media (max-width: 560px) {
  .brand span:last-child {
    display: none;
  }

  h1 {
    font-size: 45px;
  }

  .hero-text,
  .resume-copy p:not(.eyebrow) {
    font-size: 17px;
  }

  .button {
    width: 100%;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
    gap: 18px;
  }

  .section-heading h2 {
    font-size: 36px;
    line-height: 1.06;
  }

  .project-controls {
    align-self: stretch;
    justify-content: space-between;
  }

  .carousel-button {
    width: 48px;
    height: 48px;
  }

  .timeline-item,
  .project-card,
  .stack-board div,
  .terminal-body {
    padding: 20px;
  }

  .content-section {
    padding: 62px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }

  #signal-canvas {
    display: none;
  }
}
