/* ==========================================================================
   CatsHome Inc. — Cyber Aurora Glassmorphism Portal Stylesheet
   ========================================================================== */

@property --border-angle {
  syntax: "<angle>";
  initial-value: 135deg;
  inherits: false;
}

:root {
  --bg-base: #040711;
  --bg-elevated: #0a1024;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --emerald: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.45);

  /* Default theme tokens (aurora) */
  --accent-1: #22d3ee;
  --accent-2: #818cf8;
  --accent-3: #e879f9;
  --accent-rgb-1: 34, 211, 238;
  --accent-rgb-2: 129, 140, 248;
  --accent-rgb-3: 232, 121, 249;

  --orb-1: rgba(34, 211, 238, 0.22);
  --orb-2: rgba(129, 140, 248, 0.24);
  --orb-3: rgba(232, 121, 249, 0.16);
  --grid-color: rgba(56, 189, 248, 0.16);

  --card-bg: linear-gradient(155deg, rgba(13, 20, 38, 0.8), rgba(6, 11, 25, 0.9));
  --card-border-subtle: rgba(148, 163, 184, 0.18);
  --card-shadow: 0 24px 60px -18px rgba(0, 0, 0, 0.75), 0 0 36px -14px rgba(var(--accent-rgb-1), 0.18);

  --font-display: "Outfit", "Noto Sans TC", system-ui, -apple-system, sans-serif;
  --font-body: "Noto Sans TC", "Outfit", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
}

html[data-theme="aurora"] {
  --accent-1: #22d3ee;
  --accent-2: #818cf8;
  --accent-3: #e879f9;
  --accent-rgb-1: 34, 211, 238;
  --accent-rgb-2: 129, 140, 248;
  --accent-rgb-3: 232, 121, 249;
  --orb-1: rgba(34, 211, 238, 0.22);
  --orb-2: rgba(129, 140, 248, 0.24);
  --orb-3: rgba(232, 121, 249, 0.16);
  --grid-color: rgba(56, 189, 248, 0.17);
}

html[data-theme="nebula"] {
  --accent-1: #fb7185;
  --accent-2: #c084fc;
  --accent-3: #fbbf24;
  --accent-rgb-1: 251, 113, 133;
  --accent-rgb-2: 192, 132, 252;
  --accent-rgb-3: 251, 191, 36;
  --orb-1: rgba(251, 113, 133, 0.22);
  --orb-2: rgba(192, 132, 252, 0.24);
  --orb-3: rgba(251, 191, 36, 0.15);
  --grid-color: rgba(244, 114, 182, 0.16);
}

html[data-theme="quantum"] {
  --accent-1: #2dd4bf;
  --accent-2: #38bdf8;
  --accent-3: #34d399;
  --accent-rgb-1: 45, 212, 191;
  --accent-rgb-2: 56, 189, 248;
  --accent-rgb-3: 52, 211, 153;
  --orb-1: rgba(45, 212, 191, 0.22);
  --orb-2: rgba(56, 189, 248, 0.24);
  --orb-3: rgba(52, 211, 153, 0.16);
  --grid-color: rgba(45, 212, 191, 0.17);
}

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

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  overflow-x: hidden;
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color-scheme: dark;
}

.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;
}

/* ==========================================================================
   Background Engine: Canvas + Aurora Orbs + Perspective Cyber Grid
   ========================================================================== */

.bg-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 55% at 50% -10%, rgba(var(--accent-rgb-2), 0.18), transparent 70%),
    radial-gradient(circle at 15% 85%, rgba(var(--accent-rgb-1), 0.1), transparent 55%),
    radial-gradient(circle at 85% 80%, rgba(var(--accent-rgb-3), 0.1), transparent 55%),
    var(--bg-base);
  transition: background 0.6s ease;
}

#bg-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.aurora-layer {
  position: absolute;
  inset: -15%;
  opacity: 0.92;
  pointer-events: none;
}

.aurora-orb {
  position: absolute;
  border-radius: 9999px;
  transition: background 0.65s ease;
}

.aurora-orb--1 {
  width: 52vw;
  height: 52vw;
  max-width: 720px;
  max-height: 720px;
  top: -14%;
  left: 4%;
  background: radial-gradient(
    circle closest-side,
    rgba(var(--accent-rgb-1), 0.22) 0%,
    rgba(var(--accent-rgb-1), 0.11) 42%,
    rgba(var(--accent-rgb-1), 0.03) 75%,
    transparent 100%
  );
  animation: orbFloat1 18s ease-in-out infinite alternate;
}

