:root {
  --green-300: #86efac;
  --green-400: #4ade80;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-700: #15803d;
  --green-800: #166534;
  --green-900: #14532d;
}

* , *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: #000;
  overflow-x: hidden;
  max-width: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--green-400);
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(34, 197, 94, 0.09), transparent 60%),
    #000;
  min-height: 100vh;
  width: 100%;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; background: none; border: none; color: inherit; }
img { max-width: 100%; display: block; }

::selection { background: rgba(34, 197, 94, 0.35); color: #ecfdf5; }

/* accessible focus ring, only shown for keyboard navigation */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--green-400);
  outline-offset: 2px;
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cursor-blink { animation: none !important; }
  [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ---------- scanline overlay ---------- */
.scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  opacity: 0.2;
  background-image: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.4) 0px,
    rgba(0, 0, 0, 0.4) 1px,
    transparent 1px,
    transparent 3px
  );
}

/* ---------- header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--green-900);
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.site-header-inner {
  margin: 0 auto;
  max-width: 64rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  column-gap: 0.75rem;
  row-gap: 0.5rem;
  padding: 0.75rem 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.brand svg { height: 1rem; width: 1rem; color: var(--green-500); filter: drop-shadow(0 0 4px rgba(34, 197, 94, 0.6)); }
.brand span {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--green-400);
  text-shadow: 0 0 12px rgba(74, 222, 128, 0.35);
}

.cursor-blink {
  margin-left: 2px;
  display: inline-block;
  height: 1rem;
  width: 0.5rem;
  background: var(--green-400);
  vertical-align: middle;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.main-nav {
  order: 3;
  margin: 0 -0.25rem;
  display: flex;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  gap: 0.125rem;
  overflow-x: auto;
  white-space: nowrap;
  padding: 0 0.25rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.main-nav::-webkit-scrollbar { display: none; }

.nav-btn {
  position: relative;
  flex-shrink: 0;
  border-radius: 0.25rem;
  padding: 0.5rem 0.625rem;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: color 0.15s ease, background-color 0.15s ease;
  color: var(--green-700);
}
.nav-btn:hover { color: var(--green-400); }
.nav-btn.active { background: rgba(20, 83, 45, 0.4); color: var(--green-300); }
.nav-btn.active::after {
  content: "";
  position: absolute;
  left: 0.625rem;
  right: 0.625rem;
  bottom: 2px;
  height: 1px;
  background: var(--green-400);
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.8);
}
@media (min-width: 640px) { .nav-btn.active::after { left: 0.75rem; right: 0.75rem; } }

.status-pill {
  display: none;
  flex-shrink: 0;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: var(--green-600);
}
.status-dot {
  height: 0.375rem;
  width: 0.375rem;
  border-radius: 999px;
  background: var(--green-500);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

@media (min-width: 640px) {
  .site-header-inner { padding: 0.75rem 1rem; }
  .brand span { font-size: 1rem; }
  .main-nav { order: 0; margin: 0; padding: 0; gap: 0.25rem; }
  .nav-btn { padding: 0.375rem 0.75rem; font-size: 0.75rem; }
  .status-pill { display: flex; }
}

/* ---------- layout ---------- */
main {
  position: relative;
  margin: 0 auto;
  max-width: 64rem;
  padding: 2rem 1rem;
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
}

.scroll-mt { scroll-margin-top: 6rem; }

[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- terminal panel ---------- */
.term-panel {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border-radius: 0.375rem;
  border: 1px solid var(--green-800);
  background: rgba(0, 0, 0, 0.8);
  box-shadow: 0 0 25px rgba(34, 197, 94, 0.08);
}
.term-titlebar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--green-900);
  padding: 0.5rem 0.75rem;
}
@media (min-width: 640px) { .term-titlebar { padding: 0.5rem 1rem; } }
.term-dot { height: 0.625rem; width: 0.625rem; flex-shrink: 0; border-radius: 999px; }
.term-dot.red { background: rgba(239, 68, 68, 0.7); }
.term-dot.yellow { background: rgba(234, 179, 8, 0.7); }
.term-dot.green { background: rgba(34, 197, 94, 0.7); }
.term-title-text {
  margin-left: 0.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: inherit;
  font-size: 0.75rem;
  color: var(--green-600);
}
.term-body { padding: 0.75rem; }
@media (min-width: 640px) { .term-body { padding: 1rem; } }

/* ---------- section headings ---------- */
.section-heading {
  position: relative;
  margin-bottom: 1.25rem;
  padding-bottom: 0.6rem;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--green-400);
  border-bottom: 1px solid var(--green-900);
}
.section-heading .prompt { color: var(--green-700); }
.section-heading::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 2.5rem;
  height: 1px;
  background: var(--green-400);
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.9);
}

/* ---------- hero ---------- */
.hero-wrap { position: relative; overflow: hidden; border-radius: 0.25rem; }
.hero-canvas-wrap { position: absolute; inset: 0; }
#matrix-canvas { position: absolute; inset: 0; height: 100%; width: 100%; opacity: 0.2; }

.hero-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 0.5rem;
  text-align: center;
}
@media (min-width: 640px) {
  .hero-inner { flex-direction: row; align-items: flex-start; text-align: left; }
}

.avatar-wrap {
  position: relative;
  flex-shrink: 0;
}
.avatar-wrap::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 0.5rem;
  border: 1px solid rgba(34, 197, 94, 0.5);
  animation: ring-pulse 2.4s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) { .avatar-wrap::before { animation: none; } }
