/* sim-ai.org — glitch + split-screen */
:root {
  --burgundy: #5c1a2a;
  --burgundy-deep: #2a1a1e;
  --cream: #f0e4d4;
  --warm-grey: #d8d0c8;
  --hot-pink: #e83a7d;
  --signal-red: #c82a2a;
  --cyan: #3ae8d8;
  --headline: "Bebas Neue", "Inter", system-ui, sans-serif;
  --body-font: "Libre Baskerville", Georgia, serif;
  --mono: "Space Mono", ui-monospace, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--burgundy-deep);
  color: var(--cream);
  font-family: var(--body-font);
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.65;
  overflow-x: hidden;
}

/* === Hero split === */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  overflow: hidden;
}

.hero-half {
  position: relative;
  padding: 6rem 5vw;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  overflow: hidden;
}

.hero-half--left {
  background: var(--burgundy);
  color: var(--cream);
  animation: slide-in-left 0.8s cubic-bezier(.2,.8,.2,1) 0.4s both;
}

.hero-half--right {
  background: var(--cream);
  color: var(--burgundy);
  animation: slide-in-right 0.8s cubic-bezier(.2,.8,.2,1) 0.4s both;
}

.half-inner {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 540px;
}

.half-meta {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  margin-bottom: 1.6rem;
  color: inherit;
  opacity: 0.75;
}

.hero-glyph {
  font-family: var(--headline);
  font-weight: 400;
  font-size: clamp(80px, 18vw, 220px);
  letter-spacing: 0.06em;
  line-height: 0.92;
  position: relative;
  display: inline-block;
}

.hero-glyph--burgundy {
  color: var(--cream);
}

.hero-glyph--cream {
  color: var(--burgundy);
}

.hero-glyph::before,
.hero-glyph::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero-glyph--burgundy::before {
  color: var(--hot-pink);
  transform: translate(-3px, 0);
  clip-path: inset(0 0 50% 0);
  mix-blend-mode: screen;
  animation: glitch-clip-a 4s steps(1, end) infinite;
}

.hero-glyph--burgundy::after {
  color: var(--cyan);
  transform: translate(3px, 0);
  clip-path: inset(50% 0 0 0);
  mix-blend-mode: screen;
  animation: glitch-clip-b 4s steps(1, end) infinite;
}

.hero-glyph--cream::before {
  color: var(--hot-pink);
  transform: translate(-2px, 0);
  clip-path: inset(0 0 50% 0);
  mix-blend-mode: multiply;
  animation: glitch-clip-a 4s steps(1, end) infinite;
}

.hero-glyph--cream::after {
  color: var(--signal-red);
  transform: translate(2px, 0);
  clip-path: inset(50% 0 0 0);
  mix-blend-mode: multiply;
  animation: glitch-clip-b 4s steps(1, end) infinite;
}

.hero-line {
  margin-top: 1.6rem;
  font-style: italic;
  font-size: clamp(15px, 1.6vw, 19px);
  line-height: 1.5;
  color: inherit;
  opacity: 0.92;
  font-family: var(--body-font);
}

.hero-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: rgba(255,255,255,0.4);
  z-index: 4;
  pointer-events: none;
  transform-origin: top;
  animation: divider-tick 5s steps(1, end) infinite;
}

.hero-bar {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  height: 38px;
  background: var(--burgundy-deep);
  color: var(--hot-pink);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  display: flex;
  align-items: center;
  overflow: hidden;
  z-index: 3;
  border-top: 1px solid rgba(58, 232, 216, 0.35);
  border-bottom: 1px solid rgba(58, 232, 216, 0.35);
}

.hero-bar-text {
  display: inline-block;
  white-space: nowrap;
  padding-left: 100%;
  animation: bar-scroll 26s linear infinite;
}

.scanline-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,0.06) 0,
    rgba(0,0,0,0.06) 2px,
    transparent 2px,
    transparent 4px
  );
  mix-blend-mode: multiply;
  opacity: 0.45;
}

/* === Split sections === */
.splits {
  position: relative;
  z-index: 2;
}

.split {
  position: relative;
}

.split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

.split-cell {
  padding: 6rem 5vw;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  position: relative;
  overflow: hidden;
}

