/* Plan & Adjust — Index page styles */

/* ─── Header ─────────────────────────────────────────────────── */
.b-header {
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.b-header.is-hidden {
  transform: translateY(-100%);
}

.b-nav a.is-active::after {
  transform: scaleX(1);
}

/* ═══════════════════════════════════════════════════════════════
   HERO — typographic split (cream left · dark panel right)
   ═══════════════════════════════════════════════════════════════ */

.idx-hero {
  display: block; /* override brutal.css grid */
  position: relative;
  height: 100vh;   /* lock to exactly one viewport — no scrolling within hero */
  overflow: hidden;
  background: var(--b-bg);
  border-bottom: 3px solid #0D0D0D;
}

/* CSS dot-grid texture on the cream side */
.idx-hero-dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(0,0,0,0.11) 1px, transparent 1px);
  background-size: 26px 26px;
  z-index: 0;
  pointer-events: none;
}

/* Ghost parallax word — sits above dot grid, below content */
.idx-hero-ghost {
  position: absolute;
  top: 50%;
  left: 25%; /* centred on the cream half */
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: clamp(18rem, 50vw, 80rem);
  line-height: 0.8;
  color: transparent;
  -webkit-text-stroke: 1px rgba(0,0,0,0.055);
  pointer-events: none;
  white-space: nowrap;
  z-index: 1;
  letter-spacing: 0.02em;
  will-change: transform;
}

/* Full-height two-column grid — exactly fills the hero */
.idx-hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 100%; /* fills .idx-hero which is 100vh */
}

/* Left text column — 72px top clears the fixed 60px header */
.idx-hero-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 72px 60px 36px;
  overflow: hidden;
}

/* Title: scales with min(vw, vh) so it stays massive on wide screens
   but fits on shorter ones without overflowing */
.idx-hero .b-hero-title {
  font-size: clamp(3.5rem, min(14vw, 21vh), 14rem);
  line-height: 0.86;
}

/* Tighten spacing around divider and subtitle so the title gets max room */
.idx-hero .b-hero-divider {
  margin: 16px 0;
}
.idx-hero .b-hero-sub {
  font-size: 0.95rem;
  line-height: 1.55;
  margin-bottom: 20px;
}

/* Right: dark feature panel — CRT power-on entrance */
@keyframes crtOn {
  0%   { opacity: 0; transform: scaleY(0.03); }
  12%  { opacity: 0.9; transform: scaleY(1); }
  18%  { opacity: 0.1; }
  26%  { opacity: 0.85; }
  34%  { opacity: 0.25; }
  42%  { opacity: 1; }
  100% { opacity: 1; }
}

.idx-hero-panel {
  background: var(--b-bg-dark);
  border-left: 3px solid #0D0D0D;
  display: flex;
  flex-direction: column;
  position: relative;
  animation: crtOn 0.55s ease-out 0.1s both;
  transform-origin: center center;
}

/* Scan-line texture overlay */
.idx-hero-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    180deg,
    transparent 0px,
    transparent 3px,
    rgba(255,255,255,0.018) 3px,
    rgba(255,255,255,0.018) 4px
  );
  pointer-events: none;
  z-index: 0;
}

.idx-hero-panel-item {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 44px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  position: relative;
  z-index: 1; /* above scan lines */
  opacity: 0;
  animation: fadeIn 0.65s var(--ease-out) forwards;
}

.idx-hero-panel-item:last-child { border-bottom: none; }

.idx-hero-panel-item:nth-child(1) { animation-delay: 0.55s; }
.idx-hero-panel-item:nth-child(2) { animation-delay: 0.75s; }
.idx-hero-panel-item:nth-child(3) { animation-delay: 0.95s; }

.idx-hero-panel-num {
  font-family: var(--font-display);
  font-size: clamp(4.5rem, 9vw, 8.5rem);
  line-height: 1;
  color: var(--b-red);
  flex-shrink: 0;
  letter-spacing: -0.02em;
}

.idx-hero-panel-text strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.8vw, 2.6rem);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #fff;
  line-height: 0.95;
  margin-bottom: 8px;
}

.idx-hero-panel-text p {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: rgba(255,255,255,0.32);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0;
}

