/* ═══════════════════════════════════════════════════════════════
   mobile.css — iOS-style UI for lewishurd.com
   Only applied when #ios-shell exists (injected by mobile.js).
   Uses the same CSS variables as style.css for theme consistency.
═══════════════════════════════════════════════════════════════ */

/* ── Shell container ──────────────────────────────────────────── */
#ios-shell {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: -apple-system, 'SF Pro Display', 'Helvetica Neue', sans-serif;
  /* Wallpaper — matches macOS dark desktop */
  background:
    radial-gradient(ellipse 90% 60% at 20% 80%, rgba(30,60,120,0.6) 0%, transparent 65%),
    radial-gradient(ellipse 60% 50% at 80% 20%, rgba(80,30,110,0.5) 0%, transparent 60%),
    linear-gradient(160deg, #06080f 0%, #0d1020 50%, #0a0810 100%);
}

body.light-mode #ios-shell {
  background:
    radial-gradient(ellipse 80% 60% at 15% 85%, rgba(100,140,220,0.4) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 85% 15%, rgba(160,100,200,0.3) 0%, transparent 55%),
    linear-gradient(160deg, #c5cce8 0%, #d8dcf0 50%, #cdd5e8 100%);
}

/* ── Status bar ───────────────────────────────────────────────── */
.ios-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px 4px;
  padding-top: max(12px, env(safe-area-inset-top));
  flex-shrink: 0;
  color: rgba(255,255,255,0.9);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  height: calc(44px + env(safe-area-inset-top));
}

body.light-mode .ios-status-bar {
  color: rgba(0,0,0,0.85);
}

.ios-time {
  font-variant-numeric: tabular-nums;
}

/* ── Theme toggle ─────────────────────────────────────────────── */
.ios-theme-btn {
  background: rgba(255,255,255,0.12);
  border: 0.5px solid rgba(255,255,255,0.2);
  border-radius: 20px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  color: rgba(255,255,255,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, transform 0.1s;
}

body.light-mode .ios-theme-btn {
  background: rgba(0,0,0,0.08);
  border-color: rgba(0,0,0,0.15);
  color: rgba(0,0,0,0.8);
}

.ios-theme-btn:active {
  transform: scale(0.92);
  background: rgba(255,255,255,0.22);
}

body.light-mode .ios-theme-btn:active {
  background: rgba(0,0,0,0.14);
}

/* Show sun in dark mode, moon in light mode */
.ios-theme-sun  { display: block; }
.ios-theme-moon { display: none;  }

body.light-mode .ios-theme-sun  { display: none;  }
body.light-mode .ios-theme-moon { display: block; }



/* ── Home screen ──────────────────────────────────────────────── */
.ios-home {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 8px 0 0;
  transition: opacity 0.25s ease, filter 0.25s ease;
}

.ios-home.is-dimmed {
  opacity: 0.4;
  filter: blur(2px);
  pointer-events: none;
}

.ios-home-pages {
  flex: 1;
  display: flex;
  transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.ios-icon-page {
  min-width: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, auto);
  gap: 8px 0;
  padding: 16px 12px 8px;
  align-content: start;
}

/* ── App icons ────────────────────────────────────────────────── */
.ios-app-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 8px 4px;
  border-radius: 14px;
  transition: opacity 0.15s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

.ios-app-icon:active {
  opacity: 0.7;
  transform: scale(0.92);
}

.ios-icon-img {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4), 0 1px 3px rgba(0,0,0,0.3);
}

.ios-icon-img svg {
  width: 100%;
  height: 100%;
  display: block;
}

.ios-icon-label {
  font-size: 11px;
  font-weight: 400;
  color: rgba(255,255,255,0.92);
  text-align: center;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

body.light-mode .ios-icon-label {
  color: rgba(255,255,255,0.96);
  text-shadow: 0 1px 5px rgba(0,0,0,0.45);
}

/* ── Page dots ────────────────────────────────────────────────── */
.ios-page-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  padding: 6px 0 10px;
  flex-shrink: 0;
}

.ios-page-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  transition: background 0.2s, transform 0.2s;
}

.ios-page-dot.active {
  background: rgba(255,255,255,0.85);
  transform: scale(1.2);
}

body.light-mode .ios-page-dot        { background: rgba(0,0,0,0.2); }
body.light-mode .ios-page-dot.active { background: rgba(0,0,0,0.7); }

/* ── Tab bar ──────────────────────────────────────────────────── */
.ios-tab-bar {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 8px 4px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  background: rgba(30,30,35,0.75);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-top: 0.5px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
  transition: opacity 0.25s ease, filter 0.25s ease;
}

body.light-mode .ios-tab-bar {
  background: rgba(240,240,245,0.85);
  border-top-color: rgba(0,0,0,0.1);
}

.ios-tab-bar.is-dimmed {
  opacity: 0.4;
  filter: blur(2px);
  pointer-events: none;
}

.ios-tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 12px;
  border-radius: 10px;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.12s;
}

.ios-tab-btn:active { opacity: 0.6; }

.ios-tab-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  overflow: hidden;
}

.ios-tab-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.ios-tab-label {
  font-size: 10px;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  letter-spacing: -0.01em;
}

body.light-mode .ios-tab-label {
  color: rgba(0,0,0,0.55);
}

