/* ═══════════════════════════════════════════════════
   RELICT CLAY — Retro Terminal Theme  (retro.css)
   Shared across home.html, gallery.html, piece.html
   ═══════════════════════════════════════════════════ */

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

:root {
  --amber:        #ffb300;
  --amber-dim:    rgba(255,179,0,0.90);
  --amber-faint:  rgba(255,179,0,0.52);
  --amber-glow:   rgba(255,179,0,0.12);
  --amber-solid:  rgba(255,179,0,0.92);
  --bg:           #0c0900;
  --border:       rgba(255,179,0,0.24);
  --border-hi:    rgba(255,179,0,0.48);
  --font:         'Courier New', Courier, monospace;
  --gap:          clamp(1rem, 3vw, 2rem);
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #0f0f0f;
  font-family: var(--font);
  color: var(--amber);
  cursor: none;
}

::selection { background: var(--amber); color: #000; }
em { font-style: normal; }

/* ── CURSOR ─────────────────────────────────────── */
.cursor {
  position: fixed;
  width: 10px; height: 10px;
  background: var(--amber);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  transform: translate(-50%,-50%);
  transition: width .2s, height .2s;
  box-shadow: 0 0 8px rgba(255,179,0,0.7);
}
.cursor-ring {
  position: fixed;
  width: 28px; height: 28px;
  border: 1px solid var(--amber);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99998;
  transform: translate(-50%,-50%);
  opacity: .38;
  transition: width .2s, height .2s, opacity .2s;
}

/* ════════════════════════════════════════════════════
   MONITOR HOUSING
   ════════════════════════════════════════════════════ */
.monitor-housing {
  position: fixed;
  inset: 10px;
  background: linear-gradient(150deg, #2a2a2a 0%, #1c1c1c 40%, #161616 100%);
  border-radius: 14px;
  /* Multi-layer shadow: outer drop + inner depth */
  box-shadow:
    0 0 0 1px #0a0a0a,
    0 50px 120px rgba(0,0,0,0.95),
    0 8px 30px rgba(0,0,0,0.7),
    inset 0 1px 0 rgba(255,255,255,0.05),
    inset 0 -2px 4px rgba(0,0,0,0.6),
    inset 3px 0 6px rgba(0,0,0,0.3),
    inset -3px 0 6px rgba(0,0,0,0.3);
  padding: 18px 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Industrial detail: model label bottom-center */
.monitor-housing::before {
  content: 'RC-1  ◈  RELICT SYSTEMS';
  position: absolute;
  bottom: 7px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font);
  font-size: 7px;
  letter-spacing: .25em;
  color: rgba(255,255,255,0.08);
  pointer-events: none;
  white-space: nowrap;
}

/* Vent slots top-right */
.monitor-housing::after {
  content: '▐▌ ▐▌ ▐▌';
  position: absolute;
  top: 8px;
  right: 16px;
  font-size: 8px;
  color: rgba(0,0,0,0.5);
  letter-spacing: 2px;
  pointer-events: none;
  text-shadow: 0 1px 0 rgba(255,255,255,0.06);
}

/* ── BEZEL ── */
.monitor-bezel {
  flex: 1;
  min-height: 0;
  background: #0d0d0d;
  border-radius: 8px;
  padding: 8px;
  box-shadow:
    inset 0 4px 16px rgba(0,0,0,0.98),
    inset 0 0 50px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.015);
  display: flex;
  flex-direction: column;
}

/* ── CRT SCREEN ── */
.crt-screen {
  flex: 1;
  min-height: 0;
  position: relative;
  background: var(--bg);
  border-radius: 6px;
  overflow: hidden;
  /* Strong edge vignette */
  box-shadow:
    inset 0 0 60px rgba(0,0,0,0.45),
    inset 0 0 20px rgba(0,0,0,0.3),
    inset 0 0 5px rgba(0,0,0,1);
  /* Very faint amber ambient bleed */
  outline: 1px solid rgba(255,179,0,0.04);
  /* Flicker animation */
  animation: crt-flicker 9s ease-in-out infinite;
}

/* Scanlines */
.crt-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent   0px,
    transparent   3px,
    rgba(0,0,0,0.13) 3px,
    rgba(0,0,0,0.13) 4px
  );
  pointer-events: none;
  z-index: 20;
  border-radius: 6px;
}

/* Vignette */
.crt-screen::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at 50% 50%,
    transparent 60%,
    rgba(0,0,0,0.22) 80%,
    rgba(0,0,0,0.42) 100%
  );
  pointer-events: none;
  z-index: 21;
  border-radius: 6px;
}

/* Noise canvas overlay */
.crt-noise {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 19;
  opacity: .045;
  mix-blend-mode: overlay;
  border-radius: 6px;
}

/* Drift / refresh line */
.crt-drift {
  position: absolute;
  left: 0; right: 0;
  height: 4px;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(255,179,0,0.055) 50%,
    transparent
  );
  pointer-events: none;
  z-index: 18;
  animation: crt-drift 10s linear infinite;
}

@keyframes crt-drift {
  0%   { top: -6px; }
  100% { top: calc(100% + 6px); }
}

@keyframes crt-flicker {
  0%, 82%, 100% { opacity: 1; }
  83%            { opacity: 0.965; }
  84%            { opacity: 1; }
  91%            { opacity: 0.98; }
  92%            { opacity: 1; }
}

/* ════════════════════════════════════════════════════
   TERMINAL STRUCTURE
   ════════════════════════════════════════════════════ */
.terminal {
  position: relative;
  z-index: 1;
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
}

