@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&family=JetBrains+Mono:wght@400;600;700&display=swap");

:root {
  --bg: #07080d;
  --bg-2: #10131b;
  --text: #f4f7fb;
  --muted: #aab2c0;
  --soft: #717b8e;
  --line: rgba(255, 255, 255, 0.13);
  --panel: rgba(15, 18, 27, 0.78);
  --panel-strong: rgba(22, 26, 39, 0.92);
  --cyan: #38d6ff;
  --amber: #ffbd5c;
  --magenta: #ff4fd8;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    radial-gradient(circle at 15% 18%, rgba(56, 214, 255, 0.14), transparent 23rem),
    radial-gradient(circle at 84% 12%, rgba(255, 79, 216, 0.11), transparent 20rem),
    radial-gradient(circle at 76% 78%, rgba(255, 189, 92, 0.10), transparent 22rem),
    linear-gradient(135deg, #07080d 0%, #10131b 54%, #090a10 100%);
  background-size: 44px 44px, 44px 44px, auto, auto, auto, auto;
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(56, 214, 255, 0.06), transparent 22%, transparent 78%, rgba(255, 79, 216, 0.05)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 4px);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.85), transparent 76%);
}

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

canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.15;
  pointer-events: none;
}

.wrap {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: space-between;
  width: min(1120px, calc(100% - 36px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 0;
}

header,
footer,
.links,
.mini-work,
.node-left,
nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

header,
footer,
.mini-work {
  justify-content: space-between;
}

header {
  min-height: 46px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

.brand img {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(56, 214, 255, 0.26);
  border-radius: 10px;
  background: #090b12;
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.025),
    0 14px 34px rgba(0, 0, 0, 0.28);
}

.nav-link,
.cmd,
footer,
.work-grid span,
.mini-work span,
.node-link {
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
}

.nav-link {
  position: relative;
  padding: 8px 0;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 1px;
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.nav-link:hover {
  color: var(--text);
}

.nav-link:hover::after {
  opacity: 1;
  transform: translateY(0);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  align-items: center;
  gap: 46px;
  padding: 80px 0 38px;
}

.cmd {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  color: var(--cyan);
}

.cmd span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 18px rgba(255, 189, 92, 0.85);
}

h1 {
  margin: 0;
  font-size: clamp(58px, 10vw, 122px);
  line-height: 0.88;
  letter-spacing: 0;
  color: var(--text);
  text-shadow:
    0 1px 0 rgba(56, 214, 255, 0.48),
    12px 14px 54px rgba(0, 0, 0, 0.45);
}

h1::after {
  content: "_";
  color: var(--amber);
  animation: blink 1.1s steps(2, start) infinite;
}

.copy {
  max-width: 620px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.68;
}

.links {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(56, 214, 255, 0.54);
  border-radius: 7px;
  background: linear-gradient(135deg, rgba(56, 214, 255, 0.98), rgba(142, 241, 255, 0.92));
  color: #071018;
  font-weight: 800;
  box-shadow: 0 16px 44px rgba(56, 214, 255, 0.15);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 50px rgba(56, 214, 255, 0.22);
}

.button.ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  box-shadow: none;
}

.terminal {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(56, 214, 255, 0.08), transparent 45%),
    linear-gradient(315deg, rgba(255, 79, 216, 0.07), transparent 50%),
    var(--panel-strong);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.terminal-stack {
  display: grid;
  gap: 14px;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.terminal-bar i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-bar i:nth-child(1) {
  background: #ff5d6c;
}

.terminal-bar i:nth-child(2) {
  background: var(--amber);
}

.terminal-bar i:nth-child(3) {
  background: #4fe28a;
}

.terminal-bar span {
  margin-left: auto;
  color: var(--soft);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
}

pre {
  margin: 0;
  padding: 24px;
  white-space: pre-wrap;
}

code {
  color: #dfe8f4;
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  line-height: 1.85;
}

code b {
  color: var(--amber);
  font-weight: 700;
}

.line-dim {
  color: #7f8ca1;
}

.terminal-game {
  min-height: 374px;
}

.game-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.16);
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
}

.terminal-screen {
  height: 224px;
  overflow: auto;
  padding: 18px 18px 10px;
  color: #dfe8f4;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  line-height: 1.62;
  scrollbar-color: rgba(56, 214, 255, 0.42) transparent;
}

