/*
 * site.css — Shared base styles for Scrolli Labs public pages
 *
 * Used by both the live page (/p/...) and the admin preview iframe.
 * Theme-specific overrides (dia, miranda, claude) load after this.
 */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,300;0,400;0,500;1,300;1,400&display=swap');

:root {
  --canvas: #f8f8f8;
  --snow: #fff;
  --fog: #efefef;
  --pebble: #d9d9d9;
  --ash: #7c7c7c;
  --slate: #959595;
  --steel: #aeaeae;
  --graphite: #636363;
  --ink-black: #000;
  --rose-quartz: #c679c4;
  --marigold: #ffb005;
  --signal-blue: #0358f7;
  --hot-pink: #fd02f5;
  --spectrum-red: #fa3d1d;
  --spectrum-gradient: linear-gradient(90deg, #c679c4 0%, #fa3d1d 25%, #ffb005 50%, #e1e1fe 75%, #0358f7 100%);
  --bg: var(--canvas);
  --text: var(--ink-black);
  --muted: var(--graphite);
  --accent: var(--ink-black);
  --card: rgba(255,255,255,.9);
  --font-display: 'DM Sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'DM Sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --radius-card: 10px;
  --radius-image: 10px;
  --radius-button: 30px;
  --radius-pill: 9999px;
  --shadow-card: rgba(0,0,0,0.08) 0 0 8px 0;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

.progress {
  position: fixed; top: 0; left: 0; height: 2px;
  background: var(--spectrum-gradient);
  z-index: 999; transition: width .2s; border-radius: 0 2px 2px 0; width: 0;
}

/* ── Cinematic Intro (Hero) ── */
.cin-intro { position: relative; width: 100%; height: 100vh; overflow: hidden; background: var(--bg); z-index: 10; }
.cin-brand { position: absolute; left: 0; right: 0; text-align: center; font-family: 'DM Sans', sans-serif; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; opacity: 0; z-index: 5; top: 50%; transform: translateY(-50%); font-size: clamp(.85rem, 2vw, 1.25rem); color: var(--text); transition: top .9s cubic-bezier(.4,0,.2,1), transform .9s cubic-bezier(.4,0,.2,1), font-size .9s ease, color .9s ease, opacity .7s ease; }
.cin-brand.settled { top: 1.8rem; transform: translateY(0); font-size: .72rem; color: var(--muted); }
.cin-svg-wrap { position: absolute; top: 0; left: 0; width: 100%; height: 58%; z-index: 1; }
.cin-svg-wrap svg { width: 100%; height: 100%; display: block; }
.cin-text-layer { position: absolute; left: 0; right: 0; top: 58%; height: 32%; z-index: 2; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.cin-line { font-family: var(--font-display); color: var(--ink-black); opacity: 0; position: absolute; text-align: center; max-width: 72vw; line-height: 1.4; letter-spacing: -.02em; }
.cin-l1, .cin-l2 { font-size: clamp(1.3rem, 2.6vw, 1.75rem); font-weight: 300; color: var(--graphite); }
.cin-l3 { font-size: clamp(1.35rem, 2.8vw, 1.9rem); font-weight: 400; color: var(--ink-black); }
.cin-l4 { font-size: clamp(1.2rem, 2.4vw, 1.6rem); font-weight: 300; color: var(--graphite); }
.cin-l5 { font-size: clamp(1.3rem, 2.7vw, 1.85rem); font-weight: 400; color: var(--ink-black); }
.cin-l6 { font-size: clamp(1.45rem, 3.2vw, 2.2rem); font-weight: 500; color: var(--ink-black); letter-spacing: -.03em; }
.cin-title-layer { position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 0 2rem; opacity: 0; pointer-events: none; }
.cin-main-title { font-family: var(--font-display); font-size: clamp(2.6rem, 7vw, 4.5rem); font-weight: 300; color: var(--text); line-height: 1.11; letter-spacing: -.04em; margin-bottom: .8rem; }
.cin-main-title span { color: var(--accent); }
.cin-sub-title { font-family: var(--font-body); font-size: clamp(.9rem, 1.8vw, 1.15rem); color: var(--graphite); font-weight: 400; letter-spacing: -.01em; }
.cin-scroll-cue { position: absolute; bottom: 2rem; left: 0; right: 0; text-align: center; z-index: 6; color: var(--graphite); font-family: var(--font-body); font-size: .78rem; font-weight: 400; display: flex; flex-direction: column; align-items: center; gap: .5rem; opacity: 0; letter-spacing: .02em; }
.cin-scroll-cue .arr { width: 14px; height: 14px; border-right: 2px solid var(--ink-black); border-bottom: 2px solid var(--ink-black); transform: rotate(45deg); animation: bob 2s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: rotate(45deg) translateY(0); } 50% { transform: rotate(45deg) translateY(6px); } }

/* ── Editorial ── */
.editorial { max-width: 720px; margin: 0 auto; padding: 2.5rem 2rem 3rem; position: relative; z-index: 3; background: var(--canvas); }
.editorial h2 { font-family: var(--font-display); font-size: clamp(2rem, 4vw, 3.125rem); font-weight: 300; margin-bottom: 1.2rem; letter-spacing: -.04em; line-height: 1.18; color: var(--ink-black); }
.editorial p { font-family: var(--font-body); font-size: 1.0625rem; line-height: 1.55; color: var(--ink-black); margin-bottom: 1.25rem; font-weight: 400; }
.editorial .lead { font-size: 1.25rem; font-weight: 300; line-height: 1.4; letter-spacing: -.01em; color: var(--ink-black); }
.editorial .kicker { font-family: var(--font-body); font-size: .75rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--graphite); margin-bottom: .8rem; }
.pullquote { border-left: none; padding: 1.25rem 0 1.25rem 1.5rem; margin: 2.5rem 0; font-family: var(--font-display); font-size: clamp(1.25rem, 2.5vw, 1.625rem); font-weight: 300; font-style: normal; color: var(--ink-black); line-height: 1.3; letter-spacing: -.02em; position: relative; }
.pullquote::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--spectrum-gradient); border-radius: 2px; }
.pullquote cite { display: block; font-size: .85rem; font-weight: 500; font-style: normal; color: var(--graphite); margin-top: .75rem; font-family: var(--font-body); letter-spacing: .02em; }
.editorial figure { margin: 2.5rem 0; width: 100%; }
.editorial figure img { width: 100%; height: auto; border-radius: var(--radius-image); display: block; }
.editorial figcaption { font-family: var(--font-body); font-size: .78rem; color: var(--graphite); margin-top: .6rem; font-style: normal; font-weight: 400; }
.editorial .separator { width: 60px; height: 2px; background: var(--spectrum-gradient); margin: 3rem auto; border-radius: 2px; }

