/*
 * DMP Viewer: tokens, the font and what every page of ours shares.
 * The look is the vyzn'aries family (copied from the Viewer, ifc-viewer src/styles.css): cool paper with a
 * faint wash, white cards on hairlines, navy-tinted shadows, pill buttons. Navy #1D3461 is the primary colour.
 * Yellow #F8B400 is a fill only, never a text colour.
 * Sizes are in px on purpose: the bar also lives on Romana's page, whose root font size is 13 px.
 */

@font-face {
  font-family: "Geist Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("geist-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --font: "Geist Variable", "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, ui-sans-serif, system-ui,
    sans-serif;
  --paper: #f6f7fb;
  --card: #ffffff;
  --ink: #0f172a;
  --heading: #1d3461;
  --muted: #64748b;
  --muted-bg: #f1f3f8;
  --navy: #1d3461;
  --navy-hover: #26437a;
  --blue: #1c4c98;
  --yellow: #f8b400;
  --lavender: #ecedff;
  --cream: #fff4e0;
  --accent: rgba(29, 52, 97, 0.06);
  --danger: #d2462c;
  --danger-soft: #fdf0ed;
  --success: #1a9a63;
  --hairline: rgba(17, 24, 39, 0.08);
  --input: rgba(17, 24, 39, 0.14);
  --ring: rgba(28, 76, 152, 0.7);
  --shadow-ring: 0 0 0 1px rgba(17, 24, 39, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px -12px rgba(29, 52, 97, 0.12);
  --shadow-float: 0 2px 4px rgba(15, 23, 42, 0.04), 0 24px 60px -24px rgba(29, 52, 97, 0.28);
  --shadow-button: 0 1px 0 rgba(255, 255, 255, 0.12) inset, 0 6px 16px -8px rgba(29, 52, 97, 0.55);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --bar: 64px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background:
    radial-gradient(ellipse 70% 45% at 90% -10%, rgba(29, 52, 97, 0.1), transparent 62%),
    radial-gradient(ellipse 55% 45% at 0% 105%, rgba(248, 180, 0, 0.07), transparent 60%), var(--paper);
  background-attachment: fixed;
}

::selection {
  background: rgba(29, 52, 97, 0.14);
  color: #1d3461;
}

h1,
h2,
h3 {
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
}

a {
  color: var(--blue);
  text-underline-offset: 3px;
}

[hidden] {
  display: none !important;
}

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

.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* The bar's place, before bar.js has drawn it: nothing jumps when it appears. */
dmp-bar {
  display: block;
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--bar);
  border-bottom: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.8);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  backdrop-filter: blur(24px) saturate(1.5);
}

/* Buttons: pills, as in the family. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition:
    background-color 150ms ease-out,
    border-color 150ms ease-out,
    color 150ms ease-out,
    box-shadow 150ms ease-out,
    transform 150ms ease-out;
}
.btn:active {
  transform: translateY(1px);
}
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
.btn svg {
  flex: none;
  width: 16px;
  height: 16px;
}
.btn--primary {
  background: var(--navy);
  color: #fff;
  box-shadow: var(--shadow-button);
}
.btn--primary:hover {
  background: var(--navy-hover);
}
.btn--outline {
  border-color: var(--input);
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-ring);
}
.btn--outline:hover {
  border-color: rgba(29, 52, 97, 0.3);
  color: var(--navy);
}
.btn--ghost {
  color: var(--muted);
}
.btn--ghost:hover {
  background: var(--accent);
  color: var(--navy);
}
.btn--danger {
  background: var(--danger);
  color: #fff;
}
.btn--danger:hover {
  background: #bd3d25;
}
.btn--sm {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
}
.btn--lg {
  height: 48px;
  padding: 0 24px;
  font-size: 15px;
}
@media (pointer: coarse) {
  .btn,
  .btn--sm {
    min-height: 44px;
  }
}

/* White card on a hairline with the soft navy lift. */
.surface {
  border: 1px solid var(--hairline);
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow-card);
}

.eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* The page under the bar. */
.page {
  width: 100%;
  max-width: 768px;
  margin: 0 auto;
  padding: 48px 16px 64px;
  animation: fade-in 0.32s var(--ease) both;
}
.page-title {
  color: var(--heading);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.page-lead {
  max-width: 60ch;
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}
@media (min-width: 640px) {
  .page {
    padding: 72px 24px 80px;
  }
  .page-title {
    font-size: 34px;
  }
}

/* A ring that turns: sign-in running, a model opening. */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(29, 52, 97, 0.18);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Progress: a bar that fills, or slides when the end is not known. */
.progress-track {
  position: relative;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--lavender);
}
.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--navy);
  transition: width 200ms ease-out;
}
.progress-track[data-indeterminate="true"] .progress-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 35%;
  animation: progress-slide 1.4s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

/* The page that says a model is gone. */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding: 56px 24px;
  text-align: center;
}
.empty-disc {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--lavender);
  color: var(--navy);
}
.empty-disc svg {
  width: 30px;
  height: 30px;
}
.empty h1 {
  color: var(--heading);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.empty p {
  max-width: 52ch;
  color: var(--muted);
}
.empty .btn {
  margin-top: 12px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes progress-slide {
  0% {
    left: -35%;
  }
  100% {
    left: 100%;
  }
}
@keyframes fade-in {
  0% {
    opacity: 0;
    transform: translateY(4px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Reduced motion: nothing slides, fades or eases. What says "still working" keeps moving, slowed. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
  .spinner {
    animation-duration: 2.4s !important;
    animation-iteration-count: infinite !important;
  }
  .progress-track[data-indeterminate="true"] .progress-bar {
    animation-duration: 3.5s !important;
    animation-iteration-count: infinite !important;
  }
}