/* Mobile: revert to auto height and stack vertically */
@media (max-width: 800px) {
  .idx-hero {
    height: auto; /* let content breathe on small screens */
  }
  .idx-hero-inner {
    grid-template-columns: 1fr;
    height: auto;
  }
  .idx-hero-left {
    padding: 88px 28px 52px;
  }
  .idx-hero-panel {
    border-left: none;
    border-top: 3px solid #0D0D0D;
    min-height: 320px;
  }
  .idx-hero-panel-item {
    padding: 0 28px;
    gap: 20px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   FEATURES GRID
   ═══════════════════════════════════════════════════════════════ */

.idx-features-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 0;
  border: 3px solid #0D0D0D;
  box-shadow: 8px 8px 0 #0D0D0D;
}

.idx-features-left {
  padding: 56px 44px;
  border-right: 3px solid #0D0D0D;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--b-bg);
}

.idx-features-right {
  display: flex;
  flex-direction: column;
}

.idx-stat {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  padding: 36px 44px;
  border-bottom: 2px solid #0D0D0D;
  background: var(--b-bg-white);
  transition: background 0.2s;
  cursor: default;
}

.idx-stat:last-child { border-bottom: none; }

.idx-stat:hover { background: var(--b-yellow); }

.idx-stat-num {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--b-red);
  flex-shrink: 0;
  padding-top: 4px;
}

.idx-stat strong {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 8px;
  color: var(--b-ink);
}

.idx-stat p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--b-ink-soft);
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════════
   DEMO BLOCKS — video fills column, slight edge crop
   ═══════════════════════════════════════════════════════════════ */

/* Demo video wrapper — fills full height of the media column */
.idx-demo-wrap {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 100%;
}

/* Use higher specificity (.b-block-media .idx-demo-video = 0-2-0)
   to beat brutal.css's .b-block-media video rule (0-1-1) */
.b-block-media .idx-demo-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* fills the square without distortion */
  display: block;
}

/* Let blocks size naturally — video column fills via aspect-ratio */
.b-block {
  min-height: 0;
  align-items: stretch;
}

/* Ensure the media column stretches to fill block height */
.b-block-media {
  display: flex;
  flex-direction: column;
}

/* ─── Feature annotation list (in block-text) ────────────────── */
.idx-feature-list {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 2px solid #0D0D0D;
}

.idx-feature-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  transition: background 0.15s;
}

.idx-feature-item:last-child { border-bottom: none; }

.idx-feature-num {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--b-red);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

.idx-feature-item strong {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--b-ink);
  display: block;
  margin-bottom: 3px;
  letter-spacing: 0;
}

.idx-feature-item p {
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--b-ink-soft);
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════════
   USE CASE SECTION
   ═══════════════════════════════════════════════════════════════ */

.idx-use-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: start;
}

.b-use-list {
  border-top: 2px solid rgba(255,255,255,0.15);
}

.b-use-list li {
  border-bottom-color: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.8);
}

.b-use-list li::before {
  color: var(--b-red);
}

.b-section-dark .b-section-heading { color: #fff; }

/* ═══════════════════════════════════════════════════════════════
   CTA STRIP
   ═══════════════════════════════════════════════════════════════ */

.idx-cta-strip {
  background: var(--b-bg-dark);
  border-top: 3px solid #0D0D0D;
  border-bottom: 3px solid #0D0D0D;
  padding: 72px 40px;
}

.idx-cta-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: center;
}

.idx-cta-heading {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 4.5rem);
  line-height: 0.9;
  text-transform: uppercase;
  color: #fff;
  margin: 0 0 20px;
  letter-spacing: 0.01em;
}

.idx-cta-text .b-body-text {
  color: rgba(255,255,255,0.5);
  max-width: 52ch;
}

.idx-cta-action {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex-shrink: 0;
}

.idx-cta-action .b-btn-ghost {
  color: rgba(255,255,255,0.7);
  border-color: rgba(255,255,255,0.3);
  box-shadow: 4px 4px 0 rgba(255,255,255,0.15);
}

.idx-cta-action .b-btn-ghost:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border-color: rgba(255,255,255,0.6);
}

/* ═══════════════════════════════════════════════════════════════
   CONTACT
   ═══════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════
   SECURITY CARD — animated SVG icons
   ═══════════════════════════════════════════════════════════════ */

.b-card-svg {
  width: 48px;
  height: 48px;
  display: block;
  margin-bottom: 18px;
  overflow: visible; /* allow shackle / checkmark to extend outside bounds */
  color: var(--b-ink);
}

/* All drawn strokes start hidden */
.b-card-svg .svg-draw {
  stroke-dasharray: 300;
  stroke-dashoffset: 300;
}

/* Red accent fills are invisible until triggered */
.b-card-svg .svg-accent {
  opacity: 0;
  transition: opacity 0.35s ease;
}

