:root {
  color-scheme: dark;
  --bg: #09100f;
  --bg-2: #101817;
  --panel: rgba(18, 29, 28, 0.78);
  --panel-solid: #121d1c;
  --line: rgba(173, 232, 220, 0.16);
  --text: #f2f7f4;
  --muted: #9fb5ae;
  --dim: #657873;
  --teal: #39e7c6;
  --cyan: #58c7ff;
  --amber: #ffd166;
  --coral: #ff6b5f;
  --green: #8de969;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
  --radius: 8px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(rgba(57, 231, 198, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(57, 231, 198, 0.04) 1px, transparent 1px),
    radial-gradient(circle at 20% 15%, rgba(57, 231, 198, 0.12), transparent 34%),
    radial-gradient(circle at 80% 20%, rgba(255, 209, 102, 0.08), transparent 30%),
    var(--bg);
  background-size: 72px 72px, 72px 72px, auto, auto, auto;
  color: var(--text);
  font-family: var(--sans);
  letter-spacing: 0;
  overflow-x: hidden;
}

body.modal-open,
body.assistant-open {
  overflow: hidden;
}

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

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

code,
.mono {
  font-family: var(--mono);
}

#hero-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -3;
}

.cursor-glow {
  position: fixed;
  width: 320px;
  height: 320px;
  left: 0;
  top: 0;
  pointer-events: none;
  background: radial-gradient(circle, rgba(57, 231, 198, 0.12), transparent 65%);
  transform: translate(-50%, -50%);
  z-index: -2;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(16px, 4vw, 52px);
  border-bottom: 1px solid var(--line);
  background: rgba(9, 16, 15, 0.78);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(57, 231, 198, 0.5);
  background: rgba(57, 231, 198, 0.1);
  color: var(--teal);
  font-family: var(--mono);
  font-size: 12px;
  border-radius: 6px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius);
}

.main-nav a,
.nav-command {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}

.main-nav a.active,
.main-nav a:hover,
.nav-command:hover {
  color: var(--text);
  background: rgba(57, 231, 198, 0.11);
}

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

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 42px;
  align-items: center;
  min-height: 94vh;
  padding-top: 104px;
  padding-bottom: 54px;
}

.hero-copy {
  max-width: 740px;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--teal);
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

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

h1 {
  margin-bottom: 18px;
  font-size: clamp(52px, 8vw, 116px);
  line-height: 0.92;
  letter-spacing: 0;
  max-width: 760px;
}

h2 {
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  font-size: 20px;
  line-height: 1.2;
}

.hero-role {
  color: var(--amber);
  font-family: var(--mono);
  font-size: clamp(17px, 2.1vw, 22px);
  line-height: 1.5;
  max-width: 780px;
}

.hero-summary,
.section-copy p,
.section-heading p,
.lab-panel p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.hero-summary {
  max-width: 710px;
}

.hero-actions,
.lab-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 11px 15px;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.btn:hover {
  transform: translateY(-2px);
  border-color: rgba(57, 231, 198, 0.55);
  background: rgba(57, 231, 198, 0.09);
}

.btn.primary {
  background: linear-gradient(135deg, var(--teal), #1f9a8e);
  color: #04100f;
  border-color: transparent;
  font-weight: 800;
}

.btn.ghost {
  color: var(--amber);
}

.btn.small {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 13px;
}

.btn-icon {
  font-family: var(--mono);
  font-weight: 700;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(90px, 1fr));
  gap: 10px;
  margin-top: 34px;
}

.hero-metrics div,
.lab-panel,
.terminal,
.hero-console,
.contact-tile,
.contact-form,
.achievement-item,
.project-card,
.timeline-card {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

.hero-metrics div {
  padding: 14px;
}

.hero-metrics strong {
  display: block;
  color: var(--text);
  font-size: 28px;
  line-height: 1;
}

.hero-metrics span {
  color: var(--muted);
  font-size: 12px;
  font-family: var(--mono);
}

.hero-console {
  padding: 0;
  overflow: hidden;
  transform: perspective(1100px) rotateY(-4deg) rotateX(2deg);
}

.window-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
}

.window-bar span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.window-bar span:nth-child(1) {
  background: var(--coral);
}

.window-bar span:nth-child(2) {
  background: var(--amber);
}

.window-bar span:nth-child(3) {
  background: var(--teal);
}

.window-bar small {
  margin-left: 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.system-map {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 18px;
}

.system-map button {
  min-height: 82px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--mono);
  transition: transform 180ms ease, border-color 180ms ease, color 180ms ease;
}

.system-map button:hover,
.system-map button.active {
  color: var(--text);
  transform: translateY(-2px);
  border-color: rgba(57, 231, 198, 0.6);
}

.system-map button:nth-child(5) {
  grid-column: 1 / -1;
}

