/* Agent - House | Dual Theme: Dark (Design 1 Spatial AI Command Studio) & Light (Design 2 Kinetic Split-Screen & Orbital Radar) */

:root {
  --sans: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: 'SF Mono', ui-monospace, Menlo, Monaco, Consolas, monospace;
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

/* Dark Mode = Design 1: Spatial AI Command Studio */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #050811;
  --bg-elevated: rgba(15, 23, 42, 0.78);
  --surface: rgba(15, 23, 42, 0.74);
  --surface-hi: rgba(30, 41, 59, 0.88);
  --surface-solid: #0B1220;
  --ink: #F8FAFC;
  --ink-soft: #CBD5E1;
  --muted: #94A3B8;
  --accent: #38BDF8;
  --accent-strong: #0EA5E9;
  --accent-2: #10B981;
  --accent-2-hi: #34D399;
  --accent-warn: #F59E0B;
  --accent-violet: #818CF8;
  --border: rgba(148, 163, 184, 0.22);
  --border-strong: rgba(56, 189, 248, 0.48);
  --header-bg: rgba(5, 8, 17, 0.82);
  --header-border: rgba(148, 163, 184, 0.18);
  --card-shadow: 0 24px 54px rgba(0, 0, 0, 0.48);
  --cta-bg: linear-gradient(135deg, #38BDF8, #10B981);
  --cta-ink: #04121D;
  --cta-shadow: 0 10px 26px rgba(14, 165, 233, 0.25);
  --focus-ring: #38BDF8;
}

/* Light Mode = Design 2: Kinetic Split-Screen & Orbital Canvas */
html[data-theme="light"] {
  color-scheme: light;
  --bg: #FFFFFF;
  --bg-elevated: #F8FAFC;
  --surface: #FFFFFF;
  --surface-hi: #EFF6FF;
  --surface-solid: #F8FAFC;
  --ink: #0F172A;
  --ink-soft: #1E293B;
  --muted: #475569;
  --accent: #1D4ED8;
  --accent-strong: #2563EB;
  --accent-2: #059669;
  --accent-2-hi: #10B981;
  --accent-warn: #D97706;
  --accent-violet: #4F46E5;
  --border: #0F172A;
  --border-strong: #0F172A;
  --header-bg: #FFFFFF;
  --header-border: #0F172A;
  --card-shadow: 5px 5px 0 #0F172A;
  --cta-bg: #2563EB;
  --cta-ink: #FFFFFF;
  --cta-shadow: 4px 4px 0 #0F172A;
  --focus-ring: #2563EB;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  transition: background-color 0.2s ease, color 0.2s ease;
}

html[data-theme="dark"] body {
  background-image:
    radial-gradient(ellipse 70% 50% at 15% 0%, rgba(56, 189, 248, 0.16), transparent),
    radial-gradient(ellipse 60% 45% at 88% 15%, rgba(16, 185, 129, 0.13), transparent);
}

a {
  color: inherit;
}

button {
  font-family: inherit;
}

:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100;
  background: var(--accent-strong);
  color: #FFFFFF;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  left: 16px;
}

/* Cross-Document View Transitions (MPA opt-in per Modern Web Guidance) */
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }

  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 0.24s;
  }
}

/* Keyframes & Motion System (strictly opt-in via prefers-reduced-motion: no-preference) */
@keyframes spin3d {
  0%, 100% { transform: rotateY(-18deg) rotateX(8deg); }
  50% { transform: rotateY(18deg) rotateX(-6deg); }
}

@keyframes orbit {
  to { transform: rotate(360deg); }
}

@keyframes eq {
  0% { transform: scaleY(0.28); }
  100% { transform: scaleY(1); }
}

@keyframes roofWave {
  0% { transform: scaleY(0.45); }
  100% { transform: scaleY(1.05); }
}

@keyframes dashMove {
  to { stroke-dashoffset: -32; }
}

