/* ==========================================================================
   Homepage-only styles. Loaded by index.html alone so every other page's
   CSS payload is unaffected. Builds on the shared tokens/components in
   style.css (colors, .btn, .container, .section-head, etc.) rather than
   redefining them.
   ========================================================================== */

/* .context-photo below intentionally breaks out to 100vw for a full-bleed
   look; guard against the sub-pixel horizontal scrollbar that trick can
   introduce in some browsers. */
body { overflow-x: hidden; }

/* ---------- Scroll progress indicator ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 200;
  background: transparent;
  pointer-events: none;
}
.scroll-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--indigo-400), var(--violet));
}

/* ---------- Cursor-following spotlight ---------- */
.cursor-spotlight {
  position: fixed;
  top: 0;
  left: 0;
  width: 520px;
  height: 520px;
  margin-left: -260px;
  margin-top: -260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 140, 245, 0.1) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.4s ease;
  will-change: transform;
}
.cursor-spotlight.active { opacity: 1; }

@media (hover: none), (pointer: coarse) {
  .cursor-spotlight { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .scroll-progress-fill { transition: none; }
}

/* ---------- Hero: word-by-word headline reveal ---------- */
.hero-line { display: block; }
.hw {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.4em);
  filter: blur(6px);
}
.hw.accent {
  background: linear-gradient(135deg, var(--indigo-400), var(--violet));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
/* JS adds .revealed per word with a stagger; CSS-only fallback reveals
   everything immediately if JS never runs, so the headline is never stuck
   invisible. */
.hw.revealed { animation: hwIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
@keyframes hwIn {
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}
@media (prefers-reduced-motion: reduce) {
  .hw { opacity: 1; transform: none; filter: none; animation: none; }
}
.no-js .hw { opacity: 1; transform: none; filter: none; }

/* ---------- Hero: 3D rotating document ring ---------- */
.hero-3d-wrap {
  position: relative;
  height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1900px;
}

.hero-3d-glow {
  position: absolute;
  bottom: 66px;
  width: 400px;
  height: 90px;
  background: radial-gradient(ellipse, rgba(103, 232, 249, 0.4) 0%, rgba(124, 140, 245, 0.14) 45%, transparent 75%);
  filter: blur(10px);
}

.hero-3d-stage {
  position: relative;
  width: 400px;
  height: 360px;
  margin-top: -36px;
  perspective: 1800px;
  transition: transform 0.2s ease-out;
  will-change: transform;
}

.hero-3d-ring {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  animation: hero3dSpin 26s linear infinite;
}

@keyframes hero3dSpin {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(360deg); }
}

.hero-3d-face {
  position: absolute;
  inset: 0;
  padding: 38px 34px;
  background: linear-gradient(160deg, var(--bg-800) 0%, var(--bg-900) 55%, var(--bg-950) 100%);
  border: 1px solid var(--border-700);
  border-radius: var(--radius-lg);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    inset 0 0 50px rgba(124, 140, 245, 0.07),
    0 50px 100px -30px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(103, 232, 249, 0.14),
    0 0 40px -10px rgba(103, 232, 249, 0.18);
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
}

.face-1 { transform: rotateY(0deg) translateZ(200px); }
.face-2 { transform: rotateY(90deg) translateZ(200px); }
.face-3 { transform: rotateY(180deg) translateZ(200px); }
.face-4 { transform: rotateY(270deg) translateZ(200px); }

.hero-3d-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--teal-400);
}

.hero-3d-heading { font-family: var(--font-head); font-size: 1.3rem; font-weight: 700; color: var(--text-000); }

.hero-3d-body { font-size: 0.85rem; line-height: 1.5; color: var(--text-300); }

@media (max-width: 1080px) {
  .hero-3d-wrap { height: 420px; }
  .hero-3d-stage { width: 300px; height: 280px; margin-top: -18px; perspective: 1500px; }
  .hero-3d-glow { width: 300px; height: 70px; bottom: 40px; }
  .hero-3d-face { padding: 22px 20px; gap: 14px; }
  .hero-3d-heading { font-size: 1rem; }
  .hero-3d-body { font-size: 0.78rem; }
  .face-1 { transform: rotateY(0deg) translateZ(150px); }
  .face-2 { transform: rotateY(90deg) translateZ(150px); }
  .face-3 { transform: rotateY(180deg) translateZ(150px); }
  .face-4 { transform: rotateY(270deg) translateZ(150px); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-3d-ring { animation: none; }
  .hero-3d-stage { transition: none; }
}

/* ---------- Full-bleed supporting photo beneath a section head ---------- */
.context-photo {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-bottom: 40px;
  overflow: hidden;
  border-top: 1px solid var(--border-700);
  border-bottom: 1px solid var(--border-700);
}
.context-photo img {
  width: 100%;
  height: 360px;
  object-fit: cover;
  display: block;
  filter: blur(16px);
  opacity: 0;
  transform: scale(1.06);
  transition: filter 1.1s ease, opacity 1.1s ease, transform 1.1s ease;
}
.context-photo img.sharp { filter: blur(0); opacity: 1; transform: scale(1); }

@media (prefers-reduced-motion: reduce) {
  .context-photo img { filter: none; opacity: 1; transform: none; transition: none; }
}

@media (max-width: 700px) {
  .context-photo img { height: 220px; }
}

/* ---------- Section rhythm: technical labels + alternating environments ---------- */
.tech-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-400);
  margin-bottom: 14px;
}
.tech-label::before { content: ''; width: 18px; height: 1px; background: var(--teal-400); }

