/* ============================================================
   ZAYLO REMOTE COMPANION APP PORTFOLIO STYLES
   Giorgi Suramlishvili — Custom Smartphone Emulator & HUD Style
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@100;200;300;400;500;600;700;800;900&family=JetBrains+Mono:wght@100;300;400;500;700&display=swap');

:root {
  --zr-accent: #10b981; /* Premium emerald green */
  --zr-accent-soft: rgba(16, 185, 129, 0.05);
  --zr-accent-glow: rgba(16, 185, 129, 0.25);
  --phone-bg: #f6f4ed;
  --phone-chrome: #ecead9;
  --phone-width: 340px;
  --phone-height: 690px;
  --phone-radius: 46px;
  --screen-radius: 38px;
  --font-display: 'Outfit', sans-serif;
  --font-sans: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* HUD Aesthetics Variables mapped to global tokens */
  --hud-bg-dark: var(--paper);
  --hud-card-bg: rgba(255, 255, 255, 0.55);
  --hud-border: var(--rule);
  --hud-border-hover: var(--zr-accent);
  --hud-text: var(--ink);
  --hud-text-muted: var(--ink-2);
  --hud-text-dim: var(--ink-3);
  --arch-bg: rgba(236, 234, 217, 0.35);
}

html[data-theme="dark"] {
  --zr-accent: #00e676; /* Vibrant high-tech neon green */
  --zr-accent-soft: rgba(0, 230, 118, 0.05);
  --zr-accent-glow: rgba(0, 230, 118, 0.35);
  --phone-bg: #070708;
  --phone-chrome: #161518;
  --hud-card-bg: rgba(21, 20, 26, 0.55);
  --hud-border: rgba(255, 255, 255, 0.06);
  --arch-bg: rgba(21, 20, 26, 0.45);
}

html.blueprint {
  --zr-accent: var(--signal); /* Hook into blueprint gold (#ffd166) */
  --zr-accent-soft: rgba(255, 209, 102, 0.06);
  --zr-accent-glow: rgba(255, 209, 102, 0.35);
  --phone-bg: #0a2540;
  --phone-chrome: #133057;
  --hud-card-bg: rgba(19, 48, 87, 0.45);
  --hud-border: rgba(255, 255, 255, 0.08);
  --arch-bg: rgba(19, 48, 87, 0.45);
}

/* Scalable Phone Chassis depending on Viewport Width */
@media (min-width: 1200px) {
  :root {
    --phone-width: clamp(370px, 21vw, 450px);
    --phone-height: calc(var(--phone-width) * 2.03);
  }
}

@media (min-width: 1600px) {
  :root {
    --phone-width: clamp(430px, 24vw, 540px);
    --phone-height: calc(var(--phone-width) * 2.03);
  }
}

/* ===================== LAYOUT CORE OVERRIDES ===================== */
/* Inherits global cream-paper background and engineering grid */

/* Force dark styling across normal blocks */
.crumbs a {
  color: var(--hud-text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  transition: color 0.2s;
}

.crumbs a:hover {
  color: var(--zr-accent);
}

.crumbs .sep {
  color: var(--hud-text-dim);
}

.crumbs .current {
  color: var(--hud-text);
  font-family: var(--font-mono);
  font-size: 11px;
}

/* ===================== HERO LAYOUT ===================== */
.zr-hero {
  padding: 140px 0 160px;
  border-bottom: 1px solid var(--hud-border);
  position: relative;
  overflow: hidden;
}

.page > .block {
  margin: 120px 0 40px; /* Expanded vertical margins for premium breathing room */
}

.zr-hero::before {
  content: "";
  position: absolute;
  top: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(0, 230, 118, 0.04) 0%, transparent 70%);
  z-index: 0;
  pointer-events: none;
}

.zr-hero-grid {
  display: grid;
  grid-template-columns: 1.2fr var(--phone-width);
  gap: 80px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.zr-hero-text {
  display: flex;
  flex-direction: column;
}

.zr-hero-text .block-marker {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--zr-accent);
  letter-spacing: 0.15em;
  margin-bottom: 12px;
}

