/* ============================================================
   3 BLOCK STUDIO — Capabilities Deck
   Dark base · electric orange-red accent · poster typography
   ============================================================ */

:root {
  --bg:        #0B0A09;
  --bg-2:      #141210;
  --fg:        #F3EEE4;
  --muted:     #8C857A;
  --muted-2:   #57524A;
  --accent:    #E64B2C;
  --line:      rgba(243, 238, 228, 0.14);

  --font-display: 'Archivo', sans-serif;
  --font-body:    'Space Grotesk', sans-serif;

  --display-weight: 800;
  --display-tracking: -0.03em;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --fade: 640ms;

  --pad: clamp(20px, 4.5vw, 80px);
}

/* ---------- Light theme ---------- */
[data-theme="light"] {
  --bg:        #F3EEE4;
  --bg-2:      #E7DFD0;
  --fg:        #16130F;
  --muted:     #6B6357;
  --muted-2:   #A79D8C;
  --line:      rgba(22, 19, 15, 0.16);
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
  overscroll-behavior: none;
}

#root { height: 100%; }

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

/* ---------- Stage ---------- */
.stage {
  position: fixed;
  inset: 0;
  height: 100dvh;
  width: 100vw;
  background: var(--bg);
  color: var(--fg);
  overflow: hidden;
}

/* Cinematic crop marks framing the whole screen */
.cropmarks { position: fixed; inset: 0; pointer-events: none; z-index: 60; }
.cropmarks span {
  position: absolute;
  width: 26px; height: 26px;
  border: 0 solid var(--muted-2);
  opacity: 0.8;
}
.cropmarks .tl { top: 22px; left: 22px; border-top-width: 1.5px; border-left-width: 1.5px; }
.cropmarks .tr { top: 22px; right: 22px; border-top-width: 1.5px; border-right-width: 1.5px; }
.cropmarks .bl { bottom: 22px; left: 22px; border-bottom-width: 1.5px; border-left-width: 1.5px; }
.cropmarks .br { bottom: 22px; right: 22px; border-bottom-width: 1.5px; border-right-width: 1.5px; }
@media (max-width: 640px) {
  .cropmarks span { width: 16px; height: 16px; }
  .cropmarks .tl, .cropmarks .tr { top: 14px; }
  .cropmarks .bl, .cropmarks .br { bottom: 14px; }
  .cropmarks .tl, .cropmarks .bl { left: 14px; }
  .cropmarks .tr, .cropmarks .br { right: 14px; }
}

/* ---------- Sections (cross-fade) ---------- */
.section {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(18px, 3vh, 40px);
  padding: clamp(54px, 7vh, 96px) var(--pad) clamp(72px, 9vh, 120px);
  opacity: 0;
  visibility: hidden;
  transform: scale(1.014);
  transition: opacity var(--fade) var(--ease),
              transform var(--fade) var(--ease),
              visibility 0s linear var(--fade);
  pointer-events: none;
  z-index: 1;
}
@media (min-width: 821px) {
  .section { padding-left: clamp(96px, 8vw, 150px); padding-right: clamp(80px, 6vw, 120px); }
}
.section.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity var(--fade) var(--ease),
              transform var(--fade) var(--ease),
              visibility 0s;
  pointer-events: auto;
  z-index: 2;
}

/* ---------- Shared bits ---------- */
.eyebrow {
  font-family: var(--font-body);
  font-size: clamp(11px, 1.05vw, 14px);
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
}
.eyebrow .dot { width: 8px; height: 8px; background: var(--accent); border-radius: 50%; flex: none; }
.eyebrow .num { color: var(--accent); }

.display {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
  line-height: 0.9;
  text-wrap: balance;
}

.accent { color: var(--accent); }
.outline {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--fg);
}

.spacer { flex: 1 1 auto; }

/* Entrance: resting state is VISIBLE; animate FROM hidden as a flourish.
   fill-mode none means outside the active window the visible base applies,
   so print / reduced-motion / non-animating contexts always show content. */
.section .rise { opacity: 1; transform: none; }
@media (prefers-reduced-motion: no-preference) {
  .section.is-active .rise {
    animation: rise 720ms var(--ease) both;
    animation-delay: var(--d, 80ms);
  }
  @keyframes rise {
    from { opacity: 0; transform: translateY(26px); }
    to   { opacity: 1; transform: none; }
  }
}
@media print {
  .section .rise { opacity: 1 !important; transform: none !important; animation: none !important; }
  .section { position: relative !important; opacity: 1 !important; visibility: visible !important; page-break-after: always; }
}