@keyframes ring-pulse {
  0%, 100% { opacity: 0.35; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.04); }
}

.avatar {
  position: relative;
  height: 5rem;
  width: 5rem;
  flex-shrink: 0;
  border-radius: 0.25rem;
  border: 2px solid var(--green-500);
  object-fit: cover;
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.45);
}
@media (min-width: 640px) {
  .avatar { height: 7rem; width: 7rem; }
  .avatar-wrap { margin-left: 0.25rem; margin-top: 1rem; }
}

.hero-content { min-width: 0; width: 100%; flex: 1; }
.hero-label { font-family: inherit; font-size: 0.75rem; color: var(--green-700); }
.hero-name {
  margin-top: 0.25rem;
  overflow-wrap: break-word;
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--green-300);
  text-shadow: 0 0 18px rgba(74, 222, 128, 0.35);
}
@media (min-width: 640px) { .hero-name { font-size: 1.75rem; } }
.hero-name .accent { color: var(--green-600); text-shadow: none; }

.hero-meta {
  margin-top: 0.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--green-600);
}
@media (min-width: 640px) { .hero-meta { justify-content: flex-start; } }
.hero-meta .dot-item { display: flex; align-items: center; gap: 0.25rem; }
.hero-meta .dot-item .dot { height: 0.375rem; width: 0.375rem; border-radius: 999px; background: var(--green-500); }

.hero-bio {
  margin: 1rem auto 0;
  max-width: 42rem;
  text-align: left;
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--green-400);
}
@media (min-width: 640px) { .hero-bio { margin-left: 0; } }
.hero-bio > * + * { margin-top: 0.75rem; }
.hero-bio .cmd-line { color: var(--green-700); }

.social-row {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}
@media (min-width: 640px) { .social-row { justify-content: flex-start; } }

.social-icon {
  display: flex;
  height: 2.5rem;
  width: 2.5rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  border: 1px solid var(--green-800);
  color: var(--green-500);
  transition: box-shadow 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
@media (min-width: 640px) { .social-icon { height: 2.25rem; width: 2.25rem; } }
.social-icon svg { height: 1rem; width: 1rem; }

/* ---------- gear grid ---------- */
.gear-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
@media (min-width: 640px) { .gear-grid { grid-template-columns: repeat(3, 1fr); } }

.gear-card {
  border-radius: 0.25rem;
  border: 1px solid var(--green-900);
  background: rgba(0, 0, 0, 0.7);
  padding: 1rem;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.gear-card:hover { transform: translateY(-4px); border-color: var(--green-400); box-shadow: 0 0 18px rgba(34, 197, 94, 0.25); }
.gear-card:hover .gear-icon { color: var(--green-300); border-color: var(--green-400); }

.gear-icon {
  margin-bottom: 0.75rem;
  display: flex;
  height: 2.5rem;
  width: 2.5rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  border: 1px solid var(--green-800);
  color: var(--green-500);
  transition: color 0.15s ease, border-color 0.15s ease;
}
.gear-icon svg { height: 1.25rem; width: 1.25rem; }
.gear-cat { font-size: 10px; text-transform: uppercase; letter-spacing: 0.15em; color: var(--green-700); }
.gear-name { margin-top: 0.125rem; font-weight: 700; color: var(--green-300); }

/* ---------- links list ---------- */
.link-list { display: flex; flex-direction: column; gap: 0.5rem; }
.link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-radius: 0.25rem;
  border: 1px solid var(--green-900);
  background: rgba(0, 0, 0, 0.7);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.link-row:hover { transform: translateY(-2px); border-color: var(--green-400); box-shadow: 0 0 14px rgba(34, 197, 94, 0.15); }
.link-row .label-wrap { min-width: 0; flex: 1; overflow-wrap: break-word; }
.link-row .cmd { color: var(--green-700); }
.link-row .name { font-weight: 700; color: var(--green-300); }
.link-row .sub { margin-left: 0.5rem; font-size: 0.75rem; color: var(--green-700); }
.link-row .arrow {
  flex-shrink: 0;
  color: var(--green-600);
  display: inline-block;
  transition: transform 0.15s ease, color 0.15s ease;
}
.link-row:hover .arrow { transform: translateX(4px); color: var(--green-300); }

/* ---------- stream ---------- */
.stream-tabs {
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  border-bottom: 1px solid var(--green-900);
  padding-bottom: 0.75rem;
}
.stream-tab-btn {
  position: relative;
  border-radius: 0.25rem;
  padding: 0.5rem 0.75rem;
  font-family: inherit;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--green-700);
  transition: color 0.15s ease, background-color 0.15s ease;
}
@media (min-width: 640px) { .stream-tab-btn { padding: 0.375rem 0.75rem; } }
.stream-tab-btn:hover { color: var(--green-400); }
.stream-tab-btn.active { background: rgba(20, 83, 45, 0.5); color: var(--green-300); }

.stream-frame-wrap {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 0.25rem;
  background: #000;
}
.stream-frame-wrap iframe { height: 100%; width: 100%; border: 0; }

.stream-meta {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--green-600);
}
.stream-meta .source-label { overflow-wrap: break-word; }
.stream-meta .open-channel { font-weight: 700; color: var(--green-400); }
.stream-meta .open-channel:hover { color: var(--green-300); }

/* ---------- footer ---------- */
.site-footer {
  margin-top: 3rem;
  padding: 0 0.5rem 1.5rem;
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  text-align: center;
  font-size: 11px;
  color: var(--green-800);
}
