/* ============================================
   Shotbook — Editorial design system
   ============================================ */

:root {
  /* Soft, paper-like palette */
  --bg: #f4f1ec;
  --bg-elev: #faf8f4;
  --bg-card: #ffffff;
  --ink: #1a1815;
  --ink-soft: #5a5550;
  --ink-mute: #8a847d;
  --line: #e6dfd5;
  --line-soft: #efeae1;

  /* Accent — a warm, considered orange */
  --accent: #c14f1d;
  --accent-soft: #e8c9b6;
  --accent-bg: #f7e9df;

  /* Secondary accent for chips/badges */
  --gold: #b8893d;
  --green: #4a7c59;

  --shadow-sm: 0 1px 2px rgba(26, 24, 21, 0.04), 0 1px 1px rgba(26, 24, 21, 0.02);
  --shadow-md: 0 4px 16px rgba(26, 24, 21, 0.06), 0 1px 2px rgba(26, 24, 21, 0.04);
  --shadow-lg: 0 24px 60px rgba(26, 24, 21, 0.12), 0 8px 20px rgba(26, 24, 21, 0.06);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", "SF Mono", ui-monospace, monospace;

  --header-bg: rgba(244, 241, 236, 0.82);
}

/* ============================================
   Dark theme
   ============================================ */
[data-theme="dark"] {
  --bg: #18181b;
  --bg-elev: #202024;
  --bg-card: #2a2a2e;
  --ink: #e8e8ea;
  --ink-soft: #a0a0a8;
  --ink-mute: #6b6b76;
  --line: #38383d;
  --line-soft: #2e2e33;
  --accent: #e87a4a;
  --accent-soft: #5a3a2a;
  --accent-bg: #2a201c;
  --gold: #c9a04a;
  --green: #5c9e6a;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.2), 0 1px 1px rgba(0,0,0,0.15);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-lg: 0 24px 60px rgba(0,0,0,0.4), 0 8px 20px rgba(0,0,0,0.3);
  --header-bg: rgba(24, 24, 27, 0.85);
}

[data-theme="dark"] .grain {
  opacity: 0;
}

[data-theme="dark"] .saved-count {
  opacity: 0.7;
}

* { box-sizing: border-box; }