/* Draw strokes in when card enters viewport */
.b-card.is-visible .b-card-svg .svg-draw {
  animation: svgDraw 0.75s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Reveal accents shortly after the outline finishes */
.b-card.is-visible .b-card-svg .svg-accent {
  opacity: 1;
  transition-delay: 0.65s;
}

/* Stagger each card in the grid */
.b-card-grid .b-card:nth-child(1).is-visible .b-card-svg .svg-draw { animation-delay: 0.10s; }
.b-card-grid .b-card:nth-child(2).is-visible .b-card-svg .svg-draw { animation-delay: 0.22s; }
.b-card-grid .b-card:nth-child(3).is-visible .b-card-svg .svg-draw { animation-delay: 0.34s; }
.b-card-grid .b-card:nth-child(1).is-visible .b-card-svg .svg-accent { transition-delay: 0.60s; }
.b-card-grid .b-card:nth-child(2).is-visible .b-card-svg .svg-accent { transition-delay: 0.72s; }
.b-card-grid .b-card:nth-child(3).is-visible .b-card-svg .svg-accent { transition-delay: 0.84s; }

@keyframes svgDraw {
  to { stroke-dashoffset: 0; }
}

/* ── Hover: lock shackle lifts (open lock feel) ──────────────── */
.lock-shackle {
  transform-box: fill-box;
  transform-origin: bottom center;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.b-card:hover .lock-shackle {
  transform: translateY(-4px);
}

/* ── Hover: building windows light up yellow ─────────────────── */
.window {
  fill: transparent;
  transition: fill 0.2s ease;
}

.b-card:hover .window {
  fill: var(--b-yellow);
}

/* ── Hover: key jiggles ──────────────────────────────────────── */
.key-svg {
  transform-origin: 16px 18px; /* pivot at key ring centre */
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.b-card:hover .key-svg {
  transform: rotate(-12deg);
}

/* ─────────────────────────────────────────────────────────────── */

/* ─── Portfolio / credibility footer link ────────────────────── */
.b-footer-portfolio {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--b-red) !important;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
  padding-left: 12px;
  border-left: 1px solid rgba(255,255,255,0.2);
}

.b-footer-portfolio:hover {
  border-bottom-color: var(--b-red);
}

.b-footer-copy a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  opacity: 0.6;
  transition: opacity 0.15s;
}

.b-footer-copy a:hover {
  opacity: 1;
}

/* ─────────────────────────────────────────────────────────────── */

#contact { border-bottom: 3px solid #0D0D0D; }

#contact .b-section-eyebrow::before { background: var(--b-ink); }

/* ─── Email-copied toast ─────────────────────────────────────── */
.idx-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--b-ink);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 12px 22px;
  border: 2px solid #fff;
  box-shadow: var(--b-shadow);
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  z-index: 999;
  transition: opacity 0.25s, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.idx-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.idx-toast-check {
  color: #4ade80; /* green tick */
  font-size: 0.9rem;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 1000px) {
  .idx-features-grid { grid-template-columns: 1fr; }
  .idx-features-left {
    border-right: none;
    border-bottom: 3px solid #0D0D0D;
    padding: 44px 32px;
  }
  .idx-stat { padding: 28px 32px; }

  .idx-use-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .idx-cta-inner { grid-template-columns: 1fr; }
  .idx-cta-action { flex-direction: row; flex-wrap: wrap; }
}

@media (max-width: 800px) {
  /* Demo blocks: stack text above video */
  .b-block { grid-template-columns: 1fr; }

  .b-block-text {
    border-right: none;
    border-bottom: 3px solid #0D0D0D;
    padding: 36px 24px;
  }

  .b-block-reverse .b-block-text {
    order: 0;
    border-left: none;
    border-bottom: 3px solid #0D0D0D;
  }

  /* Give the media column a 1:1 aspect ratio to match the square videos.
     This replaces min-height: 0 which was collapsing the container. */
  .b-block-media {
    min-height: 0;
    aspect-ratio: 1 / 1;
    width: 100%;
  }

  /* Wrap and video already use height: 100% / absolute fill — they'll
     fill the aspect-ratio-driven parent correctly */
  .idx-demo-wrap {
    height: 100%;
  }
}

@media (max-width: 600px) {
  .idx-features-left { padding: 32px 20px; }
  .idx-stat { padding: 20px; }
  .idx-cta-strip { padding: 44px 20px; }

  /* Tighter block text on small phones */
  .b-block-text { padding: 28px 20px; }

  /* Feature list items less spacious */
  .idx-feature-item { padding: 10px 0; }

  /* Use-case grid padding */
  .idx-use-grid { gap: 32px; }

  /* CTA actions stack properly */
  .idx-cta-action { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .idx-hero-panel-item { animation: none; opacity: 1; }
}
