/* ==========================================================================
   ĀTMAN COGNITIVE SANCTUARY LOGIN SYSTEM (login.css)
   - Master Grade Living Visual Language & Atmospheric Depth
   - Sentient Ākṛiti Cephalopod Kinematics, Respiration & Organic Tendril Waves
   - Subtle Sacred Geometry Parallax & Tonal Surface Architecture
   - Fully Accessible (WCAG AAA/AA), Zero Clutter, Strict Reduced-Motion
   ========================================================================== */

:root {
  /* ─── 1. Environmental Void & Atmospheric Depth ──────────────────────────── */
  --bg-space: #070705;
  --bg-void: #0D0D0A;
  --bg-ambient: #12120E;
  
  /* ─── 2. Layered Surface Architecture ────────────────────────────────────── */
  --surface-ground: #14130F;
  --surface-card: rgba(18, 16, 12, 0.82);
  --surface-elevated: rgba(28, 25, 20, 0.90);
  --surface-input: rgba(13, 12, 9, 0.90);
  
  /* ─── 3. Typography & Contrast Hierarchy ─────────────────────────────────── */
  --text-primary: #F7F5EE;
  --text-secondary: #B6B2A4;
  --text-tertiary: #848072;
  --text-muted: #565348;
  
  /* ─── 4. Luminous Sacred Gold ────────────────────────────────────────────── */
  --accent-gold: #C9B27C;
  --accent-gold-radiant: #E5CD95;
  --accent-gold-bright: #F7E5BD;
  --accent-gold-deep: #968153;
  --accent-gold-subtle: rgba(201, 178, 124, 0.14);
  --accent-gold-dim: rgba(201, 178, 124, 0.06);
  
  /* ─── 5. Structural Separators & Borders ──────────────────────────────────── */
  --border-faint: rgba(237, 232, 216, 0.05);
  --border-subtle: rgba(237, 232, 216, 0.10);
  --border-active: rgba(237, 232, 216, 0.22);
  --border-gold: rgba(201, 178, 124, 0.38);
  --border-focus: #C9B27C;

  /* ─── 6. Semantic Status Indicators ──────────────────────────────────────── */
  --error-bg: rgba(248, 113, 113, 0.10);
  --error-border: rgba(248, 113, 113, 0.35);
  --error-text: #FCA5A5;

  --success-bg: rgba(110, 231, 183, 0.10);
  --success-border: rgba(110, 231, 183, 0.35);
  --success-text: #6EE7B7;

  /* ─── 7. Typography Scales & Modular Bounds ──────────────────────────────── */
  --font-display: 'Bricolage Grotesque', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, Menlo, monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 9999px;

  --control-height: 46px;
  --ease-precise: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-organic: cubic-bezier(0.4, 0, 0.2, 1);

  /* Mouse Parallax Offsets */
  --parallax-x: 0px;
  --parallax-y: 0px;
}

/* Light Theme Overrides (Refined Warm Vellum) */
[data-theme="light"] {
  --bg-space: #F5F1E8;
  --bg-void: #FAF7F0;
  --bg-ambient: #EDE7D8;
  
  --surface-ground: #EBE4D5;
  --surface-card: rgba(255, 255, 255, 0.88);
  --surface-elevated: #F8F5EE;
  --surface-input: #FFFFFF;
  
  --text-primary: #1C1914;
  --text-secondary: #4A4438;
  --text-tertiary: #6E6656;
  --text-muted: #948B77;
  
  --accent-gold: #967B38;
  --accent-gold-radiant: #7D652B;
  --accent-gold-bright: #624F1F;
  --accent-gold-deep: #5A481B;
  --accent-gold-subtle: rgba(150, 123, 56, 0.12);
  --accent-gold-dim: rgba(150, 123, 56, 0.05);
  
  --border-faint: rgba(28, 25, 20, 0.06);
  --border-subtle: rgba(28, 25, 20, 0.12);
  --border-active: rgba(28, 25, 20, 0.25);
  --border-gold: rgba(150, 123, 56, 0.45);
  --border-focus: #967B38;

  --error-bg: rgba(239, 68, 68, 0.08);
  --error-border: rgba(239, 68, 68, 0.30);
  --error-text: #DC2626;

  --success-bg: rgba(16, 185, 129, 0.08);
  --success-border: rgba(16, 185, 129, 0.30);
  --success-text: #059669;
}

