
/* ============================================================
   APP PAGES SECTION
   ============================================================ */

#pages-section {
  padding: 0 2rem;
  gap: 0;
}

.pages-intro {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 2rem;
  width: 100%;
  margin-bottom: 1.5rem;
}

.pages-intro__text {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  max-width: 600px;
}

.pages-intro__icon-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pages-intro__icon {
  width: clamp(8rem, 14vw, 12rem);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 22%;
  corner-shape: smooth;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.35), 3px 5px 30px rgba(0, 0, 0, 0.22);
}

@media (max-width: 680px) {
  .pages-intro {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 1rem;
  }

  .pages-intro__icon-wrap {
    justify-content: flex-start;
  }

  .pages-intro__icon {
    width: clamp(6rem, 28vw, 9rem);
  }
}

#pages-section .middle-section-title {
  margin-bottom: 0;
}

#pages-section .content {
  margin-bottom: 0;
}

.pages-app-frame {
  display: block;
  margin-top: 1.5rem;
}

.pages-content-area {
  width: 100%;
}

.page-panel {
  display: block;
  width: 100%;
  padding: 2rem 0 3rem;
  box-sizing: border-box;
  color: var(--dm-on-surface);
  scroll-margin-top: 96px;
}

.page-panel + .page-panel {
  border-top: 1px solid color-mix(in srgb, var(--dm-outline-variant) 25%, transparent);
  padding-top: 3rem;
}

/* ---- Coming-soon placeholder for unfinished sections ---- */
.placeholder-section {
  min-height: 55vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-align: center;
  opacity: 0.38;
}

.placeholder-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: var(--dm-surface-container);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.25rem;
}

.placeholder-icon {
  font-size: 2rem;
  color: var(--dm-on-surface-variant);
}

.placeholder-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--dm-on-surface);
  margin: 0;
  letter-spacing: 0.02em;
}

.placeholder-sublabel {
  font-size: 0.82rem;
  color: var(--dm-on-surface-variant);
  margin: 0;
}

/* ============================================================
   FLOATING PAGE SECTION NAV
   Same glass material as the app tabbar below. Fixed top-center;
   JS toggles --visible so it never co-shows with the sticky
   dm-nav tabbar inside #pages-section.
   ============================================================ */

/* Note: `left: 50% + transform: translateX(-50%)` for centering is static —
   never animated. Chrome/Safari flatten backdrop-filter on an element whose
   *own* transform is mid-animation (the same reason the app tabbar below
   keeps its blur on a plain, non-transformed .dm-tabbar child rather than
   animating the sticky wrapper itself). Show/hide here animates opacity +
   top instead, so the blurred element's transform never changes. */
.dm-page-nav {
  position: fixed;
  top: -4rem;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
  z-index: 50;

  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px;
  border-radius: 999px;

  background: rgba(255, 255, 255, 0.60);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);

  transition:
    top     0.45s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.35s ease;
}

.dm-page-nav--visible {
  top: 1.25rem;
  opacity: 1;
  pointer-events: auto;
}

.dm-page-nav a {
  position: relative;
  z-index: 1;
  font-family: 'Roboto Flex', system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1;
  padding: 9px 14px;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  color: var(--dm-on-surface-variant);
  transition: color 0.2s ease;
}

.dm-page-nav a:hover {
  color: var(--dm-on-surface);
}

.dm-page-nav a.active {
  color: var(--dm-primary);
}

/* Sliding capsule — JS positions it under the active link (left/width),
   mirroring the app tabbar's own pill so both navs share one motion language. */
.dm-page-nav__pill {
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 0;
  width: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--dm-secondary-container) 70%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 0 0 1px rgba(255, 255, 255, 0.30);
  pointer-events: none;
  transition: left 0.4s cubic-bezier(0.22, 1, 0.36, 1), width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  .dm-page-nav {
    background: rgba(37, 43, 41, 0.60);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  }

  .dm-page-nav__pill {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.14),
      inset 0 0 0 1px rgba(255, 255, 255, 0.10);
  }
}

/* Mobile: the back button + app tabbar are enough wayfinding */
@media (max-width: 900px) {
  .dm-page-nav { display: none; }
}