.node-readout {
  min-height: 230px;
  padding: 18px;
  border-top: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(57, 231, 198, 0.08), transparent 40%),
    rgba(0, 0, 0, 0.16);
}

.node-readout .mono {
  color: var(--teal);
}

.node-readout h2 {
  font-size: 26px;
  margin-bottom: 12px;
}

.node-readout p:last-child {
  color: var(--muted);
  line-height: 1.7;
}

.signal-strip {
  display: flex;
  gap: 10px;
  width: 100%;
  overflow: hidden;
  padding: 18px 0;
  border-block: 1px solid var(--line);
  background: rgba(9, 16, 15, 0.72);
}

.signal-strip span {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  animation: drift 28s linear infinite;
}

@keyframes drift {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-720px);
  }
}

.split-section {
  display: grid;
  grid-template-columns: minmax(280px, 0.7fr) minmax(360px, 1.3fr);
  gap: 28px;
  align-items: start;
}

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

.section-copy {
  position: sticky;
  top: 96px;
}

.section-copy h2,
.section-heading h2 {
  margin-bottom: 14px;
}

.hint-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 20px;
}

.hint-grid button,
.filter-btn,
.quick-prompts button,
.pipeline-options button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  border-radius: 6px;
  padding: 9px 10px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12px;
}

.hint-grid button:hover,
.filter-btn:hover,
.filter-btn.active,
.quick-prompts button:hover,
.pipeline-options button:hover,
.pipeline-options button.active {
  color: var(--text);
  border-color: rgba(57, 231, 198, 0.55);
  background: rgba(57, 231, 198, 0.09);
}

.terminal {
  overflow: hidden;
}

.terminal-screen {
  height: 440px;
  overflow: auto;
  padding: 16px;
  color: #cfeee6;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    rgba(0, 0, 0, 0.24);
  background-size: 100% 4px;
}

.terminal-line {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.terminal-line.in {
  color: var(--text);
}

.terminal-line.err {
  color: var(--coral);
}

.terminal-line.system {
  color: var(--amber);
}

.terminal-line.success {
  color: var(--green);
}

.terminal-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 16px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
}

.prompt {
  flex: 0 0 auto;
  color: var(--teal);
  font-size: 13px;
}

.terminal-form input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--mono);
}

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

.timeline::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(var(--teal), var(--amber), transparent);
}

.timeline-card {
  position: relative;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 20px;
  margin-left: 38px;
  padding: 18px;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease;
}

.timeline-card::before {
  content: "";
  position: absolute;
  left: -27px;
  top: 22px;
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: var(--teal);
  box-shadow: 0 0 22px rgba(57, 231, 198, 0.7);
}

.timeline-card:hover,
.project-card:hover,
.lab-panel:hover,
.contact-tile:hover {
  transform: translateY(-3px);
  border-color: rgba(57, 231, 198, 0.55);
}

.timeline-date {
  color: var(--amber);
  font-family: var(--mono);
  font-size: 12px;
}

.timeline-card h3,
.project-card h3 {
  margin-bottom: 6px;
}

.timeline-card p,
.project-card p {
  color: var(--muted);
  line-height: 1.6;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.tag-list span {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 7px;
  color: var(--teal);
  background: rgba(57, 231, 198, 0.07);
  font-family: var(--mono);
  font-size: 11px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

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

.project-card {
  position: relative;
  min-height: 285px;
  padding: 18px;
  overflow: hidden;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 180ms ease, border-color 180ms ease, opacity 180ms ease;
}

.project-card::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(115deg, transparent, rgba(57, 231, 198, 0.12), transparent);
  transform: translateX(-80%);
  transition: opacity 180ms ease, transform 500ms ease;
}

.project-card:hover::after {
  opacity: 1;
  transform: translateX(80%);
}

.project-kicker {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--amber);
  font-family: var(--mono);
  font-size: 12px;
  margin-bottom: 18px;
}

.project-glyph {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 18px;
  border: 1px solid rgba(57, 231, 198, 0.35);
  border-radius: 6px;
  color: var(--teal);
  background: rgba(57, 231, 198, 0.08);
  font-family: var(--mono);
  font-weight: 800;
}

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

.lab-panel {
  padding: 18px;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-title span {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 209, 102, 0.42);
  border-radius: 6px;
  color: var(--amber);
  font-family: var(--mono);
}

.panel-title h3 {
  margin: 0;
}

.perm-grid {
  display: grid;
  grid-template-columns: 88px repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
  margin: 18px 0;
  font-family: var(--mono);
  font-size: 12px;
}

.perm-grid label,
.perm-grid span {
  min-height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
}

.perm-grid input {
  width: 17px;
  height: 17px;
  accent-color: var(--teal);
}

.lab-result,
.scoreboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.lab-result span,
.scoreboard span {
  display: block;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
}

.lab-result strong,
.scoreboard strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 24px;
}