.zr-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(38px, 4vw, 68px);
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: var(--hud-text);
  margin-top: 12px;
  margin-bottom: 24px;
}

.zr-dot {
  color: var(--zr-accent);
  text-shadow: 0 0 15px var(--zr-accent-glow);
}

.zr-tagline {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--hud-text-muted);
  margin-bottom: 28px;
}

.zr-sub {
  font-size: 15px;
  line-height: 1.7;
  color: var(--hud-text-muted);
  margin-bottom: 48px;
  max-width: 58ch;
}

.zr-hero-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px 32px;
  border-top: 1px dashed var(--hud-border);
  padding-top: 36px;
}

.zr-hero-meta .m-cell {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--font-mono);
}

.zr-hero-meta .m-cell .k {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--hud-text-dim);
  letter-spacing: 0.12em;
}

.zr-hero-meta .m-cell .v {
  font-size: 14px;
  font-weight: 500;
  color: var(--hud-text);
}

.zr-hero-meta .m-cell .v.live {
  color: var(--zr-accent);
  display: flex;
  align-items: center;
  gap: 10px;
}

.zr-hero-meta .m-cell .v.live::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--zr-accent);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--zr-accent);
  animation: livePulse 2s infinite;
}

@keyframes livePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.4; }
}

.zr-param {
  color: var(--zr-accent);
  font-family: var(--font-mono);
  font-weight: 500;
}

/* ===================== SMARTPHONE CHASSIS (OBSIDIAN SATIN) ===================== */
.zr-emulator-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.zr-emulator-container::before {
  content: "";
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: calc(var(--phone-width) * 1.5);
  height: calc(var(--phone-width) * 1.5);
  background: radial-gradient(circle, var(--zr-accent-glow) 0%, rgba(16, 185, 129, 0.02) 50%, transparent 70%);
  z-index: 0;
  pointer-events: none;
  filter: blur(40px);
  opacity: 0.85;
  animation: phoneGlowPulse 4s ease-in-out infinite alternate;
}

@keyframes phoneGlowPulse {
  0% {
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0.6;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 0.9;
  }
}

.phone-frame {
  position: relative;
  width: var(--phone-width);
  height: var(--phone-height);
  background: linear-gradient(135deg, #2b2a30 0%, #121115 50%, #1e1d23 100%);
  border: 11px solid #1f1e24;
  border-radius: var(--phone-radius);
  box-shadow: 
    0 35px 80px -15px rgba(0, 0, 0, 0.5),
    0 15px 35px -10px rgba(0, 0, 0, 0.35),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 2px 4px rgba(255, 255, 255, 0.15),
    0 0 0 1px rgba(0, 0, 0, 0.6);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.5s ease;
  z-index: 10;
}

.phone-frame:hover {
  transform: translateY(-5px);
  box-shadow: 
    0 40px 90px -12px rgba(0, 0, 0, 0.6),
    0 20px 45px -8px rgba(0, 0, 0, 0.45),
    inset 0 0 12px rgba(255, 255, 255, 0.12);
}

/* Phone side buttons - brushed titanium textures */
.side-button {
  position: absolute;
  background: linear-gradient(180deg, #cfced9 0%, #8d8c9c 100%);
  border-radius: 4px;
  z-index: -1;
  cursor: pointer;
  box-shadow: 
    -1px 2px 3px rgba(0,0,0,0.5),
    inset 0 1px 1px rgba(255,255,255,0.05);
  transition: transform 0.12s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease, width 0.12s ease;
}

html[data-theme="dark"] .side-button {
  background: linear-gradient(180deg, #4c4b54 0%, #25242a 100%);
}

html.blueprint .side-button {
  background: linear-gradient(180deg, #3d5a82 0%, #1a3055 100%);
}

.side-button::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}

.side-button:hover {
  background: linear-gradient(180deg, var(--zr-accent) 0%, #00b359 100%);
  box-shadow: 0 0 12px var(--zr-accent-glow);
}

.volume-up {
  left: -13px;
  top: 120px;
  width: 4px;
  height: 52px;
  border-radius: 4px 0 0 4px;
}

.volume-down {
  left: -13px;
  top: 188px;
  width: 4px;
  height: 52px;
  border-radius: 4px 0 0 4px;
}

.power-btn {
  right: -13px;
  top: 150px;
  width: 4px;
  height: 80px;
  border-radius: 0 4px 4px 0;
}

/* Active Press Animations */
.volume-up:active {
  transform: translateX(2px) scaleY(0.96);
}

.volume-down:active {
  transform: translateX(2px) scaleY(0.96);
}

.power-btn:active {
  transform: translateX(-2px) scaleY(0.97);
}

.side-button.btn-pressed {
  background: var(--zr-accent);
}

/* Phone Screen Container */
.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--phone-bg);
  border-radius: var(--screen-radius);
  overflow: hidden;
  border: 4px solid #000;
  box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.9);
}

/* Glass glare reflection overlay */
.phone-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.005) 45%, transparent 45%);
  pointer-events: none;
  z-index: 25;
}