.terminal-line {
  margin: 0 0 7px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.terminal-line.command {
  color: var(--cyan);
}

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

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

.terminal-line.success {
  color: #63f2a4;
}

.terminal-line.error {
  color: #ff7482;
}

.terminal-input {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 13px;
  border-top: 1px solid var(--line);
  background: rgba(7, 8, 13, 0.54);
}

.terminal-input label {
  color: var(--cyan);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
}

.terminal-input label::after {
  content: " $";
  color: var(--amber);
}

.terminal-input input {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  outline: none;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  padding: 0 11px;
}

.terminal-input input:focus {
  border-color: rgba(56, 214, 255, 0.56);
  box-shadow: 0 0 0 3px rgba(56, 214, 255, 0.10);
}

.terminal-input button {
  min-height: 38px;
  border: 1px solid rgba(255, 189, 92, 0.44);
  border-radius: 6px;
  background: rgba(255, 189, 92, 0.13);
  color: var(--amber);
  cursor: pointer;
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  padding: 0 12px;
}

.terminal-input button:hover {
  background: rgba(255, 189, 92, 0.20);
}

.terminal-game.is-complete {
  border-color: rgba(99, 242, 164, 0.34);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.42),
    0 0 42px rgba(99, 242, 164, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.rickroll-terminal {
  min-height: 334px;
  border-color: rgba(255, 189, 92, 0.28);
}

.rick-stage {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 8px;
  height: 296px;
  overflow: hidden;
  padding: 12px;
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 189, 92, 0.18), transparent 9rem),
    radial-gradient(circle at 20% 76%, rgba(56, 214, 255, 0.09), transparent 8rem),
    linear-gradient(180deg, rgba(7, 8, 13, 0.08), rgba(7, 8, 13, 0.72)),
    rgba(0, 0, 0, 0.14);
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
}

.rick-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(16, 19, 27, 0.88), transparent 18%, transparent 84%, rgba(16, 19, 27, 0.88)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 5px);
}

.rick-art,
.rick-code {
  position: relative;
  z-index: 1;
}

.rick-art {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 189, 92, 0.22);
  border-radius: 7px;
  background: rgba(255, 189, 92, 0.06);
  color: var(--amber);
  white-space: pre;
  text-align: center;
  line-height: 1;
  text-shadow: 0 0 16px rgba(255, 189, 92, 0.24);
  animation: rick-glitch 1.8s steps(2, end) infinite;
}

.rick-art .bit-zero {
  color: rgba(170, 178, 192, 0.16);
}

.rick-art .bit-one {
  color: #ffd28a;
  text-shadow:
    0 0 8px rgba(255, 189, 92, 0.52),
    0 0 18px rgba(255, 189, 92, 0.18);
}

.rick-code {
  min-width: 0;
  height: 42px;
  overflow: hidden;
  border: 1px solid rgba(56, 214, 255, 0.14);
  border-radius: 6px;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--muted);
  line-height: 1.36;
}

.rick-line {
  margin: 0 0 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  animation: meme-pop 280ms ease both;
}

.rick-line.hot {
  color: var(--amber);
}

.rick-line.blue {
  color: var(--cyan);
}

.rick-line.pink {
  color: var(--magenta);
}

.ascii-live-terminal {
  min-height: 354px;
  border-color: rgba(99, 242, 164, 0.30);
}

.live-stage {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto 44px;
  gap: 9px;
  height: 316px;
  overflow: hidden;
  padding: 12px;
  background:
    radial-gradient(circle at 50% 38%, rgba(99, 242, 164, 0.14), transparent 10rem),
    radial-gradient(circle at 18% 78%, rgba(56, 214, 255, 0.10), transparent 8rem),
    linear-gradient(180deg, rgba(7, 8, 13, 0.08), rgba(7, 8, 13, 0.78)),
    rgba(0, 0, 0, 0.18);
  font-family: "JetBrains Mono", monospace;
}

.live-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(16, 19, 27, 0.86), transparent 13%, transparent 86%, rgba(16, 19, 27, 0.88)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 5px);
}

.live-command,
.live-frame,
.live-footer,
.live-log {
  position: relative;
  z-index: 2;
}

.live-command,
.live-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.20);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  padding: 7px 9px;
}

.live-command strong {
  min-width: 0;
  overflow: hidden;
  color: #63f2a4;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-frame {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(99, 242, 164, 0.22);
  border-radius: 7px;
  background:
    linear-gradient(135deg, rgba(99, 242, 164, 0.055), transparent 50%),
    rgba(0, 0, 0, 0.24);
  color: #63f2a4;
  font-size: 9px;
  line-height: 1.08;
  padding: 12px 10px;
  white-space: pre;
  text-align: left;
  text-shadow:
    0 0 10px rgba(99, 242, 164, 0.40),
    1px 0 0 rgba(56, 214, 255, 0.22),
    -1px 0 0 rgba(255, 189, 92, 0.16);
}