/* ─── Global Reset & Foundation ───────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  min-height: 100%;
  background-color: var(--bg-space);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 32px 16px;
  position: relative;
}

/* ─── 1. Atmospheric Background Environment (Yantra & Subtle Parallax) ─────── */
.yantra-viewport {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

/* Ambient Radial Luminescence */
.ambient-subtle-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 720px;
  height: 720px;
  transform: translate(-50%, -50%) translate3d(var(--parallax-x), var(--parallax-y), 0);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 178, 124, 0.09) 0%, rgba(127, 146, 166, 0.04) 40%, transparent 70%);
  animation: ambientBreathe 7.5s var(--ease-organic) infinite;
  will-change: transform, opacity;
}

@keyframes ambientBreathe {
  0%, 100% {
    opacity: 0.65;
    transform: translate(-50%, -50%) translate3d(var(--parallax-x), var(--parallax-y), 0) scale(1);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) translate3d(var(--parallax-x), var(--parallax-y), 0) scale(1.08);
  }
}

/* Sacred Geometric Yantra SVG Canvas */
.yantra-svg {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 820px;
  height: 820px;
  transform: translate(-50%, -50%) translate3d(calc(var(--parallax-x) * -0.5), calc(var(--parallax-y) * -0.5), 0);
  transition: transform 0.25s var(--ease-precise);
  will-change: transform;
}

/* Celestial Rotations */
.yantra-ring-slow {
  transform-origin: 400px 400px;
  animation: yantraRotate 120s linear infinite;
}

.yantra-ring-reverse {
  transform-origin: 400px 400px;
  animation: yantraReverse 90s linear infinite;
}

.yantra-lotus {
  transform-origin: 400px 400px;
  animation: yantraRotate 240s linear infinite;
}

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

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

/* ─── 2. Master Portal Gateway Container ──────────────────────────────────── */
.portal-wrapper {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 380px;
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  animation: portalFadeIn 0.8s var(--ease-precise) forwards;
}

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

/* ─── 3. Living Ākṛiti Emblem & Atmospheric Brand Header ───────────────────── */
.portal-brand-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
}

.portal-atmi-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 12px;
}

/* Ākṛiti Ambient Bioluminescent Halo */
.atmi-ambient-halo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 110px;
  height: 110px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 178, 124, 0.22) 0%, rgba(201, 178, 124, 0.05) 55%, transparent 75%);
  pointer-events: none;
  animation: haloPulse 4.2s var(--ease-organic) infinite;
  will-change: transform, opacity;
}

@keyframes haloPulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.6;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.15);
    opacity: 0.95;
  }
}

/* Ākṛiti Guardian Seat (Interactive & Animated) */
.portal-atmi-seat {
  position: relative;
  width: 80px;
  height: 86px;
  cursor: pointer;
  user-select: none;
  transition: transform 0.25s var(--ease-precise);
  animation: atmiFloating 6s var(--ease-organic) infinite;
  outline: none;
}

.portal-atmi-seat:hover {
  transform: translateY(-3px) scale(1.04);
}

.portal-atmi-seat:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 4px;
  border-radius: var(--radius-pill);
}

@keyframes atmiFloating {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

.atmi-creature-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.65));
}

/* Organic Respiration */
.atmi-creature-body {
  transform-origin: 30px 24px;
  animation: atmiBreathing 4.8s var(--ease-organic) infinite;
}

@keyframes atmiBreathing {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 0 10px rgba(201, 178, 124, 0.25));
  }
  50% {
    transform: scale(1.035);
    filter: drop-shadow(0 0 18px rgba(201, 178, 124, 0.55));
  }
}

/* Halo Ring Slow Rotation */
.atmi-halo-ring {
  transform-origin: 30px 24px;
  animation: yantraRotate 28s linear infinite;
}