@keyframes flowPacket {
  0% { offset-distance: 0%; opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { offset-distance: 100%; opacity: 0; }
}

@keyframes radarSweep {
  to { transform: rotate(360deg); }
}

@keyframes ringPulse {
  0% { transform: scale(0.92); opacity: 0.78; }
  100% { transform: scale(1.22); opacity: 0; }
}

.orbit-dot {
  transform-origin: 24px 24px;
}

.wave-bar,
.wh-bar {
  transform-origin: bottom;
}

@media (prefers-reduced-motion: no-preference) {
  .cube-svg { animation: spin3d 9s ease-in-out infinite; }
  .orbit-dot { animation: orbit 3.8s linear infinite; }
  .wave-bar { animation: eq 1.15s ease-in-out infinite alternate; }
  .wh-bar:nth-child(1) { animation: roofWave 1.1s 0s ease-in-out infinite alternate; }
  .wh-bar:nth-child(2) { animation: roofWave 1.1s 0.2s ease-in-out infinite alternate; }
  .wh-bar:nth-child(3) { animation: roofWave 1.1s 0.4s ease-in-out infinite alternate; }
  .wh-bar:nth-child(4) { animation: roofWave 1.1s 0.1s ease-in-out infinite alternate; }
  .wh-bar:nth-child(5) { animation: roofWave 1.1s 0.3s ease-in-out infinite alternate; }
  .packet-dot { animation: flowPacket 2.6s linear infinite; }
  .pulse-line { animation: dashMove 1.8s linear infinite; }
  .radar-sweep { animation: radarSweep 7s linear infinite; transform-origin: 180px 180px; }
  .orb-pulse { animation: ringPulse 2.4s ease-out infinite; }
}

body.motion-paused .cube-svg,
body.motion-paused .orbit-dot,
body.motion-paused .wave-bar,
body.motion-paused .wh-bar,
body.motion-paused .packet-dot,
body.motion-paused .pulse-line,
body.motion-paused .radar-sweep,
body.motion-paused .orb-pulse {
  animation-play-state: paused !important;
}

/* Container */
.wrap {
  width: min(1320px, calc(100% - 40px));
  margin: 0 auto;
}

/* Header & Moving Logos */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--header-bg);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--header-border);
}

html[data-theme="light"] .site-header {
  border-bottom-width: 2px;
  backdrop-filter: none;
}

.nav-bar {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 0;
}

.logo-wrap {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-mark {
  width: 46px;
  height: 46px;
  position: relative;
  display: grid;
  place-items: center;
}

.logo-dark {
  width: 44px;
  height: 44px;
  perspective: 260px;
  display: grid;
  place-items: center;
}

.cube-svg {
  width: 42px;
  height: 42px;
  transform-style: preserve-3d;
}

.logo-light {
  display: none;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: #1D4ED8;
  border: 2px solid #0F172A;
  box-shadow: 2px 2px 0 #0F172A;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  padding: 10px 8px;
}

.wh-bar {
  width: 4px;
  background: #FFFFFF;
  border-radius: 3px;
}

.wh-bar:nth-child(1) { height: 11px; }
.wh-bar:nth-child(2) { height: 20px; }
.wh-bar:nth-child(3) { height: 25px; }
.wh-bar:nth-child(4) { height: 20px; }
.wh-bar:nth-child(5) { height: 11px; }

html[data-theme="light"] .logo-dark {
  display: none;
}

html[data-theme="light"] .logo-light {
  display: flex;
}

.brand-title {
  font-size: 18.5px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.brand-sub {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.1em;
}

/* 5-Page Navigation */
.page-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border-radius: 12px;
}

html[data-theme="dark"] .page-nav {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border);
}

html[data-theme="light"] .page-nav {
  background: #F8FAFC;
  border: 1.5px solid #0F172A;
}

.nav-link {
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 700;
  padding: 8px 13px;
  border-radius: 8px;
  color: var(--muted);
  white-space: nowrap;
  transition: background-color 0.18s, color 0.18s;
}

.nav-link:hover {
  color: var(--ink);
}

html[data-theme="dark"] .nav-link.active {
  background: var(--cta-bg);
  color: #04121D;
}

html[data-theme="light"] .nav-link.active {
  background: #0F172A;
  color: #FFFFFF;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.portal-chip {
  text-decoration: none;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  padding: 7px 11px;
  border-radius: 999px;
  white-space: nowrap;
}

html[data-theme="dark"] .portal-chip.status {
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.12);
}

html[data-theme="dark"] .portal-chip.erp {
  color: #38BDF8;
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.12);
}

html[data-theme="light"] .portal-chip {
  border: 1.5px solid #0F172A;
  border-radius: 8px;
  background: #FFFFFF;
  color: #0F172A;
}

html[data-theme="light"] .portal-chip.status {
  background: #ECFDF5;
  border-color: #059669;
  color: #065F46;
}

.ctl-btn {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  color: var(--ink-soft);
  background: var(--surface-hi);
  border: 1px solid var(--border);
}

html[data-theme="light"] .ctl-btn {
  border: 1.5px solid #0F172A;
  background: #FFFFFF;
  color: #0F172A;
}

