/* ==========================================================================
   RE:in_coding page — retro-terminal theme
   Loaded after style.css, only on re-in-coding.html.
   ========================================================================== */

.ric {
  --bg: #07080a;
  --panel: #0e1013;
  --line: #22262c;
  --text: #d9dee5;
  --dim: #8a93a0;
  --green: #7dff9a;
  --pink: #ff6ec7;
  --cyan: #63e6ff;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --pixel: "VT323", var(--mono);

  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.98rem;
  line-height: 1.75;
}

/* Faint CRT scanlines over everything */
.ric::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.025) 0,
    rgba(255, 255, 255, 0.025) 1px,
    transparent 1px,
    transparent 3px
  );
}

.ric h1, .ric h2, .ric h3 {
  font-family: var(--pixel);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1;
}
.ric h2 { font-size: clamp(2.6rem, 6vw, 4.2rem); color: var(--green); }
.ric h3 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); }

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

/* Keep the shared header looking the same as on the other pages */
.ric .site-header { font-family: "Poppins", system-ui, sans-serif; }
.ric .site-header a { color: inherit; }
.ric ::selection { background: var(--pink); color: #000; }

.ric .section { padding: clamp(64px, 9vw, 112px) 0; }
.ric .section + .section { border-top: 1px dashed var(--line); }

/* Small "// label" above headings */
.ric .tag {
  display: block;
  color: var(--dim);
  font-size: 0.85rem;
  margin-bottom: 1.2em;
}
.ric .tag::before { content: "// "; color: var(--pink); }

/* Terminal-style button */
.ric .term-btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.95rem;
  padding: 0.7em 1.2em;
  border: 1px solid var(--green);
  color: var(--green);
  background: transparent;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.ric .term-btn::before { content: "> "; }
.ric .term-btn:hover { background: var(--green); color: #000; }
.ric .term-btn[aria-disabled="true"] {
  border-color: var(--line);
  color: var(--dim);
  pointer-events: none;
}
.ric .term-btn[aria-disabled="true"]::before { content: "# "; }

/* ---------- Hero ---------- */
.ric-hero {
  position: relative;
  min-height: 92vh;
  min-height: 92svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 140px 0 80px;
}
.ric-hero__bg {
  position: absolute;
  inset: 0;
  background: url("../images/re-in-coding/part1-cover-green.webp") center / cover;
  opacity: 0.16;
  animation: ric-drift 40s linear infinite alternate;
}
@keyframes ric-drift {
  from { transform: scale(1.1) translateX(-2%); }
  to   { transform: scale(1.1) translateX(2%); }
}
.ric-hero .container { position: relative; }

.ric-title {
  position: relative;
  display: inline-block;
  font-size: clamp(4.5rem, 15vw, 12rem);
  color: var(--text);
  margin: 0 0 0.25em;
}
/* RGB-split glitch on the title text */
.ric-title::before,
.ric-title::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.ric-title::before { color: var(--pink); mix-blend-mode: screen; animation: ric-glitch-a 3.2s infinite steps(1, end); }
.ric-title::after  { color: var(--cyan); mix-blend-mode: screen; animation: ric-glitch-b 3.2s infinite steps(1, end); }
@keyframes ric-glitch-a {
  0%, 86%, 100% { transform: none; clip-path: inset(0 0 100% 0); }
  88% { transform: translate(-4px, 0); clip-path: inset(10% 0 60% 0); }
  90% { transform: translate(5px, 0);  clip-path: inset(55% 0 20% 0); }
  92% { transform: translate(-3px, 0); clip-path: inset(30% 0 45% 0); }
  94% { transform: none; clip-path: inset(0 0 100% 0); }
}
@keyframes ric-glitch-b {
  0%, 87%, 100% { transform: none; clip-path: inset(0 0 100% 0); }
  89% { transform: translate(4px, 0);  clip-path: inset(65% 0 5% 0); }
  91% { transform: translate(-5px, 0); clip-path: inset(20% 0 62% 0); }
  93% { transform: translate(3px, 0);  clip-path: inset(40% 0 30% 0); }
  95% { transform: none; clip-path: inset(0 0 100% 0); }
}

/* Typed-in prompt line */
.ric-prompt {
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  max-width: 46em;
  min-height: 3.6em;
  color: var(--text);
}
.ric-prompt::before { content: "$ "; color: var(--green); }
.ric-cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: var(--green);
  animation: ric-blink 1s steps(1, end) infinite;
}
@keyframes ric-blink { 50% { opacity: 0; } }

.ric-hero__meta {
  margin-top: 2em;
  color: var(--dim);
  font-size: 0.9rem;
}
.ric-hero__meta span { color: var(--pink); }

/* ---------- About ---------- */
.ric-about {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}
.ric-about p { max-width: 38em; }
.ric-about em { color: var(--pink); font-style: normal; }
.ric figure { margin: 0; }
.ric figcaption { color: var(--dim); font-size: 0.8rem; margin-top: 0.8em; }
.ric figcaption::before { content: "^ "; color: var(--green); }
.ric-photo img { width: 100%; border: 1px solid var(--line); }
@media (max-width: 860px) { .ric-about { grid-template-columns: 1fr; } }

/* ---------- Process steps ---------- */
.ric-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 40px;
  counter-reset: step;
}
.ric-step {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 28px 24px;
}
.ric-step h3 { color: var(--text); margin: 0 0 0.4em; }
.ric-step h3::before {
  counter-increment: step;
  content: "0" counter(step) " ";
  color: var(--pink);
}
.ric-step p { margin: 0; color: var(--dim); }
@media (max-width: 860px) { .ric-steps { grid-template-columns: 1fr; } }

