/* Cotton Candy Parlor · for COSMIC — hub page styles */

:root {
  --display: "Fredoka", system-ui, sans-serif;
  --body:    "Lato", system-ui, sans-serif;
  --mono:    "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --brand-a: #ff3b6b;
  --brand-b: #5fd4c4;
  --brand-c: #5fb8ff;
  --brand-d: #ffd84d;
  --brand-hot: #ff3b6b;
  --brand-pop: #a96bff;
  --pink:    #ff5fa2;

  --paper:   #fffaf0;
  --cream:   #fff8e7;
  --bg-soft: #f7f0d8;
  --ink:     #1a1626;
  --ink-soft:#4a3f5e;

  --r-sm:  8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-pill: 999px;

  --stroke:      2.5px;
  --stroke-soft: 2px;

  --shadow-sm: 3px 3px 0 var(--ink);
  --shadow-md: 6px 6px 0 var(--ink);
  --shadow-lg: 8px 8px 0 var(--ink);
}

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

body {
  font-family: var(--body);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.55;
  overflow-x: hidden;
  padding-top: 56px;  /* leave room for fixed rail */
}

a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--brand-pop); }

code {
  font-family: var(--mono);
  background: var(--bg-soft);
  border: 1.5px solid var(--ink-soft);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 0.92em;
}

h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; line-height: 1.05; }

/* ───────── top rail ───────── */
.rail {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--ink);
  color: var(--cream);
  border-bottom: 2.5px solid var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}
.rail-in {
  max-width: 1320px; margin: 0 auto;
  padding: 16px 32px;
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 24px;
  white-space: nowrap;
}
.rail-c { text-align: center; opacity: 0.7; }
.rail-r { text-align: right; opacity: 0.7; }
.dot {
  display: inline-block;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--brand-hot);
  margin-right: 10px;
  vertical-align: middle;
  box-shadow: 0 0 0 4px rgba(255,59,107,0.22);
  animation: blink 1.8s ease-in-out infinite;
}
@keyframes blink { 0%,100% { opacity: 1 } 50% { opacity: 0.4 } }

/* ───────── shared stage ───────── */
.stage {
  max-width: 1320px;
  margin: 0 auto;
  padding: 80px 32px;
  position: relative;
}
.sec-h {
  font-family: var(--mono); font-weight: 600;
  font-size: 18px; letter-spacing: 0.28em;
  text-transform: uppercase;
  margin: 0 0 12px;
  color: var(--ink);
}
.sec-sub {
  font-size: 19px;
  max-width: 760px;
  margin: 0 0 48px;
  color: var(--ink-soft);
  text-wrap: pretty;
}
.sec-note {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  margin-top: 24px;
  color: var(--ink-soft);
}

/* ───────── hero ───────── */
.hero {
  padding: 96px 32px 88px;
  text-align: center;
  /* Contain the ambient glow blobs so they never extend the page's horizontal
     scroll. `overflow-x: clip` clips the bleed at the hero box WITHOUT creating a
     scroll container or touching layout — the radial-gradient halos stay visible
     inside the hero, and the page no longer scrolls sideways at any width
     (320 → 1920, NO horizontal scroll). The vertical axis is untouched. */
  overflow-x: clip;
}
.halo {
  position: absolute; pointer-events: none;
  border-radius: 50%;
  z-index: -1;
}
.hero .h-pink   { top: -120px; left: -100px; width: 540px; height: 540px;
  background: radial-gradient(circle, rgba(255,95,162,0.55), transparent 70%); }
.hero .h-mint   { top: -80px;  right: -120px; width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(95,212,196,0.45), transparent 70%); }
.hero .h-butter { bottom: -150px; left: 18%; width: 540px; height: 540px;
  background: radial-gradient(circle, rgba(255,216,77,0.50), transparent 70%); }
.hero .h-grape  { bottom: -120px; right: 8%; width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(169,107,255,0.35), transparent 70%); }