.ctl-btn:hover {
  border-color: var(--accent);
}

.menu-toggle {
  display: none;
}

/* Main Stage */
.page-main {
  padding: 28px 0 56px;
}

html[data-theme="light"] .page-main.home-main {
  padding-top: 0;
}

/* Shared Buttons & Badges */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  cursor: pointer;
  background: var(--cta-bg);
  color: var(--cta-ink);
  font-weight: 800;
  font-size: 14.5px;
  padding: 13px 22px;
  border-radius: 11px;
  border: 2px solid transparent;
  box-shadow: var(--cta-shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

html[data-theme="light"] .btn-primary {
  border-color: #0F172A;
}

.btn-primary:hover {
  transform: translateY(-2px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 14.5px;
  padding: 13px 20px;
  border-radius: 11px;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

html[data-theme="dark"] .btn-secondary {
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid var(--border-strong);
  color: #F8FAFC;
}

html[data-theme="light"] .btn-secondary {
  background: #FFFFFF;
  border: 2px solid #0F172A;
  color: #0F172A;
}

.kicker-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 6px 12px;
  border-radius: 999px;
}

html[data-theme="dark"] .kicker-pill {
  background: rgba(5, 8, 17, 0.74);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #38BDF8;
}

html[data-theme="light"] .kicker-pill {
  background: #EFF6FF;
  border: 1.5px solid #1D4ED8;
  border-radius: 6px;
  color: #1D4ED8;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-2-hi);
  box-shadow: 0 0 10px var(--accent-2);
}

/* ============================================================
   HOME PAGE: Dual-Mode Bento Studio (Dark) / Kinetic Split (Light)
   ============================================================ */
.hero-band {
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 20px;
  margin-bottom: 24px;
}

html[data-theme="light"] .hero-band {
  grid-template-columns: 0.96fr 1.24fr;
  gap: 0;
  border-bottom: 2px solid #0F172A;
  margin-bottom: 28px;
}

.hero-primary {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 430px;
  border: 1px solid var(--border-strong);
  box-shadow: var(--card-shadow);
}

.hero-primary-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.62) contrast(1.06);
}

.hero-primary-inner {
  position: relative;
  z-index: 2;
  height: 100%;
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  background: linear-gradient(180deg, rgba(5, 8, 17, 0.32) 0%, rgba(5, 8, 17, 0.92) 100%);
}

html[data-theme="light"] .hero-primary {
  border-radius: 0;
  border: 0;
  border-right: 2px solid #0F172A;
  box-shadow: none;
  background: #FFFFFF;
}

html[data-theme="light"] .hero-primary-img {
  display: none;
}

html[data-theme="light"] .hero-primary-inner {
  background: transparent;
  padding: 44px 38px 34px 0;
}

.hero-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.eq-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 26px;
}

.wave-bar {
  width: 4px;
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
}

.wave-bar:nth-child(2) { animation-delay: 0.2s; }
.wave-bar:nth-child(3) { animation-delay: 0.4s; }
.wave-bar:nth-child(4) { animation-delay: 0.1s; }
.wave-bar:nth-child(5) { animation-delay: 0.3s; }

.hero-copy h1 {
  font-size: clamp(36px, 4.4vw, 54px);
  line-height: 1.01;
  letter-spacing: -0.04em;
  font-weight: 850;
  margin-bottom: 14px;
}

.hero-copy h1 span {
  color: var(--accent);
}

html[data-theme="dark"] .hero-copy p {
  color: #E2E8F0;
}

.hero-copy p {
  font-size: 16.5px;
  color: var(--muted);
  max-width: 470px;
  margin-bottom: 22px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* Quick proof strip shown crisply inside Light Kinetic Left Panel and compactly in Dark */
.proof-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding-top: 18px;
}

html[data-theme="dark"] .proof-strip {
  border-top: 1px solid rgba(148, 163, 184, 0.24);
}

html[data-theme="light"] .proof-strip {
  border-top: 1.5px solid #CBD5E1;
}

.proof-tile {
  text-decoration: none;
  border-radius: 10px;
  padding: 10px 12px;
  transition: border-color 0.18s, transform 0.18s;
}

html[data-theme="dark"] .proof-tile {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.24);
}

html[data-theme="light"] .proof-tile {
  background: #F8FAFC;
  border: 1.5px solid #0F172A;
}

.proof-tile:hover {
  transform: translateY(-2px);
  border-color: var(--accent-strong);
}

