/* ==========================================================================
   Sorouh Science Labs (Port 8080) - Mobile & Tablet Responsive Tokens
   Luxury Obsidian Dark Aesthetic & Touch Ergonomics
   Strictly <= 250 lines compliant
   ========================================================================== */

:root {
  /* ------------------------------------------------------------------------
     1. Safe Area Insets (Physical Notches, Island & Home Bar Support)
     ------------------------------------------------------------------------ */
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-left: env(safe-area-inset-left, 0px);
  --safe-area-right: env(safe-area-inset-right, 0px);

  /* Padded safe bounds with minimum ergonomic margins */
  --safe-pad-top: max(8px, env(safe-area-inset-top, 0px));
  --safe-pad-bottom: max(12px, env(safe-area-inset-bottom, 0px));
  --safe-pad-left: max(10px, env(safe-area-inset-left, 0px));
  --safe-pad-right: max(10px, env(safe-area-inset-right, 0px));

  /* ------------------------------------------------------------------------
     2. Touch Target Tokens (Apple HIG & W3C WCAG 2.1 AA Compliant)
     ------------------------------------------------------------------------ */
  --touch-target-min: 48px;
  --touch-target-comfortable: 56px;
  --touch-target-compact: 44px;
  --touch-target-fab: 52px;
  --touch-icon-size: 24px;
  --touch-icon-well: 40px;
  --touch-hit-margin: 6px;

  /* ------------------------------------------------------------------------
     3. Breakpoint Design System Reference Tokens
     ------------------------------------------------------------------------ */
  --bp-mobile-portrait-min: 360px;
  --bp-mobile-portrait-max: 480px;
  --bp-mobile-landscape-min: 481px;
  --bp-mobile-landscape-max: 768px;
  --bp-tablet-portrait-min: 769px;
  --bp-tablet-portrait-max: 1024px;
  --bp-tablet-landscape-min: 1025px;
  --bp-tablet-landscape-max: 1366px;

  /* ------------------------------------------------------------------------
     4. Obsidian Mobile Surface & Elevation Palette
     ------------------------------------------------------------------------ */
  --mobile-bg-space: #000000;
  --mobile-bg-base: #0a0c10;
  --mobile-bg-elevated: #12151c;
  --mobile-bg-surface: #181b24;
  --mobile-bg-active: #222735;
  --mobile-bg-overlay: rgba(0, 0, 0, 0.88);
  --mobile-bg-sheet: #0e1117;
  --mobile-bg-drawer: #0c0e14;
  --mobile-bg-card: #141720;

  /* ------------------------------------------------------------------------
     5. Tactile Bevels, Metallic Borders & 3D Depth
     ------------------------------------------------------------------------ */
  --mobile-border-subtle: rgba(255, 255, 255, 0.12);
  --mobile-border-medium: rgba(255, 255, 255, 0.22);
  --mobile-border-bright: rgba(255, 255, 255, 0.45);
  --mobile-bevel-top: rgba(255, 255, 255, 0.28);
  --mobile-bevel-bot: rgba(0, 0, 0, 0.95);
  --mobile-extrusion: #040507;

  /* Tactile Shadows & Wells */
  --mobile-shadow-sheet: 0 -8px 32px rgba(0, 0, 0, 0.92),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  --mobile-shadow-drawer: -8px 0 32px rgba(0, 0, 0, 0.95),
    inset -1px 0 0 rgba(255, 255, 255, 0.16);
  --mobile-shadow-card: 0 12px 36px rgba(0, 0, 0, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  --mobile-shadow-fab: 0 4px 0 var(--mobile-extrusion),
    0 8px 24px rgba(0, 0, 0, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  --mobile-shadow-fab-pressed: 0 1px 0 var(--mobile-extrusion),
    0 2px 8px rgba(0, 0, 0, 0.6),
    inset 0 2px 5px rgba(0, 0, 0, 0.85);
  --mobile-shadow-well: inset 0 2px 4px rgba(0, 0, 0, 0.9),
    inset 0 -1px 1px rgba(255, 255, 255, 0.12),
    0 1px 0 rgba(255, 255, 255, 0.08);

  /* ------------------------------------------------------------------------
     6. Scientific Status Micro-LED Tokens
     ------------------------------------------------------------------------ */
  --led-chem: #f59e0b;
  --led-phys: #00b4d8;
  --led-bio: #10b981;
  --led-tutor: #a855f7;
  --led-glow-chem: rgba(245, 158, 11, 0.65);
  --led-glow-phys: rgba(0, 180, 216, 0.65);
  --led-glow-bio: rgba(16, 185, 129, 0.65);
  --led-glow-tutor: rgba(168, 85, 247, 0.65);

  /* ------------------------------------------------------------------------
     7. Mobile Header, Sheet & Drawer Layout Sizing
     ------------------------------------------------------------------------ */
  --mobile-header-height: 42px;
  --mobile-header-max: 44px;
  --mobile-sheet-collapsed-height: 48px;
  --mobile-sheet-peek-height: 120px;
  --mobile-sheet-expanded-height: 72vh;
  --mobile-drawer-width-phone: 280px;
  --mobile-drawer-width-tablet: 340px;

  /* Rounded Corners */
  --mobile-radius-sm: 8px;
  --mobile-radius-md: 12px;
  --mobile-radius-lg: 18px;
  --mobile-radius-sheet: 20px 20px 0 0;
  --mobile-radius-pill: 9999px;

  /* Smooth Elastic Transitions */
  --mobile-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --mobile-trans-sheet: transform 0.32s var(--mobile-spring);
  --mobile-trans-drawer: transform 0.3s var(--mobile-spring);
  --mobile-trans-tap: transform 0.12s ease, box-shadow 0.12s ease;

  /* Typography Stack */
  --mobile-font-family: 'Cairo', 'Tajawal', -apple-system, sans-serif;
  --mobile-font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --mobile-text-title: 15px;
  --mobile-text-subtitle: 12px;
  --mobile-text-body: 13px;
  --mobile-text-caption: 11px;
}

/* Landscape Mobile Height Optimizations (H < 500px) */
@media screen and (orientation: landscape) and (max-height: 500px) {
  :root {
    --mobile-header-height: 38px;
    --touch-target-min: 44px;
    --mobile-sheet-collapsed-height: 38px;
    --mobile-sheet-expanded-height: 84vh;
  }
}
