:root {
  color-scheme: dark;
  --bg: #05070b;
  --bg-elevated: rgba(8, 13, 21, 0.74);
  --text: #f4f7fb;
  --muted: #98a8ba;
  --line: rgba(157, 220, 255, 0.2);
  --cyan: #35d8ff;
  --lime: #8dff6a;
  --magenta: #ff4fd8;
  --amber: #ffc857;
  --red: #ff5e6c;
  --shadow: rgba(0, 0, 0, 0.45);
  --panel-blur: 18px;
  --radius: 8px;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 15% 10%, rgba(53, 216, 255, 0.13), transparent 30rem),
    radial-gradient(circle at 85% 0%, rgba(255, 79, 216, 0.1), transparent 28rem),
    linear-gradient(180deg, #05070b 0%, #091018 46%, #05070b 100%);
  color: var(--text);
  font-family: var(--sans);
}

body.high-contrast {
  --bg: #020305;
  --bg-elevated: rgba(2, 5, 9, 0.84);
  --line: rgba(141, 255, 106, 0.26);
  --cyan: #8dff6a;
  --magenta: #35d8ff;
}

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

button,
input {
  font: inherit;
}

#neural-field {
  position: fixed;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
  background: var(--bg);
}

.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  z-index: -1;
  width: 32rem;
  height: 32rem;
  pointer-events: none;
  opacity: 0.48;
  transform: translate3d(-50%, -50%, 0);
  background:
    radial-gradient(circle, rgba(53, 216, 255, 0.18), transparent 45%),
    radial-gradient(circle, rgba(255, 79, 216, 0.1), transparent 62%);
  filter: blur(8px);
}

.scanline {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  opacity: 0.18;
  background:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 100% 3px, 4px 100%;
  mix-blend-mode: screen;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 4.75rem;
  padding: 0 4rem;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 7, 11, 0.66);
  backdrop-filter: blur(18px);
}

.brand,
.nav-links,
.top-actions,
.hero-actions,
.project-tags,
.contact-links,
.form-row {
  display: flex;
  align-items: center;
}

.brand {
  gap: 0.75rem;
  justify-self: start;
  font-family: var(--mono);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid rgba(53, 216, 255, 0.55);
  border-radius: 6px;
  color: var(--cyan);
  background: rgba(53, 216, 255, 0.08);
  box-shadow: 0 0 24px rgba(53, 216, 255, 0.18);
}

.brand-text {
  font-size: 0.86rem;
  color: var(--muted);
}

.nav-links {
  justify-self: center;
  gap: 1.6rem;
  color: #d8e6f2;
  font-family: var(--mono);
  font-size: 0.82rem;
}

.nav-links a {
  position: relative;
  padding: 0.55rem 0;
}

.nav-links a::after {
  position: absolute;
  right: 0;
  bottom: 0.2rem;
  left: 0;
  height: 1px;
  content: "";
  transform: scaleX(0);
  transform-origin: right;
  background: var(--cyan);
  transition: transform 180ms ease;
}

.nav-links a:hover::after,
.nav-links a:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

.top-actions {
  justify-self: end;
  gap: 0.65rem;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 2.55rem;
  height: 2.55rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.icon-button svg,
.button svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: rgba(53, 216, 255, 0.7);
  background: rgba(53, 216, 255, 0.1);
  transform: translateY(-1px);
}

.menu-toggle {
  display: none;
}

.hero {
  position: relative;
  min-height: 43rem;
  padding: 8rem 4rem 3rem;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero-grid {
  position: absolute;
  inset: 0;
  z-index: -2;
  opacity: 0.42;
  background:
    linear-gradient(rgba(53, 216, 255, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(53, 216, 255, 0.16) 1px, transparent 1px);
  background-size: 5.5rem 5.5rem;
  mask-image: linear-gradient(to bottom, black, transparent 86%);
}

.hero::before,
.hero::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.hero::before {
  inset: 10rem -15% auto auto;
  width: 46rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--magenta), transparent);
  transform: rotate(-18deg);
  box-shadow: 0 0 32px rgba(53, 216, 255, 0.52);
}