.hidden { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button { cursor: pointer; }

img { max-width: 100%; display: block; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Subtle grain over the whole page */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.4;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ============================================
   Header
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: var(--ink);
  color: var(--bg);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.brand-mark svg { width: 22px; height: 22px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 24;
}
.brand-tag {
  font-size: 12px;
  color: var(--ink-mute);
  letter-spacing: 0.01em;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tabs {
  display: flex;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
}

a.tab.nav-link {
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 14px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
}
a.tab.nav-link:hover {
  background: var(--bg-card);
  border-color: var(--ink-mute);
}
a.tab.nav-link.active {
  background: var(--ink);
  color: var(--bg-elev);
  border-color: var(--ink);
}

.tab {
  background: transparent;
  border: none;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.tab:hover { color: var(--ink); }

.tab.active {
  background: var(--ink);
  color: var(--bg-elev);
  box-shadow: var(--shadow-sm);
}

.saved-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  background: var(--accent-bg);
  color: var(--accent);
  border-radius: 999px;
  transition: all 0.2s ease;
}
.tab.active .saved-count {
  background: rgba(255,255,255,0.18);
  color: var(--bg-elev);
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.theme-toggle:hover {
  background: var(--bg-card);
  color: var(--ink);
  border-color: var(--ink-mute);
  transform: translateY(-1px);
}
.theme-toggle svg {
  width: 18px;
  height: 18px;
}
.theme-toggle .sun-icon { display: block; }
.theme-toggle .moon-icon { display: none; }
[data-theme="dark"] .theme-toggle .sun-icon { display: none; }
[data-theme="dark"] .theme-toggle .moon-icon { display: block; }

/* ============================================
   Hero / Search
   ============================================ */
.hero {
  position: relative;
  z-index: 2;
  padding: 72px 32px 32px;
}

.hero-inner {
  max-width: 920px;
  margin: 0 auto;
  text-align: center;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-variation-settings: "opsz" 144;
  font-size: clamp(40px, 6vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0 0 20px;
  color: var(--ink);
}
.hero-title em {
  font-style: italic;
  font-weight: 500;
  color: var(--accent);
}

.hero-sub {
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 560px;
  margin: 0 auto 40px;
}

.search-bar {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 6px 6px 22px;
  box-shadow: var(--shadow-md);
  max-width: 720px;
  margin: 0 auto;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.search-bar:focus-within {
  box-shadow: var(--shadow-lg);
  border-color: var(--ink);
}

.search-field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.search-icon {
  width: 18px; height: 18px;
  color: var(--ink-mute);
  flex-shrink: 0;
}
#searchInput {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  padding: 14px 0;
  font-size: 16px;
  color: var(--ink);
}
#searchInput::placeholder { color: var(--ink-mute); }

.search-divider {
  width: 1px;
  height: 24px;
  background: var(--line);
  margin: 0 12px;
}

.country-field {
  position: relative;
  display: flex;
  align-items: center;
}
#countrySelect {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  outline: none;
  padding: 8px 28px 8px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
}
.chevron {
  position: absolute;
  right: 8px;
  width: 14px; height: 14px;
  color: var(--ink-mute);
  pointer-events: none;
}

.search-btn {
  background: var(--ink);
  color: var(--bg-elev);
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.15s ease, background 0.2s ease;
}
.search-btn:hover { background: var(--accent); transform: translateY(-1px); }
.search-btn:active { transform: translateY(0); }
.search-btn svg { width: 16px; height: 16px; }

.quick-picks {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
}
.qp-label {
  font-size: 13px;
  color: var(--ink-mute);
  margin-right: 4px;
}
.qp-chip {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s ease;
}
.qp-chip:hover {
  background: var(--bg-card);
  color: var(--ink);
  border-color: var(--ink-mute);
}

/* ============================================
   Results & Saved sections
   ============================================ */
.results-section,
.saved-section {
  position: relative;
  z-index: 2;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 32px 80px;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.section-heading h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 28px;
  letter-spacing: -0.015em;
  margin: 0;
  font-variation-settings: "opsz" 36;
}
.section-heading p {
  font-size: 13px;
  color: var(--ink-mute);
  font-family: var(--font-mono);
  margin: 0;
}

/* ============================================
   States (loading, empty, error)
   ============================================ */
.state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 24px;
  color: var(--ink-soft);
}
.state h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 24px;
  color: var(--ink);
  margin: 16px 0 8px;
  letter-spacing: -0.01em;
}
.state p {
  font-size: 15px;
  max-width: 380px;
  margin: 0;
  line-height: 1.55;
}

.spinner {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2.5px solid var(--line);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
  margin-bottom: 18px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.state-icon {
  width: 56px; height: 56px;
  display: grid;
  place-items: center;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-mute);
  margin-bottom: 4px;
}
.state-icon svg { width: 24px; height: 24px; }
.state-icon.error {
  background: var(--accent-bg);
  color: var(--accent);
  border-color: var(--accent-soft);
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
}

.ghost-btn {
  margin-top: 18px;
  background: transparent;
  border: 1px solid var(--ink);
  color: var(--ink);
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s ease;
}
.ghost-btn:hover { background: var(--ink); color: var(--bg-elev); }

/* Empty-state phone illustration */
.empty-illustration {
  display: flex;
  gap: 14px;
  margin-bottom: 20px;
  perspective: 1000px;
}
.phone {
  width: 64px;
  height: 130px;
  background: linear-gradient(135deg, var(--bg-card), var(--bg-elev));
  border: 1.5px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
}
.phone-1 { transform: rotate(-8deg) translateY(6px); background: linear-gradient(135deg, #fff, var(--accent-bg)); }
.phone-2 { transform: rotate(0deg); background: linear-gradient(135deg, #fff, #f0ebe2); }
.phone-3 { transform: rotate(8deg) translateY(6px); background: linear-gradient(135deg, #fff, #e8e4d8); }

/* ============================================
   Card grid
   ============================================ */
.card-grid,
.apps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}

.app-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
  animation: card-in 0.5s cubic-bezier(0.2, 0.9, 0.3, 1) backwards;
}
.app-card:hover { box-shadow: var(--shadow-md); }

@keyframes card-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 24px 28px 20px;
}

.app-icon {
  width: 72px; height: 72px;
  border-radius: 18px;
  flex-shrink: 0;
  box-shadow: 0 1px 0 rgba(0,0,0,0.04), 0 6px 14px rgba(0,0,0,0.08);
  background: var(--bg-elev);
  object-fit: cover;
}

.app-meta {
  flex: 1;
  min-width: 0;
}

.app-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 4px;
  color: var(--ink);
  font-variation-settings: "opsz" 28;
}

.app-dev {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 12px;
}

.app-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 500;
}
.tag.rating {
  background: var(--accent-bg);
  border-color: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
}
.tag.rating svg { width: 11px; height: 11px; }

.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.icon-btn {
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-soft);
  transition: all 0.15s ease;
}
.icon-btn:hover {
  background: var(--bg-card);
  color: var(--ink);
  border-color: var(--ink-mute);
  transform: translateY(-1px);
}
.icon-btn svg { width: 18px; height: 18px; }

.icon-btn.saved {
  background: var(--ink);
  color: var(--bg-elev);
  border-color: var(--ink);
}
.icon-btn.saved:hover { background: var(--accent); border-color: var(--accent); }

/* Screenshot strip */
.shots-wrap {
  position: relative;
  padding: 4px 0 28px;
  background: linear-gradient(180deg, transparent, var(--bg-elev));
  border-top: 1px solid var(--line-soft);
}

.shots-label {
  font-size: 11px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
  padding: 16px 28px 12px;
}

.shots {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  padding: 0 28px 4px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.shots::-webkit-scrollbar { height: 6px; }
.shots::-webkit-scrollbar-track { background: transparent; }
.shots::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 999px;
}
.shots::-webkit-scrollbar-thumb:hover { background: var(--ink-mute); }

.shot {
  flex-shrink: 0;
  height: 380px;
  border-radius: 18px;
  cursor: zoom-in;
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  object-fit: cover;
}
.shot:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.no-shots {
  padding: 20px 28px 8px;
  font-size: 13px;
  color: var(--ink-mute);
  font-style: italic;
}

/* ============================================
   Icon grid (App Icons page)
   ============================================ */
.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.icon-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px 24px 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
  animation: card-in 0.5s cubic-bezier(0.2, 0.9, 0.3, 1) backwards;
}
.icon-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.icon-card-icon {
  width: 120px;
  height: 120px;
  border-radius: 28px;
  margin: 0 auto 18px;
  box-shadow: 0 2px 0 rgba(0,0,0,0.04), 0 8px 20px rgba(0,0,0,0.1);
  object-fit: cover;
  display: block;
}

.icon-card-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 20px;
  letter-spacing: -0.01em;
  margin: 0 0 4px;
  color: var(--ink);
  font-variation-settings: "opsz" 28;
}