.env-dark { background: var(--bg-950); }
.env-panel { background: var(--bg-900); border-top: 1px solid var(--border-700); border-bottom: 1px solid var(--border-700); }

.env-blueprint {
  position: relative;
  background: var(--bg-950);
  background-image:
    linear-gradient(rgba(124, 140, 245, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 140, 245, 0.07) 1px, transparent 1px);
  background-size: 44px 44px;
}
.env-blueprint::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, transparent 0%, var(--bg-950) 85%);
  pointer-events: none;
}
.env-blueprint > .container { position: relative; z-index: 1; }

/* ---------- Chaos to Clarity ---------- */
.chaos-clarity {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 32px;
  align-items: center;
  margin-top: 56px;
}

.chaos-side {
  position: relative;
  min-height: 320px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-content: center;
}

.chaos-chip {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  background: var(--bg-800);
  border: 1px solid var(--border-700);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-300);
  box-shadow: 0 12px 24px -16px rgba(0, 0, 0, 0.5);
  animation: chipFloat 7s ease-in-out infinite;
}
.chaos-chip.c1 { transform: rotate(-3deg); animation-delay: 0s; }
.chaos-chip.c2 { transform: rotate(2deg); animation-delay: -1.2s; }
.chaos-chip.c3 { transform: rotate(-1.5deg); animation-delay: -2.4s; }
.chaos-chip.c4 { transform: rotate(3deg); animation-delay: -3.6s; }
.chaos-chip.c5 { transform: rotate(-2.5deg); animation-delay: -4.8s; }
.chaos-chip.c6 { transform: rotate(1.5deg); animation-delay: -6s; }

@keyframes chipFloat {
  0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); }
  50% { transform: translateY(-10px) rotate(var(--r, 0deg)); }
}

.clarity-arrow {
  color: var(--teal-400);
  width: 32px;
  height: 32px;
}
.clarity-arrow svg { width: 100%; height: 100%; }

.clarity-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.clarity-list li {
  padding: 14px 18px;
  background: var(--bg-800);
  border: 1px solid var(--border-700);
  border-left: 3px solid var(--teal-400);
  border-radius: var(--radius-sm);
  font-weight: 600;
  color: var(--text-100);
  font-size: 0.9rem;
  opacity: 0;
  transform: translateX(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.clarity-list.in-view li { opacity: 1; transform: translateX(0); }
.clarity-list.in-view li:nth-child(1) { transition-delay: 0.05s; }
.clarity-list.in-view li:nth-child(2) { transition-delay: 0.12s; }
.clarity-list.in-view li:nth-child(3) { transition-delay: 0.19s; }
.clarity-list.in-view li:nth-child(4) { transition-delay: 0.26s; }
.clarity-list.in-view li:nth-child(5) { transition-delay: 0.33s; }
.clarity-list.in-view li:nth-child(6) { transition-delay: 0.4s; }
.clarity-list.in-view li:nth-child(7) { transition-delay: 0.47s; }
.clarity-list.in-view li:nth-child(8) { transition-delay: 0.54s; }
.clarity-list.in-view li:nth-child(9) { transition-delay: 0.61s; }

@media (max-width: 900px) {
  .chaos-clarity { grid-template-columns: 1fr; }
  .clarity-arrow { transform: rotate(90deg); justify-self: center; }
  .chaos-side { min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .chaos-chip { animation: none; }
  .clarity-list li { transition: none; opacity: 1; transform: none; }
}

/* ---------- Interactive process flow ---------- */
.process-flow {
  position: relative;
  max-width: 720px;
  margin: 56px auto 0;
  padding-left: 64px;
}

.process-flow-line {
  position: absolute;
  left: 19px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border-700);
  overflow: hidden;
}

.process-flow-line-fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background: linear-gradient(var(--indigo-500), var(--violet));
  transition: height 0.6s ease;
}

.process-flow-stage {
  position: relative;
  display: flex;
  margin-bottom: 44px;
}
.process-flow-stage:last-child { margin-bottom: 0; }

.process-flow-dot {
  position: absolute;
  left: -64px;
  top: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-800);
  border: 2px solid var(--border-700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--text-500);
  flex-shrink: 0;
  transition: all 0.4s ease;
  z-index: 1;
}

