/* ==========================================================================
   shawnrider.com — a terminal
   neon on void
   ========================================================================== */

:root {
  --bg:       #000000;
  --term-bg:  rgba(22, 12, 42, 0.92);
  --surface:  rgba(40, 24, 68, 0.5);

  --ink:      #e0daf0;
  --bright:   #f8f4ff;

  --magenta:  #ff3c8e;
  --pink:     #ff6eb4;
  --gold:     #ffd866;
  --green:    #a9dc76;
  --cyan:     #78dce8;
  --blue:     #7aa2f7;
  --purple:   #c792ea;
  --orange:   #fc9867;
  --red:      #ff6188;

  --muted:    #8878a0;
  --dim:      #3d3060;
  --border:   rgba(199, 146, 234, 0.15);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  font-size: 15px;
}

body {
  font-family: 'Courier Prime', 'Courier New', monospace;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 20% 50%, rgba(30, 10, 60, 0.6) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(20, 8, 50, 0.5) 0%, transparent 45%),
    radial-gradient(ellipse at 60% 80%, rgba(25, 12, 55, 0.4) 0%, transparent 50%),
    radial-gradient(ellipse at 40% 30%, rgba(15, 5, 40, 0.3) 0%, transparent 40%),
    linear-gradient(160deg, #06010f 0%, #0d0420 25%, #120830 50%, #0a0318 75%, #030108 100%);
  -webkit-font-smoothing: antialiased;
}

/* --- GoL Canvas --- */
#gol-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* --- The Terminal --- */

.terminal-shell {
  position: fixed;
  z-index: 10;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 760px);
  height: min(88vh, 640px);
  display: flex;
  flex-direction: column;
  background: var(--term-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow:
    0 0 40px rgba(199, 146, 234, 0.12),
    0 0 80px rgba(120, 220, 232, 0.06),
    0 0 160px rgba(255, 60, 142, 0.04);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Title bar */
.term-titlebar {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.85rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.72rem;
  color: var(--muted);
  user-select: none;
  flex-shrink: 0;
  border-radius: 6px 6px 0 0;
}

.term-dots {
  display: flex;
  gap: 6px;
  margin-right: 0.8rem;
}

.term-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.term-dots span:nth-child(1) { background: var(--red); }
.term-dots span:nth-child(2) { background: var(--gold); }
.term-dots span:nth-child(3) { background: var(--green); }

.term-titlebar .title {
  flex: 1;
  text-align: center;
  color: var(--muted);
}

/* Output area */
.term-output {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.2rem;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--dim) transparent;
  font-size: 1rem;
  line-height: 1.7;
}

.term-output::-webkit-scrollbar { width: 4px; }
.term-output::-webkit-scrollbar-track { background: transparent; }
.term-output::-webkit-scrollbar-thumb { background: var(--dim); border-radius: 2px; }

/* Output lines */
.line { margin-bottom: 0.15rem; white-space: pre-wrap; word-wrap: break-word; }
.line-cmd { color: var(--bright); font-weight: 500; }
.line-cmd .prompt { color: var(--gold); }
.line-info { color: var(--ink); }
.line-muted { color: var(--muted); }
.line-heading { color: var(--magenta); font-size: 1.15rem; font-weight: 700; margin-top: 0.6rem; letter-spacing: 0.05em; }
.line-gold { color: var(--gold); }
.line-green { color: var(--green); }
.line-cyan { color: var(--cyan); }
.line-blue { color: var(--blue); }
.line-purple { color: var(--purple); }
.line-orange { color: var(--orange); }
.line-pink { color: var(--pink); }
.line-bright { color: var(--bright); }
.line-red { color: var(--red); }
.line-blank { height: 0.6rem; }
.line-rule { color: var(--dim); }

/* Links in output */
.term-link {
  color: var(--gold);
  text-decoration: none;
  cursor: pointer;
  transition: text-shadow 0.12s, color 0.12s;
}
.term-link:hover {
  color: var(--pink);
  text-shadow:
    0 0 8px rgba(255,110,180,0.4),
    1px 0 0 rgba(255,60,142,0.2),
    -1px 0 0 rgba(120,220,232,0.2);
}

/* Terminal cards */
.term-card {
  border: 1px solid var(--dim);
  padding: 0.75rem 1rem;
  margin: 0.4rem 0;
  transition: border-color 0.12s, background 0.12s, box-shadow 0.12s;
  cursor: default;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.term-card.focused {
  border-color: var(--cyan);
  background: var(--surface);
  box-shadow: 0 0 12px rgba(120, 220, 232, 0.08);
}
.term-card .term-img {
  width: 120px;
  height: auto;
  flex-shrink: 0;
  border: 1px solid var(--dim);
  display: block;
  margin: 0;
  object-fit: cover;
}
.term-card .card-body { flex: 1; min-width: 0; }
.term-card .card-type { color: var(--purple); font-size: 0.8rem; }
.term-card .card-name { color: var(--cyan); font-size: 1rem; }
.term-card .card-desc { color: var(--ink); font-size: 0.9rem; margin-top: 0.2rem; line-height: 1.5; }
.term-card .card-meta { color: var(--muted); font-size: 0.8rem; margin-top: 0.25rem; }
.term-card .card-meta .term-link { font-size: 0.85rem; }

@media (max-width: 500px) {
  .term-card { flex-direction: column; }
  .term-card .term-img { width: 100%; max-width: 200px; }
}

/* Input line */
.term-input-row {
  display: flex;
  align-items: center;
  padding: 0.55rem 1.2rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  gap: 0.5ch;
}

.term-input-row .prompt {
  color: var(--green);
  white-space: nowrap;
  font-size: 1rem;
  font-weight: 700;
}

.term-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--bright);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  caret-color: var(--magenta);
}

.term-cursor {
  width: 0.55em;
  height: 1.1em;
  background: var(--magenta);
  animation: blink 1s step-end infinite;
  flex-shrink: 0;
}

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

/* Hints bar */
.term-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1rem;
  padding: 0.35rem 1.2rem;
  border-top: 1px solid var(--border);
  font-size: 0.65rem;
  color: var(--muted);
  user-select: none;
  flex-shrink: 0;
  border-radius: 0 0 6px 6px;
}

.term-hints kbd {
  display: inline-block;
  padding: 0.05rem 0.35rem;
  border: 1px solid var(--dim);
  border-radius: 2px;
  font-family: inherit;
  font-size: inherit;
  color: var(--purple);
  margin-right: 0.2rem;
  background: rgba(40, 24, 68, 0.4);
}

.term-hints .hint-sep {
  color: var(--dim);
}

/* --- Responsive --- */
@media (max-width: 500px) {
  .terminal-shell {
    width: 100vw;
    height: 100vh;
    top: 0;
    left: 0;
    transform: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }
  .term-titlebar { border-radius: 0; }
  .term-hints { border-radius: 0; }
}

/* --- Screen reader only --- */
.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;
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  .term-cursor { animation: none; opacity: 1; }
}