.aurora-orb--2 {
  width: 56vw;
  height: 56vw;
  max-width: 780px;
  max-height: 780px;
  top: 14%;
  right: 0%;
  background: radial-gradient(
    circle closest-side,
    rgba(var(--accent-rgb-2), 0.24) 0%,
    rgba(var(--accent-rgb-2), 0.12) 42%,
    rgba(var(--accent-rgb-2), 0.03) 75%,
    transparent 100%
  );
  animation: orbFloat2 22s ease-in-out infinite alternate;
}

.aurora-orb--3 {
  width: 48vw;
  height: 48vw;
  max-width: 640px;
  max-height: 640px;
  bottom: -16%;
  left: 28%;
  background: radial-gradient(
    circle closest-side,
    rgba(var(--accent-rgb-3), 0.18) 0%,
    rgba(var(--accent-rgb-3), 0.08) 42%,
    rgba(var(--accent-rgb-3), 0.02) 75%,
    transparent 100%
  );
  animation: orbFloat3 20s ease-in-out infinite alternate;
}

.cyber-grid {
  position: absolute;
  inset: auto 0 0 0;
  height: 44vh;
  perspective: 520px;
  overflow: hidden;
  mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.35) 55%, transparent 100%);
  -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.35) 55%, transparent 100%);
}

.cyber-grid__plane {
  position: absolute;
  inset: -56px -25% 0 -25%;
  background-image:
    linear-gradient(to right, var(--grid-color) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-color) 1px, transparent 1px);
  background-size: 56px 56px;
  transform: rotateX(68deg);
  transform-origin: center bottom;
  animation: gridFlow 12s linear infinite;
}

.cyber-grid__scanline {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(var(--accent-rgb-1), 0.08) 50%,
    transparent 100%
  );
  height: 120px;
  animation: scanSweep 9s ease-in-out infinite;
}

.vignette-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 45%, transparent 45%, rgba(3, 6, 16, 0.78) 100%);
}

/* ==========================================================================
   Page Layout Shell
   ========================================================================== */

.page-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(1.1rem, 2.5vw, 2rem) clamp(1rem, 3vw, 2rem) clamp(1.25rem, 2.5vw, 1.75rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(1.25rem, 2.8vh, 2.2rem);
}

/* Choreographed Entrance */
.anim-in {
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUpIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--delay, 0s);
}

/* ==========================================================================
   Top HUD Bar
   ========================================================================== */

.hud-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.95rem;
  border-radius: 9999px;
  background: rgba(10, 17, 36, 0.82);
  border: 1px solid rgba(16, 185, 129, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.6), 0 0 20px -8px var(--emerald-glow);
}