/* Dynamic Island/Notch */
.dynamic-island {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 25px;
  background: #000;
  border-radius: 12px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 14px;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.camera-lens {
  width: 8px;
  height: 8px;
  background: radial-gradient(circle at 30% 30%, #4facfe 0%, #001233 80%);
  border-radius: 50%;
  margin-right: 8px;
  box-shadow: 
    inset 0 0 3px rgba(255, 255, 255, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.15);
  position: relative;
}

.camera-lens::before {
  content: "";
  position: absolute;
  top: 1px;
  left: 1px;
  width: 2.5px;
  height: 2.5px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  filter: blur(0.2px);
}

.speaker-grille {
  width: 36px;
  height: 3px;
  background: #111;
  border-radius: 1.5px;
}

/* Screen status bar */
.phone-status-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40px;
  padding: 10px 22px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 18;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  pointer-events: none;
}

.status-time {
  letter-spacing: -0.01em;
  font-weight: 600;
}

.status-icons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-icon {
  width: 13px;
  height: 13px;
}

.lte-text {
  font-size: 9px;
  font-weight: bold;
}

.battery-icon {
  display: flex;
  align-items: center;
}

.battery-body {
  width: 19px;
  height: 10px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 2px;
  padding: 1px;
  display: flex;
  align-items: center;
}

.battery-level {
  height: 100%;
  background: var(--zr-accent);
  border-radius: 0.5px;
}

.battery-tip {
  width: 1.5px;
  height: 3px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 0 1px 1px 0;
  margin-left: 0.5px;
}

/* Minimalist Lock Screen Overlay (Glassmorphism Blur) */
.phone-sleep-overlay {
  position: absolute;
  inset: 0;
  background: rgba(6, 6, 8, 0.45);
  backdrop-filter: blur(28px) saturate(1.9);
  -webkit-backdrop-filter: blur(28px) saturate(1.9);
  z-index: 19;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 85px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.45s ease;
  pointer-events: none;
}

.phone-sleep-overlay.overlay-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.sleep-time {
  font-family: var(--font-display);
  font-size: clamp(48px, 3.5vw, 68px);
  font-weight: 200;
  color: #fff;
  line-height: 1;
  letter-spacing: -0.03em;
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.08);
  transform: scale(0.85) translateY(-10px);
  opacity: 0;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.5s ease;
}

.sleep-date {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  color: var(--hud-text-muted);
  margin-top: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transform: translateY(-8px);
  opacity: 0;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.05s, opacity 0.5s ease 0.05s;
}

.unlock-hint {
  position: absolute;
  bottom: 80px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--zr-accent);
  text-shadow: 0 0 10px var(--zr-accent-glow);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  transform: translateY(10px);
  opacity: 0;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s, opacity 0.5s ease 0.1s;
}

.phone-sleep-overlay.overlay-active .sleep-time,
.phone-sleep-overlay.overlay-active .sleep-date {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.phone-sleep-overlay.overlay-active .unlock-hint {
  transform: translateY(0);
  opacity: 1;
  animation: pulseUnlock 2.2s ease-in-out infinite;
}

@keyframes pulseUnlock {
  0%, 100% { opacity: 0.35; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-2px); }
}