/* ---------- Navigation chrome ---------- */
.nav {
  position: fixed;
  z-index: 70;
  right: clamp(20px, 3vw, 46px);
  bottom: clamp(20px, 3vw, 40px);
  display: flex;
  align-items: center;
  gap: 12px;
}
.navbtn {
  -webkit-appearance: none; appearance: none;
  border: 1.5px solid var(--line);
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  backdrop-filter: blur(8px);
  color: var(--fg);
  width: 52px; height: 52px;
  border-radius: 50%;
  display: grid; place-items: center;
  cursor: pointer;
  transition: border-color 220ms, background 220ms, transform 220ms, opacity 220ms;
}
.navbtn:hover { border-color: var(--fg); transform: translateY(-2px); }
.navbtn.primary { background: var(--accent); border-color: var(--accent); width: 60px; height: 60px; }
.navbtn.primary:hover { background: #ff5638; transform: translateY(-2px) scale(1.03); }
.navbtn.primary svg { stroke: #fff; }
.navbtn:disabled { opacity: 0.32; pointer-events: none; }
.navbtn svg { width: 22px; height: 22px; stroke: var(--fg); stroke-width: 2.2; fill: none; }

/* Section index — left rail (desktop) */
.rail {
  position: fixed;
  left: clamp(20px, 3vw, 46px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 70;
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.rail button {
  -webkit-appearance: none; appearance: none;
  background: none; border: none; cursor: pointer;
  display: flex; align-items: center; gap: 11px;
  color: var(--muted-2);
  font-family: var(--font-body);
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  transition: color 220ms;
  padding: 2px 0;
}
.rail .tick { width: 18px; height: 2px; background: currentColor; transition: width 260ms var(--ease), background 220ms; flex: none; }
.rail .rnum { width: 2ch; flex: none; }
.rail .rword {
  opacity: 0; transform: translateX(-6px);
  transition: opacity 200ms, transform 200ms;
  white-space: nowrap; text-transform: uppercase;
  pointer-events: none;
}
.rail button:hover { color: var(--muted); }
.rail button:hover .rword { opacity: 1; transform: none; }
.rail button.on { color: var(--fg); }
.rail button.on .tick { width: 34px; background: var(--accent); }

/* Top wordmark */
.brandmark {
  position: fixed;
  top: clamp(20px, 3vw, 40px);
  left: clamp(20px, 3vw, 46px);
  z-index: 70;
  display: flex; align-items: center; gap: 11px;
  white-space: nowrap;
}
.brandmark .brand-logo { height: clamp(15px, 1.5vw, 19px); }

/* ---------- Brand assets (inlined SVGs, recoloured via CSS) ---------- */
.brand-logo, .brand-tag { display: inline-block; line-height: 0; }
.brand-logo { aspect-ratio: 400 / 49; }
.brand-tag { aspect-ratio: 876 / 173; }
.brand-logo svg, .brand-tag svg { display: block; width: 100%; height: 100%; }
.brand-logo svg path { fill: var(--fg); }
.brand-tag svg path { fill: var(--fg); }
.brand-tag svg circle { fill: var(--accent); }
.counter {
  position: fixed;
  top: clamp(22px, 3vw, 42px);
  right: clamp(20px, 3vw, 46px);
  z-index: 70;
  font-family: var(--font-body);
  font-size: 13px; font-weight: 600; letter-spacing: 0.1em;
  color: var(--muted);
}
.counter b { color: var(--fg); }

/* ---------- Theme toggle ---------- */
.themebtn {
  position: fixed;
  z-index: 70;
  top: clamp(18px, 2.8vw, 38px);
  right: clamp(72px, 8vw, 120px);
  -webkit-appearance: none; appearance: none;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--fg);
  display: grid; place-items: center;
  cursor: pointer;
  transition: border-color 220ms, transform 220ms, background 220ms;
}
.themebtn:hover { border-color: var(--fg); transform: translateY(-1px); }
.themebtn svg { width: 19px; height: 19px; fill: none; stroke: var(--fg); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 820px) {
  .rail { display: none; }
}

/* progress bar (mobile) */
.pbar { position: fixed; left: 0; bottom: 0; height: 3px; background: var(--accent); z-index: 70; transition: width var(--fade) var(--ease); }

/* ---------- helpers ---------- */
.kick { color: var(--muted); font-size: clamp(15px, 1.5vw, 20px); line-height: 1.5; max-width: 42ch; font-weight: 400; }
.hint {
  font-family: var(--font-body); font-size: 11px; letter-spacing: 0.04em;
  color: var(--muted-2); border: 1px dashed var(--muted-2); border-radius: 6px;
  padding: 4px 9px; display: inline-flex; align-items: center; gap: 6px;
}