.sonar-dot {
  position: relative;
  width: 10px;
  height: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sonar-dot__core {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: var(--emerald);
  box-shadow: 0 0 10px var(--emerald);
}

.sonar-dot__ring {
  position: absolute;
  inset: -4px;
  border-radius: 9999px;
  border: 1.5px solid var(--emerald);
  opacity: 0;
  animation: sonarPulse 2.4s cubic-bezier(0.2, 0.8, 0.4, 1) infinite;
}

.sonar-dot__ring--2 {
  animation-delay: 1.2s;
}

.status-pill__text {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #a7f3d0;
}

.hud-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.6rem;
  border-radius: 9999px;
  background: rgba(10, 17, 36, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.16);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.hud-telemetry {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.hud-telemetry__clock {
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.hud-telemetry__sep {
  color: var(--text-muted);
}

.hud-divider {
  width: 1px;
  height: 16px;
  background: rgba(148, 163, 184, 0.2);
}

.theme-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.theme-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 23, 42, 0.75);
  width: 24px;
  height: 24px;
  border-radius: 9999px;
  padding: 3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.theme-btn:hover {
  transform: scale(1.1);
}

.theme-btn[aria-pressed="true"] {
  border-color: rgba(255, 255, 255, 0.75);
  box-shadow: 0 0 12px rgba(var(--accent-rgb-1), 0.55);
}

.theme-btn__swatch {
  width: 100%;
  height: 100%;
  border-radius: 9999px;
}

.theme-btn__swatch--aurora {
  background: linear-gradient(135deg, #22d3ee, #818cf8, #e879f9);
}

.theme-btn__swatch--nebula {
  background: linear-gradient(135deg, #fb7185, #c084fc, #fbbf24);
}

.theme-btn__swatch--quantum {
  background: linear-gradient(135deg, #2dd4bf, #38bdf8, #34d399);
}

.motion-btn {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.7);
  color: var(--text-secondary);
  border-radius: 9999px;
  padding: 0.26rem 0.62rem;
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.motion-btn:hover {
  color: var(--text-primary);
  border-color: rgba(var(--accent-rgb-1), 0.5);
}

.motion-btn[data-motion-mode="full"] {
  color: var(--accent-1);
  border-color: rgba(var(--accent-rgb-1), 0.34);
}

.motion-btn[data-motion-mode="lite"] {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.36);
  background: rgba(16, 185, 129, 0.12);
}

.motion-btn[data-motion-mode="reduced"] {
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.45);
  border-color: rgba(148, 163, 184, 0.22);
}

.motion-btn__icon {
  width: 13px;
  height: 13px;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  padding: 0.25rem 0;
}

.hero__brand-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.85rem, 2vw, 1.35rem);
}

.cyber-emblem {
  position: relative;
  width: clamp(64px, 7vw, 76px);
  height: clamp(64px, 7vw, 76px);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.cyber-emblem:hover {
  transform: translateY(-2px) scale(1.04);
}

.cyber-emblem__rings {
  position: absolute;
  inset: -10px;
  width: calc(100% + 20px);
  height: calc(100% + 20px);
  pointer-events: none;
}

.ring-outer {
  transform-origin: 60px 60px;
  animation: spinSlow 24s linear infinite;
}

.ring-inner {
  transform-origin: 60px 60px;
  animation: spinReverse 16s linear infinite;
}

.cyber-emblem:hover .ring-outer {
  animation-duration: 9s;
}

.cyber-emblem:hover .ring-inner {
  animation-duration: 6s;
}

.cyber-emblem__core {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 20px;
  padding: 1.5px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2), var(--accent-3));
  box-shadow:
    0 12px 32px -10px rgba(0, 0, 0, 0.8),
    0 0 28px -6px rgba(var(--accent-rgb-1), 0.45);
  display: grid;
  place-items: center;
}

.cyber-emblem__core::before {
  content: "";
  position: absolute;
  inset: 1.5px;
  border-radius: 18.5px;
  background: radial-gradient(circle at 30% 25%, rgba(30, 41, 59, 0.92), rgba(5, 9, 22, 0.96));
}

.cyber-emblem__cat {
  position: relative;
  z-index: 1;
  width: 66%;
  height: 66%;
  filter: drop-shadow(0 0 10px rgba(var(--accent-rgb-1), 0.38));
}

.cat-eye {
  animation: eyePulse 4.2s ease-in-out infinite;
}

.hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 5.2vw, 3.65rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.06;
  background: linear-gradient(
    115deg,
    #ffffff 0%,
    #e2e8f0 32%,
    var(--accent-1) 58%,
    var(--accent-2) 84%,
    #ffffff 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 26px rgba(var(--accent-rgb-1), 0.22));
}

.hero__subtitle {
  margin: 0;
  font-size: clamp(0.95rem, 1.8vw, 1.12rem);
  font-weight: 400;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
}

/* ==========================================================================
   Main Portal Grid & Cards (Glassmorphism 2.0 + Holo Border + 3D Tilt)
   ========================================================================== */

.portal-main {
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 2.2vh, 1.5rem);
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 2.2vw, 1.5rem);
}

.portal-card,
.quick-card {
  position: relative;
  display: flex;
  text-decoration: none;
  color: inherit;
  border-radius: 22px;
  background: var(--card-bg);
  border: 1px solid var(--card-border-subtle);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.12),
    var(--card-shadow);
  overflow: hidden;
  transform-style: preserve-3d;
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.35s ease,
    box-shadow 0.35s ease;
}