.process-flow-stage.active .process-flow-dot {
  border-color: var(--teal-400);
  color: var(--teal-400);
  background: var(--bg-900);
  box-shadow: 0 0 0 5px rgba(103, 232, 249, 0.14);
}

.process-flow-body { opacity: 0.5; transition: opacity 0.4s ease; }
.process-flow-stage.active .process-flow-body { opacity: 1; }
.process-flow-body h3 { margin-bottom: 6px; font-size: 1.1rem; }
.process-flow-body p { color: var(--text-300); font-size: 0.92rem; max-width: 480px; }

@media (max-width: 700px) {
  .process-flow { padding-left: 52px; }
  .process-flow-dot { left: -52px; width: 34px; height: 34px; font-size: 0.7rem; }
  .process-flow-line { left: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .process-flow-line-fill, .process-flow-dot, .process-flow-body { transition: none; }
}

/* ---------- Before / after drag comparison ---------- */
.ba-slider {
  position: relative;
  max-width: 720px;
  height: 380px;
  margin: 56px auto 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-700);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.7);
  user-select: none;
}

.ba-panel { position: absolute; inset: 0; padding: 32px; display: flex; flex-direction: column; }
.ba-after { background: var(--bg-900); }
.ba-before { background: var(--bg-800); clip-path: inset(0 50% 0 0); }

.ba-panel-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--teal-400); margin-bottom: 22px; }

.ba-doc-mini { display: flex; flex-direction: column; gap: 14px; }
.ba-doc-title { font-family: var(--font-head); font-size: 1.2rem; font-weight: 700; color: var(--text-000); margin-bottom: 4px; }
.ba-doc-h { font-size: 0.76rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-500); }

.ba-messy { position: relative; display: flex; flex-wrap: wrap; gap: 16px; align-content: flex-start; padding-top: 24px; }
.ba-messy .chaos-chip { animation: none; }

.ba-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  background: var(--teal-400);
  cursor: ew-resize;
  transform: translateX(-50%);
  z-index: 2;
}

.ba-handle-grip {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--teal-400);
  color: #0b1220;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px -8px rgba(103, 232, 249, 0.6);
}
.ba-handle-grip svg { width: 20px; height: 20px; }

.ba-handle:focus-visible .ba-handle-grip { outline: 2px solid var(--text-000); outline-offset: 2px; }

@media (max-width: 700px) {
  .ba-slider { height: 320px; }
  .ba-panel { padding: 20px; }
}

/* ---------- Signature moment: watch a procedure build itself ---------- */
.wow-doc {
  max-width: 640px;
  margin: 56px auto 0;
  background: var(--bg-900);
  border: 1px solid var(--border-700);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.7);
}

.wow-doc-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  background: var(--bg-800);
  border-bottom: 1px solid var(--border-700);
}
.wow-doc-bar .filename { font-size: 0.78rem; color: var(--text-500); margin-left: 8px; }

.wow-doc-complete {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-500);
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-700);
  transition: all 0.4s ease;
}
.wow-doc-complete.done { color: #0b1220; background: var(--teal-400); }

.wow-doc-body { padding: 28px 26px; display: flex; flex-direction: column; gap: 26px; }

.wow-stage {
  opacity: 0.22;
  transform: translateY(14px);
  filter: blur(2px);
  transition: opacity 0.6s ease, transform 0.6s ease, filter 0.6s ease;
}
.wow-stage.built { opacity: 1; transform: none; filter: none; }

.wow-stage-label { font-size: 0.76rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--teal-400); margin-bottom: 10px; }

.wow-line-skeleton { height: 9px; border-radius: 5px; background: var(--bg-700); margin-bottom: 6px; }
.wow-line-skeleton.w80 { width: 80%; }
.wow-line-skeleton.w70 { width: 70%; }
.wow-line-skeleton.w60 { width: 60%; }
.wow-line-skeleton.w50 { width: 50%; }

.wow-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.wow-chips span { padding: 6px 12px; border-radius: 999px; background: var(--bg-700); border: 1px solid var(--border-700); font-size: 0.76rem; color: var(--text-300); }

.wow-steps { display: flex; gap: 8px; }
.wow-steps span {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--bg-700); border: 1px solid var(--border-700);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 700; color: var(--text-300);
}

.wow-flow { display: flex; align-items: center; gap: 8px; }
.wow-flow span { width: 44px; height: 24px; border-radius: 6px; background: var(--bg-700); border: 1px solid var(--border-700); position: relative; }
.wow-flow span:not(:last-child)::after {
  content: ''; position: absolute; right: -9px; top: 50%;
  transform: translateY(-50%); width: 8px; height: 2px; background: var(--border-600);
}

