/**
 * CORTEX OS v4.1 — Linear / Raycast / Vercel Carbon Design System
 * Ergonomic Scaling for 27" 2K Monitor (2560x1440) & iPad Air (3rd Gen, 10.5" Retina)
 * Palette:
 * - Background Void:   #09090B (Zinc 950)
 * - Surface / Sidebar: #0C0C0F
 * - Card Surface:      #121215
 * - Elevated Control:  #18181C
 * - Hairline Border:   #222226 (hover #2E2E34)
 * - Primary Text:      #EDEDEF
 * - Secondary Text:    #9CA3AF
 * - Muted Text:        #6B7280
 * - Primary Accent:    #5E6AD2 (Linear Indigo) / #EDEDEF (Monochrome High-Contrast)
 */

:root {
  --bg-void: #09090B;
  --bg-surface: #0C0C0F;
  --bg-card: #121215;
  --bg-elevated: #18181C;
  --border-subtle: #222226;
  --border-hover: #32323A;
  --text-primary: #EDEDEF;
  --text-secondary: #9CA3AF;
  --text-muted: #6B7280;
  --accent-indigo: #5E6AD2;
  --accent-emerald: #10B981;
  --accent-amber: #F59E0B;
  --accent-rose: #F43F5E;
}

* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  /* Scaled up base rem for 27" 2K readability (1rem = 16.5px on desktop) */
  font-size: 16px;
}

@media (min-width: 1400px) {
  html {
    font-size: 16.75px;
  }
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-void);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.95rem;
  line-height: 1.55;
  letter-spacing: -0.011em;
}

.font-mono-tech,
.tabular-nums {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

[x-cloak] {
  display: none !important;
}

/* Custom Minimalist Scrollbars */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: var(--bg-void);
}

::-webkit-scrollbar-thumb {
  background: #242429;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #36363E;
}

/* Linear / Raycast Surface Cards */
.linear-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.linear-card:hover {
  border-color: var(--border-hover);
}

.linear-panel {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
}

/* Raycast Command Bar / Focus Strip */
.focus-command-strip {
  background: linear-gradient(180deg, #16161B 0%, #111115 100%);
  border: 1px solid #2C2C35;
  border-radius: 10px;
  box-shadow: 0 10px 28px -8px rgba(0, 0, 0, 0.7);
}

.focus-command-strip.is-active {
  border-color: rgba(94, 106, 210, 0.65);
}

.focus-command-strip.is-paused {
  border-color: rgba(245, 158, 11, 0.65);
}

/* Status Dots */
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 9999px;
  display: inline-block;
  flex-shrink: 0;
}

.status-dot-emerald {
  background-color: #10B981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.45);
}

.status-dot-amber {
  background-color: #F59E0B;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.45);
}

.status-dot-rose {
  background-color: #F43F5E;
  box-shadow: 0 0 8px rgba(244, 63, 94, 0.45);
}

.status-dot-indigo {
  background-color: #5E6AD2;
  box-shadow: 0 0 8px rgba(94, 106, 210, 0.45);
}

.status-dot-zinc {
  background-color: #52525B;
}

/* Module Pill Badges (Scaled up for 2K & iPad readability) */
.mod-pill {
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid #2A2A30;
  background-color: #18181C;
  color: #E4E4E7;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  line-height: 1.35;
}

.mod-pill-A1 {
  border-color: rgba(244, 63, 94, 0.4);
  background-color: rgba(244, 63, 94, 0.1);
  color: #FDA4AF;
}

.mod-pill-B11,
.mod-pill-B12 {
  border-color: rgba(94, 106, 210, 0.4);
  background-color: rgba(94, 106, 210, 0.12);
  color: #A5B4FC;
}

.mod-pill-C11,
.mod-pill-C12 {
  border-color: rgba(16, 185, 129, 0.4);
  background-color: rgba(16, 185, 129, 0.1);
  color: #6EE7B7;
}

.mod-pill-C31 {
  border-color: rgba(245, 158, 11, 0.4);
  background-color: rgba(245, 158, 11, 0.1);
  color: #FCD34D;
}

.mod-pill-C511,
.mod-pill-C512 {
  border-color: rgba(56, 189, 248, 0.4);
  background-color: rgba(56, 189, 248, 0.1);
  color: #7DD3FC;
}

.mod-pill-C8 {
  border-color: rgba(168, 85, 247, 0.4);
  background-color: rgba(168, 85, 247, 0.1);
  color: #D8B4FE;
}

/* Linear Buttons (Ergonomic 2K & iPad Sizing) */
.btn-linear-primary {
  background-color: #EDEDEF;
  color: #09090B;
  border: 1px solid #FFFFFF;
  border-radius: 7px;
  font-weight: 600;
  font-size: 13px;
  padding: 7px 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background-color 120ms ease, transform 80ms ease;
  cursor: pointer;
  white-space: nowrap;
}

