html {
  background: var(--color-bg);
  color-scheme: dark;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  color: var(--color-text);
  background: var(--color-bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(255, 107, 43, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 80% 120%, rgba(226, 62, 43, 0.05) 0%, transparent 50%);
  background-attachment: fixed;
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

p { color: var(--color-text-muted); line-height: var(--lh-normal); }

strong { color: var(--color-text); font-weight: 600; }

/* Scrollbar (webkit) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: var(--radius-pill); border: 2px solid var(--color-bg); }
::-webkit-scrollbar-thumb:hover { background: var(--color-border-strong); }

/* Selection */
::selection { background: var(--color-ember); color: white; }

/* Loading state */
.app-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: var(--sp-4);
  color: var(--color-text-muted);
}

.ember-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gradient-ember);
  box-shadow: var(--shadow-ember);
  animation: ember-pulse 1.4s ease-in-out infinite;
}

@keyframes ember-pulse {
  0%, 100% { transform: scale(1); opacity: 1; box-shadow: 0 0 20px var(--color-ember-glow); }
  50% { transform: scale(1.15); opacity: 0.85; box-shadow: 0 0 40px var(--color-ember-glow); }
}

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

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

/* View transitions */
.view-enter {
  animation: fade-in var(--dur-med) var(--ease-out);
}

/* Print */
@media print {
  body {
    background: white;
    color: black;
  }
  .app-header, .app-tabbar, .filter-drawer, .btn, .toast-root, [data-no-print] {
    display: none !important;
  }
  .recipe-detail {
    padding: 0 !important;
    max-width: 100% !important;
  }
  .recipe-detail h1, .recipe-detail h2, .recipe-detail h3 {
    color: black;
  }
  .recipe-detail .card, .recipe-detail .detail-card {
    background: white !important;
    border: 1px solid #ddd !important;
    box-shadow: none !important;
    break-inside: avoid;
  }
}