/* ── Sheets container ─────────────────────────────────────────── */
.ios-sheets {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9100;
}

/* ── Individual sheet ─────────────────────────────────────────── */
.ios-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: 60px; /* leave gap for status bar blur effect */
  display: flex;
  flex-direction: column;
  background: var(--terminal-bg);
  border-radius: 16px 16px 0 0;
  transform: translateY(100%);
  transition: transform 0.42s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.5);
}

body.light-mode .ios-sheet {
  background: #f2f2f7;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.18);
}

.ios-sheet.is-open {
  pointer-events: all;
}

/* Handle bar */
.ios-sheet-handle-bar {
  display: flex;
  justify-content: center;
  padding: 10px 0 4px;
  cursor: grab;
  flex-shrink: 0;
}

.ios-sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.25);
}

body.light-mode .ios-sheet-handle {
  background: rgba(0,0,0,0.18);
}

/* Sheet header */
.ios-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 12px;
  flex-shrink: 0;
  border-bottom: 0.5px solid var(--border);
}

.ios-sheet-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-strong);
  letter-spacing: -0.02em;
}

.ios-sheet-close {
  font-size: 16px;
  font-weight: 600;
  color: var(--blue);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  -webkit-tap-highlight-color: transparent;
}

.ios-sheet-close:active {
  opacity: 0.6;
}

/* Sheet scroll area */
.ios-sheet-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 16px calc(32px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Content components ───────────────────────────────────────── */

/* Cards */
.ios-card {
  background: var(--panel);
  border-radius: 12px;
  padding: 14px 16px;
  border: 0.5px solid var(--border);
}

body.light-mode .ios-card {
  background: rgba(255,255,255,0.9);
  border-color: rgba(0,0,0,0.06);
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

/* Section labels */
.ios-section-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-dim);
  padding: 0 4px;
  margin-top: 4px;
}

/* Hero */
.ios-sheet-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 16px 16px;
  background: var(--panel);
  border-radius: 12px;
  border: 0.5px solid var(--border);
  text-align: center;
}

.ios-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.ios-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.ios-hero-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-strong);
  letter-spacing: -0.03em;
}

.ios-hero-title {
  font-size: 14px;
  color: var(--blue);
  font-weight: 500;
}

.ios-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 4px;
}

.ios-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(88,166,255,0.12);
  border: 0.5px solid rgba(88,166,255,0.3);
  color: var(--blue);
}

/* Body text */
.ios-body-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 6px;
}

.ios-body-text:last-child { margin-bottom: 0; }

/* Job cards */
.ios-job-card { gap: 8px; display: flex; flex-direction: column; }

.ios-job-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.ios-job-company {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-strong);
  letter-spacing: -0.01em;
}

.ios-job-role {
  font-size: 13px;
  color: var(--blue);
  margin-top: 2px;
}

.ios-job-period {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 2px;
}

/* Bullets */
.ios-bullets {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ios-bullets li {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
}

/* Skills */
.ios-skill-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.ios-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ios-tag {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 7px;
  background: rgba(63,185,80,0.08);
  border: 0.5px solid rgba(63,185,80,0.25);
  color: var(--green);
}

/* Projects */
.ios-project-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ios-project-link {
  cursor: pointer;
  transition: opacity 0.12s;
}

.ios-project-link:active { opacity: 0.7; }

.ios-project-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-strong);
  letter-spacing: -0.01em;
}

.ios-external {
  font-size: 12px;
  color: var(--blue);
  margin-left: 4px;
}

.ios-project-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Contact */
.ios-contact-row {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.12s;
}

.ios-contact-row:active { opacity: 0.7; }

.ios-contact-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  width: 64px;
  flex-shrink: 0;
}

.ios-contact-val {
  font-size: 14px;
  color: var(--blue);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ios-contact-arrow {
  font-size: 14px;
  color: var(--text-dim);
}

/* Terminal info */
.ios-cmd-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.ios-cmd-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  min-width: 80px;
  flex-shrink: 0;
}

.ios-cmd-desc {
  font-size: 13px;
  color: var(--text-muted);
}

/* Footer text */
.ios-footer-text {
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  padding: 4px 0;
}

/* ── Finder tabs ──────────────────────────────────────────────── */
.ios-finder-tabs {
  display: flex;
  overflow-x: auto;
  gap: 6px;
  padding: 0 0 12px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex-shrink: 0;
}

.ios-finder-tabs::-webkit-scrollbar { display: none; }

.ios-finder-tab {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: 20px;
  border: 0.5px solid var(--border);
  background: var(--panel);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
  font-family: -apple-system, 'SF Pro Display', 'Helvetica Neue', sans-serif;
}

.ios-finder-tab.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.ios-finder-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Game sheets (Pong) ───────────────────────────────────────── */

/* Game sheets fill the full sheet height with no scroll area */
.ios-sheet--game {
  display: flex;
  flex-direction: column;
}

.ios-game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 10px;
  flex-shrink: 0;
  border-bottom: 0.5px solid var(--border);
}

.ios-game-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-strong);
  letter-spacing: -0.02em;
}

/* Canvas wrap fills all remaining space */
.ios-game-canvas-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  position: relative;
  /* Prevent pull-to-refresh and page scroll while gaming */
  overscroll-behavior: none;
  touch-action: none;
}

.ios-game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}