.btn-linear-primary:hover {
  background-color: #FFFFFF;
}

.btn-linear-indigo {
  background-color: #5E6AD2;
  color: #FFFFFF;
  border: 1px solid #6E7AE2;
  border-radius: 7px;
  font-weight: 600;
  font-size: 13px;
  padding: 7px 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background-color 120ms ease;
  cursor: pointer;
  white-space: nowrap;
}

.btn-linear-indigo:hover {
  background-color: #6875DF;
}

.btn-linear-secondary {
  background-color: #18181C;
  color: #EDEDEF;
  border: 1px solid #2A2A32;
  border-radius: 7px;
  font-weight: 500;
  font-size: 13px;
  padding: 7px 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: border-color 120ms ease, background-color 120ms ease;
  cursor: pointer;
  white-space: nowrap;
}

.btn-linear-secondary:hover {
  background-color: #222228;
  border-color: #3A3A44;
}

/* Keyboard Shortcut Kbd Badge */
.kbd-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.18);
  line-height: 1.2;
}

/* Linear Inputs */
.input-linear {
  background-color: #0C0C0F;
  border: 1px solid #26262E;
  border-radius: 7px;
  color: #EDEDEF;
  font-size: 13.5px;
  padding: 8.5px 12px;
  width: 100%;
  outline: none;
  transition: border-color 120ms ease;
}

.input-linear:focus {
  border-color: #5E6AD2;
}

/* Concept A+B Logo Animation */
@keyframes hexDraw {
  0% {
    stroke-dashoffset: 240;
    opacity: 0.2;
  }
  100% {
    stroke-dashoffset: 0;
    opacity: 1;
  }
}

@keyframes orbitSpin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.boot-hex-path {
  stroke-dasharray: 240;
  stroke-dashoffset: 240;
  animation: hexDraw 1.1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.logo-orbit-group {
  transform-origin: center;
  animation: orbitSpin 18s linear infinite;
}

/* =========================================================================
   iPad Air (3rd Gen, 10.5" Retina) / Hörsaal Touch-Mode (.mode-uni)
   Instant visible transformation on BOTH desktop (1024px centered frame)
   and real iPad Air hardware (46px+ touch targets, bottom dock, lecture deck)
   ========================================================================= */
body.mode-uni {
  background: radial-gradient(circle at 50% 0%, #161622 0%, #070709 75%);
  padding-bottom: 78px;
}

body.mode-uni .uni-hide {
  display: none !important;
}

body.mode-uni .uni-workspace-shell {
  max-width: 1024px;
  width: 100%;
  margin: 12px auto 24px auto;
  border: 1px solid #2A2A36;
  border-radius: 18px;
  background-color: #0B0B0E;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(94, 106, 210, 0.22);
  overflow: hidden;
}

@media (max-width: 1060px) {
  body.mode-uni .uni-workspace-shell {
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
}

body.mode-uni .btn-linear-primary,
body.mode-uni .btn-linear-indigo,
body.mode-uni .btn-linear-secondary,
body.mode-uni .touch-btn-ipad {
  min-height: 46px;
  padding: 10px 16px;
  font-size: 14px;
  border-radius: 9px;
}

body.mode-uni .input-linear {
  min-height: 46px;
  font-size: 15px;
  border-radius: 9px;
}

body.mode-uni header {
  max-width: 1024px;
  width: 100%;
  margin: 0 auto;
  border-left: 1px solid #2A2A36;
  border-right: 1px solid #2A2A36;
}

body.mode-uni .grid.lg\:grid-cols-12 {
  grid-template-columns: minmax(0, 1fr) !important;
}

body.mode-uni .grid.lg\:grid-cols-12 > [class*="lg:col-span-"] {
  grid-column: span 1 / span 1 !important;
}

body.mode-uni .linear-card {
  border-radius: 12px;
  padding: 18px;
}

/* iPad Bottom Floating Touch Navigation Dock */
.ipad-bottom-dock {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 45;
  max-width: calc(100vw - 24px);
  overflow-x: auto;
  background: rgba(18, 18, 23, 0.94);
  backdrop-filter: blur(16px);
  border: 1px solid #2E2E3A;
  border-radius: 14px;
  padding: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75);
}

.ipad-dock-btn {
  min-height: 46px;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 500;
  color: #9CA3AF;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 120ms ease;
}

.ipad-dock-btn.is-active {
  background-color: #5E6AD2;
  color: #FFFFFF;
  font-weight: 600;
}

@media (max-width: 1120px), (pointer: coarse) {
  .btn-linear-primary,
  .btn-linear-indigo,
  .btn-linear-secondary {
    min-height: 42px;
    padding: 9px 14px;
  }
  .input-linear {
    min-height: 44px;
    font-size: 15px; /* Prevents iOS/iPadOS Safari auto-zoom on input focus */
  }
}
