/* base.css – app shell for iOS/iPadOS home-screen apps (document never scrolls). */

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

html {
  height: 100%;
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: manipulation;
}

body {
  position: fixed;
  inset: 0;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background-color: var(--paper);
  /* dotted travel-journal paper */
  background-image: radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--ink) 8%, transparent) 1.3px, transparent 1.7px);
  background-size: 26px 26px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-m);
  line-height: 1.35;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

#app {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  padding: max(10px, var(--safe-top)) max(12px, var(--safe-right)) max(12px, var(--safe-bottom)) max(12px, var(--safe-left));
}
.is-tablet #app {
  padding: max(14px, var(--safe-top)) max(20px, var(--safe-right)) max(16px, var(--safe-bottom)) max(20px, var(--safe-left));
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  margin: 0;
  letter-spacing: .005em;
}
h1 { font-size: var(--fs-xl); }
h2 { font-size: var(--fs-l); }
h3 { font-size: var(--fs-m); }
p { margin: 0; }

img, svg { -webkit-user-drag: none; user-select: none; }
img { display: block; max-width: 100%; }

button {
  font: inherit;
  color: inherit;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}
button:disabled { cursor: default; }

input, textarea, select {
  font: inherit;
  font-size: max(16px, 1em);      /* prevents iOS focus zoom */
  color: var(--ink);
  -webkit-user-select: text;
  user-select: text;
}

a { color: var(--sky-2); }

:focus { outline: none; }
:focus-visible {
  outline: 4px solid var(--sky);
  outline-offset: 3px;
  border-radius: var(--r-s);
}

.scroll {
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

.board, .no-touch-gestures { touch-action: none; }

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

[hidden] { display: none !important; }

/* Night mode: illustrations a touch dimmer */
:root[data-theme="night"] img:not(.no-dim) { filter: brightness(.88) saturate(.9); }

/* Reduced motion (system setting OR app setting via data-motion) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
:root[data-motion="reduced"] *, :root[data-motion="reduced"] *::before, :root[data-motion="reduced"] *::after {
  animation-duration: .01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .01ms !important;
}