/* App IFrame in Phone Screen */
.app-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: var(--screen-radius);
  overflow: hidden;
  padding-top: 40px;
  padding-bottom: 12px;
  background: #fdfdfd;
  transition: filter 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

html[data-theme="dark"] .app-iframe {
  background: #070708;
}

.screen-asleep .app-iframe {
  filter: brightness(0);
}

/* App preview placeholder (kept as graceful fallback styling, no longer used by markup) */
.app-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--screen-radius);
  overflow: hidden;
  padding: 44px 14px 24px;
  background: linear-gradient(180deg, #fdfdfd 0%, #f3f1ea 100%);
  display: flex;
  flex-direction: column;
  transition: filter 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.45s ease;
  z-index: 5;
}

html[data-theme="dark"] .app-preview {
  background: linear-gradient(180deg, #0d0d10 0%, #060608 100%);
}

.screen-asleep .app-preview {
  filter: brightness(0);
  opacity: 0;
}

.app-preview-inner {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}

.app-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hud-text-dim);
  padding: 4px 6px 8px;
  border-bottom: 1px dashed var(--hud-border);
}

.app-preview-mark {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--zr-accent);
  font-weight: 600;
}

.app-preview-mark .dot {
  width: 6px;
  height: 6px;
  background: var(--zr-accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--zr-accent-glow);
  animation: previewDot 2s ease-in-out infinite;
}

@keyframes previewDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(0.85); }
}

.app-preview-greeting {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 6px 0;
}

.app-preview-time {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--hud-text);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.app-preview-hello {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  color: var(--hud-text);
  letter-spacing: -0.01em;
}

.app-preview-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--hud-text-dim);
  letter-spacing: 0.04em;
}

.app-preview-tiles {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-content: start;
  margin-top: 4px;
}

.ap-tile {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--hud-border);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.35s ease, box-shadow 0.35s ease;
}

html[data-theme="dark"] .ap-tile {
  background: rgba(255, 255, 255, 0.04);
}

.ap-tile:hover {
  transform: translateY(-2px);
  border-color: var(--zr-accent);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.ap-tile-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ap-icon {
  width: 22px;
  height: 22px;
  color: var(--hud-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ap-icon svg {
  width: 100%;
  height: 100%;
}

.ap-tile-toggle {
  position: relative;
  width: 24px;
  height: 14px;
  background: rgba(0, 0, 0, 0.12);
  border-radius: 7px;
  transition: background 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

html[data-theme="dark"] .ap-tile-toggle {
  background: rgba(255, 255, 255, 0.12);
}

.ap-tile-toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.ap-tile-toggle.on {
  background: var(--zr-accent);
}

.ap-tile-toggle.on::after {
  transform: translateX(10px);
}

.ap-tile-name {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  color: var(--hud-text);
  line-height: 1.2;
}

.ap-tile-state {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--hud-text-dim);
  letter-spacing: 0.04em;
}

.app-preview-footer {
  position: relative;
  margin-top: auto;
  padding: 10px 6px 4px;
  text-align: center;
}

.app-preview-stripe {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background-image: repeating-linear-gradient(
    90deg,
    var(--zr-accent) 0 6px,
    transparent 6px 12px
  );
  opacity: 0.65;
}

.app-preview-cta {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--zr-accent);
  font-weight: 600;
}

/* Home Indicator Bar */
.home-indicator {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 115px;
  height: 4px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 2px;
  z-index: 18;
  pointer-events: none;
}

.emulator-caption {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
  color: var(--hud-text-muted);
  margin-top: 24px;
  max-width: var(--phone-width);
  text-align: center;
}

.emulator-caption b {
  color: var(--hud-text);
  font-weight: 600;
}

/* ===================== INTERACTIVE SVG DIAGRAM (DATAFLOW) ===================== */
.zr-arch-svg {
  width: 100%;
  height: auto;
  border: 1px solid var(--hud-border);
  background: var(--arch-bg) !important;
  border-radius: 16px;
  padding: 40px;
  margin-top: 24px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 
    0 20px 45px rgba(0, 0, 0, 0.15),
    inset 0 0 24px rgba(255,255,255,0.02);
}

.zr-arch-svg .arch-node rect {
  fill: var(--paper-2);
  stroke: var(--rule);
  stroke-width: 1px;
  transition: fill 0.35s cubic-bezier(0.16, 1, 0.3, 1), stroke 0.35s ease, stroke-width 0.35s ease, filter 0.35s ease, opacity 0.35s ease;
}

.zr-arch-svg .arch-node .n-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  fill: var(--hud-text);
  letter-spacing: -0.01em;
}

.zr-arch-svg .arch-node .n-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  fill: var(--hud-text-muted);
}

