:root {
  color-scheme: dark;
  --bg: #000000;
  --panel: rgba(0, 0, 0, 0.72);
  --panel-bar: rgba(0, 20, 8, 0.6);
  --green: #00ff66;
  --green-soft: #5fffa0;
  --green-dim: #1f9e54;
  --text: #c6f7d3;
  --muted: #5c8c6a;
  --line: rgba(0, 255, 102, 0.16);
  --line-bright: rgba(0, 255, 102, 0.36);
  --glow: 0 0 24px rgba(0, 255, 102, 0.12);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", "DejaVu Sans Mono", monospace;
  --max: 760px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(16px, 5vw, 56px) 16px;
  color: var(--text);
  background: var(--bg);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* matrix rain canvas, behind everything */
.rain {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.75s ease;
}

.rain.is-on {
  opacity: 0.315;
}

a {
  color: var(--green-soft);
  text-decoration: none;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
}

img {
  display: block;
  max-width: 100%;
}

/* ---- terminal frame ---- */
.term {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--max);
  border: 1px solid var(--line-bright);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--glow), 0 24px 70px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  overflow: hidden;
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-bar);
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid var(--green-dim);
}

.dot:first-child {
  background: var(--green-dim);
}

.term-title {
  flex: 1;
  text-align: center;
  margin-right: 33px; /* offset the dots so the title sits centered */
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.term-body {
  padding: clamp(20px, 4.5vw, 34px);
}

/* ---- intro ---- */
.prompt {
  color: var(--green);
  font-weight: 700;
}

.cmd-line {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 0.92rem;
  word-break: break-word;
}

.name {
  margin: 0 0 10px;
  font-size: clamp(1.7rem, 6vw, 2.1rem);
  line-height: 1.05;
  font-weight: 700;
  color: var(--green-soft);
  text-shadow: 0 0 18px rgba(0, 255, 102, 0.28);
}

.tagline {
  margin: 0;
  max-width: 60ch;
  color: var(--muted);
  font-size: 0.95rem;
}

.cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: -0.18em;
  background: var(--green);
  animation: blink 1.1s steps(2, start) infinite;
}

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

/* ---- section blocks ---- */
.block {
  margin-top: 34px;
}

.block-h {
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--green-soft);
  letter-spacing: 0.01em;
}

/* ---- project cards ---- */
.cards {
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  display: flex;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.32);
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.card:hover {
  border-color: var(--line-bright);
  background: rgba(0, 255, 102, 0.045);
  box-shadow: var(--glow);
}

.card-icon {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 9px;
  border: 1px solid var(--line);
}

.card-main {
  min-width: 0;
}

.card-name {
  margin: 1px 0 4px;
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--green-soft);
}

.card-desc {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border: 1px solid var(--line-bright);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.4);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
}

.chip:hover {
  color: var(--green);
  border-color: var(--green);
  background: rgba(0, 255, 102, 0.08);
}

/* ---- scripts ---- */
.script {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.32);
}

.script + .script {
  margin-top: 12px;
}

.script-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.script-name {
  font-weight: 700;
  color: var(--text);
}

.os-tag {
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.view {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  color: var(--muted);
  font-size: 0.85rem;
}

.view:hover {
  color: var(--green);
}

/* ---- command box (shared) ---- */
.cmd-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid var(--line-bright);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.55);
}

.cmd-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 0.88rem;
  color: var(--text);
  scrollbar-width: none;
}

.cmd-text::-webkit-scrollbar {
  display: none;
}

.cmd-prompt {
  margin-right: 8px;
  color: var(--green);
  user-select: none;
}

.cmd-copy {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.4);
  color: var(--muted);
  cursor: pointer;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
}

.cmd-copy:hover {
  color: var(--green);
  border-color: var(--line-bright);
}

.cmd-copy svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cmd-copy .ti-check {
  display: none;
}

.cmd-copy.is-copied {
  color: var(--green);
  border-color: var(--green);
}

.cmd-copy.is-copied .ti-copy {
  display: none;
}

.cmd-copy.is-copied .ti-check {
  display: inline;
}

/* ---- footer ---- */
.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.84rem;
}

.foot a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
}

.foot a:hover {
  color: var(--green);
}

/* ---- icons ---- */
.ic {
  width: 1em;
  height: 1em;
  flex: none;
  fill: currentColor;
}

.ic-ext {
  width: 0.85em;
  height: 0.85em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.os-ic {
  width: 1.05rem;
  height: 1.05rem;
  color: var(--green);
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

/* ---- responsive ---- */
@media (max-width: 480px) {
  .view {
    margin-left: 0;
    width: 100%;
  }

  .cmd-text {
    font-size: 0.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .cursor {
    animation: none;
  }
}