.hero-eyebrow {
  font-family: var(--mono); font-weight: 500;
  font-size: 14px; letter-spacing: 0.30em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 32px;
}
.hero-wordmark {
  font-size: 128px; font-weight: 700;
  margin: 0 0 24px;
  line-height: 0.95;
}
.hero-wordmark .candy   { color: var(--brand-hot); }
.hero-wordmark .factory { color: var(--brand-pop); }
.hero-wordmark .space   { display: inline-block; width: 8px; }
.hero-wordmark .sticker-em {
  display: inline-block;
  font-style: normal;
  font-family: var(--display);
  font-weight: 600;
  font-size: 38px;
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  box-shadow: 6px 6px 0 var(--ink);
  padding: 6px 18px 8px;
  transform: rotate(-3deg) translateY(-32px);
  margin-left: 14px;
  color: var(--ink);
}
.hero-lead {
  font-size: 22px;
  max-width: 720px;
  margin: 0 auto 32px;
  color: var(--ink);
  text-wrap: balance;
}
.hero-lead code {
  font-size: 0.85em;
}
.hero-chips {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 12px;
  margin-bottom: 40px;
}
.chip {
  font-family: var(--mono); font-weight: 500;
  font-size: 12px; letter-spacing: 0.20em;
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 8px 16px;
  box-shadow: 3px 3px 0 var(--ink);
  transform: rotate(-1deg);
}
.chip.pink  { background: #ffe2ee; transform: rotate(1.5deg); box-shadow: 3px 3px 0 var(--ink); }
.chip.grape { background: #e6d6ff; transform: rotate(-2deg);  box-shadow: 3px 3px 0 var(--ink); }
.chip.ink   { background: var(--ink); color: var(--cream); transform: rotate(0.5deg); box-shadow: 3px 3px 0 var(--brand-hot); }

.cta {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--display); font-weight: 700;
  font-size: 22px;
  background: var(--brand-hot);
  color: var(--cream);
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  padding: 16px 32px;
  text-decoration: none;
  box-shadow: 8px 8px 0 var(--ink);
  transition: transform .12s, box-shadow .12s;
}
.cta:hover {
  color: var(--cream);
  transform: translate(-2px, -2px);
  box-shadow: 10px 10px 0 var(--ink);
}
.cta:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}
.cta-arrow { font-size: 28px; }

/* ───────── anatomy grid ───────── */
.anatomy { padding-bottom: 64px; }
.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.mode-col {
  border: 2.5px solid var(--ink);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 8px 8px 0 var(--ink);
}
/* dark-bodied cards get candy-accent shadows so they actually pop on cream */
.mode-col:has(.mode-head.bonfire) {
  box-shadow: 8px 8px 0 var(--pink);
}

.mode-head {
  font-family: var(--display); font-weight: 700;
  font-size: 22px;
  padding: 18px 24px;
  border-bottom: 2.5px solid var(--ink);
}
.mode-head em { font-style: normal; font-family: var(--mono); font-weight: 500; font-size: 12px; letter-spacing: 0.24em; text-transform: uppercase; margin-left: 8px; opacity: 0.7; }
.mode-head.bonfire { background: var(--ink); color: var(--cream); }
.mode-head.parlor  { background: var(--cream); color: var(--ink); }

