/* css/layout.css — App shell, header, view zones */

/* ── App Header ─────────────────────────────────────────── */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  /* Safe area for notched phones */
  padding-left: max(var(--space-6), env(safe-area-inset-left));
  padding-right: max(var(--space-6), env(safe-area-inset-right));
  background: rgba(8, 8, 8, 0.85);
  backdrop-filter: var(--blur-ui);
  -webkit-backdrop-filter: var(--blur-ui);
  border-bottom: 1px solid rgba(235, 228, 215, 0.06);
  z-index: 100;
  will-change: transform;
}

.app-wordmark {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.22em;
  color: rgba(235, 228, 215, 0.55);
  text-transform: uppercase;
  user-select: none;
}

/* ── Mode Toggle ────────────────────────────────────────── */
.mode-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.mode-btn {
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 400;
  color: rgba(235, 228, 215, 0.42);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  position: relative;
  transition: color var(--dur-base) var(--ease-out);
  letter-spacing: 0.01em;
}

.mode-btn.active {
  color: var(--ink-primary);
}

.mode-btn::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--ink-secondary);
  transform: scaleX(0);
  transition: transform var(--dur-base) var(--ease-spring);
}

.mode-btn.active::after {
  transform: scaleX(1);
}

/* ── Views ──────────────────────────────────────────────── */
/*
 * Views use inline styles for opacity/pointer-events — managed entirely by JS.
 * CSS only sets position/layout. [hidden] = display:none (from reset.css).
 */
.view {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
}

.view--gallery {
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* ── Toast container ────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: calc(var(--hud-height) + var(--space-4));
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  pointer-events: none;
}

/* ── Storage warning ────────────────────────────────────── */
.storage-warning {
  position: fixed;
  bottom: calc(var(--hud-height) + var(--space-3));
  right: var(--space-6);
  z-index: 150;
  background: rgba(255, 180, 80, 0.1);
  border: 1px solid rgba(255, 180, 80, 0.2);
  border-radius: var(--radius-xs);
  padding: var(--space-2) var(--space-3);
}

.storage-warning-text {
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(255, 200, 120, 0.7);
  letter-spacing: 0.05em;
}

/* ── Mobile ─────────────────────────────────────────────── */
@media (max-width: 480px) {
  .app-header {
    padding: 0 var(--space-3);
  }
  .app-wordmark {
    font-size: 11px;
    letter-spacing: 0.18em;
  }
  .mode-btn {
    font-size: 14px;
  }
  .mode-toggle {
    gap: var(--space-3);
  }
}