.split-cell--left {
  background: var(--cream);
  color: var(--burgundy-deep);
}

.split-cell--right {
  background: var(--burgundy);
  color: var(--cream);
}

.split-cell--theory-right,
.split-cell--manifesto-right {
  background: var(--burgundy);
}

.split-cell--types-right {
  background: var(--burgundy-deep);
}

.cell-tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--hot-pink);
  font-weight: 700;
}

.split-cell--left .cell-tag {
  color: var(--signal-red);
}

.cell-title {
  font-family: var(--headline);
  font-weight: 400;
  font-size: clamp(44px, 7vw, 88px);
  letter-spacing: 0.04em;
  line-height: 0.95;
  margin-bottom: 0.6rem;
}

.cell-title--glitch {
  position: relative;
  color: var(--cream);
}

.cell-title--glitch::before,
.cell-title--glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  white-space: pre-line;
}

.cell-title--glitch::before {
  color: var(--hot-pink);
  transform: translate(-3px, 1px);
  mix-blend-mode: screen;
  clip-path: inset(0 0 60% 0);
  animation: glitch-clip-a 3s steps(1, end) infinite;
}

.cell-title--glitch::after {
  color: var(--cyan);
  transform: translate(3px, -1px);
  mix-blend-mode: screen;
  clip-path: inset(60% 0 0 0);
  animation: glitch-clip-b 3s steps(1, end) infinite;
}

/* Theory body */
.theory-body p {
  margin-bottom: 1rem;
  max-width: 50ch;
}

.theory-body em {
  color: var(--signal-red);
  font-style: italic;
  font-weight: 700;
}

/* Practice body — glitch lines */
.practice-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.glitch-line {
  position: relative;
  font-family: var(--body-font);
  font-style: italic;
  font-size: clamp(17px, 1.9vw, 22px);
  letter-spacing: 0.01em;
  color: var(--cream);
  display: inline-block;
}

.glitch-line::before,
.glitch-line::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.glitch-line::before {
  color: var(--hot-pink);
  transform: translate(-2px, 0);
  clip-path: inset(0 0 65% 0);
  mix-blend-mode: screen;
  opacity: 0.6;
}

.glitch-line::after {
  color: var(--cyan);
  transform: translate(2px, 0);
  clip-path: inset(65% 0 0 0);
  mix-blend-mode: screen;
  opacity: 0.55;
}

.glitch-line--bright {
  color: var(--cream);
  font-weight: 700;
  font-size: clamp(22px, 2.4vw, 28px);
  letter-spacing: 0.02em;
}

.glitch-line--bright::before { opacity: 0.85; transform: translate(-3px, 0); }
.glitch-line--bright::after { opacity: 0.85; transform: translate(3px, 0); }

/* Failure list */
.failure-list {
  list-style: none;
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.failure-row {
  display: grid;
  grid-template-columns: 90px 1fr 200px;
  gap: 1rem;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px dashed rgba(92, 26, 42, 0.25);
}

.failure-num {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--signal-red);
}

.failure-name {
  font-family: var(--body-font);
  font-size: 15px;
  font-weight: 700;
  color: var(--burgundy-deep);
}

.failure-bar {
  position: relative;
  height: 8px;
  background: rgba(92, 26, 42, 0.18);
  overflow: hidden;
}

.failure-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--w);
  background: linear-gradient(90deg, var(--signal-red), var(--hot-pink));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1s cubic-bezier(.2,.8,.2,1);
}

.failure-row.is-active .failure-fill {
  transform: scaleX(1);
}

/* Datablock grid */
.datablock-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1fr;
  gap: 0.8rem;
  margin-top: 1.2rem;
  flex: 1;
  min-height: 280px;
}

.datablock {
  position: relative;
  border: 1px solid rgba(58, 232, 216, 0.4);
  background: rgba(58, 232, 216, 0.05);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0.8rem;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.datablock:hover {
  border-color: var(--hot-pink);
}

.datablock-num {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: 0.16em;
  position: relative;
  z-index: 2;
}

.datablock-glitch {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, rgba(232,58,125,0.12) 0, rgba(232,58,125,0.12) 2px, transparent 2px, transparent 4px),
    repeating-linear-gradient(90deg, rgba(58,232,216,0.08) 0, rgba(58,232,216,0.08) 2px, transparent 2px, transparent 4px);
  z-index: 1;
}

