/* ============================================================
   APOHO WiFi Landing Page — design tokens (modern light theme)
   Single full-viewport layout: no vertical/horizontal scrolling.
   ============================================================ */
:root {
  --bg-top: #ffffff;
  --bg-mid: #eef4ff;
  --bg-bottom: #dbe8fb;

  --text-primary: #0f2540;
  --text-secondary: #4a6a8f;
  --text-muted: #7d93ad;

  --accent: #2f6feb;
  --accent-soft: #eaf1ff;

  --pill-bg: #ffffff;

  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(47, 111, 235, 0.18);

  --radius-pill: 9999px;
  --radius-card: 18px;

  --shadow-soft: 0 18px 44px rgba(47, 111, 235, 0.16);
  --shadow-chip: 0 10px 26px rgba(47, 111, 235, 0.12);

  --font: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont,
          "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@font-face {
  font-family: "Caveat";
  src: url("/static/fonts/Caveat-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "Caveat";
  src: url("/static/fonts/Caveat-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: block;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--text-primary);
  background: #0a1628;
  height: 100dvh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---- Full-page background — employee images cycle here ---- */
.page-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: #0a1628;
  background-size: cover;
  background-position: 70% center;
  background-repeat: no-repeat;
  opacity: 1;
  transition: opacity 0.6s ease-in-out;
  animation: subtleZoom 20s ease-in-out infinite;
  transform-origin: center center;
  will-change: transform;
}

.page-bg.is-changing {
  opacity: 0;
}

@keyframes subtleZoom {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

a { color: inherit; text-decoration: none; }

/* ============================================================
   Page shell — fills the viewport exactly
   ============================================================ */
.page {
  min-height: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ============================================================
   Clock — floating top-right
   ============================================================ */
.clock {
  position: absolute;
  top: 20px;
  right: 28px;
  z-index: 10;
  text-align: right;
  line-height: 1.2;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.clock-time { font-size: 3.2rem; font-weight: 700; font-variant-numeric: tabular-nums; color: #ffffff; text-shadow: 0 3px 14px rgba(0, 0, 0, 0.35); }
.clock-date { font-size: 1.9rem; color: rgba(255, 255, 255, 0.8); text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3); }

/* ============================================================
   Main — centers content vertically, fills remaining height
   ============================================================ */
.main {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(10px, 1.6vh, 18px);
  padding: clamp(12px, 2vh, 22px) clamp(18px, 3vw, 48px);
}

/* ============================================================
   Hero — text on left side, employee images as background
   ============================================================ */
.hero {
  flex: 1 1 auto;
  min-height: 0;
  max-width: 40%;
  width: 100%;
  margin: 0;
  margin-left: 5%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  text-align: left;
}

.hero-heading {
  margin: 0 0 18px;
  font-family: "Caveat", cursive;
  font-size: clamp(3.5rem, 8vw, 7rem);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-wrap: balance;
  color: #ffffff;
  transform: rotate(-2deg);
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  animation: textSlideIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-heading.is-changing {
  animation: textSlideOut 0.3s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}

.hero-sub {
  margin: 0;
  max-width: 52ch;
  font-size: clamp(0.95rem, 1.4vw, 1.15rem);
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  animation: subSlideIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
  opacity: 0;
}

.hero-sub.is-changing {
  animation: subSlideOut 0.3s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}

@keyframes subSlideIn {
  0% {
    opacity: 0;
    transform: translateY(20px);
    filter: blur(4px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes subSlideOut {
  0% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-15px);
    filter: blur(4px);
  }
}

@keyframes textSlideIn {
  0% {
    opacity: 0;
    transform: translateY(20px) rotate(-2deg);
    filter: blur(4px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotate(-2deg);
    filter: blur(0);
  }
}

@keyframes textSlideOut {
  0% {
    opacity: 1;
    transform: translateY(0) rotate(-2deg);
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-15px) rotate(-2deg);
    filter: blur(4px);
  }
}

/* ---- Slideshow status (progress bar only) ---- */
.slideshow-status {
  margin-top: 24px;
  width: 200px;
}

.slideshow-progress {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  overflow: hidden;
}

.slideshow-progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, rgba(255,255,255,0.6), #ffffff);
  border-radius: 3px;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

/* ============================================================
   Apps — iOS-style grid inside liquid glass container
   ============================================================ */
.apps { min-width: 0; width: 100%; max-width: 680px; margin: 0 auto; }

.apps-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px 22px;
  padding: 22px 28px;
  border-radius: 32px;
  background: var(--apps-bg, rgba(255, 255, 255, 0.12));
  backdrop-filter: blur(var(--apps-blur, 20px)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--apps-blur, 20px)) saturate(180%);
  border: 1px solid var(--apps-border, rgba(255, 255, 255, 0.3));
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.app-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  width: 68px;
  text-decoration: none;
  color: var(--text-primary);
  transition: transform 0.18s ease;
}

.app-item:hover { transform: translateY(-3px); }

.app-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.app-item:hover .app-icon {
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.app-icon img { width: 24px; height: 24px; }

/* Icon colors */
.app-icon[data-icon="file-check"] img { filter: hue-rotate(0deg) saturate(2) brightness(0.7); }
.app-icon[data-icon="shield-check"] img { filter: hue-rotate(80deg) saturate(2) brightness(0.7); }
.app-icon[data-icon="mail"] img { filter: hue-rotate(-30deg) saturate(2) brightness(0.7); }
.app-icon[data-icon="utility-pole"] img { filter: hue-rotate(30deg) saturate(2) brightness(0.7); }
.app-icon[data-icon="map"] img { filter: hue-rotate(200deg) saturate(2) brightness(0.7); }
.app-icon[data-icon="plane-takeoff"] img { filter: hue-rotate(150deg) saturate(2) brightness(0.7); }
.app-icon[data-icon="brain"] img { filter: hue-rotate(280deg) saturate(2) brightness(0.7); }

.app-label {
  display: none;
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 10;
}

.app-item { position: relative; }

.app-item:hover .app-label {
  display: block;
  opacity: 1;
}

/* ============================================================
   Ticker — pinned to the very bottom, flat frosted glass
   ============================================================ */
.ticker-wrap {
  flex: 0 0 auto;
  width: 100%;
  position: relative;
  z-index: 2;
  background: var(--ticker-bg, rgba(255, 255, 255, 0.12));
  backdrop-filter: blur(var(--ticker-blur, 18px)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--ticker-blur, 18px)) saturate(180%);
  border-top: 1px solid var(--ticker-border, rgba(255, 255, 255, 0.3));
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.1);
}

.ticker-viewport {
  max-width: 1280px;
  margin: 0 auto;
  min-height: 46px;
  padding: 0 clamp(18px, 3vw, 48px);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent,
                      black 28px, black calc(100% - 28px), transparent);
  mask-image: linear-gradient(to right, transparent,
              black 28px, black calc(100% - 28px), transparent);
}

.ticker-track {
  display: inline-flex;
  align-items: center;
  padding: 12px 0;
  white-space: nowrap;
  animation: ticker var(--ticker-duration, 40s) linear infinite;
  will-change: transform;
}

.ticker-segment {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0 30px;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ticker-text, #ffffff);
  text-shadow: var(--ticker-shadow, 0 1px 6px rgba(0, 0, 0, 0.25));
}

.ticker-segment::before {
  content: "✦";
  color: var(--accent);
  font-size: 0.7rem;
}

@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ============================================================
   Responsive — still single-screen, just rearranged
   ============================================================ */
@media (max-width: 920px) {
  .clock { top: 14px; right: 18px; }
  .hero { max-width: 60%; margin-left: 5%; }
  .page-bg { background-position: 65% center; }
}

@media (max-width: 560px) {
  .clock { top: 12px; right: 14px; }
  .clock-time { font-size: 2rem; }
  .clock-date { font-size: 1.2rem; }
  .hero { max-width: 90%; margin-left: 5%; }
  .hero-heading { font-size: clamp(2rem, 6vw, 4rem); }
  .hero-sub { font-size: 0.85rem; }
  .page-bg { background-position: 55% 25%; }
  .apps { max-width: 100%; padding: 0 10px; }
  .apps-inner {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 14px;
    gap: 16px;
    border-radius: 20px;
    scrollbar-width: none;
  }
  .apps-inner::-webkit-scrollbar { display: none; }
  .app-item { width: 52px; flex-shrink: 0; }
  .app-icon { width: 36px; height: 36px; }
  .app-icon img { width: 24px; height: 24px; }
  .slideshow-status { width: 120px; margin-top: 14px; }
}

/* ---- Short viewports (landscape phones / small laptops) ---- */
@media (max-height: 700px) and (min-width: 921px) {
  .clock { top: 14px; right: 20px; }
  .hero-heading { font-size: clamp(2.5rem, 5vh, 4rem); }
  .ticker-track { padding: 8px 0; }
  .ticker-segment { font-size: 0.86rem; }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
  .ticker-wrap::before { animation: none; filter: none; }
}

.noscript {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--bg-mid);
  color: var(--text-primary);
  font-weight: 600;
}