/* ── Scrollytelling ── */
/* NOTE: Scrolly/DataScrolly layout + step card styles live in render.js inline CSS.
   site.css only provides viz-panel rules for legacy D3 chart pages. */
.viz-panel { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.5rem 2rem 1rem 2rem; z-index: 1; pointer-events: none; background: var(--bg); transform: translateY(100vh); will-change: transform; }

/* ── Outro ── */
.outro { max-width: 720px; margin: 0 auto; padding: 3rem 2rem 6rem; font-family: var(--font-body); position: relative; z-index: 3; background: var(--canvas); }
.outro h2 { font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 300; margin-bottom: 1rem; letter-spacing: -.03em; line-height: 1.2; }
.outro p { font-family: var(--font-body); font-size: 1.0625rem; line-height: 1.55; color: var(--ink-black); margin-bottom: 1.2rem; font-weight: 400; }
.outro .final-line { font-family: var(--font-display); font-size: clamp(1.25rem, 2.5vw, 1.5rem); font-weight: 300; color: var(--ink-black); font-style: normal; margin-top: 2.5rem; line-height: 1.3; letter-spacing: -.02em; }
.outro .source-block { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--fog); font-family: var(--font-body); font-size: .78rem; color: var(--graphite); line-height: 1.65; }

/* ── Page background ── */
#page-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; transition: opacity .8s ease; }
#page-bg-img { width: 100%; height: 100%; object-fit: cover; }

/* ── Progress Nav ── */
.progress-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  height: 3px;
  background: transparent;
  pointer-events: none;
}
.progress-nav-bar {
  height: 100%;
  width: 0;
  background: var(--accent, #c06830);
  transition: width 0.1s linear;
}
.progress-nav-dots {
  position: fixed;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  z-index: 9998;
  pointer-events: auto;
}
.progress-nav-dot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
}
.progress-nav-dot::after {
  content: '';
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--fog, #d0ccc4);
  transition: background 0.2s, transform 0.2s;
  flex-shrink: 0;
}
.progress-nav-dot.is-active::after {
  background: var(--accent, #c06830);
  transform: scale(1.35);
}
.progress-nav-label {
  font-family: var(--font-body, sans-serif);
  font-size: 0.7rem;
  color: var(--graphite, #777);
  white-space: nowrap;
  opacity: 0;
  transform: translateX(4px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.progress-nav-dot:hover .progress-nav-label,
.progress-nav-dot.is-active .progress-nav-label {
  opacity: 1;
  transform: translateX(0);
}
@media (max-width: 640px) {
  .progress-nav-dots { display: none; }
}

/* ── Mobile ── */
@media (max-width: 900px) {
  .cin-main-title { font-size: clamp(1.8rem, 8vw, 2.8rem); }
  .cin-svg-wrap { height: 50%; }
  .cin-text-layer { top: 50%; height: 38%; }
  .cin-line { max-width: 90vw; }
  .editorial { padding: 2.5rem 1.25rem; }
  .editorial p { font-size: 1.02rem; line-height: 1.75; }
  .editorial h2 { font-size: 1.4rem; }
  .pullquote { font-size: 1.05rem; }
  .outro { padding: 3rem 1.25rem 5rem; }
}

/* Render error fallback */
.render-error { max-width: 680px; margin: 4rem auto; padding: 1.5rem 2rem; font-family: var(--font-body, 'DM Sans', system-ui, sans-serif); }
.render-error h1 { font-size: 1.5rem; font-weight: 400; margin-bottom: .75rem; }
.render-error p { color: var(--graphite, #636363); }