.datablock--a .datablock-glitch { animation: db-shift-a 5s steps(8, end) infinite; }
.datablock--b .datablock-glitch { animation: db-shift-b 6s steps(10, end) infinite; }
.datablock--c .datablock-glitch { animation: db-shift-a 4s steps(6, end) infinite reverse; }
.datablock--d .datablock-glitch { animation: db-shift-b 7s steps(12, end) infinite; }
.datablock--e .datablock-glitch { animation: db-shift-a 3.6s steps(5, end) infinite; }
.datablock--f .datablock-glitch { animation: db-shift-b 5.5s steps(9, end) infinite reverse; }

/* Quote band */
.split--quote {
  background: var(--burgundy-deep);
  padding: 5rem 5vw;
  border-top: 1px solid rgba(232, 58, 125, 0.3);
  border-bottom: 1px solid rgba(232, 58, 125, 0.3);
}

.quote-band {
  max-width: 880px;
  margin: 0 auto;
  text-align: center;
}

.quote-text {
  font-family: var(--body-font);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(22px, 3.2vw, 38px);
  line-height: 1.35;
  color: var(--cream);
  position: relative;
}

.quote-mark {
  display: block;
  font-family: var(--headline);
  font-size: 4em;
  color: var(--hot-pink);
  line-height: 0.6;
  margin-bottom: 0.2em;
  text-shadow: 0 0 22px rgba(232, 58, 125, 0.4);
}

.quote-text em {
  color: var(--cyan);
  font-style: italic;
  font-weight: 700;
}

.quote-byline {
  margin-top: 1.6rem;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--hot-pink);
}

/* Manifesto */
.manifesto-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.manifesto-list li {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid rgba(92, 26, 42, 0.18);
}

.m-num {
  font-family: var(--headline);
  font-size: clamp(20px, 2.4vw, 28px);
  color: var(--hot-pink);
  letter-spacing: 0.04em;
  min-width: 2.4em;
}

.m-text {
  font-family: var(--body-font);
  font-size: 16px;
  color: var(--burgundy-deep);
  line-height: 1.55;
}

/* Echo channel */
.echo-stack {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 1.4rem;
}

.echo-line {
  font-family: var(--headline);
  font-size: clamp(28px, 3.8vw, 44px);
  letter-spacing: 0.06em;
  color: rgba(240, 228, 212, 0.62);
  transform: translateX(calc(var(--shift, 0) * 1px));
}

.echo-line[data-shift="2"] { color: rgba(240, 228, 212, 0.78); --shift: 2; }
.echo-line[data-shift="4"] { color: rgba(240, 228, 212, 0.94); --shift: 4; }
.echo-line[data-shift="6"] { --shift: 6; }
.echo-line[data-shift="-3"] { --shift: -3; }

.echo-line--cyan {
  color: var(--cyan);
  text-shadow: 0 0 12px rgba(58, 232, 216, 0.45);
}

.echo-line--pink {
  color: var(--hot-pink);
  text-shadow: 0 0 12px rgba(232, 58, 125, 0.45);
}

.waveform {
  margin-top: 1.6rem;
  height: 60px;
}

.waveform svg {
  width: 100%;
  height: 100%;
}

/* Terminal */
.split--terminal {
  background: var(--burgundy-deep);
  padding: 4rem 5vw 5rem;
}

.terminal-band {
  max-width: 980px;
  margin: 0 auto;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(58, 232, 216, 0.45);
  box-shadow: 0 24px 60px rgba(0,0,0,0.45),
    0 0 32px rgba(58, 232, 216, 0.18);
  font-family: var(--mono);
  color: var(--cyan);
  overflow: hidden;
}

.terminal-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  background: rgba(58, 232, 216, 0.06);
  border-bottom: 1px solid rgba(58, 232, 216, 0.25);
}

.terminal-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.terminal-dot--a { background: var(--signal-red); }
.terminal-dot--b { background: var(--hot-pink); }
.terminal-dot--c { background: var(--cyan); }

.terminal-name {
  margin-left: 0.6rem;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cream);
}