/* Tendril Sinuous Waves - Staggered Phase Waves */
.atmi-tendril.t0 { transform-origin: 19px 33px; animation: tendrilSwayL 3.8s ease-in-out infinite 0s; }
.atmi-tendril.t1 { transform-origin: 23px 34px; animation: tendrilSwayL 4.2s ease-in-out infinite 0.35s; }
.atmi-tendril.t2 { transform-origin: 27px 34px; animation: tendrilSwayC 4.6s ease-in-out infinite 0.70s; }
.atmi-tendril.t3 { transform-origin: 33px 34px; animation: tendrilSwayC 4.6s ease-in-out infinite 1.05s; }
.atmi-tendril.t4 { transform-origin: 37px 34px; animation: tendrilSwayR 4.2s ease-in-out infinite 0.45s; }
.atmi-tendril.t5 { transform-origin: 41px 33px; animation: tendrilSwayR 3.8s ease-in-out infinite 0.85s; }

@keyframes tendrilSwayL {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-3.5deg); }
}

@keyframes tendrilSwayR {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(3.5deg); }
}

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

/* Sentient Eye Eyelid Natural Micro-Blink */
.atmi-eyelid-wrap {
  transform-origin: 30px 21px;
  animation: atmiBlinkAnim 5.4s ease-in-out infinite;
}

@keyframes atmiBlinkAnim {
  0%, 92%, 100% {
    transform: scaleY(0);
    opacity: 0;
  }
  95%, 97% {
    transform: scaleY(1);
    opacity: 1;
  }
}

/* Pupil Tracking & Catchlight Aiming */
.atmi-eye-iris-wrap {
  transform-origin: 30px 21px;
  will-change: transform;
  transition: transform 0.14s var(--ease-precise);
}

/* Attentive Downward Gaze when user focuses input */
body.input-focused .atmi-eye-iris-wrap {
  transform: translate3d(0px, 2.2px, 0px) scale(1.08) !important;
}

/* ─── Contextual Telepathic Whisper (Gentle Micro-Hint) ──────────────────── */
.portal-atmi-bubble {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: rgba(24, 22, 17, 0.90);
  border: 1px solid rgba(201, 178, 124, 0.25);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  font-size: 0.76rem;
  color: var(--accent-gold);
  font-style: italic;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s var(--ease-precise), transform 0.3s var(--ease-precise);
  z-index: 20;
}

.portal-atmi-bubble.active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.atmi-bubble-glyph {
  font-size: 0.65rem;
  font-style: normal;
  color: var(--accent-gold);
}

.atmi-bubble-text {
  letter-spacing: 0.01em;
}

/* ─── Brand Heading & Authentic Subtitle ─────────────────────────────────── */
.portal-title {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 5px;
}

.portal-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-weight: 400;
  line-height: 1.45;
  max-width: 320px;
  margin: 0 auto;
}

/* ─── 4. Integrated Authentication Surface (No Outer Card Enclosure) ─────── */
.portal-card {
  width: 100%;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  border-radius: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: none;
  position: relative;
}

/* Dynamic Notification / Status Message */
.portal-status-msg {
  display: none;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  line-height: 1.45;
  text-align: left;
  animation: statusFade 0.25s var(--ease-precise);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

@keyframes statusFade {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.portal-status-msg.error {
  display: block;
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error-text);
}

.portal-status-msg.success {
  display: block;
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success-text);
}

/* ─── 5. Scalable Identity Provider Stack (Floating Tactile Stones) ───────── */
.auth-providers-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.auth-provider-btn,
.btn-gateway-google {
  width: 100%;
  height: var(--control-height);
  padding: 0 18px;
  background: rgba(22, 20, 16, 0.85);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  border: 1px solid rgba(237, 232, 216, 0.10);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.90rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: transform 0.2s var(--ease-precise), border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
  user-select: none;
  text-decoration: none;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

.auth-provider-btn:hover {
  border-color: rgba(201, 178, 124, 0.35);
  background: rgba(30, 26, 20, 0.95);
  transform: translateY(-1.5px);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.45), 0 0 12px rgba(201, 178, 124, 0.10);
}

[data-theme="light"] .auth-provider-btn {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(28, 25, 20, 0.10);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .auth-provider-btn:hover {
  background: #FFFFFF;
  border-color: rgba(150, 123, 56, 0.40);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.10);
}

