/* Galago — reset, layout shell, typography. PRD §11/§12. */

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

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font-sans);
  font-weight: var(--fw-normal);
  font-size: var(--fs-md);
  color: var(--c-ink);
  background: radial-gradient(120% 120% at 50% 0%, var(--c-paper) 0%, var(--c-paper-2) 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Touch-first: no tap highlight, no text selection on chrome, no callout. */
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  overflow-x: hidden;
}

h1,
h2,
h3 {
  font-weight: var(--fw-bold);
  line-height: 1.1;
  margin: 0 0 var(--sp-3);
}
h1 {
  font-size: var(--fs-2xl);
}
h2 {
  font-size: var(--fs-xl);
}
h3 {
  font-size: var(--fs-lg);
}
p {
  margin: 0 0 var(--sp-3);
  line-height: 1.45;
}

/* App root + safe-area insets for the iPad home indicator / notch. PRD §12. */
#app {
  min-height: 100%;
  min-height: 100dvh;
  padding: max(var(--sp-4), env(safe-area-inset-top)) max(var(--sp-4), env(safe-area-inset-right))
    max(var(--sp-4), env(safe-area-inset-bottom)) max(var(--sp-4), env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
}

.screen {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  animation: screen-in var(--dur-med) var(--ease-out);
}

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

/* Top bar shared by hub screens. */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.spacer {
  flex: 1;
}

.center-stack {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--sp-5);
}

.grid {
  display: grid;
  gap: var(--sp-4);
}
.grid.cols-auto {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

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

/* Landscape iPad (1024×768): keep hub content from getting too tall. */
@media (orientation: landscape) and (max-height: 820px) {
  h1 {
    font-size: var(--fs-xl);
  }
}