.hero::after {
  right: 4rem;
  bottom: 2.5rem;
  width: 22rem;
  height: 22rem;
  border: 1px solid rgba(141, 255, 106, 0.24);
  background:
    linear-gradient(90deg, transparent 49%, rgba(141, 255, 106, 0.28) 50%, transparent 51%),
    linear-gradient(transparent 49%, rgba(141, 255, 106, 0.28) 50%, transparent 51%);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  opacity: 0.3;
}

.hero-content {
  width: min(48rem, 100%);
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--lime);
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.5;
  text-transform: uppercase;
}

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

h1 {
  max-width: 11ch;
  margin-bottom: 1.25rem;
  color: var(--text);
  font-family: var(--mono);
  font-size: 5.8rem;
  line-height: 0.92;
  letter-spacing: 0;
  text-shadow:
    0 0 24px rgba(53, 216, 255, 0.34),
    0 0 56px rgba(255, 79, 216, 0.18);
}

.hero-copy {
  max-width: 42rem;
  margin-bottom: 2rem;
  color: #c3d2e2;
  font-size: 1.18rem;
  line-height: 1.9;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 0.9rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.72rem;
  min-height: 3.2rem;
  padding: 0 1.2rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.9rem;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button.primary {
  border-color: rgba(53, 216, 255, 0.7);
  background: linear-gradient(135deg, rgba(53, 216, 255, 0.22), rgba(141, 255, 106, 0.14));
  box-shadow: 0 0 32px rgba(53, 216, 255, 0.18);
}

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

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(255, 200, 87, 0.8);
}

.glass-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
    var(--bg-elevated);
  box-shadow: 0 24px 90px var(--shadow);
  backdrop-filter: blur(var(--panel-blur));
}

.identity-console {
  position: absolute;
  right: 4rem;
  bottom: 3rem;
  width: min(31rem, calc(100% - 8rem));
  padding: 1rem;
}

.panel-header,
.project-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.panel-header {
  justify-content: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.9rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--line);
}

.status-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 16px var(--lime);
}

.terminal-lines {
  display: grid;
  gap: 0.65rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.6;
}

.terminal-lines p {
  margin-bottom: 0;
  color: #cfdae7;
}

.terminal-lines span {
  color: var(--cyan);
}

.terminal-lines strong {
  color: var(--amber);
  font-weight: 500;
}

.telemetry {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
  background: rgba(5, 7, 11, 0.48);
  backdrop-filter: blur(14px);
}

.telemetry-item {
  min-height: 8rem;
  padding: 1.4rem 1.6rem;
  border-right: 1px solid var(--line);
}

.telemetry-item:last-child {
  border-right: 0;
}

.metric,
.metric-text {
  display: block;
  min-height: 2.5rem;
  color: var(--text);
  font-family: var(--mono);
  font-size: 2rem;
  line-height: 1.2;
}

.metric::after {
  content: "%";
  color: var(--cyan);
  font-size: 1rem;
}

.telemetry-item:nth-child(2) .metric::after,
.telemetry-item:nth-child(3) .metric::after {
  content: "+";
}

.metric-label {
  display: block;
  margin-top: 0.55rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.section {
  padding: 6.5rem 4rem;
}

.section-heading {
  width: min(54rem, 100%);
  margin-bottom: 2.2rem;
}

.section-heading.compact {
  margin-bottom: 0;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: 2.65rem;
  line-height: 1.16;
  letter-spacing: 0;
}

.stack-layout {
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  gap: 1rem;
}

.tab-list {
  align-self: start;
  display: grid;
  gap: 0.65rem;
  padding: 0.75rem;
}

.tab-button {
  min-height: 3.1rem;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-family: var(--mono);
  text-align: left;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.tab-button:hover,
.tab-button:focus-visible,
.tab-button.active {
  color: var(--text);
  border-color: rgba(53, 216, 255, 0.52);
  background: rgba(53, 216, 255, 0.08);
}

.stack-panel {
  display: grid;
  grid-template-columns: minmax(18rem, 0.8fr) minmax(20rem, 1fr);
  gap: 2rem;
  min-height: 22rem;
  padding: 1.4rem;
}

.stack-copy h3 {
  margin-bottom: 0.8rem;
  font-size: 1.45rem;
  line-height: 1.35;
}

.stack-copy p {
  color: #bdcbd9;
  line-height: 1.9;
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.skill-chip {
  min-height: 4.8rem;
  padding: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
}

.skill-chip strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.88rem;
}

.skill-chip span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.work-section {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  perspective: 1200px;
}

.project-card {
  position: relative;
  min-height: 24rem;
  padding: 1.25rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)),
    rgba(7, 12, 20, 0.78);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
  transform-style: preserve-3d;
  transition: transform 180ms ease, border-color 180ms ease;
}