.portal-card {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Holographic rotating conic-gradient border via mask */
.portal-card::before,
.quick-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(
    from var(--border-angle),
    rgba(var(--accent-rgb-1), 0.12) 0deg,
    rgba(var(--accent-rgb-1), 0.9) 70deg,
    rgba(var(--accent-rgb-2), 0.85) 140deg,
    rgba(var(--accent-rgb-3), 0.9) 210deg,
    rgba(var(--accent-rgb-1), 0.12) 300deg,
    rgba(var(--accent-rgb-1), 0.12) 360deg
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0.25;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.portal-card:hover::before,
.portal-card:focus-visible::before,
.quick-card:hover::before,
.quick-card:focus-visible::before,
.portal-card.is-triggered::before,
.quick-card.is-triggered::before {
  opacity: 1;
  animation: holoSpin 4.5s linear infinite;
}

.portal-card:hover,
.quick-card:hover {
  border-color: rgba(var(--accent-rgb-1), 0.35);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.18),
    0 28px 65px -18px rgba(0, 0, 0, 0.85),
    0 0 42px -10px rgba(var(--accent-rgb-1), 0.3);
}

.portal-card.is-triggered,
.quick-card.is-triggered {
  box-shadow:
    0 0 0 2px rgba(var(--accent-rgb-1), 0.7),
    0 0 40px rgba(var(--accent-rgb-1), 0.45);
}

/* Mouse-following spotlight */
.card-spotlight {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    420px circle at var(--mx, 50%) var(--my, 50%),
    rgba(var(--accent-rgb-1), 0.16),
    rgba(var(--accent-rgb-2), 0.06) 40%,
    transparent 70%
  );
  transition: opacity 0.3s ease;
}

.portal-card:hover .card-spotlight,
.quick-card:hover .card-spotlight {
  opacity: 1;
}

/* Specular shimmer sweep */
.card-shimmer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    112deg,
    transparent 30%,
    rgba(255, 255, 255, 0.08) 48%,
    rgba(var(--accent-rgb-1), 0.12) 52%,
    transparent 68%
  );
  transform: translateX(-120%);
  transition: transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

.portal-card:hover .card-shimmer {
  transform: translateX(120%);
}

.portal-card {
  flex-direction: column;
  justify-content: space-between;
  gap: 1.35rem;
  padding: clamp(1.35rem, 2.5vw, 1.85rem);
  min-height: 248px;
}

.portal-card__top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.icon-badge {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  position: relative;
  border: 1px solid rgba(var(--accent-rgb-1), 0.32);
  background: linear-gradient(145deg, rgba(var(--accent-rgb-1), 0.18), rgba(var(--accent-rgb-2), 0.08));
  color: var(--accent-1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 10px 24px -10px rgba(var(--accent-rgb-1), 0.4);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
}

.icon-badge--mail {
  border-color: rgba(var(--accent-rgb-2), 0.34);
  background: linear-gradient(145deg, rgba(var(--accent-rgb-2), 0.2), rgba(var(--accent-rgb-3), 0.08));
  color: var(--accent-2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 10px 24px -10px rgba(var(--accent-rgb-2), 0.4);
}

.icon-badge svg {
  width: 28px;
  height: 28px;
}

.portal-card:hover .icon-badge {
  transform: translateY(-2px) scale(1.06);
}

.led-blink {
  animation: ledFlash 2.6s ease-in-out infinite;
}

.led-blink--delay {
  animation-delay: 1.3s;
}

.mail-pulse {
  animation: mailDot 2.8s ease-in-out infinite;
}

.card-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.protocol-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.72rem;
  border-radius: 9999px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--accent-1);
  background: rgba(var(--accent-rgb-1), 0.1);
  border: 1px solid rgba(var(--accent-rgb-1), 0.28);
}

.protocol-badge--mail {
  color: var(--accent-2);
  background: rgba(var(--accent-rgb-2), 0.12);
  border-color: rgba(var(--accent-rgb-2), 0.3);
}

.protocol-badge__dot {
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.kbd-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.22);
  transition: color 0.25s ease, border-color 0.25s ease;
}

.portal-card:hover .kbd-hint,
.quick-card:hover .kbd-hint {
  color: var(--text-primary);
  border-color: rgba(var(--accent-rgb-1), 0.45);
}

.portal-card__body {
  position: relative;
  z-index: 1;
}