/* ---------- Movements ---------- */
.ric-part {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(16px, 2.4vw, 32px);
  align-items: start;
  padding: 48px 0;
  border-top: 1px solid var(--line);
}
.ric-part:first-of-type { border-top: 0; }
.ric-part--no-cover { grid-template-columns: minmax(0, 1fr) minmax(0, 2.15fr); }
.ric-part__art { position: relative; }
.ric-video { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; background: #fff; }
.ric-part__art .label {
  display: block;
  font-size: 0.75rem;
  color: var(--dim);
  margin-top: 0.6em;
}
.ric-part__num { color: var(--pink); font-family: var(--pixel); font-size: 1.6rem; }
.ric-part h3 { margin: 0.1em 0 0.15em; color: var(--text); }
.ric-part__sub { color: var(--green); margin-bottom: 1em; }
.ric-part__note { margin-bottom: 1.2em; }
.ric-part dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.2em 1em;
  margin: 0 0 1.6em;
  font-size: 0.88rem;
}
.ric-part dt { color: var(--dim); }
.ric-listen { display: flex; flex-wrap: wrap; gap: 10px; }

.ric-release { max-width: 46em; color: var(--dim); margin-bottom: 1.5em; }
.ric-release span { color: var(--pink); }
.ric-part dd { margin: 0; }
@media (max-width: 960px) {
  .ric-part, .ric-part--no-cover { grid-template-columns: 1fr 1fr; }
  .ric-part__text { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .ric-part, .ric-part--no-cover { grid-template-columns: 1fr; }
}

/* Placeholder for artwork that hasn't been released yet.
   Swap it for the real <img> (or .glitch for a sample) on release day. */
.ric-locked {
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding: 10%;
  border: 1px dashed var(--line);
  background:
    repeating-linear-gradient(0deg, rgba(125, 255, 154, 0.035) 0 2px, transparent 2px 5px),
    var(--panel);
  font-size: 0.8rem;
  color: var(--dim);
  overflow: hidden;
}
.ric-locked__file { color: var(--text); }
.ric-locked__file::before { content: "> "; color: var(--green); }
.ric-locked__bar {
  position: relative;
  height: 10px;
  border: 1px solid var(--line);
}
.ric-locked__bar::after {
  content: "";
  position: absolute;
  inset: 1px auto 1px 1px;
  width: 0;
  background: var(--green);
  opacity: 0.7;
  animation: ric-decode 4.5s steps(18, end) infinite;
}
@keyframes ric-decode {
  0%   { width: 0; }
  70%  { width: 62%; }
  71%, 100% { width: 0; }
}
.ric-locked__status::after {
  content: "_";
  animation: ric-blink 1s steps(1, end) infinite;
}
.ric-locked--small { font-size: 0.7rem; gap: 8px; }

/* Note: .glitch must keep its white background. The effect rebuilds the
   image by multiply-blending its colour layers, which needs a white base. */

/* ---------- Live ---------- */
.ric-live {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 6vw, 80px);
}
.ric-log { list-style: none; padding: 0; margin: 0 0 2em; }
.ric-log li { padding: 0.5em 0; border-bottom: 1px dashed var(--line); }
.ric-log time { color: var(--green); margin-right: 1em; }
.ric-people { list-style: none; padding: 0; margin: 0; }
.ric-people li { padding: 0.25em 0; }
.ric-people li::before { content: "+ "; color: var(--pink); }
.ric-people span { color: var(--dim); }
@media (max-width: 860px) { .ric-live { grid-template-columns: 1fr; } }

/* ---------- Archive strip ---------- */
.ric-archive {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 32px;
}
.ric-archive img { width: 100%; aspect-ratio: 1; object-fit: cover; border: 1px solid var(--line); }
@media (max-width: 760px) { .ric-archive { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Closing ---------- */
.ric-end { text-align: center; }
.ric-end h2 { color: var(--text); }
.ric-end p { color: var(--dim); max-width: 34em; margin: 0 auto 2em; }

@media (prefers-reduced-motion: reduce) {
  .ric-hero__bg, .ric-title::before, .ric-title::after, .ric-cursor,
  .ric-locked__bar::after, .ric-locked__status::after { animation: none; }
  .ric-locked__bar::after { width: 62%; }
}