.pipeline-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.pipeline-chain {
  min-height: 58px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  padding: 12px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
}

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

.achievement-item {
  padding: 16px;
}

.achievement-item span {
  color: var(--amber);
  font-family: var(--mono);
  font-size: 12px;
}

.achievement-item h3 {
  margin: 8px 0;
}

.achievement-item p {
  color: var(--muted);
  line-height: 1.6;
}

.contact-section {
  padding-bottom: 140px;
}

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

.contact-tile {
  padding: 18px;
}

.contact-tile span,
.contact-form span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.contact-tile strong {
  display: block;
  margin-top: 8px;
  overflow-wrap: anywhere;
}

.contact-form {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr) auto;
  gap: 12px;
  align-items: end;
  padding: 18px;
}

.contact-form label {
  display: grid;
  gap: 7px;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  border-radius: 6px;
  padding: 11px 12px;
  outline: 0;
}

.contact-form input:focus,
.contact-form textarea:focus,
.assistant-form input:focus {
  border-color: rgba(57, 231, 198, 0.65);
}

.assistant-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(57, 231, 198, 0.55);
  background: var(--teal);
  color: #04100f;
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
  cursor: pointer;
  font-family: var(--mono);
  font-weight: 800;
}

.assistant-panel {
  position: fixed;
  right: 22px;
  bottom: 92px;
  z-index: 31;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  width: min(420px, calc(100vw - 28px));
  height: min(680px, calc(100vh - 118px));
  border: 1px solid var(--line);
  background: rgba(12, 21, 20, 0.96);
  backdrop-filter: blur(22px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transform: translateY(18px) scale(0.98);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.assistant-panel.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.assistant-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.assistant-head h2 {
  margin: 4px 0 0;
  font-size: 24px;
}

.assistant-head button,
.modal-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  border-radius: 6px;
  cursor: pointer;
}

.assistant-messages {
  overflow-y: auto;
  padding: 16px;
}

.msg {
  max-width: 88%;
  margin: 0 0 10px;
  padding: 11px 12px;
  border-radius: 8px;
  line-height: 1.5;
  font-size: 14px;
}

.msg.bot {
  background: rgba(57, 231, 198, 0.09);
  border: 1px solid rgba(57, 231, 198, 0.18);
}

.msg.user {
  margin-left: auto;
  background: rgba(255, 209, 102, 0.12);
  border: 1px solid rgba(255, 209, 102, 0.2);
}

.quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0 16px 14px;
}

.assistant-form {
  display: flex;
  gap: 8px;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--line);
}

.assistant-form input {
  min-width: 0;
  flex: 1;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  border-radius: 6px;
  padding: 10px 11px;
  outline: 0;
}

.assistant-form button {
  border: 0;
  background: var(--teal);
  color: #04100f;
  border-radius: 6px;
  padding: 0 12px;
  cursor: pointer;
  font-weight: 800;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.64);
  backdrop-filter: blur(10px);
}

.modal-backdrop.open {
  display: grid;
}

.detail-modal {
  position: relative;
  width: min(900px, 100%);
  max-height: min(780px, calc(100vh - 36px));
  overflow-y: auto;
  border: 1px solid var(--line);
  background: var(--panel-solid);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.modal-close {
  position: sticky;
  top: 14px;
  float: right;
  margin: 14px 14px 0 0;
  z-index: 1;
}

.modal-inner {
  padding: 28px;
}

.modal-inner h2 {
  margin-bottom: 8px;
}

.modal-meta {
  color: var(--amber);
  font-family: var(--mono);
  margin-bottom: 20px;
}

.modal-section {
  margin-top: 22px;
}

.modal-section h3 {
  color: var(--teal);
  font-family: var(--mono);
  font-size: 13px;
  text-transform: uppercase;
}

.modal-section ul {
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

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

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

@media (max-width: 980px) {
  .main-nav {
    display: none;
  }

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

  .hero {
    min-height: auto;
  }

  .hero-console {
    transform: none;
  }

  .section-copy {
    position: static;
  }

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

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

@media (max-width: 700px) {
  .site-header {
    padding-inline: 14px;
  }

  .brand span:last-child {
    display: none;
  }

  .section {
    width: min(100% - 24px, 1180px);
    padding: 82px 0;
  }

  .hero {
    padding-top: 92px;
  }

  h1 {
    font-size: clamp(46px, 18vw, 72px);
  }

  .hero-metrics,
  .project-grid,
  .lab-grid,
  .achievement-board,
  .contact-grid,
  .system-map {
    grid-template-columns: 1fr;
  }

  .timeline-card {
    grid-template-columns: 1fr;
    margin-left: 28px;
  }

  .terminal-screen {
    height: 380px;
    font-size: 12px;
  }

  .prompt {
    font-size: 12px;
  }

  .assistant-panel {
    right: 14px;
    bottom: 84px;
  }
}

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