.portal-card__title {
  margin: 0 0 0.55rem 0;
  font-family: var(--font-display);
  font-size: clamp(1.32rem, 2.2vw, 1.55rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.portal-card__desc {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

.portal-card__footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.95rem;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.portal-card__label {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Animated optical signal bars */
.eq-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 12px;
}

.eq-bars span {
  width: 2.5px;
  border-radius: 2px;
  background: var(--accent-1);
  opacity: 0.7;
  animation: eqWave 1.4s ease-in-out infinite;
}

.eq-bars--alt span {
  background: var(--accent-2);
}

.eq-bars span:nth-child(1) { height: 4px; animation-delay: 0s; }
.eq-bars span:nth-child(2) { height: 10px; animation-delay: 0.25s; }
.eq-bars span:nth-child(3) { height: 6px; animation-delay: 0.5s; }
.eq-bars span:nth-child(4) { height: 12px; animation-delay: 0.75s; }

.portal-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: color 0.25s ease;
}

.portal-card:hover .portal-card__cta {
  color: var(--accent-1);
}

.arrow-icon {
  width: 17px;
  height: 17px;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.portal-card:hover .arrow-icon {
  transform: translateX(4px);
}

/* ==========================================================================
   Quick Access Dock
   ========================================================================== */

.quick-dock {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: clamp(0.95rem, 2vw, 1.2rem);
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(12, 19, 38, 0.78), rgba(6, 10, 22, 0.88));
  border: 1px solid rgba(148, 163, 184, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 18px 40px -18px rgba(0, 0, 0, 0.7);
}

.quick-dock__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0 0.25rem;
}

.quick-dock__title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.quick-dock__bolt {
  width: 17px;
  height: 17px;
  color: var(--accent-1);
  filter: drop-shadow(0 0 8px rgba(var(--accent-rgb-1), 0.65));
}

.quick-dock__title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.quick-dock__hint {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.quick-dock__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.quick-card {
  border-radius: 16px;
  padding: 0.9rem 1rem;
  align-items: center;
  gap: 0.85rem;
  background: linear-gradient(155deg, rgba(17, 26, 48, 0.72), rgba(9, 14, 30, 0.84));
}

.quick-card__icon {
  position: relative;
  z-index: 1;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--accent-1);
  background: rgba(var(--accent-rgb-1), 0.1);
  border: 1px solid rgba(var(--accent-rgb-1), 0.25);
  transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease;
}

.quick-card:nth-child(2) .quick-card__icon {
  color: var(--accent-2);
  background: rgba(var(--accent-rgb-2), 0.12);
  border-color: rgba(var(--accent-rgb-2), 0.28);
}

.quick-card:nth-child(3) .quick-card__icon {
  color: var(--accent-3);
  background: rgba(var(--accent-rgb-3), 0.12);
  border-color: rgba(var(--accent-rgb-3), 0.28);
}

.quick-card__icon svg {
  width: 20px;
  height: 20px;
}

.quick-card:hover .quick-card__icon {
  transform: scale(1.08);
}

.quick-card__info {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.16rem;
  min-width: 0;
  flex: 1;
}

.quick-card__name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-card__sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-card__right {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.quick-card__arrow {
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  transition: transform 0.25s ease, color 0.25s ease;
}

.quick-card:hover .quick-card__arrow {
  color: var(--accent-1);
  transform: translate(2px, -2px);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding-top: 0.35rem;
}

.site-footer__line {
  width: 100%;
  height: 1px;
  margin-bottom: 0.65rem;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(var(--accent-rgb-1), 0.35) 30%,
    rgba(var(--accent-rgb-2), 0.45) 50%,
    rgba(var(--accent-rgb-3), 0.35) 70%,
    transparent 100%
  );
}

.site-footer__copy {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.site-footer__copy strong {
  color: var(--text-primary);
  font-weight: 600;
}

.site-footer__arch {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

/* ==========================================================================
   Focus Visibility & Accessibility
   ========================================================================== */

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent-1);
  outline-offset: 3px;
}

/* ==========================================================================
   Keyframes
   ========================================================================== */

@keyframes fadeUpIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes orbFloat1 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(6vw, 5vh) scale(1.12); }
}

@keyframes orbFloat2 {
  0% { transform: translate(0, 0) scale(1.05); }
  100% { transform: translate(-7vw, -4vh) scale(0.92); }
}

@keyframes orbFloat3 {
  0% { transform: translate(0, 0) scale(0.95); }
  100% { transform: translate(5vw, -6vh) scale(1.1); }
}

@keyframes gridFlow {
  0% { transform: rotateX(68deg) translate3d(0, 0, 0); }
  100% { transform: rotateX(68deg) translate3d(0, 56px, 0); }
}