.wow-kpi-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.wow-kpi-badges span {
  padding: 6px 12px; border-radius: 6px;
  background: rgba(103, 232, 249, 0.12); border: 1px solid rgba(103, 232, 249, 0.3);
  color: var(--teal-400); font-size: 0.8rem; font-weight: 700;
}

.wow-tab-row { display: flex; gap: 8px; }
.wow-tab { padding: 8px 14px; border-radius: 6px 6px 0 0; background: var(--bg-700); border: 1px solid var(--border-700); border-bottom: none; font-size: 0.78rem; color: var(--text-300); }

.wow-final {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding-top: 18px; border-top: 1px dashed var(--border-700);
  color: var(--teal-400); font-weight: 700; font-size: 1rem;
}
.wow-final svg { width: 26px; height: 26px; }

.wow-caption { text-align: center; margin-top: 32px; font-size: 1.05rem; color: var(--text-300); }
.wow-caption a { margin-left: 6px; }

@media (prefers-reduced-motion: reduce) {
  .wow-stage, .wow-doc-complete { transition: none; opacity: 1; transform: none; filter: none; }
}

/* ---------- Interactive industry showcase ---------- */
.industry-showcase {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
  margin-top: 48px;
  align-items: stretch;
}

.industry-tabs { display: flex; flex-direction: column; gap: 4px; }

.industry-tab {
  text-align: left;
  padding: 14px 16px;
  background: transparent;
  border: none;
  border-left: 2px solid var(--border-700);
  color: var(--text-500);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.industry-tab:hover, .industry-tab:focus-visible { color: var(--text-100); }

.industry-tab.active {
  color: var(--text-000);
  border-left-color: var(--teal-400);
  background: var(--bg-800);
}

.industry-preview {
  position: relative;
  display: block;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 360px;
  border: 1px solid var(--border-700);
}

.industry-preview img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }

.industry-preview-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 32px;
  background: linear-gradient(0deg, rgba(10, 10, 13, 0.92) 0%, rgba(10, 10, 13, 0.55) 55%, transparent 100%);
}

.industry-preview-overlay h3 { color: var(--text-000); font-size: 1.6rem; margin-bottom: 12px; }

.industry-preview-overlay ul { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 6px; }
.industry-preview-overlay li { color: var(--text-100); font-size: 0.92rem; }
.industry-preview-overlay li::before { content: '+ '; color: var(--teal-400); font-weight: 700; }

@media (max-width: 800px) {
  .industry-showcase { grid-template-columns: 1fr; }
  .industry-tabs { flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .industry-tab { border-left: none; border-bottom: 2px solid var(--border-700); padding: 8px 4px; }
  .industry-tab.active { border-bottom-color: var(--teal-400); background: transparent; }
}

/* ---------- Compliance hub-and-spoke ---------- */
.compliance-viz {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 720px;
  margin: 56px auto 0;
}

.compliance-node {
  padding: 18px 14px;
  background: var(--bg-800);
  border: 1px solid var(--border-700);
  border-radius: var(--radius-md);
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-300);
}

.compliance-center {
  grid-column: 1 / 4;
  padding: 26px 20px;
  background: var(--bg-700);
  border: 2px solid var(--teal-400);
  border-radius: var(--radius-md);
  text-align: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-000);
  box-shadow: 0 0 0 6px rgba(103, 232, 249, 0.1);
}

.compliance-connector {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  position: relative;
}

.compliance-line {
  width: 2px;
  height: 100%;
  background: linear-gradient(var(--border-600), var(--teal-400));
  transform-origin: top;
  transform: scaleY(0);
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.compliance-connector.up .compliance-line {
  background: linear-gradient(var(--teal-400), var(--border-600));
  transform-origin: bottom;
}

.compliance-dot {
  position: absolute;
  bottom: -2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal-400);
  opacity: 0;
  transition: opacity 0.4s ease 0.6s;
  box-shadow: 0 0 8px 2px rgba(103, 232, 249, 0.6);
}
.compliance-connector.up .compliance-dot { bottom: auto; top: -2px; }

.compliance-viz.lit .compliance-line { transform: scaleY(1); }
.compliance-viz.lit .compliance-dot { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .compliance-line, .compliance-dot { transition: none; transform: scaleY(1); opacity: 1; }
}

@media (max-width: 700px) {
  .compliance-viz { max-width: 320px; }
  .compliance-node { font-size: 0.8rem; padding: 14px 8px; }
}

/* Scroll-reveal primitive: JS toggles .in-view; CSS-only fallback for no-JS */
.reveal-up { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal-up.in-view { opacity: 1; transform: translateY(0); }
.no-js .reveal-up { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal-up { opacity: 1; transform: none; transition: none; }
}
