:root {
  color-scheme: dark;
  --ink: #090b12;
  --ink-raised: #0d101a;
  --panel: #111522;
  --text: #c0caf5;
  --text-bright: #e6e9ff;
  --muted: #565f89;
  --muted-soft: #343b58;
  --blue: #7aa2f7;
  --blue-bright: #a9bffc;
  --green: #9ece6a;
  --cyan: #7dcfff;
  --purple: #bb9af7;
  --red: #f7768e;
  --grid: rgba(122, 162, 247, 0.055);
  --mouse-x: 52%;
  --mouse-y: 44%;
  --mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", "Liberation Mono", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--ink);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at var(--mouse-x) var(--mouse-y), rgba(122, 162, 247, 0.09), transparent 24rem),
    linear-gradient(rgba(122, 162, 247, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(122, 162, 247, 0.045) 1px, transparent 1px),
    var(--ink);
  background-size: auto, 48px 48px, 48px 48px, auto;
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

body::before {
  position: fixed;
  z-index: 10;
  inset: 0;
  pointer-events: none;
  content: "";
  background: linear-gradient(
    to bottom,
    transparent 50%,
    rgba(0, 0, 0, 0.09) 50%
  );
  background-size: 100% 4px;
  opacity: 0.38;
  mix-blend-mode: soft-light;
}

body::after {
  position: fixed;
  z-index: 11;
  inset: 0;
  border: 1px solid rgba(122, 162, 247, 0.12);
  box-shadow:
    inset 0 0 90px rgba(0, 0, 0, 0.7),
    inset 0 0 1px rgba(192, 202, 245, 0.2);
  pointer-events: none;
  content: "";
}

button,
input,
textarea {
  color: inherit;
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

::selection {
  background: var(--blue);
  color: var(--ink);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(20px, 3.5vw, 52px) clamp(20px, 4.5vw, 72px) clamp(22px, 3vw, 44px);
}

.topbar,
.command-dock,
.hero {
  width: min(100%, 1440px);
  margin-inline: auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 28px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  animation: fade-down 550ms 80ms both;
}

.home-command {
  transition: color 160ms ease;
}

.home-command:hover,
.home-command:focus-visible {
  color: var(--text-bright);
}

.prompt {
  margin-right: 4px;
  color: var(--blue);
}

.runtime {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 36px);
}

.runtime-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
}

.runtime-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
  animation: status-pulse 2.4s ease-in-out infinite;
}

.hero {
  align-self: center;
  padding-block: clamp(58px, 8vh, 112px) clamp(44px, 7vh, 96px);
}

.hero-index {
  display: grid;
  grid-template-columns: auto minmax(32px, 92px) auto;
  align-items: center;
  width: max-content;
  margin-bottom: clamp(22px, 3vw, 40px);
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  animation: reveal 500ms 120ms both;
}

.hero-index-line {
  width: 100%;
  height: 1px;
  margin-inline: 12px;
  background: var(--muted-soft);
  transform-origin: left center;
  animation: grow-line 650ms 280ms both;
}

.wordmark {
  width: 100%;
  max-width: 1160px;
  margin: 0;
  line-height: 0;
}

.wordmark svg {
  display: block;
  width: 100%;
  max-height: 31vh;
  overflow: visible;
  fill: var(--text);
  filter:
    drop-shadow(0 0 1px rgba(230, 233, 255, 0.9))
    drop-shadow(0 12px 30px rgba(122, 162, 247, 0.11));
}

.wordmark .pixel {
  opacity: 0;
  animation: pixel-in 350ms steps(2, end) both;
  animation-delay: calc(210ms + var(--pixel-order) * 5ms);
  transition: fill 90ms steps(1, end), transform 90ms steps(1, end);
  transform-box: fill-box;
  transform-origin: center;
}

.wordmark:hover .pixel:nth-child(17n + 3),
.wordmark:focus-within .pixel:nth-child(17n + 3) {
  fill: var(--blue);
  transform: translateY(-1px);
}

.wordmark:hover .pixel:nth-child(29n + 7),
.wordmark:focus-within .pixel:nth-child(29n + 7) {
  fill: var(--green);
}

.wordmark-fallback {
  display: block;
  color: var(--text);
  font-size: clamp(54px, 12vw, 180px);
  font-weight: 700;
  letter-spacing: -0.1em;
  line-height: 0.8;
}