.proof-tile span {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent);
  font-weight: 700;
}

.proof-tile strong {
  font-size: 13px;
  display: block;
  margin-top: 2px;
}

/* Hero Right Panel (Interactive Flow Studio in Dark / Dark-Cobalt Visual Canvas in Light) */
.hero-secondary {
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}

html[data-theme="dark"] .hero-secondary {
  background: var(--surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
}

html[data-theme="light"] .hero-secondary {
  border-radius: 0;
  background: linear-gradient(135deg, #0F172A 0%, #1E3A8A 100%);
  color: #F8FAFC;
  padding: 28px 28px 28px 34px;
}

.canvas-photo-pair {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

html[data-theme="light"] .canvas-photo-pair {
  display: grid;
}

.canvas-tile {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  height: 156px;
  border: 1.5px solid rgba(147, 197, 253, 0.4);
  text-decoration: none;
  color: #FFFFFF;
}

.canvas-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.canvas-tile-cap {
  position: absolute;
  inset: auto 0 0 0;
  padding: 10px 12px;
  background: linear-gradient(transparent, rgba(15, 23, 42, 0.94));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.canvas-tile-cap strong {
  font-size: 13.5px;
}

.canvas-tile-cap span {
  font-family: var(--mono);
  font-size: 10px;
  color: #34D399;
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.panel-kicker {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #34D399;
}

.trigger-row {
  display: flex;
  gap: 6px;
}

.trig-btn {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 7px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #CBD5E1;
  cursor: pointer;
}

.trig-btn.active {
  background: rgba(56, 189, 248, 0.24);
  border-color: #38BDF8;
  color: #FFFFFF;
}

.flow-diagram {
  background: rgba(5, 8, 17, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 14px;
  padding: 16px;
}

.nodes-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.f-node {
  background: rgba(30, 41, 59, 0.86);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 10px;
  padding: 12px 8px;
  text-align: center;
}

.f-node strong {
  display: block;
  font-size: 12.5px;
  color: #F8FAFC;
}

.f-node span {
  font-family: var(--mono);
  font-size: 10px;
  color: #38BDF8;
}

.flow-output {
  font-family: var(--mono);
  font-size: 12px;
  color: #A7F3D0;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.32);
  border-radius: 10px;
  padding: 12px 14px;
}

.mini-service-pills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.svc-chip {
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.24);
}

.svc-chip span {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  color: #38BDF8;
}

.svc-chip strong {
  font-size: 12.5px;
  color: #F8FAFC;
}

/* Visual Project Reel Strip + Portal Cards */
.section-bar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
  gap: 12px;
}

.section-bar h2 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section-bar span {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.reel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.reel-card {
  display: block;
  text-decoration: none;
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

html[data-theme="light"] .reel-card {
  border-width: 2px;
  box-shadow: 4px 4px 0 #0F172A;
}

.reel-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-strong);
}

.reel-visual {
  height: 152px;
  position: relative;
  overflow: hidden;
  background: #0B1220;
}

.reel-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.82;
}

.reel-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(5, 8, 17, 0.85);
  color: #34D399;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.reel-copy {
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.reel-copy h3 {
  font-size: 16.5px;
  font-weight: 800;
}

.reel-copy p {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.arrow-pill {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  flex-shrink: 0;
}

html[data-theme="dark"] .arrow-pill {
  background: rgba(56, 189, 248, 0.16);
  color: #38BDF8;
}

html[data-theme="light"] .arrow-pill {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1.5px solid #0F172A;
}

/* Portal Strip (`erp.` untouched portal) */
.portal-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.portal-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: 16px;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  transition: transform 0.18s ease, border-color 0.18s ease;
}

html[data-theme="light"] .portal-card {
  border-width: 2px;
  box-shadow: 4px 4px 0 #0F172A;
}

.portal-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-strong);
}

.portal-meta {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-2);
}

.portal-card h3 {
  font-size: 16px;
  font-weight: 800;
  margin-top: 2px;
}

.portal-card p {
  font-size: 13px;
  color: var(--muted);
}

/* ============================================================
   PROJECT DETAIL VISUAL PAGES (Pages 3, 4, 5)
   ============================================================ */
.project-stage {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
}

html[data-theme="light"] .project-stage {
  border-width: 2px;
  box-shadow: 6px 6px 0 #0F172A;
}

.proj-banner {
  position: relative;
  min-height: 240px;
  display: flex;
  align-items: flex-end;
  padding: 28px 32px;
  overflow: hidden;
}