.zr-arch-svg .arch-node .n-pin {
  font-family: var(--font-mono);
  font-size: 9px;
  fill: var(--hud-text-dim);
}

/* Node customized colors (Dark theme harmonized HUD style) */
.zr-arch-svg #node-app rect {
  fill: var(--zr-accent-soft);
  stroke: var(--zr-accent);
  stroke-width: 1.5px;
}

.zr-arch-svg #node-firebase rect {
  fill: rgba(255, 145, 0, 0.05);
  stroke: #ff9100;
}

.zr-arch-svg #node-ble rect {
  fill: rgba(41, 121, 255, 0.05);
  stroke: #2979ff;
}

.zr-arch-svg #node-mqtt rect {
  fill: var(--zr-accent-soft);
  stroke: var(--zr-accent);
}

.zr-arch-svg #node-devices rect {
  fill: var(--zr-accent-soft);
  stroke: var(--zr-accent);
}

/* Node hover animations - microchip glow card effect */
.zr-arch-svg .arch-node:hover rect {
  stroke-width: 2px !important;
  fill: var(--paper-3) !important;
  stroke: var(--zr-accent) !important;
  filter: drop-shadow(0 0 10px var(--zr-accent-glow));
}

.zr-arch-svg #node-firebase:hover rect { stroke: #ff9100 !important; filter: drop-shadow(0 0 10px rgba(255, 145, 0, 0.25)); }
.zr-arch-svg #node-ble:hover rect { stroke: #2979ff !important; filter: drop-shadow(0 0 10px rgba(41, 121, 255, 0.25)); }
.zr-arch-svg #node-mqtt:hover rect { stroke: var(--zr-accent) !important; filter: drop-shadow(0 0 10px var(--zr-accent-glow)); }

/* Monoline Circuit Signal Connections */
.zr-arch-svg .arch-line {
  fill: none;
  stroke: var(--rule);
  stroke-width: 1.5px;
  transition: stroke 0.35s ease, stroke-width 0.35s ease, opacity 0.35s ease;
}

.zr-arch-svg .arch-line.dashed {
  stroke-dasharray: 4 4;
}

.zr-arch-svg .arch-line.signal {
  stroke: var(--ink-4);
  stroke-dasharray: 8 16;
  animation: neonFlow 8s linear infinite;
}

/* Travelling Neon Pulse Streams keyframes loop */
@keyframes neonFlow {
  0% {
    stroke-dashoffset: 60;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

/* Active Highlight Stream on Hover */
.zr-arch-svg .line-highlight {
  stroke: var(--zr-accent) !important;
  stroke-width: 3.5px !important;
  stroke-dasharray: 8 10 !important;
  animation: neonFlow 1s linear infinite !important;
  filter: drop-shadow(0 0 10px var(--zr-accent)) drop-shadow(0 0 3px var(--zr-accent));
}

/* Dimmed background paths when other nodes are highlighted */
.zr-arch-svg .line-dimmed {
  opacity: 0.08 !important;
}

.zr-arch-svg .node-dimmed rect {
  opacity: 0.2 !important;
}

.zr-arch-svg .node-dimmed text {
  opacity: 0.2 !important;
}

/* Connecting Arrow Labels */
.zr-arch-svg .e-label-bg {
  fill: var(--paper-3);
  stroke: var(--rule);
  stroke-width: 1px;
}

.zr-arch-svg .arch-edge {
  font-family: var(--font-mono);
  font-size: 9px;
  fill: var(--hud-text-muted);
}

.zr-arch-svg .arch-edge.sig {
  fill: var(--zr-accent);
}

/* Legend items in dashboard style */
.zr-arch-svg .arch-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 28px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--hud-text-muted);
  justify-content: center;
  border-top: 1px solid var(--hud-border);
  padding-top: 20px;
}

