:root {
  --screen: #eee9e1;
  --surface: #f5f1ea;
  --text: #2a2622;
  --text-muted: #5a524a;
  --tint: #0a7ea4;
  --border: #d5cec4;
  --shadow: rgba(42, 38, 34, 0.08);
  --site-chrome-height: 56px;
  --site-header-offset: calc(env(safe-area-inset-top) + 0.5in);
}

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

html {
  scroll-behavior: smooth;
  scroll-snap-type: y proximity;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial,
    sans-serif;
  background: var(--screen);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.site {
  display: block;
}

.section {
  min-height: 100dvh;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: center;
}

.section--image {
  padding: 0;
  padding-bottom: calc(var(--site-chrome-height) + env(safe-area-inset-bottom));
  background: var(--screen);
  box-sizing: border-box;
}

.slide-image {
  display: block;
  width: 100%;
  height: calc(100dvh - var(--site-chrome-height) - env(safe-area-inset-bottom));
  min-height: 280px;
  object-fit: contain;
  object-position: center;
  background: var(--screen);
}

.scroll-nav {
  position: fixed;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 6px;
  border-radius: 999px;
  background: rgba(245, 241, 234, 0.88);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.scroll-nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease;
}

.scroll-nav-dot.is-active {
  background: var(--tint);
  transform: scale(1.35);
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 8;
  padding-top: var(--site-header-offset);
  padding-right: max(16px, env(safe-area-inset-right));
  padding-left: max(16px, env(safe-area-inset-left));
  padding-bottom: 14px;
  background: linear-gradient(
    180deg,
    rgba(238, 233, 225, 0.98) 0%,
    rgba(238, 233, 225, 0.92) 75%,
    rgba(238, 233, 225, 0) 100%
  );
  pointer-events: none;
}

.site-nav {
  pointer-events: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 36px;
  max-width: 960px;
  margin: 0 auto;
}

.site-nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.2;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--tint);
  border-bottom-color: var(--tint);
}

.sound-hint {
  position: fixed;
  left: 50%;
  bottom: calc(var(--site-chrome-height) + 16px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 6;
  margin: 0;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(42, 38, 34, 0.82);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.sound-hint:active {
  transform: translateX(-50%) scale(0.98);
}

.sound-hint--status {
  cursor: default;
  max-width: min(92vw, 360px);
  text-align: center;
  line-height: 1.35;
}

.site-chrome {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 7;
  background: rgba(245, 241, 234, 0.97);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 32px rgba(42, 38, 34, 0.06);
  backdrop-filter: blur(12px);
}

.site-chrome-inner {
  max-width: 1080px;
  margin: 0 auto;
  min-height: var(--site-chrome-height);
  padding: 10px 20px calc(10px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: center;
}

.audio-controls {
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.audio-btn {
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: none;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.2;
}

.audio-btn--primary {
  background: var(--tint);
  border-color: var(--tint);
  color: #fff;
}

.audio-btn--primary.audio-btn--muted {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-muted);
}

.audio-btn:active {
  transform: scale(0.98);
}

@media (max-width: 767px) {
  html {
    scroll-snap-type: none;
  }

  .section {
    min-height: auto;
  }

  .section--image {
    padding-top: calc(var(--site-header-offset) + 48px);
    padding-bottom: calc(var(--site-chrome-height) + 12px + env(safe-area-inset-bottom));
  }

  .slide-image {
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
  }

  .scroll-nav {
    display: none;
  }

  .site-header {
    padding-bottom: 10px;
  }

  .site-nav {
    gap: 8px 16px;
  }

  .site-nav a {
    font-size: 0.8125rem;
    white-space: normal;
    text-align: center;
  }
}

@media (max-width: 380px) {
  .site-nav {
    gap: 6px 12px;
  }

  .site-nav a {
    font-size: 0.75rem;
  }

  .audio-btn {
    padding: 8px 14px;
    font-size: 0.8125rem;
  }
}

@media (min-width: 768px) {
  .scroll-nav {
    right: 18px;
  }
}

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