.intro-line {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-top: clamp(28px, 4vw, 50px);
  color: var(--text);
  font-size: clamp(13px, 1.3vw, 17px);
  animation: reveal 500ms 780ms both;
}

.intro-line p {
  margin: 0;
  letter-spacing: -0.015em;
}

.command-mark {
  color: var(--green);
  font-weight: 700;
}

.cursor {
  display: inline-block;
  width: 0.62em;
  height: 1.05em;
  margin-left: 0.4em;
  background: var(--blue);
  vertical-align: -0.16em;
  animation: blink 1.05s steps(1, end) infinite;
}

.command-dock {
  animation: fade-up 600ms 930ms both;
}

.dock-rule {
  position: relative;
  width: 100%;
  height: 1px;
  overflow: hidden;
  background: var(--muted-soft);
}

.dock-rule span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 23%;
  background: var(--blue);
  box-shadow: 0 0 12px rgba(122, 162, 247, 0.35);
}

.command-dock nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.command-dock nav a,
.contact-trigger {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 11px;
  min-height: 62px;
  padding: 0 clamp(12px, 2vw, 28px);
  overflow: hidden;
  border: 0;
  border-right: 1px solid var(--muted-soft);
  background: transparent;
  color: var(--text);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  isolation: isolate;
}

.command-dock nav a:first-child {
  border-left: 1px solid var(--muted-soft);
}

.command-dock nav a::before,
.contact-trigger::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: var(--blue);
  content: "";
  transform: translateY(calc(100% - 2px));
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.command-dock nav a:hover,
.command-dock nav a:focus-visible,
.contact-trigger:hover,
.contact-trigger:focus-visible {
  color: var(--ink);
  outline: none;
}

.command-dock nav a:hover::before,
.command-dock nav a:focus-visible::before,
.contact-trigger:hover::before,
.contact-trigger:focus-visible::before {
  transform: translateY(0);
}

.key {
  color: var(--muted);
  transition: color 160ms ease;
}

.command-dock nav a:hover .key,
.command-dock nav a:focus-visible .key,
.contact-trigger:hover .key,
.contact-trigger:focus-visible .key {
  color: var(--ink);
}

.link-action {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 160ms ease, transform 160ms ease;
}

.command-dock nav a:hover .link-action,
.command-dock nav a:focus-visible .link-action,
.contact-trigger:hover .link-action,
.contact-trigger:focus-visible .link-action {
  color: var(--ink);
  transform: translateX(3px);
}

.dock-meta {
  display: flex;
  justify-content: flex-end;
  gap: 22px;
  padding-top: 12px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

dialog {
  width: min(880px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100svh - 32px);
  padding: 0;
  overflow: visible;
  border: 1px solid var(--muted-soft);
  background: transparent;
  color: var(--text);
  opacity: 0;
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.68);
  transform: translateY(18px) scale(0.985);
  transition:
    opacity 180ms ease,
    transform 260ms cubic-bezier(0.16, 1, 0.3, 1),
    display 260ms allow-discrete,
    overlay 260ms allow-discrete;
}