.auth-provider-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.auth-provider-btn:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

.provider-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.provider-label {
  white-space: nowrap;
  letter-spacing: 0.01em;
}

/* ─── 6. Hairline Divider ────────────────────────────────────────────────── */
.portal-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin: 4px 0;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: rgba(237, 232, 216, 0.08);
}

[data-theme="light"] .divider-line {
  background: rgba(28, 25, 20, 0.08);
}

.divider-label {
  font-size: 0.74rem;
  color: var(--text-tertiary);
  letter-spacing: 0.04em;
  text-transform: lowercase;
  white-space: nowrap;
}

/* ─── 7. Passwordless Magic Link Form ────────────────────────────────────── */
.portal-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  text-align: left;
}

.input-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(22, 20, 16, 0.85);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  border: 1px solid rgba(237, 232, 216, 0.10);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

[data-theme="light"] .input-wrap {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(28, 25, 20, 0.10);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
}

.input-wrap:focus-within {
  border-color: #C9B27C;
  box-shadow: 0 0 0 3px rgba(201, 178, 124, 0.16), 0 4px 22px rgba(0, 0, 0, 0.35);
}

.input-glyph {
  position: absolute;
  left: 14px;
  font-size: 0.72rem;
  color: var(--accent-gold);
  opacity: 0.7;
  pointer-events: none;
}

.portal-input {
  width: 100%;
  height: var(--control-height);
  padding: 0 16px 0 36px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.90rem;
  line-height: var(--control-height);
}

.portal-input::placeholder {
  color: var(--text-muted);
}

/* Primary Action CTA (Resonant Antique Gold Stone) */
.btn-summon-passcode {
  width: 100%;
  height: var(--control-height);
  padding: 0 20px;
  background: linear-gradient(135deg, #D4BE88 0%, #C9B27C 60%, #A89052 100%);
  border: 1px solid #C9B27C;
  border-radius: var(--radius-md);
  color: #0A0907;
  font-family: var(--font-body);
  font-size: 0.90rem;
  font-weight: 600;
  letter-spacing: 0.015em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(201, 178, 124, 0.25);
  transition: transform 0.2s var(--ease-precise), filter 0.2s ease, box-shadow 0.25s ease;
  user-select: none;
}

.btn-summon-passcode:hover {
  filter: brightness(1.06);
  transform: translateY(-1.5px);
  box-shadow: 0 8px 28px rgba(201, 178, 124, 0.40);
}

.btn-summon-passcode:active {
  transform: translateY(0);
  filter: brightness(0.96);
  box-shadow: 0 2px 10px rgba(201, 178, 124, 0.2);
}

.btn-summon-passcode:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

.btn-summon-passcode:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ─── 8. Local Workspace Tier (Coming Soon Status) ────────────────────────── */
.portal-guest-row {
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid rgba(237, 232, 216, 0.08);
  display: flex;
  justify-content: center;
  width: 100%;
}

[data-theme="light"] .portal-guest-row {
  border-top-color: rgba(28, 25, 20, 0.08);
}

.shunya-tier {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-size: 0.80rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
  padding: 4px 2px;
}

.shunya-tier.shunya-coming-soon {
  cursor: default;
  color: var(--text-tertiary);
  user-select: none;
}

.shunya-left {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.shunya-glyph {
  font-size: 0.70rem;
  color: var(--accent-gold);
  opacity: 0.85;
}

.shunya-pill {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: var(--accent-gold-dim);
  border: 1px solid var(--accent-gold-subtle);
  color: var(--accent-gold);
  font-weight: 600;
}

/* ─── 9. Portal Footer Navigation & Pranayama Rhythm ─────────────────────── */
.portal-footer {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px;
  font-size: 0.78rem;
  color: var(--text-tertiary);
  gap: 12px;
}

.portal-return-link {
  color: var(--text-tertiary);
  text-decoration: none;
  font-size: 0.78rem;
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.portal-return-link:hover {
  color: var(--accent-gold);
}

.portal-return-link:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/* 4-7-8 Pranayama Respiratory Cadence Indicator */
.pranayama-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 0.70rem;
  color: var(--text-secondary);
  background: rgba(24, 22, 17, 0.6);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-faint);
  user-select: none;
}

.pranayama-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-gold);
  animation: pranayamaBreathe 19s infinite ease-in-out;
  flex-shrink: 0;
}