.mode-body { padding: 18px 24px 24px; }
.bonfire-body { background: #14101e; color: var(--cream); }
.parlor-body  { background: var(--paper); color: var(--ink); }

.map-row {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 0;
  border-bottom: 1.5px dashed rgba(255,255,255,0.12);
}
.parlor-body .map-row { border-bottom: 1.5px dashed rgba(26,22,38,0.14); }
.map-row:last-child { border-bottom: 0; }
.map-row.hi { padding: 14px 12px; margin: 4px -12px; border-radius: 10px; }
.bonfire-body .map-row.hi { background: rgba(255,95,162,0.10); border-bottom-color: transparent; }
.parlor-body  .map-row.hi { background: rgba(126,56,222,0.10); border-bottom-color: transparent; }

.sw {
  width: 40px; height: 40px;
  border-radius: 10px;
  border: 2px solid rgba(255,255,255,0.3);
  flex: 0 0 auto;
}
.parlor-body .sw { border-color: var(--ink); }
.bonfire-body .sw { border-color: rgba(255,248,231,0.35); }

.map-text { display: flex; flex-direction: column; gap: 2px; }
.map-text b {
  font-family: var(--mono); font-weight: 600;
  font-size: 13.5px; letter-spacing: 0.12em;
}
.map-text span {
  font-family: var(--mono); font-weight: 400;
  font-size: 11.5px; letter-spacing: 0.10em;
  opacity: 0.7;
}

/* ───────── COSMIC mock ───────── */
.preview { padding-bottom: 64px; }
.cosmic-frame {
  background: var(--ink);
  border: 2.5px solid var(--ink);
  border-radius: 18px;
  box-shadow: 12px 12px 0 var(--brand-pop);
  overflow: hidden;
}
.cosmic-titlebar {
  background: #221c30;
  padding: 14px 18px;
  display: flex; align-items: center; gap: 14px;
  border-bottom: 1.5px solid #0e0a16;
}
.cosmic-titlebar .tl { display: flex; gap: 8px; }
.cosmic-titlebar .tl i {
  width: 12px; height: 12px; border-radius: 50%;
  background: #ff3b6b; display: block;
}
.cosmic-titlebar .tl i:nth-child(2){ background: #ffd84d; }
.cosmic-titlebar .tl i:nth-child(3){ background: #5fd4c4; }
.tl-title {
  font-family: var(--mono); font-size: 13px;
  color: rgba(255,248,231,0.7);
  letter-spacing: 0.08em;
}

.cosmic-body {
  display: grid;
  grid-template-columns: 240px 1fr;
  background: #14101e;
  color: var(--cream);
  min-height: 540px;
}
.cosmic-side {
  background: #1a1626;
  padding: 20px 8px;
  border-right: 1.5px solid #0e0a16;
}
.cs-row, .cs-sub {
  font-family: var(--body);
  font-size: 14px;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: default;
}
.cs-row.active { background: rgba(255,95,162,0.18); color: var(--pink); font-weight: 700; }
.cs-sub { padding: 8px 28px; font-size: 13.5px; opacity: 0.75; }

.cosmic-main { padding: 32px 36px; }
.cm-title {
  font-family: var(--display); font-weight: 600;
  font-size: 28px; margin-bottom: 24px;
}

.cm-card {
  background: #1a1626;
  border: 1.5px solid #2c243d;
  border-radius: 12px;
  padding: 18px 22px;
  margin-bottom: 18px;
}
.cm-label {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: rgba(255,248,231,0.55);
  margin-bottom: 12px;
}

.cm-modes { display: flex; gap: 18px; }
.cm-mode {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1.5px solid #2c243d;
  cursor: default;
}
.cm-mode.active {
  border-color: var(--pink);
  background: rgba(255,95,162,0.10);
  box-shadow: 0 0 0 1px var(--pink) inset;
}
.mode-swatch {
  width: 96px; height: 60px;
  border-radius: 8px;
  display: flex; align-items: end;
  padding: 6px;
  position: relative;
  overflow: hidden;
  border: 1.5px solid #2c243d;
}
.mode-swatch .ms-bg {
  position: absolute; inset: 0;
}
.mode-swatch .ms-accent {
  position: relative;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  z-index: 1;
}
.mode-swatch.light .ms-accent { border-color: var(--ink); }
.mode-swatch.dark  .ms-accent { border-color: var(--cream); }
.ms-name {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.20em; text-transform: uppercase;
}

.cm-accents { display: flex; gap: 12px; align-items: center; }
.cm-accents.small { gap: 8px; }
.acc {
  width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid var(--ink);
  display: block;
  position: relative;
}
.acc.star { outline: 2.5px solid var(--pink); outline-offset: 3px; }
.cm-hint {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.16em;
  color: rgba(255,248,231,0.5);
  margin-top: 10px;
}

.cm-window {
  background: #221c30;
  border: 1.5px solid #2c243d;
  border-radius: 12px;
  outline: 2px solid var(--brand-pop);
  outline-offset: 0;
  margin-top: 24px;
  overflow: hidden;
}
.cmw-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: #1a1626;
  border-bottom: 1.5px solid #2c243d;
}
.cmw-bar i { width: 10px; height: 10px; border-radius: 50%; display: block; }
.cmw-bar span {
  font-family: var(--mono); font-size: 12px;
  letter-spacing: 0.10em;
  color: rgba(255,248,231,0.55);
  margin-left: 8px;
}
.cmw-body { padding: 20px 22px; display: flex; gap: 12px; align-items: center; }
.cmw-btn {
  font-family: var(--display); font-weight: 600;
  font-size: 14px;
  padding: 9px 18px;
  border-radius: 10px;
  border: 1.5px solid transparent;
}
.cmw-btn.primary { background: var(--pink); color: var(--ink); }
.cmw-btn.ghost { color: var(--cream); border-color: #4a3f5e; }
.cmw-bar2 { margin-left: auto; display: flex; gap: 8px; }
.cmw-pip { width: 14px; height: 14px; border-radius: 4px; }
.cmw-pip.ok   { background: var(--brand-b); }
.cmw-pip.warn { background: var(--brand-d); }
.cmw-pip.dest { background: var(--brand-hot); }
.cmw-pip.hint { background: var(--brand-pop); }

/* ───────── prompt + install terminals ───────── */
.prompt-card, .term {
  background: #0d0a16;
  color: rgba(255,248,231,0.92);
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  box-shadow: 8px 8px 0 var(--brand-c);  /* sky offset — brand's candied terminal lift */
  overflow: hidden;
}
.pc-bar, .term-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  background: #14101e;
  border-bottom: 1.5px solid #2c243d;
}
.pc-bar i, .term-bar i {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--brand-hot); display: block;
}
.pc-bar i:nth-child(2), .term-bar i:nth-child(2) { background: var(--brand-d); }
.pc-bar i:nth-child(3), .term-bar i:nth-child(3) { background: var(--brand-b); }
.pc-title, .term-bar span {
  font-family: var(--mono); font-size: 12.5px;
  color: rgba(255,248,231,0.6);
  letter-spacing: 0.12em;
  margin-left: 8px;
  flex: 1;
}
.pc-copy {
  font-family: var(--mono); font-weight: 600;
  font-size: 11px; letter-spacing: 0.20em; text-transform: uppercase;
  background: var(--brand-d);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
}
.pc-copy:hover { transform: translate(-1px,-1px); }

#prompt-text, .term pre {
  margin: 0;
  font-family: var(--mono);
  font-size: 14.5px;
  line-height: 1.7;
  padding: 24px 28px;
  white-space: pre;
  overflow-x: auto;
}