dialog[open] {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@starting-style {
  dialog[open] {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
}

dialog::backdrop {
  background: rgba(3, 5, 10, 0.22);
  opacity: 0;
  backdrop-filter: blur(0);
  transition:
    opacity 220ms ease,
    backdrop-filter 220ms ease,
    display 220ms allow-discrete,
    overlay 220ms allow-discrete;
}

dialog[open]::backdrop {
  opacity: 1;
  backdrop-filter: blur(12px);
}

@starting-style {
  dialog[open]::backdrop {
    opacity: 0;
    backdrop-filter: blur(0);
  }
}

.console-window {
  max-height: calc(100svh - 32px);
  overflow-y: auto;
  background:
    linear-gradient(rgba(122, 162, 247, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(122, 162, 247, 0.025) 1px, transparent 1px),
    rgba(13, 16, 26, 0.98);
  background-size: 24px 24px, 24px 24px, auto;
}

.console-bar {
  position: sticky;
  z-index: 2;
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-bottom: 1px solid var(--muted-soft);
  background: rgba(17, 21, 34, 0.96);
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.console-lights {
  display: flex;
  gap: 7px;
}

.console-lights span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted-soft);
}

.console-lights span:first-child {
  background: var(--red);
}

.console-lights span:nth-child(2) {
  background: var(--purple);
}

.console-lights span:last-child {
  background: var(--green);
}

.console-bar button {
  justify-self: end;
  padding: 7px 0 7px 16px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.console-bar button:hover,
.console-bar button:focus-visible {
  color: var(--text-bright);
  outline: none;
}

.console-content {
  display: grid;
  grid-template-columns: minmax(220px, 0.78fr) minmax(300px, 1.22fr);
  gap: clamp(36px, 7vw, 86px);
  padding: clamp(30px, 6vw, 72px);
}

.console-heading > span {
  display: block;
  margin-bottom: 26px;
  color: var(--blue);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.console-heading h2 {
  margin: 0 0 18px;
  color: var(--text-bright);
  font-size: clamp(32px, 5vw, 58px);
  font-weight: 500;
  letter-spacing: -0.08em;
  line-height: 0.95;
}

.console-heading p {
  max-width: 30ch;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
}

#contactForm {
  display: grid;
  gap: 20px;
}

#contactForm label {
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: start;
  gap: 14px;
  border-bottom: 1px solid var(--muted-soft);
  transition: border-color 150ms ease;
}

#contactForm label:focus-within {
  border-color: var(--blue);
}

#contactForm label > span {
  padding-top: 12px;
  color: var(--purple);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#contactForm input,
#contactForm textarea {
  width: 100%;
  padding: 10px 0 12px;
  resize: vertical;
  border: 0;
  border-radius: 0;
  outline: none;
  background: transparent;
  color: var(--text-bright);
  font-size: 12px;
  line-height: 1.6;
}

#contactForm input::placeholder,
#contactForm textarea::placeholder {
  color: var(--muted-soft);
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}

.send-button,
.copy-button {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--muted-soft);
  background: transparent;
  font-size: 10px;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.send-button {
  border-color: var(--blue);
  background: var(--blue);
  color: var(--ink);
}

.send-button:hover,
.send-button:focus-visible {
  border-color: var(--blue-bright);
  background: var(--blue-bright);
  outline: none;
}

.copy-button {
  color: var(--muted);
}

.copy-button:hover,
.copy-button:focus-visible {
  border-color: var(--muted);
  color: var(--text-bright);
  outline: none;
}

.form-status {
  min-height: 1.4em;
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

@keyframes pixel-in {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  58% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-down {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes grow-line {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes blink {
  0%, 45% {
    opacity: 1;
  }
  46%, 100% {
    opacity: 0;
  }
}

@keyframes status-pulse {
  0%, 100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

@media (max-width: 760px) {
  body {
    background-size: auto, 32px 32px, 32px 32px, auto;
  }

  .site-shell {
    padding: 18px 16px 18px;
  }

  .runtime-status {
    display: none;
  }

  .hero {
    padding-block: 52px 46px;
  }

  .hero-index {
    margin-bottom: 22px;
  }

  .wordmark svg {
    width: calc(100% + 1px);
    max-height: 27vh;
  }

  .intro-line {
    gap: 10px;
    max-width: 29ch;
    margin-top: 26px;
    line-height: 1.6;
  }

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

  .command-dock nav a,
  .contact-trigger {
    min-height: 50px;
    border-bottom: 1px solid var(--muted-soft);
    font-size: 10px;
  }

  .command-dock nav a:nth-child(3) {
    border-left: 1px solid var(--muted-soft);
  }

  .link-action {
    display: none;
  }

  .dock-meta {
    justify-content: space-between;
    gap: 8px;
    padding-top: 10px;
    font-size: 7px;
  }

  .console-content {
    grid-template-columns: 1fr;
    gap: 34px;
    padding: 30px 22px 34px;
  }

  .console-heading > span {
    margin-bottom: 18px;
  }

  .console-heading p {
    max-width: 38ch;
  }

  #contactForm label {
    grid-template-columns: 60px 1fr;
  }

  .form-actions {
    flex-direction: column;
  }
}

@media (max-height: 680px) and (min-width: 761px) {
  .site-shell {
    padding-block: 20px;
  }

  .hero {
    padding-block: 34px 30px;
  }

  .hero-index {
    margin-bottom: 20px;
  }

  .wordmark svg {
    max-height: 24vh;
  }

  .intro-line {
    margin-top: 24px;
  }

  .command-dock nav a,
  .contact-trigger {
    min-height: 50px;
  }
}

@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;
  }
}