.project-card::before {
  position: absolute;
  inset: auto -20% -35% -20%;
  height: 14rem;
  content: "";
  background:
    linear-gradient(90deg, transparent, rgba(53, 216, 255, 0.22), transparent),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 16px);
  transform: rotate(-8deg);
}

.project-card:hover {
  border-color: rgba(255, 200, 87, 0.72);
}

.project-card h3 {
  margin: 4.2rem 0 1rem;
  font-size: 1.45rem;
  line-height: 1.28;
}

.project-card p {
  color: #bfccdc;
  line-height: 1.75;
}

.project-tags {
  position: absolute;
  right: 1.25rem;
  bottom: 1.25rem;
  left: 1.25rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.project-tags span {
  padding: 0.4rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.22);
  font-family: var(--mono);
  font-size: 0.72rem;
}

.contact-section {
  padding-top: 2rem;
}

.contact-shell {
  padding: 1.6rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(18rem, 0.9fr) minmax(22rem, 1fr);
  gap: 2rem;
  align-items: end;
  margin-top: 1.5rem;
}

.contact-copy p {
  max-width: 42rem;
  color: #c4d1df;
  line-height: 1.85;
}

.contact-links {
  flex-wrap: wrap;
  gap: 0.8rem;
  font-family: var(--mono);
  font-size: 0.84rem;
}

.contact-links a {
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--cyan);
  background: rgba(255, 255, 255, 0.035);
}

.signal-form {
  display: grid;
  gap: 0.65rem;
}

.signal-form label,
.form-response {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
}

.form-row {
  gap: 0.65rem;
}

.signal-form input {
  width: 100%;
  min-height: 3.25rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: 0;
  padding: 0 1rem;
  color: var(--text);
  background: rgba(0, 0, 0, 0.28);
}

.signal-form input:focus {
  border-color: rgba(53, 216, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(53, 216, 255, 0.12);
}

.send-button {
  flex: 0 0 auto;
  width: 3.25rem;
  height: 3.25rem;
}

.form-response {
  min-height: 1.2rem;
  margin-bottom: 0;
  color: var(--lime);
}

body.js-ready [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 560ms ease, transform 560ms ease;
}

body.js-ready [data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr auto;
    padding: 0 1.25rem;
  }

  .nav-links {
    position: fixed;
    top: 4.75rem;
    right: 1rem;
    display: none;
    width: min(18rem, calc(100vw - 2rem));
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.7rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(5, 7, 11, 0.92);
    backdrop-filter: blur(18px);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 0.9rem;
  }

  .menu-toggle {
    display: grid;
  }

  .hero,
  .section {
    padding-right: 1.25rem;
    padding-left: 1.25rem;
  }

  .hero {
    min-height: 43rem;
    padding-top: 6.2rem;
  }

  h1 {
    font-size: 4.2rem;
  }

  .identity-console {
    right: 1.25rem;
    bottom: 2rem;
    width: min(31rem, calc(100% - 2.5rem));
  }

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

  .telemetry-item:nth-child(2) {
    border-right: 0;
  }

  .telemetry-item:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .stack-layout,
  .stack-panel,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .tab-list {
    grid-template-columns: repeat(3, 1fr);
  }

  .tab-button {
    text-align: center;
  }

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

  .project-card {
    min-height: 20rem;
  }
}

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

  .hero {
    min-height: 45rem;
  }

  h1 {
    font-size: 3.05rem;
  }

  .hero-copy {
    font-size: 1rem;
  }

  .hero-actions,
  .button {
    width: 100%;
  }

  .button {
    justify-content: space-between;
  }

  .identity-console {
    font-size: 0.9rem;
  }

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

  .telemetry-item {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .section-heading h2 {
    font-size: 1.9rem;
  }

  .tab-list,
  .skill-grid {
    grid-template-columns: 1fr;
  }

  .contact-links {
    align-items: stretch;
    flex-direction: column;
  }
}

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

  .cursor-glow {
    display: none;
  }
}