/* Anchored sections land clear of the floating nav */
#overview,
#platforms,
#built-with,
#screenshots-section,
#presentation-section {
  scroll-margin-top: 5.5rem;
}

@media (prefers-reduced-motion: reduce) {
  .dm-page-nav { transition: none; }
  .dm-page-nav__pill { transition: none; }
}

/* ============================================================
   SPRING PILL NAV (app's CustomTabBar / TabSidebar, web port)
   ============================================================ */

.dm-nav-wrapper {
  --dm-nav-primary:              var(--dm-primary);
  --dm-nav-on-surface-variant:   var(--dm-on-surface-variant);
  --dm-nav-secondary-container:  color-mix(in srgb, var(--dm-secondary-container) 70%, transparent);
  --dm-nav-bar-bg:               rgba(255, 255, 255, 0.60);
  --dm-nav-bar-shadow:           rgba(0, 0, 0, 0.18);
  --dm-nav-pill-highlight:       rgba(255, 255, 255, 0.55);
  --dm-nav-pill-border:          rgba(255, 255, 255, 0.40);

  position: relative;
}

@media (prefers-color-scheme: dark) {
  .dm-nav-wrapper {
    --dm-nav-bar-bg:               rgba(37, 43, 41, 0.60);
    --dm-nav-bar-shadow:           rgba(0, 0, 0, 0.45);
    --dm-nav-pill-highlight:       rgba(255, 255, 255, 0.14);
    --dm-nav-pill-border:          rgba(255, 255, 255, 0.10);
  }
}

.dm-tab-item {
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; padding: 0; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  color: var(--dm-nav-on-surface-variant);
}
.dm-tab-item:focus-visible {
  outline: 2px solid var(--dm-nav-primary);
  outline-offset: -6px;
  border-radius: 24px;
}
.dm-tab-content {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px; pointer-events: none;
}
.dm-tab-label {
  font-size: 9px; font-weight: 600;
  letter-spacing: 0.2px; line-height: 1;
  white-space: nowrap;
}
ion-icon { font-size: 22px; }

.dm-pill-outer {
  pointer-events: none;
  position: absolute;
  box-shadow: 0 2px 2px rgba(0, 0, 0, 0.12);
  will-change: transform;
  transform-origin: center;
}
.dm-pill-inner {
  position: absolute; inset: 0;
  overflow: hidden;
  background: var(--dm-nav-secondary-container);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    inset 0 1px 0 var(--dm-nav-pill-highlight),
    inset 0 0 0 1px var(--dm-nav-pill-border);
}
.dm-active-row {
  position: absolute; top: 0; left: 0;
  display: flex; align-items: center;
  will-change: transform;
}
.dm-active-row .dm-tab-content { color: var(--dm-nav-primary); }
.dm-pill-hit {
  pointer-events: auto;
  position: absolute;
  touch-action: none;
  cursor: grab;
  will-change: transform;
  transform-origin: center;
}
.dm-pill-hit:active { cursor: grabbing; }

.dm-tabbar {
  pointer-events: auto;
  position: relative;
  display: flex; align-items: center;
  background: var(--dm-nav-bar-bg);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  box-shadow: 0 8px 24px var(--dm-nav-bar-shadow);
}

/* ---- Tab bar — sticky, centered, floating above content ---- */
.dm-nav-wrapper.mode-bottom {
  position: sticky;
  top: 1.5rem;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  pointer-events: none;
}

/* Invisible blocker below the tabbar — prevents widgets from entering hover state
   when the cursor is in the gap between the bar and the content beneath it */
.dm-nav-wrapper.mode-bottom::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 3rem;
  pointer-events: auto;
}

.dm-nav-wrapper.mode-bottom .dm-tabbar {
  flex-direction: row;
  width: 100%;
  max-width: 360px;
  padding: 4px 0;
  border-radius: 40px;
}
.dm-nav-wrapper.mode-bottom .dm-tab-item { flex: 1; height: 56px; }
.dm-nav-wrapper.mode-bottom .dm-pill-outer,
.dm-nav-wrapper.mode-bottom .dm-pill-hit  { border-radius: 35px; }
.dm-nav-wrapper.mode-bottom .dm-pill-inner { border-radius: 35px; }
.dm-nav-wrapper.mode-bottom .dm-active-row { flex-direction: row; top: 0; bottom: 0; }
