/* Reset, typography and the top bar (task.md sections 9.3 and 9.4). */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: var(--leading-text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--leading-tight);
}

p {
  margin: 0;
  max-width: 60ch;
}

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

button,
input {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-3);
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--btn-bg);
  color: #fff;
  text-decoration: none;
}

.skip-link:focus {
  top: calc(var(--space-2) + env(safe-area-inset-top));
}

/* --- offline banner ----------------------------------------------------- */

.banner {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  padding-top: calc(var(--space-3) + env(safe-area-inset-top));
  background: var(--alert-bg);
  color: #fff;
  text-align: center;
  font-size: var(--text-sm);
  font-weight: 800;
}

/* --- top bar ------------------------------------------------------------ */

/* A separate block in the flow, not a bar floating over the photo: the owner asked
   for the header to sit above the picture instead of on top of it. It scrolls away
   with the page (no sticky), so it never covers a disc or the map. */
.topbar {
  padding: var(--space-3) var(--space-4);
  padding-top: calc(var(--space-3) + env(safe-area-inset-top));
  background: var(--paper);
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 8%, transparent);
}

.topbar__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.topbar__title {
  font-size: var(--text-lg);
  text-align: center;
  letter-spacing: -0.01em;
}

/* --- shared button ------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--tap);
  padding: var(--space-3) var(--space-5);
  border: 0;
  border-radius: var(--radius-md);
  background: var(--btn-bg);
  box-shadow: 0 var(--node-edge) 0 var(--violet-deep);
  color: #fff;
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
  cursor: pointer;
  transition:
    transform var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
}

.btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--violet-deep);
}

.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn--ghost {
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  border: 2px solid color-mix(in srgb, var(--ink) 12%, transparent);
}

.btn--ghost:active {
  transform: translateY(2px);
  box-shadow: none;
}

.btn--full {
  width: 100%;
}

/* --- motion preferences ------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