.icon-card-dev {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0 0 10px;
}

.icon-card-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 18px;
}

.icon-card-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.icon-card-btn {
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  cursor: pointer;
}
.icon-card-btn:hover {
  background: var(--bg-card);
  color: var(--ink);
  border-color: var(--ink-mute);
  transform: translateY(-1px);
}
.icon-card-btn.primary {
  background: var(--ink);
  color: var(--bg-elev);
  border-color: var(--ink);
}
.icon-card-btn.primary:hover {
  background: var(--accent);
  border-color: var(--accent);
}

/* ============================================
   Detail modal (App Icons page)
   ============================================ */
.detail-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 18, 15, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: lb-in 0.2s ease;
}

.detail-panel {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  max-width: 800px;
  width: 90vw;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 40px 100px rgba(0,0,0,0.3);
  animation: lb-img-in 0.25s cubic-bezier(0.2, 0.9, 0.3, 1);
  position: relative;
}

.detail-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  display: grid;
  place-items: center;
  font-size: 22px;
  cursor: pointer;
  z-index: 10;
  transition: all 0.15s ease;
}
.detail-close:hover {
  background: var(--ink);
  color: var(--bg-elev);
  border-color: var(--ink);
}

.detail-body {
  padding: 32px;
}

.detail-header {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-bottom: 28px;
  padding-right: 40px;
}

.detail-header-icon {
  width: 88px;
  height: 88px;
  border-radius: 20px;
  flex-shrink: 0;
  box-shadow: 0 2px 0 rgba(0,0,0,0.04), 0 8px 20px rgba(0,0,0,0.1);
  object-fit: cover;
}

.detail-info {
  flex: 1;
  min-width: 0;
}
.detail-info h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 24px;
  letter-spacing: -0.015em;
  margin: 0 0 4px;
  color: var(--ink);
  font-variation-settings: "opsz" 28;
}
.detail-info .detail-artist {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 8px;
}
.detail-info .detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.detail-screenshots-label {
  font-size: 11px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
  margin-bottom: 12px;
}

.detail-screenshots {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.detail-screenshots::-webkit-scrollbar { height: 6px; }
.detail-screenshots::-webkit-scrollbar-track { background: transparent; }
.detail-screenshots::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 999px;
}
.detail-screenshots::-webkit-scrollbar-thumb:hover { background: var(--ink-mute); }

.detail-screenshot {
  flex-shrink: 0;
  height: 320px;
  border-radius: 16px;
  cursor: zoom-in;
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease;
  object-fit: cover;
}
.detail-screenshot:hover {
  transform: translateY(-3px);
}

