/* Hermes Deck — browse + present
   Normal: continuous layout (no forced viewport gaps)
   Present (.is-presenting): one [data-deck-page] per viewport, remote-driven
*/

:root {
  --deck-nav-active: #3ecf8e;
  --deck-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* —— Top nav active chapter —— */
#nav a.is-active,
.site-nav a.is-active,
header nav a.is-active {
  color: var(--deck-nav-active) !important;
}

.is-presenting #nav a.is-active,
.is-presenting .site-nav a.is-active {
  text-shadow: 0 0 18px rgba(62, 207, 142, 0.35);
}

/* —— Present chrome (only while presenting; no browse-mode FAB) —— */
.deck-exit {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 90;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(24, 23, 28, 0.92);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  display: none;
  place-items: center;
}
.is-presenting .deck-exit { display: grid; }

.deck-progress {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 85;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  display: none;
}
.is-presenting .deck-progress { display: block; }
.deck-progress > i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--deck-nav-active);
  transition: width 0.25s var(--deck-ease);
}

/* —— Normal browse: scroll reveal (no extra page gaps) —— */
[data-reveal],
.js-reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--deck-ease), transform 0.7s var(--deck-ease);
  transition-delay: var(--reveal-delay, 0ms);
}
[data-reveal].is-inview,
.js-reveal.is-inview {
  opacity: 1;
  transform: none;
}

/* Stagger helpers */
[data-reveal="1"] { --reveal-delay: 0ms; }
[data-reveal="2"] { --reveal-delay: 80ms; }
[data-reveal="3"] { --reveal-delay: 160ms; }
[data-reveal="4"] { --reveal-delay: 240ms; }
[data-reveal="5"] { --reveal-delay: 320ms; }
[data-reveal="6"] { --reveal-delay: 400ms; }

/* —— Charts: animate when entering view —— */
[data-chart],
.js-chart {
  --chart-progress: 0;
}
[data-chart].is-chart-live,
.js-chart.is-chart-live {
  animation: deckChartIn 0.9s var(--deck-ease) both;
}
[data-chart].is-chart-replay .deck-bar,
.js-chart.is-chart-replay .deck-bar {
  transform-origin: left center;
  animation: deckBarGrow 0.85s var(--deck-ease) both;
}
[data-chart].is-chart-replay .deck-bar:nth-child(2) { animation-delay: 0.08s; }
[data-chart].is-chart-replay .deck-bar:nth-child(3) { animation-delay: 0.16s; }
[data-chart].is-chart-replay .deck-bar:nth-child(4) { animation-delay: 0.24s; }
[data-chart].is-chart-replay .deck-bar:nth-child(5) { animation-delay: 0.32s; }

@keyframes deckChartIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@keyframes deckBarGrow {
  from { transform: scaleX(0); opacity: 0.35; }
  to { transform: scaleX(1); opacity: 1; }
}

/* —— Present mode only: PPT pages —— */
/* Keep html scrollable for programmatic scrollTop; native wheel/touch is locked in JS */
/*
  4:3 is the CONTENT safe zone (padding inset), NOT the background frame.
  Each page still paints full viewport so the next slide cannot peek in.
*/
html.is-presenting {
  height: 100%;
  height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-behavior: auto;
  overscroll-behavior: none;
  --deck-safe-w: min(100vw, calc(100dvh * 4 / 3));
  --deck-safe-h: min(100dvh, calc(100vw * 3 / 4));
  --deck-pad-x: max(0px, calc((100vw - var(--deck-safe-w)) / 2));
  --deck-pad-y: max(0px, calc((100dvh - var(--deck-safe-h)) / 2));
}

html.is-presenting body {
  overflow: visible;
  min-height: 100%;
  font-size: clamp(16px, 1.35vmin + 0.35rem, 26px);
}

html.is-presenting .footer { display: none; }

html.is-presenting [data-deck-page] {
  box-sizing: border-box;
  width: 100vw;
  max-width: none;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  min-height: 100vh;
  min-height: 100dvh;
  height: 100dvh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* Full-bleed background; 4:3 CONTENT safe zone via padding only */
  padding-top: max(1.25rem, var(--deck-pad-y));
  padding-bottom: max(1rem, var(--deck-pad-y));
  padding-left: max(1.5rem, var(--deck-pad-x));
  padding-right: max(1.5rem, var(--deck-pad-x));
  overflow: hidden;
}

html.is-presenting [data-deck-page].is-deck-enter {
  animation: deckPageIn 0.55s var(--deck-ease) both;
}

@keyframes deckPageIn {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: none; }
}

html.is-presenting img {
  max-height: 48vh;
  object-fit: cover;
}

html.is-presenting .work-grid,
html.is-presenting .svc-list {
  max-height: 62vh;
  overflow: auto;
  width: min(1100px, 100%);
}

html.is-presenting .features,
html.is-presenting .why-grid,
html.is-presenting .partner-logos {
  width: min(1100px, 100%);
}

@media (max-width: 720px) {
  html.is-presenting [data-deck-page] {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal],
  .js-reveal,
  html.is-presenting [data-deck-page].is-deck-enter,
  [data-chart].is-chart-live,
  .js-chart.is-chart-live,
  .deck-bar {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