@keyframes pranayamaBreathe {
  0% { transform: scale(1); opacity: 0.4; }
  21% { transform: scale(1.6); opacity: 0.95; } /* 4s inhale */
  58% { transform: scale(1.6); opacity: 0.95; } /* 7s hold */
  100% { transform: scale(1); opacity: 0.4; }   /* 8s exhale */
}

/* Theme Toggle Button */
.theme-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-family: var(--font-body);
  font-size: 0.78rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: color 0.2s ease;
}

.theme-toggle-btn:hover {
  color: var(--accent-gold);
}

.theme-toggle-btn:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/* ─── 10. Responsive Adaptations ─────────────────────────────────────────── */
/* Tablet & Mobile Battery / CPU Preservation Profile */
@media (max-width: 768px) {
  .yantra-ring-slow,
  .yantra-ring-reverse,
  .yantra-lotus {
    animation: none !important;
  }
}

@media (max-width: 480px) {
  :root {
    --control-height: 50px;
  }

  body {
    padding: 24px 16px;
    padding-bottom: max(24px, env(safe-area-inset-bottom, 24px));
  }

  .portal-wrapper {
    max-width: 360px;
    gap: 18px;
  }

  .portal-atmi-seat {
    width: 66px;
    height: 72px;
  }

  /* Smooth keyboard avoidance: scale down mascot when typing */
  body.input-focused .portal-atmi-seat {
    height: 52px;
    width: 50px;
    opacity: 0.85;
    transition: all 0.25s var(--ease-precise);
  }

  .portal-title {
    font-size: 1.65rem;
  }

  .portal-subtitle {
    font-size: 0.85rem;
  }

  .portal-card {
    padding: 0;
    gap: 14px;
  }

  .portal-footer {
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
    padding-top: 8px;
  }

  .pranayama-pill {
    order: 1;
    width: 100%;
    justify-content: center;
    margin-bottom: 6px;
  }

  .portal-return-link {
    order: 2;
  }

  .theme-toggle-btn {
    order: 3;
  }
}

/* Small Mobile (320px - 340px) */
@media (max-width: 340px) {
  body {
    padding: 16px 10px;
  }

  .portal-wrapper {
    gap: 14px;
  }

  .portal-atmi-seat {
    width: 58px;
    height: 64px;
  }

  .portal-title {
    font-size: 1.45rem;
  }

  .portal-subtitle {
    font-size: 0.80rem;
  }

  .portal-card {
    padding: 0;
    gap: 12px;
  }

  .auth-provider-btn {
    font-size: 0.82rem;
    padding: 0 10px;
    gap: 8px;
  }

  .portal-input {
    font-size: 0.85rem;
  }

  .btn-summon-passcode {
    font-size: 0.85rem;
  }

  .shunya-tier {
    font-size: 0.74rem;
  }

  .shunya-pill {
    font-size: 0.60rem;
    padding: 1px 5px;
  }
}

/* Short Mobile Screens & Landscape Orientation (Zero Cutoffs) */
@media (max-height: 600px) {
  body {
    padding: 14px 10px;
    justify-content: flex-start;
  }

  .portal-wrapper {
    margin: 8px auto;
  }

  .portal-atmi-seat {
    width: 52px;
    height: 56px;
  }

  .portal-title {
    font-size: 1.35rem;
  }

  .portal-card {
    padding: 0;
    gap: 10px;
  }
}

/* ─── 11. Prefers-Reduced-Motion Strict Overrides ─────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .yantra-ring-slow,
  .yantra-ring-reverse,
  .yantra-lotus,
  .ambient-subtle-glow,
  .atmi-halo-ring,
  .atmi-creature-body,
  .portal-atmi-seat,
  .atmi-ambient-halo,
  .atmi-eyelid-wrap,
  .atmi-tendril,
  .pranayama-indicator {
    animation: none !important;
  }
}
