/* ─── Safe area: Dynamic Island / notch / home indicator ─── */
header {
  padding-top: env(safe-area-inset-top);
}
body {
  padding-bottom: env(safe-area-inset-bottom);
}


/* ─── HTML background — prevents white overscroll flash and white view-transition gap ─── */
html {
  background-color: #f8fafc; /* slate-50, light mode */
  overscroll-behavior-y: none;
}
html.dark {
  background-color: #060f1e; /* ink, dark mode */
  color-scheme: dark;        /* tells browser chrome (scrollbars, inputs) to go dark too */
}


/* ─── View Transitions — smooth crossfade, no white flash ─── */
@view-transition {
  navigation: auto;
}

/* Lock the background during the transition so neither layer exposes white */
::view-transition-group(root) {
  background-color: #f8fafc;
}
html.dark ::view-transition-group(root) {
  background-color: #060f1e;
}

::view-transition-old(root) {
  animation: 100ms ease both vt-fade-out;
}
::view-transition-new(root) {
  animation: 150ms ease both vt-fade-in;
}

@keyframes vt-fade-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}
@keyframes vt-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}


/* ─── Page fade-in on load (fallback for browsers without view-transition) ─── */
@supports not (view-transition-name: none) {
  body { animation: vt-fade-in 0.18s ease both; }
}


/* ─── Nav link hover — subtle scale bounce, no white ─── */
.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border-radius: 0.625rem;
  padding: 0.375rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  transition:
    transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
    background-color 0.15s ease,
    color 0.15s ease;
  will-change: transform;
}
.nav-pill:hover {
  transform: scale(1.07);
  background-color: rgba(99, 102, 241, 0.08); /* indigo tint — not white */
}
html.dark .nav-pill:hover {
  background-color: rgba(99, 102, 241, 0.12);
}
.nav-pill:active {
  transform: scale(0.97);
  transition-duration: 0.08s;
}


/* ─── Global input / select / textarea baseline ─── */
input:not([type=submit]):not([type=button]):not([type=checkbox]):not([type=radio]),
select,
textarea {
  background: white;
  border-color: #e2e8f0;
  color: #0f172a;
  border-radius: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-width: 1px;
  border-style: solid;
  outline: none;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:not([type=submit]):not([type=button]):not([type=checkbox]):not([type=radio]):focus,
select:focus,
textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.dark input:not([type=submit]):not([type=button]):not([type=checkbox]):not([type=radio]),
.dark select,
.dark textarea {
  background: #0d1a2e;
  border-color: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
}
.dark input:not([type=submit]):not([type=button]):not([type=checkbox]):not([type=radio]):focus,
.dark select:focus,
.dark textarea:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}


/* ─── Scrollbar — thin and clean ─── */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 116, 139, 0.25) transparent;
}
html.dark * {
  scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}