.t-prompt { color: var(--brand-d); font-weight: 600; }
.t-dim    { color: rgba(255,248,231,0.45); }
.t-ok     { color: var(--brand-b); }
.t-arrow  { color: var(--pink); font-weight: 600; }
.cur {
  display: inline-block; width: 10px; height: 18px;
  background: var(--brand-d); vertical-align: -3px;
  animation: blink 1.05s steps(2,end) infinite;
}

/* ───────── install next steps ───────── */
.install { padding-bottom: 64px; }
.next-steps {
  margin-top: 36px;
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: 18px;
  padding: 28px 32px 24px;
  box-shadow: 6px 6px 0 var(--ink);
}
.next-steps h3 {
  margin: 0 0 14px;
  font-size: 20px;
}
.next-steps ol {
  margin: 0; padding-left: 22px;
  font-size: 16px;
  line-height: 1.7;
}
.next-steps ol li { margin-bottom: 6px; }
.undo {
  margin-top: 12px;
  font-family: var(--mono); font-size: 12.5px;
  color: var(--ink-soft);
  letter-spacing: 0.10em;
}

/* ───────── files tree ───────── */
.tree-card {
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: 18px;
  box-shadow: 8px 8px 0 var(--ink);
  padding: 0;
  overflow: hidden;
}
.tree {
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.75;
  margin: 0;
  padding: 28px 32px;
  white-space: pre;
  overflow-x: auto;
  color: var(--ink);
}
.tree a { color: var(--ink); text-decoration: none; border-bottom: 1.5px solid var(--ink); }
.tree a:hover { color: var(--brand-pop); border-bottom-color: var(--brand-pop); }
.t-note { color: var(--ink-soft); font-style: italic; }

/* ───────── ticker + footer ───────── */
.ticker-row {
  background: var(--ink);
  color: var(--cream);
  overflow: hidden;
  padding: 18px 0;
  margin-top: 32px;
  border-top: 2.5px solid var(--ink);
}
.ticker {
  font-family: var(--mono); font-weight: 500;
  font-size: 13px; letter-spacing: 0.30em;
  text-transform: uppercase;
  white-space: nowrap;
  animation: scroll 60s linear infinite;
}
@keyframes scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

footer {
  background: var(--ink);
  color: rgba(255,248,231,0.55);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  padding: 18px 32px;
  display: flex; justify-content: space-between;
  border-top: 1.5px solid rgba(255,248,231,0.10);
}

/* ───────── small screens ───────── */
@media (max-width: 1100px) {
  .mode-grid { grid-template-columns: 1fr; }
  .cosmic-body { grid-template-columns: 1fr; }
  .cosmic-side { display: none; }
  .hero-wordmark { font-size: 84px; }
  .hero-wordmark .sticker-em { font-size: 26px; transform: rotate(-3deg) translateY(-22px); }
}

@media (max-width: 640px) {
  .stage { padding: 56px 20px; }
  .hero { padding: 64px 20px 56px; }
  .rail-in { grid-template-columns: 1fr; gap: 6px; padding: 12px 20px; }
  .rail-c, .rail-r { text-align: left; }
  .hero-wordmark { font-size: 56px; }
  .hero-wordmark .sticker-em { font-size: 20px; padding: 4px 12px 6px; box-shadow: 4px 4px 0 var(--ink); transform: rotate(-3deg) translateY(-14px); }
  .hero-lead { font-size: 18px; }
  .cta { font-size: 18px; padding: 14px 24px; }
  .sec-h { font-size: 16px; }
  .sec-sub { font-size: 17px; margin-bottom: 32px; }
  .next-steps { padding: 20px 22px; }
  .next-steps ol { padding-left: 18px; font-size: 15px; }
  footer { padding: 14px 20px; flex-direction: column; gap: 4px; }
}

/* Respect motion-reduction preferences */
@media (prefers-reduced-motion: reduce) {
  .dot, .cur, .ticker { animation: none; }
  .cta, .wp-card, .wp-dl { transition: none; }
}