/* ── Title bar ── */
.terminal-titlebar {
  flex-shrink: 0;
  display: flex;
  align-items: stretch;
  min-height: 34px;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.45);
  position: relative;
  z-index: 10;
}

.terminal-logo {
  display: flex;
  align-items: center;
  padding: 0 1rem;
  font-size: .6rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--amber);
  border-right: 1px solid var(--border);
  white-space: nowrap;
  text-shadow: 0 0 8px rgba(255,179,0,0.9), 0 0 20px rgba(255,179,0,0.35);
  flex-shrink: 0;
}
.terminal-logo a { color: inherit; text-decoration: none; }

/* Tabs */
.terminal-tabs {
  display: flex;
  align-items: stretch;
  list-style: none;
}
.terminal-tabs li { display: contents; }

.terminal-tabs a,
.terminal-tabs button.tab-btn {
  display: flex;
  align-items: center;
  padding: 0 1rem;
  font-family: var(--font);
  font-size: .55rem;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: rgba(255,179,0,0.82);
  text-decoration: none;
  background: transparent;
  border: none;
  border-right: 1px solid var(--border);
  cursor: none;
  transition: color .2s, background .2s;
  white-space: nowrap;
  user-select: none;
}
.terminal-tabs a:hover,
.terminal-tabs button.tab-btn:hover {
  color: var(--amber);
  background: var(--amber-glow);
}
.terminal-tabs a.active {
  color: var(--amber);
  background: rgba(255,179,0,0.07);
  box-shadow: inset 0 -2px 0 var(--amber);
}

/* Window buttons (right side) */
.terminal-winbtns {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 .9rem;
  margin-left: auto;
  border-left: 1px solid var(--border);
  flex-shrink: 0;
}
.terminal-winbtns span {
  width: 8px; height: 8px;
  border: 1px solid rgba(255,179,0,0.22);
  display: block;
}

/* ── Scrollable body ── */
.terminal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

.terminal-body::-webkit-scrollbar       { width: 5px; }
.terminal-body::-webkit-scrollbar-track { background: rgba(0,0,0,0.3); }
.terminal-body::-webkit-scrollbar-thumb { background: rgba(255,179,0,0.22); }
.terminal-body::-webkit-scrollbar-thumb:hover { background: rgba(255,179,0,0.45); }

/* ════════════════════════════════════════════════════
   SHARED CONTENT COMPONENTS
   ════════════════════════════════════════════════════ */

/* Phosphor glow — subtle bloom on all body text, stronger on headings */
.terminal-body {
  text-shadow: 0 0 7px rgba(255,179,0,0.22);
}
.terminal-body h1,
.terminal-body h2,
.terminal-body .section-title,
.terminal-body .ascii-heading {
  text-shadow:
    0 0 8px  rgba(255,179,0,0.80),
    0 0 24px rgba(255,179,0,0.40),
    0 0 52px rgba(255,179,0,0.16);
}

.section-label {
  font-size: .56rem;
  letter-spacing: .38em;
  text-transform: uppercase;
  color: var(--amber-dim);
  margin-bottom: .5rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: .65rem 1.7rem;
  font-family: var(--font);
  font-size: .62rem;
  letter-spacing: .25em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--amber);
  color: #000;
  background: var(--amber);
  transition: background .2s, color .2s, box-shadow .2s;
  cursor: none;
}
.btn:hover {
  background: transparent;
  color: var(--amber);
  box-shadow: 0 0 14px rgba(255,179,0,0.25);
}

.btn-ghost {
  font-family: var(--font);
  font-size: .62rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--amber-dim);
  text-decoration: none;
  transition: color .2s;
  cursor: none;
}
.btn-ghost:hover { color: var(--amber); }

.btn-outline {
  display: inline-block;
  padding: .65rem 1.7rem;
  font-family: var(--font);
  font-size: .62rem;
  letter-spacing: .25em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--border-hi);
  color: var(--amber-dim);
  background: transparent;
  transition: border-color .2s, color .2s, box-shadow .2s;
  cursor: none;
}
.btn-outline:hover {
  border-color: var(--amber);
  color: var(--amber);
  box-shadow: 0 0 10px rgba(255,179,0,0.15);
}

/* Redaction */
.redact-word {
  position: relative;
  display: inline-block;
  white-space: nowrap;
}
.redact-word::after {
  content: '';
  position: absolute;
  left: -1px; right: -1px; top: 1px; bottom: 1px;
  background: var(--amber);
  border-radius: 1px;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .5s cubic-bezier(.77,0,.18,1);
  pointer-events: none;
  z-index: 2;
}
.is-redacted .redact-word::after { transform: scaleX(1); }
.is-redacted:hover .redact-word::after {
  transform: scaleX(0);
  transform-origin: right center;
}

/* Image amber toning — removed on hover to reveal true colors */
.terminal-body img {
  filter: sepia(1) saturate(1.4) hue-rotate(5deg) brightness(0.88);
  transition: filter 0.35s ease;
}
.preview-item:hover img,
.piece-card:hover img,
.related-card:hover img,
.terminal-body a:hover img,
.piece-image-col:hover img {
  filter: none;
}

/* Footer */
.site-footer {
  padding: 1.1rem var(--gap);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .7rem;
  font-size: .55rem;
  letter-spacing: .18em;
  color: var(--amber-dim);
}
.site-footer a {
  color: var(--amber-dim);
  text-decoration: none;
  transition: color .2s;
}
.site-footer a:hover { color: var(--amber); }

/* Animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.visible { opacity: 1; transform: none; }