.proj-banner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.48) contrast(1.08);
}

.proj-banner-inner {
  position: relative;
  z-index: 2;
  max-width: 780px;
  color: #F8FAFC;
}

.proj-banner-inner h1 {
  font-size: clamp(28px, 3.4vw, 42px);
  font-weight: 850;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin: 10px 0 8px;
}

.proj-banner-inner p {
  font-size: 15.5px;
  color: #E2E8F0;
}

.proj-visual-body {
  padding: 28px 32px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
}

.step-tabs {
  display: grid;
  gap: 10px;
}

.step-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 14px 18px;
  border-radius: 12px;
  cursor: pointer;
  color: var(--ink);
  transition: transform 0.16s, border-color 0.16s, background-color 0.16s;
}

html[data-theme="dark"] .step-btn {
  background: rgba(5, 8, 17, 0.7);
  border: 1px solid var(--border);
}

html[data-theme="dark"] .step-btn.active {
  background: rgba(14, 165, 233, 0.16);
  border-color: #38BDF8;
}

html[data-theme="light"] .step-btn {
  background: #F8FAFC;
  border: 1.5px solid #0F172A;
}

html[data-theme="light"] .step-btn.active {
  background: #2563EB;
  color: #FFFFFF;
  box-shadow: 3px 3px 0 #0F172A;
}

.step-num {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
  padding: 5px 8px;
  border-radius: 7px;
  background: rgba(56, 189, 248, 0.18);
  color: #38BDF8;
  flex-shrink: 0;
}

html[data-theme="light"] .step-btn:not(.active) .step-num {
  background: #EFF6FF;
  color: #1D4ED8;
}

html[data-theme="light"] .step-btn.active .step-num {
  background: #0F172A;
  color: #FFFFFF;
}

.step-btn strong {
  display: block;
  font-size: 15px;
}

.step-btn span.step-sub {
  display: block;
  font-size: 12.5px;
  opacity: 0.85;
}

.step-detail-col {
  display: grid;
  gap: 16px;
  align-content: start;
}

.step-inspector {
  border-radius: 14px;
  padding: 20px;
}

html[data-theme="dark"] .step-inspector {
  background: rgba(5, 8, 17, 0.72);
  border: 1px solid rgba(56, 189, 248, 0.35);
}

html[data-theme="light"] .step-inspector {
  background: #EFF6FF;
  border: 2px solid #0F172A;
}

.step-inspector h2 {
  font-size: 19px;
  font-weight: 800;
  margin: 6px 0 8px;
}

.step-inspector p {
  font-size: 14px;
  color: var(--ink-soft);
}

.stat-panel {
  border-radius: 14px;
  padding: 18px 20px;
  display: grid;
  gap: 12px;
}

html[data-theme="dark"] .stat-panel {
  background: rgba(16, 185, 129, 0.09);
  border: 1px solid rgba(16, 185, 129, 0.32);
}

html[data-theme="light"] .stat-panel {
  background: #ECFDF5;
  border: 2px solid #0F172A;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12.5px;
}

.stat-row strong {
  color: var(--accent-2);
}

.proj-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--header-border);
  padding: 20px 0 34px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links a {
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--accent);
}

/* Responsive Breakpoints (1440 / 768 / 390) */
@media (max-width: 1060px) {
  .hero-band,
  html[data-theme="light"] .hero-band {
    grid-template-columns: 1fr;
  }

  html[data-theme="light"] .hero-primary {
    border-right: 0;
    border-bottom: 2px solid #0F172A;
    padding-left: 0;
  }

  html[data-theme="light"] .hero-primary-inner {
    padding: 28px 0;
  }

  .reel-grid {
    grid-template-columns: 1fr 1fr;
  }

  .proj-visual-body {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .nav-bar {
    flex-wrap: wrap;
  }

  .page-nav {
    display: none;
    order: 4;
    width: 100%;
    flex-wrap: wrap;
  }

  .page-nav.open {
    display: flex;
  }

  .nav-controls {
    flex-wrap: wrap;
  }
}

@media (max-width: 680px) {
  .wrap {
    width: calc(100% - 28px);
  }

  .reel-grid,
  .portal-grid,
  .proof-strip,
  .mini-service-pills,
  .canvas-photo-pair,
  .nodes-row {
    grid-template-columns: 1fr;
  }

  .hero-primary-inner,
  .hero-secondary,
  .proj-banner,
  .proj-visual-body {
    padding: 20px;
  }

  .portal-chip {
    display: none;
  }
}