.zr-arch-svg .arch-legend .lg {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.zr-arch-svg .arch-legend .sw {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

.zr-arch-svg .arch-legend .sw.box-app { background: var(--zr-accent); box-shadow: 0 0 5px var(--zr-accent); }
.zr-arch-svg .arch-legend .sw.box-cloud { background: #ff9100; box-shadow: 0 0 5px rgba(255, 145, 0, 0.8); }
.zr-arch-svg .arch-legend .sw.box-api { background: #2979ff; box-shadow: 0 0 5px rgba(41, 121, 255, 0.8); }
.zr-arch-svg .arch-legend .sw.box-mqtt { background: #00e676; box-shadow: 0 0 5px rgba(0, 230, 118, 0.8); }
.zr-arch-svg .arch-legend .sw.box-hw { background: var(--zr-accent); }
.zr-arch-svg .arch-legend .sw.line { width: 16px; height: 2px; background: rgba(255,255,255,0.2); border-radius: 0; }
.zr-arch-svg .arch-legend .sw.line.dashed { background: transparent; border-top: 2px dashed rgba(255,255,255,0.2); }

/* ===================== BENTO GRID FEATURES ===================== */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px; /* Expanded gap for premium feel */
  margin-top: 24px;
}

.bento-cell {
  background: var(--hud-card-bg);
  border: 1px solid var(--hud-border);
  border-radius: 16px;
  padding: 44px; /* Generous cell padding */
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 
    inset 0 1px 1px rgba(255, 255, 255, 0.05),
    0 4px 12px rgba(0, 0, 0, 0.05);
}

.bento-cell::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.02) 40%, transparent 60%);
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.5s ease;
}

.bento-cell:hover {
  transform: translateY(-8px) scale(1.025);
  border-color: var(--zr-accent);
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.45),
    0 0 20px var(--zr-accent-glow),
    inset 0 1px 2px rgba(255, 255, 255, 0.15);
}

.bento-cell .fg-num {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--zr-accent);
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 24px;
}

.bento-cell .fg-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--zr-accent);
  margin-bottom: 24px;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s;
}

.bento-cell:hover .fg-icon {
  transform: scale(1.1) rotate(3deg);
  background: rgba(0, 230, 118, 0.06);
  border-color: rgba(0, 230, 118, 0.15);
}

.bento-cell h4 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--hud-text);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.bento-cell p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--hud-text-muted);
}

/* ===================== COMPANION PANELS SECTION ===================== */
.zr-pages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px; /* Expanded grid gap */
  margin-top: 24px;
}

.zr-page-card {
  background: var(--hud-card-bg);
  border: 1px solid var(--hud-border);
  border-radius: 14px;
  padding: 36px; /* Expanded padding */
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
  box-shadow: 
    inset 0 1px 1px rgba(255, 255, 255, 0.05),
    0 4px 10px rgba(0, 0, 0, 0.05);
}

.zr-page-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
  pointer-events: none;
}

.zr-page-card:hover {
  transform: translateY(-8px) scale(1.03);
  border-color: var(--zr-accent);
  box-shadow: 
    0 22px 45px rgba(0, 0, 0, 0.4),
    0 0 18px var(--zr-accent-glow),
    inset 0 1px 2px rgba(255, 255, 255, 0.15);
}

.zr-page-card h5 {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  color: var(--zr-accent);
  margin-bottom: 16px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.zr-page-card p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--hud-text-muted);
}

/* ===================== COMPANION LINKS GRID ===================== */
.zr-links-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px; /* Generous gap between large action link cards */
  margin-top: 24px;
}

.zr-link-card {
  display: flex;
  flex-direction: column;
  padding: 44px; /* Premium breathing space */
  background: var(--hud-card-bg);
  border: 1px solid var(--hud-border);
  border-radius: 16px;
  position: relative;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
  box-shadow: 
    inset 0 1px 1px rgba(255, 255, 255, 0.05),
    0 6px 16px rgba(0, 0, 0, 0.05);
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.4s ease;
}

