/* Reset, typography and page layout */

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

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

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-system);
  font-size: var(--font-size-body);
  line-height: 1.35;
  color: var(--color-text);
  background: var(--color-background);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* The gradient behind everything, so the glass blur is visible.
   A fixed pseudo-element is used because iOS ignores background-attachment: fixed. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--background-gradient);
  pointer-events: none;
}

h1,
h2,
h3,
p {
  margin: 0;
}

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

a {
  color: var(--color-accent);
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

body.has-sheet {
  overflow: hidden;
}

/* Elements with the hidden attribute stay hidden, even when a class sets display */
[hidden] {
  display: none !important;
}

/* Main area: leaves room for the floating tab bar on phones,
   and for the floating sidebar on wide screens */
.main {
  min-height: 100dvh;
  padding-bottom: calc(var(--tabbar-height) + max(var(--tabbar-gap), env(safe-area-inset-bottom)) + var(--space-6));
}

@media (min-width: 900px) {
  .main {
    margin-left: calc(var(--sidebar-width) + var(--sidebar-gap));
    padding-bottom: var(--space-7);
  }
}

/* Centered, readable content column */
.page-content {
  max-width: var(--content-width);
  margin: 0 auto;
  padding-left: calc(var(--gutter) + env(safe-area-inset-left));
  padding-right: calc(var(--gutter) + env(safe-area-inset-right));
}

/* Page transition */
.view-enter {
  animation: view-enter var(--duration-page) var(--ease-spring);
}

@keyframes view-enter {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}
