/* AK://dc — phosphor terminal. Standalone stylesheet (brand hexes, dark only). */

:root {
  --bg: #060709;
  --screen: #0a0b0e;
  --phos: #c8a46a;
  --phos-bright: #e8ce9c;
  --phos-dim: rgba(200, 164, 106, 0.55);
  --phos-faint: rgba(200, 164, 106, 0.3);
  --sec: #6eb5c0;
  --ok: #4fae7f;
  --err: #d06565;
  --border: rgba(200, 164, 106, 0.22);
  --glow: 0 0 6px rgba(200, 164, 106, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--phos);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 15px;
  line-height: 1.5;
}

a {
  color: var(--sec);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

#rain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.28;
}

.chip-header,
main,
.stealth-footer {
  position: relative;
  z-index: 1;
}

/* Header */
.chip-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.25rem;
  max-width: 940px;
  margin: 0 auto;
}

.chip-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 2px dashed var(--phos);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  position: relative;
}

.chip-mark::before {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  border: 1px solid var(--phos-faint);
}

.chip-mark span {
  width: 0.8rem;
  height: 0.6rem;
  border-left: 2px solid var(--phos);
  border-bottom: 2px solid var(--phos);
  transform: rotate(-45deg) translate(1px, -2px);
}

.chip-title {
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--phos-bright);
  text-shadow: var(--glow);
}

.chip-title .dim {
  color: var(--phos-dim);
  font-weight: 400;
}

.cursor {
  animation: blink 1s steps(2, start) infinite;
  margin-left: 0.15rem;
}

@keyframes blink {
  to {
    visibility: hidden;
  }
}

.chip-actions {
  margin-left: auto;
  display: flex;
  gap: 0.4rem;
}

/* Buttons */
.cbtn {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--phos);
  font-size: 0.82rem;
  background: rgba(200, 164, 106, 0.05);
  transition: border-color 0.15s, background 0.15s;
  white-space: nowrap;
}

.cbtn:hover {
  border-color: var(--phos);
  text-decoration: none;
  background: rgba(200, 164, 106, 0.12);
}

.cbtn-primary {
  color: var(--phos-bright);
  border-color: var(--phos-dim);
}

.cbtn.is-copied {
  color: var(--ok);
  border-color: var(--ok);
}

/* Terminal */
main {
  max-width: 940px;
  margin: 0 auto;
  padding: 0.5rem 1.25rem 2rem;
}

.term {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--screen);
  box-shadow: 0 0 40px rgba(200, 164, 106, 0.06), 0 24px 80px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.term-titlebar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid var(--border);
  background: rgba(200, 164, 106, 0.04);
  font-size: 0.78rem;
  color: var(--phos-dim);
}

.led {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
}

.led-r { background: var(--err); }
.led-y { background: var(--phos); }
.led-g { background: var(--ok); }

.term-title {
  margin-left: 0.4rem;
}

.term-badge {
  margin-left: auto;
  color: var(--ok);
  letter-spacing: 0.08em;
}

.term-screen {
  position: relative;
  padding: 1rem 1.1rem 0.9rem;
  height: min(62vh, 540px);
  overflow-y: auto;
  background:
    radial-gradient(120% 90% at 50% 40%, transparent 60%, rgba(0, 0, 0, 0.35)),
    var(--screen);
  cursor: text;
}

.term-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    transparent 0 2px,
    rgba(0, 0, 0, 0.08) 2px 3px
  );
}

#term-out .line {
  white-space: pre-wrap;
  word-break: break-word;
  text-shadow: var(--glow);
  min-height: 1.2em;
}

#term-out .line.pre {
  white-space: pre;
  overflow-x: auto;
}

#term-out .sys { color: var(--phos-dim); }
#term-out .ok { color: var(--ok); }
#term-out .err { color: var(--err); }
#term-out .sec { color: var(--sec); }
#term-out .bright { color: var(--phos-bright); }
#term-out .echo { color: var(--phos-dim); }

.term-promptline {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.prompt {
  color: var(--phos-bright);
  text-shadow: var(--glow);
  white-space: nowrap;
}

#term-in {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  color: var(--phos-bright);
  font: inherit;
  text-shadow: var(--glow);
  caret-color: var(--phos-bright);
  padding: 0;
}

/* Jackpot / konami flashes */
.term.flash-gold {
  animation: flashgold 0.9s ease-out 2;
}

@keyframes flashgold {
  0% { box-shadow: 0 0 60px rgba(200, 164, 106, 0.55); }
  100% { box-shadow: 0 0 40px rgba(200, 164, 106, 0.06); }
}

/* Contact strip */
.contact-strip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.creds {
  font-size: 0.72rem;
  color: var(--phos-dim);
  letter-spacing: 0.02em;
}

/* Footer */
.stealth-footer {
  text-align: center;
  padding: 1.5rem 1rem 2rem;
  font-size: 0.75rem;
}

.stealth-footer a {
  color: var(--phos-faint);
  transition: color 0.15s;
}

.stealth-footer a:hover {
  color: var(--phos);
  text-decoration: none;
}

/* Mobile */
@media (max-width: 480px) {
  html,
  body {
    font-size: 14px;
  }

  .chip-title .dim {
    display: none;
  }

  .chip-actions {
    gap: 0.3rem;
  }

  .term-screen {
    height: min(58vh, 460px);
  }

  .contact-strip .cbtn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .creds {
    flex-basis: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cursor {
    animation: none;
  }

  .term.flash-gold {
    animation: none;
  }

  .cbtn {
    transition: none;
  }
}