.zr-link-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
  pointer-events: none;
}

.zr-link-card .arrow {
  position: absolute;
  top: 36px;
  right: 36px;
  font-size: 18px;
  color: var(--hud-text-dim);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), color 0.3s ease;
}

.zr-link-card:hover .arrow {
  transform: translateX(8px);
  color: var(--zr-accent);
}

.zr-link-card .idx {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--zr-accent);
  margin-bottom: 16px;
  letter-spacing: 0.12em;
  font-weight: 500;
}

.zr-link-card h4 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
  color: var(--hud-text);
}

.zr-link-card p {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--hud-text-muted);
  max-width: 44ch;
}

.zr-link-card:hover {
  transform: translateY(-10px) scale(1.02);
  border-color: var(--zr-accent);
  background: radial-gradient(circle at top right, var(--zr-accent-soft) 0%, var(--hud-card-bg) 65%);
  box-shadow: 
    0 30px 60px rgba(0, 0, 0, 0.5),
    0 0 25px var(--zr-accent-glow),
    inset 0 1px 2px rgba(255, 255, 255, 0.15);
}

/* ===================== FOOTER / HUDS OVERRIDES ===================== */
.footer {
  border-top: 1px solid var(--hud-border) !important;
  color: var(--hud-text-dim) !important;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  padding: 60px 0 100px !important;
}

.hud {
  background: rgba(10, 9, 12, 0.8) !important;
  border-top: 1px solid var(--hud-border) !important;
  color: var(--hud-text-muted) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
}

.hud .cell .live {
  background: var(--zr-accent) !important;
  box-shadow: 0 0 8px var(--zr-accent) !important;
}

.hud .cell .k {
  color: var(--hud-text-dim) !important;
}

.hud .cell .v {
  color: var(--hud-text) !important;
  font-family: var(--font-mono) !important;
}

/* Adjust general block heads */
.block-head {
  border-bottom: 1px dashed var(--hud-border) !important;
  margin-bottom: 40px !important;
}

.bh-row .bh-marker {
  font-family: var(--font-mono) !important;
  color: var(--zr-accent) !important;
  letter-spacing: 0.15em !important;
}

.bh-row .bh-meta {
  font-family: var(--font-mono) !important;
  color: var(--hud-text-dim) !important;
}

.bh-title {
  font-family: var(--font-display) !important;
  font-weight: 700 !important;
  color: var(--hud-text) !important;
  font-size: clamp(28px, 3.2vw, 44px) !important;
  letter-spacing: -0.03em !important;
  margin-bottom: 16px !important;
}

.bh-lede {
  color: var(--hud-text-muted) !important;
  font-size: 15px !important;
  line-height: 1.6 !important;
}

.two-col-prose p {
  color: var(--hud-text-muted) !important;
  font-size: 14.5px !important;
  line-height: 1.7 !important;
}

/* ===================== RESPONSIVE SHIFTS ===================== */
@media (max-width: 1024px) {
  .zr-hero-grid {
    grid-template-columns: 1fr;
    gap: 56px;
    justify-items: center;
  }

  .zr-hero-text {
    align-items: center;
    text-align: center;
    max-width: 600px;
  }

  .zr-hero-meta {
    width: 100%;
    max-width: 500px;
  }
  
  .zr-sub {
    margin-bottom: 32px;
  }

  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .zr-links-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 768px) {
  .zr-hero {
    padding: 60px 0 80px;
  }
  
  .zr-hero-meta {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .bento-grid {
    grid-template-columns: 1fr;
  }
  
  .zr-arch-svg {
    padding: 20px;
  }
}

@media (max-width: 400px) {
  :root {
    --phone-width: 280px;
    --phone-height: 570px;
    --phone-radius: 38px;
    --screen-radius: 30px;
  }
  
  .dynamic-island {
    width: 90px;
    height: 22px;
  }
  
  .phone-status-bar {
    height: 34px;
    padding: 8px 16px 0;
  }
  
  .app-iframe {
    padding-top: 34px;
  }
  .app-preview {
    padding-top: 38px;
  }

  .bento-cell, .zr-page-card, .zr-link-card {
    padding: 24px;
  }
}