@keyframes scanSweep {
  0%, 100% { transform: translateY(-100%); opacity: 0; }
  50% { transform: translateY(340%); opacity: 0.85; }
}

@keyframes sonarPulse {
  0% { transform: scale(0.75); opacity: 0.85; }
  100% { transform: scale(2.4); opacity: 0; }
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes spinReverse {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

@keyframes eyePulse {
  0%, 100% { opacity: 1; transform: scaleY(1); }
  48% { opacity: 1; transform: scaleY(1); }
  50% { opacity: 0.35; transform: scaleY(0.25); }
  52% { opacity: 1; transform: scaleY(1); }
}

@keyframes textShimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes holoSpin {
  0% { --border-angle: 0deg; }
  100% { --border-angle: 360deg; }
}

@keyframes ledFlash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.28; }
}

@keyframes mailDot {
  0%, 100% { transform: scale(1); opacity: 0.95; }
  50% { transform: scale(1.25); opacity: 0.45; }
}

@keyframes eqWave {
  0%, 100% { transform: scaleY(0.45); }
  50% { transform: scaleY(1); }
}

/* ==========================================================================
   Performance Lite Mode (Software Rendering / No Hardware Acceleration)
   ========================================================================== */

html.perf-lite {
  --card-bg: linear-gradient(155deg, rgba(13, 20, 38, 0.92), rgba(6, 11, 25, 0.96));
}

html.perf-lite .status-pill,
html.perf-lite .hud-controls,
html.perf-lite .portal-card,
html.perf-lite .quick-dock {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

html.perf-lite .status-pill,
html.perf-lite .hud-controls {
  background: rgba(9, 15, 32, 0.94);
}

html.perf-lite .quick-dock {
  background: linear-gradient(160deg, rgba(12, 19, 38, 0.92), rgba(6, 10, 22, 0.96));
}

html.perf-lite .aurora-orb,
html.perf-lite .cyber-grid__plane,
html.perf-lite .cyber-grid__scanline {
  animation: none !important;
}

html.perf-lite .card-shimmer {
  display: none;
}

html.perf-lite .portal-card:hover,
html.perf-lite .quick-card:hover {
  transform: translateY(-3px);
}

html.perf-lite .portal-card:hover::before,
html.perf-lite .portal-card:focus-visible::before,
html.perf-lite .quick-card:hover::before,
html.perf-lite .quick-card:focus-visible::before,
html.perf-lite .portal-card.is-triggered::before,
html.perf-lite .quick-card.is-triggered::before {
  opacity: 1;
  animation: none !important;
}

/* ==========================================================================
   Reduced Motion (OS preference or user toggle)
   ========================================================================== */

html.reduced-motion .aurora-orb,
html.reduced-motion .cyber-grid__plane,
html.reduced-motion .cyber-grid__scanline,
html.reduced-motion .sonar-dot__ring,
html.reduced-motion .ring-outer,
html.reduced-motion .ring-inner,
html.reduced-motion .cat-eye,
html.reduced-motion .led-blink,
html.reduced-motion .mail-pulse,
html.reduced-motion .eq-bars span {
  animation: none !important;
}

html.intro-done .anim-in {
  opacity: 1;
  transform: none;
  animation: none !important;
}

html.reduced-motion .anim-in {
  opacity: 1;
  transform: none;
  animation: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .aurora-orb,
  .cyber-grid__plane,
  .cyber-grid__scanline,
  .sonar-dot__ring,
  .ring-outer,
  .ring-inner,
  .cat-eye,
  .hero__title,
  .led-blink,
  .mail-pulse,
  .eq-bars span {
    animation: none !important;
  }

  .anim-in {
    opacity: 1;
    transform: none;
    animation: none !important;
  }
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 900px) {
  .quick-dock__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .hud-topbar {
    justify-content: center;
  }

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

  .portal-card {
    min-height: 215px;
  }

  .quick-dock__hint {
    display: none;
  }

  .kbd-hint {
    display: none;
  }
}

@media (max-width: 480px) {
  .status-pill {
    width: 100%;
    justify-content: center;
  }

  .status-pill__text {
    font-size: 0.68rem;
  }

  .hud-controls {
    width: 100%;
    justify-content: space-between;
  }

  .hud-telemetry__date,
  .hud-telemetry__sep {
    display: none;
  }

  .hero__brand-row {
    flex-direction: column;
    gap: 0.75rem;
  }
}