.terminal-body {
  padding: 1.2rem 1.4rem;
  font-size: 13px;
  line-height: 1.7;
  color: var(--cyan);
  white-space: pre;
  overflow-x: auto;
}

/* Closing */
.split--closing {
  background: var(--cream);
  color: var(--burgundy-deep);
  padding: 5rem 5vw;
}

.closing-band {
  max-width: 880px;
  margin: 0 auto;
  text-align: center;
}

.closing-title {
  font-family: var(--headline);
  font-weight: 400;
  font-size: clamp(48px, 8vw, 96px);
  letter-spacing: 0.06em;
  color: var(--burgundy-deep);
  position: relative;
  display: inline-block;
}

.closing-title::before,
.closing-title::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.closing-title::before {
  color: var(--hot-pink);
  transform: translate(-2px, 0);
  clip-path: inset(0 0 55% 0);
  mix-blend-mode: multiply;
  opacity: 0.7;
}

.closing-title::after {
  color: var(--signal-red);
  transform: translate(2px, 0);
  clip-path: inset(55% 0 0 0);
  mix-blend-mode: multiply;
  opacity: 0.7;
}

.closing-text {
  margin: 1.6rem auto;
  max-width: 50ch;
  font-size: clamp(16px, 1.7vw, 19px);
}

.closing-stamp {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--burgundy);
  margin-top: 1rem;
}

.closing-key {
  color: var(--hot-pink);
  font-weight: 700;
}

/* Footer */
.signoff-bar {
  background: var(--burgundy-deep);
  color: var(--cream);
  padding: 2rem 5vw;
  border-top: 1px solid rgba(232, 58, 125, 0.3);
  position: relative;
  z-index: 2;
}

.signoff-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.4rem;
}

.signoff-mark {
  font-family: var(--headline);
  font-size: 28px;
  letter-spacing: 0.06em;
  color: var(--hot-pink);
}

.signoff-mark--cyan {
  color: var(--cyan);
}

.signoff-line {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  color: var(--cream);
  opacity: 0.85;
}

/* Animations */
@keyframes slide-in-left {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slide-in-right {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes glitch-clip-a {
  0%, 92%, 96%, 100% { clip-path: inset(0 0 60% 0); transform: translate(-3px, 0); }
  93% { clip-path: inset(0 0 70% 0); transform: translate(-7px, 1px); }
  95% { clip-path: inset(20% 0 50% 0); transform: translate(-1px, -1px); }
}

@keyframes glitch-clip-b {
  0%, 88%, 91%, 100% { clip-path: inset(60% 0 0 0); transform: translate(3px, 0); }
  89% { clip-path: inset(40% 0 20% 0); transform: translate(7px, -1px); }
  90% { clip-path: inset(70% 0 0 0); transform: translate(1px, 1px); }
}

@keyframes divider-tick {
  0%, 92%, 95%, 100% { transform: scaleX(1); opacity: 1; }
  93% { transform: scaleX(3); opacity: 0.7; }
  94% { transform: scaleX(1); opacity: 1; }
}

@keyframes bar-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

@keyframes db-shift-a {
  0%, 88%, 100% { background-position: 0 0, 0 0; }
  89% { background-position: 4px -3px, -2px 2px; }
  91% { background-position: -3px 1px, 3px -2px; }
  93% { background-position: 0 0, 0 0; }
}

@keyframes db-shift-b {
  0%, 84%, 100% { background-position: 0 0, 0 0; }
  85% { background-position: -2px 4px, 3px -3px; }
  87% { background-position: 5px -2px, -3px 4px; }
  89% { background-position: 0 0, 0 0; }
}

/* Reveal */
.split {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.95s ease, transform 0.95s ease;
}

.split.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 800px) {
  .hero {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
  }
  .hero-divider {
    top: 50%;
    bottom: auto;
    left: 0;
    right: 0;
    width: 100%;
    height: 1px;
    background: rgba(255,255,255,0.4);
  }
  .split-grid {
    grid-template-columns: 1fr;
  }
  .failure-row {
    grid-template-columns: 80px 1fr;
    gap: 0.6rem;
  }
  .failure-bar {
    grid-column: 1 / -1;
    width: 100%;
  }
  .signoff-inner {
    flex-direction: column;
    gap: 0.8rem;
    text-align: center;
  }
}