.detail-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
}

/* ============================================
   Lightbox
   ============================================ */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 15, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: lb-in 0.25s ease;
}
@keyframes lb-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes lb-img-in {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

#lightboxImage {
  max-width: 100%;
  max-height: 82vh;
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  object-fit: contain;
  animation: lb-img-in 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.9);
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: background 0.15s ease, transform 0.15s ease;
}
.lightbox-close:hover,
.lightbox-nav:hover {
  background: rgba(255,255,255,0.18);
  transform: scale(1.05);
}
.lightbox-close {
  top: 24px;
  right: 24px;
  width: 48px; height: 48px;
  font-size: 28px;
  line-height: 1;
}

.lightbox-nav {
  width: 52px; height: 52px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 32px;
  line-height: 1;
}
.lightbox-nav.lightbox-prev { left: 24px; }
.lightbox-nav.lightbox-next { right: 24px; }
.lightbox-nav.lightbox-prev:hover { transform: translateY(-50%) scale(1.05); }
.lightbox-nav.lightbox-next:hover { transform: translateY(-50%) scale(1.05); }
.lightbox-nav[disabled] { opacity: 0.3; cursor: not-allowed; }

/* ============================================
   Toast
   ============================================ */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: var(--bg-elev);
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px 32px;
  background: var(--bg-elev);
  position: relative;
  z-index: 2;
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--ink-mute);
}
.footer-inner .dot { color: var(--line); }

/* ============================================
   Responsive
   ============================================ */
@media (min-width: 720px) {
  .card-grid,
  .apps-grid { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 720px) {
  .header-inner { padding: 14px 18px; gap: 14px; }
  .brand-tag { display: none; }
  .header-nav { gap: 6px; }
  .tabs { padding: 3px; }
  .tab { padding: 7px 14px; font-size: 13px; }
  a.tab.nav-link { padding: 7px 14px; font-size: 13px; }
  .theme-toggle { width: 36px; height: 36px; }

  .hero { padding: 48px 18px 24px; }
  .hero-title { font-size: clamp(36px, 9vw, 52px); }
  .hero-sub { font-size: 15px; margin-bottom: 28px; }

  .search-bar {
    flex-wrap: wrap;
    border-radius: var(--radius-md);
    padding: 6px;
    gap: 6px;
  }
  .search-field {
    width: 100%;
    background: var(--bg-elev);
    border-radius: var(--radius-sm);
    padding: 6px 14px;
  }
  #searchInput { padding: 10px 0; }
  .search-divider { display: none; }
  .country-field {
    flex: 1;
    background: var(--bg-elev);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
  }
  .search-btn {
    padding: 12px 18px;
    border-radius: var(--radius-sm);
  }

  .quick-picks { margin-top: 20px; }

  .results-section,
  .saved-section { padding: 18px 18px 60px; }
  .section-heading { margin-bottom: 22px; padding-bottom: 12px; }
  .section-heading h2 { font-size: 22px; }

  .card-header { padding: 20px 20px 16px; gap: 14px; }
  .app-icon { width: 60px; height: 60px; border-radius: 14px; }
  .app-name { font-size: 18px; }
  .app-dev { font-size: 13px; }
  .icon-btn { width: 36px; height: 36px; }
  .icon-btn svg { width: 16px; height: 16px; }

  .shots-label { padding: 14px 20px 10px; }
  .shots { gap: 10px; padding: 0 20px 4px; }
  .shot { height: 280px; border-radius: 14px; }

  .lightbox-close { top: 14px; right: 14px; width: 42px; height: 42px; }
  .lightbox-nav { width: 44px; height: 44px; }
  .lightbox-nav.lightbox-prev { left: 10px; }
  .lightbox-nav.lightbox-next { right: 10px; }

  .icon-grid { gap: 16px; }
  .icon-card { padding: 24px 18px 20px; }
  .icon-card-icon { width: 92px; height: 92px; border-radius: 22px; }
  .icon-card-name { font-size: 17px; }
  .icon-card-btn { padding: 7px 14px; font-size: 12px; }
  .detail-panel { width: 96vw; border-radius: var(--radius-lg); }
  .detail-body { padding: 20px; }
  .detail-header { flex-direction: column; text-align: center; gap: 14px; }
  .detail-header-icon { width: 72px; height: 72px; border-radius: 18px; }
  .detail-info h2 { font-size: 20px; }
  .detail-info .detail-meta { justify-content: center; }
  .detail-screenshot { height: 240px; }
}

@media (min-width: 1100px) {
  .shot { height: 420px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
