/* G5: the page background is --ground, never #FFFFFF. */
:root {
  --ground: #f2f5f7;
  --ink: #171c20;
  --ink-mid: #5a656e;
  --cyan: #00b8d4;
  --cyan-core: #0091ae;
  /* randommonkey.io ink dots — highlights only, cyan stays the language */
  --dot-c: #64c3d9;
  --dot-m: #d6136b;
  --dot-y: #ffd400;
  --card-bg: rgba(242, 245, 247, 0.78);
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, Consolas, monospace;
}

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

html {
  background: var(--ground);
}

body {
  background: var(--ground);
  color: var(--ink);
  /* the machine wrote this — modern monotype, everywhere */
  font-family: var(--mono);
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--dot-m);
  color: #fff;
}

.canvas-wrap {
  position: fixed;
  inset: 0;
}

/* ---- copy layer (real DOM over the canvas, law 8) ---- */
.copy-root {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

/* persistent brand chrome */
.brand {
  position: absolute;
  top: 1.4rem;
  left: 1.6rem;
  pointer-events: auto;
  display: block;
  line-height: 0;
  opacity: 0.92;
  transition: opacity 0.2s;
}
.brand:hover {
  opacity: 1;
}
.brand img {
  height: 34px;
  width: auto;
}

/* ---- scrolly cards: rise in, hold while the beat plays, hand off ---- */
.card {
  position: absolute;
  left: clamp(1.2rem, 6vw, 6rem);
  bottom: 12vh;
  max-width: 27rem;
  width: min(88vw, 27rem);
  padding: 1.35rem 1.5rem 1.45rem;
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(23, 28, 32, 0.08);
  border-left: 3px solid var(--accent, var(--cyan));
  border-radius: 6px;
  box-shadow:
    0 1px 2px rgba(23, 28, 32, 0.05),
    0 12px 40px -18px rgba(23, 28, 32, 0.25),
    0 0 26px -8px var(--accent-glow, transparent);
  will-change: opacity, transform;
}
.accent-c {
  --accent: var(--dot-c);
  --accent-glow: rgba(100, 195, 217, 0.45);
}
.accent-m {
  --accent: var(--dot-m);
  --accent-glow: rgba(214, 19, 107, 0.32);
}
.accent-y {
  --accent: var(--dot-y);
  --accent-glow: rgba(255, 212, 0, 0.4);
}

.card h1 {
  font-size: clamp(1.7rem, 4vw, 2.7rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.card h2 {
  font-size: clamp(1.05rem, 1.9vw, 1.35rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.card h2::before,
.card .statement::before {
  content: '» ';
  color: var(--accent, var(--cyan));
}
.card .statement {
  margin-top: 0.55rem;
  font-weight: 700;
  font-size: clamp(0.98rem, 1.6vw, 1.15rem);
}
.card .body {
  margin-top: 0.75rem;
  font-size: clamp(0.82rem, 1.25vw, 0.93rem);
  line-height: 1.65;
  color: var(--ink-mid);
}
.card .kicker {
  margin-top: 0.8rem;
  font-weight: 700;
  font-size: clamp(0.88rem, 1.35vw, 1rem);
  color: var(--ink);
}
.card .kicker::after {
  content: ' _';
  color: var(--accent, var(--cyan));
  animation: caret 1.1s steps(1) infinite;
}
@keyframes caret {
  50% {
    opacity: 0;
  }
}

.card-opening {
  bottom: auto;
  top: 16vh;
  max-width: 30rem;
  width: min(88vw, 30rem);
}

/* ---- the doors (SKY): three ways in ---- */
.card-doors {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.6rem;
  will-change: opacity, transform;
}
.three-ways {
  font-size: clamp(1.05rem, 1.8vw, 1.4rem);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.products {
  display: flex;
  gap: clamp(1.2rem, 4vw, 3.2rem);
  flex-wrap: wrap;
  justify-content: center;
  padding: 0 1rem;
}
.product {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--ink);
  max-width: 16rem;
  text-align: center;
  padding: 1.2rem 1.4rem 1.3rem;
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(23, 28, 32, 0.08);
  border-radius: 6px;
  transition: box-shadow 0.25s, transform 0.25s;
}
.product .mark {
  font-size: 1.5rem;
  line-height: 1;
  color: var(--accent);
  text-shadow: 0 0 14px var(--accent-glow);
}
.product .name {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}
.product .line {
  font-size: 0.78rem;
  color: var(--ink-mid);
  line-height: 1.55;
}
.product:hover {
  transform: translateY(-3px);
  box-shadow:
    0 14px 40px -16px rgba(23, 28, 32, 0.3),
    0 0 34px -6px var(--accent-glow);
}
.product:hover .name {
  color: var(--accent);
}
.product.accent-y:hover .name {
  color: #c7a600; /* readable yellow on light ground */
}

/* ---- fallback (reduced motion / no WebGL) ---- */
.fallback {
  max-width: 44rem;
  margin: 0 auto;
  padding: 4rem 1.5rem 6rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}
.fallback header h1 {
  font-size: 2.4rem;
  letter-spacing: -0.03em;
}
.fallback header p {
  color: var(--ink-mid);
  margin-top: 0.5rem;
}
.fallback img {
  width: 100%;
  height: auto;
  border-radius: 4px;
}
.fallback section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  font-size: 1rem;
  line-height: 1.65;
}
.fallback .products {
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  padding: 0;
}
.fallback .products a {
  color: var(--ink);
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
}
.fallback .products a span {
  color: var(--cyan);
}

/* ---- dev panel (?dev only) ---- */
.dev-panel {
  position: fixed;
  right: 10px;
  top: 10px;
  z-index: 10;
  background: rgba(23, 28, 32, 0.85);
  color: #fff;
  font: 12px/1.6 var(--mono);
  padding: 10px 12px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dev-panel label {
  display: flex;
  align-items: center;
  gap: 6px;
}
.dev-panel input[type='range'] {
  width: 140px;
}