.live-frame.is-flashing {
  color: #ffd28a;
}

.live-footer {
  color: var(--soft);
  font-size: 10px;
}

.live-footer span:first-child {
  color: var(--cyan);
}

.live-log {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(56, 214, 255, 0.14);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.32;
  padding: 6px 8px;
}

.live-log p {
  margin: 0 0 3px;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
  animation: meme-pop 280ms ease both;
}

.live-log .ok {
  color: #63f2a4;
}

.live-log .hot {
  color: var(--amber);
}

@keyframes meme-pop {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 0.82;
    transform: translateY(0);
  }
}

@keyframes rick-glitch {
  50% {
    color: #ffd28a;
    text-shadow:
      2px 0 0 rgba(56, 214, 255, 0.26),
      -2px 0 0 rgba(255, 79, 216, 0.20),
      0 0 18px rgba(255, 189, 92, 0.34);
  }
}

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

.work-grid article {
  min-height: 156px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 16, 24, 0.66);
  backdrop-filter: blur(14px);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.work-grid article:hover {
  transform: translateY(-3px);
  border-color: rgba(56, 214, 255, 0.34);
  background: rgba(18, 22, 33, 0.82);
}

.work-grid strong {
  display: block;
  margin-top: 28px;
  font-size: 18px;
}

.work-grid p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.mini-work {
  margin: 0 0 36px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 189, 92, 0.08), transparent 36%),
    rgba(13, 16, 24, 0.72);
  backdrop-filter: blur(16px);
}

.node-left {
  min-width: 0;
}

.node-mark {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 189, 92, 0.44);
  border-radius: 10px;
  background: rgba(255, 189, 92, 0.075);
  box-shadow: 0 0 28px rgba(255, 189, 92, 0.14);
}

.node-mark::before,
.node-mark::after,
.node-mark span {
  content: "";
  position: absolute;
}

.node-mark::before {
  width: 22px;
  height: 22px;
  border: 1px solid rgba(255, 255, 255, 0.20);
  transform: rotate(45deg);
}

.node-mark::after {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 18px rgba(255, 189, 92, 0.8);
}

.node-mark span {
  width: 32px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
}

.mini-work strong {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
  color: rgba(244, 247, 251, 0.92);
  font-family: "JetBrains Mono", monospace;
  font-size: 16px;
  font-weight: 700;
}

.mini-work p {
  margin: 5px 0 0;
  color: var(--soft);
  font-size: 13px;
  line-height: 1.5;
}

.node-link {
  flex: 0 0 auto;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
}

.node-link:hover {
  border-color: rgba(255, 189, 92, 0.5);
  color: var(--amber);
}

footer {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

#quote {
  transition: opacity 220ms ease, transform 220ms ease;
}

#quote.is-changing {
  opacity: 0;
  transform: translateY(4px);
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@media (max-width: 820px) {
  .hero,
  .work-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    align-items: start;
    gap: 30px;
    padding-top: 54px;
  }

  .terminal {
    max-width: 560px;
  }

  .terminal-stack {
    max-width: 560px;
  }
}

@media (max-width: 560px) {
  .wrap {
    width: min(100% - 28px, 1120px);
    min-height: 100svh;
    padding-top: 18px;
  }

  header,
  footer,
  .mini-work {
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    width: 100%;
    justify-content: space-between;
  }

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

  .copy {
    font-size: 16px;
  }

  .links {
    width: 100%;
  }

  .button {
    flex: 1 1 130px;
  }

  pre {
    padding: 18px;
  }

  code {
    font-size: 13px;
  }

  .terminal-game {
    min-height: 0;
  }

  .game-head,
  .terminal-input {
    grid-template-columns: 1fr;
  }

  .terminal-screen {
    height: 236px;
    padding: 15px;
    font-size: 12px;
  }

  .rick-stage {
    height: 262px;
    font-size: 7px;
  }

  .live-stage {
    height: 292px;
    grid-template-rows: auto minmax(0, 1fr) auto 39px;
  }

  .live-command,
  .live-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .live-frame {
    font-size: 6.5px;
    padding: 10px 8px;
  }

  .rick-code {
    height: 39px;
    font-size: 10px;
  }

  .terminal-input {
    gap: 10px;
  }

  .work-grid article {
    min-height: 136px;
  }

  .node-link {
    width: 100%;
    text-align: center;
  }
}

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

  canvas {
    display: none;
  }
}
