/* ============================================================
   KRAN-APP  |  shared.css
   Global tokens, reset, and reusable utility classes.
   ============================================================ */

/* --- Color tokens (locked) --------------------------------- */
:root {
  --primary:       #001f3d;
  --accent:        #faa80f;
  --primary-light: #a1d2e2;
  --background:    #f2f2f2;
  --dark:          #141301;
  --white:         #ffffff;
}

/* --- Reset / base ------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { overflow-x: hidden; }

/* --- Body -------------------------------------------------- */
body {
  font-family: Inter, system-ui, sans-serif;
  background: var(--background);
  color: #1a1a1a;
  -webkit-font-smoothing: antialiased;
}

/* --- Reveal: base state ------------------------------------ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Reveal-group: children stagger (CSS baseline) --------- */
.reveal-group > *:nth-child(1) { transition-delay: 0s; }
.reveal-group > *:nth-child(2) { transition-delay: 0.1s; }
.reveal-group > *:nth-child(3) { transition-delay: 0.2s; }
.reveal-group > *:nth-child(4) { transition-delay: 0.3s; }
.reveal-group > *:nth-child(5) { transition-delay: 0.4s; }
.reveal-group > *:nth-child(6) { transition-delay: 0.5s; }

.reveal-group > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal-group.visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* --- Glass card (dark/image backgrounds) ------------------- */
.glass-card {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 24px;
}

/* --- Glass card light (light/image backgrounds) ------------ */
.glass-card-light {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 16px;
  padding: 24px;
}

/* --- Buttons ----------------------------------------------- */
.btn-primary {
  display: inline-block;
  background: #faa80f;
  color: #001f3d;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
  transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.88; }

.btn-primary-dark {
  display: inline-block;
  background: #001f3d;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
  transition: opacity 0.15s;
}
.btn-primary-dark:hover { opacity: 0.85; }

/* Accent-background CTAs: override btn-primary to dark so it's visible on yellow */
#page-cta .btn-primary,
#fp-cta .btn-primary,
#co-cta .btn-primary {
  background: #001f3d;
  color: #ffffff;
}
#page-cta .btn-primary:hover,
#fp-cta .btn-primary:hover,
#co-cta .btn-primary:hover { opacity: 0.85; }

.btn-ghost-dark {
  display: inline-block;
  background: transparent;
  border: 2px solid #001f3d;
  color: #001f3d;
  border-radius: 8px;
  padding: 10px 22px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
  transition: background 0.15s;
}
.btn-ghost-dark:hover { background: rgba(0, 31, 61, 0.06); }

.btn-ghost-light {
  display: inline-block;
  background: transparent;
  border: 2px solid #ffffff;
  color: #ffffff;
  border-radius: 8px;
  padding: 10px 22px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
  transition: background 0.15s;
}
.btn-ghost-light:hover { background: rgba(255, 255, 255, 0.1); }

/* --- Laptop frame (CSS-only browser mockup) ---------------- */
.laptop-frame {
  background: #2d2d2d;
  border-radius: 12px;
  padding: 12px 12px 28px;
}

.laptop-frame__bar {
  background: #3d3d3d;
  height: 24px;
  border-radius: 6px 6px 0 0;
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 6px;
}

.laptop-frame__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.laptop-frame__dot--red    { background: #ff5f57; }
.laptop-frame__dot--yellow { background: #febc2e; }
.laptop-frame__dot--green  { background: #28c840; }

.laptop-frame__screen {
  position: relative;
  background: #ffffff;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.laptop-frame__screen img,
.laptop-frame__screen video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* --- Video placeholder ------------------------------------- */
.video-placeholder {
  background: #2d2d2d;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-placeholder__play {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

/* --- Section spacing --------------------------------------- */
section {
  padding: 80px 20px;
  position: relative;
}

/* HEX SECTION DIVIDERS
   Trapezoid top/bottom cuts that interlock like puzzle pieces.
   Use section-hex-first on the first section (no top cut).
   Use section-hex on all middle sections (both cuts, negative margin).
   Use section-hex-last on the last section (no bottom cut).
   Assign ascending z-index to each section so later ones sit on top. */

:root { --hex-h: 52px; }

.section-hex-first {
  position: relative;
  clip-path: polygon(0% 0%, 100% 0%, 100% calc(100% - var(--hex-h)), 80% 100%, 20% 100%, 0% calc(100% - var(--hex-h)));
}

.section-hex {
  position: relative;
  clip-path: polygon(0% var(--hex-h), 20% 0%, 80% 0%, 100% var(--hex-h), 100% calc(100% - var(--hex-h)), 80% 100%, 20% 100%, 0% calc(100% - var(--hex-h)));
  margin-top: calc(var(--hex-h) * -1);
}

.section-hex-last {
  position: relative;
  clip-path: polygon(0% var(--hex-h), 20% 0%, 80% 0%, 100% var(--hex-h), 100% 100%, 0% 100%);
  margin-top: calc(var(--hex-h) * -1);
}

@media (max-width: 600px) {
  :root { --hex-h: 30px; }
}

/* Legacy slant classes (kept for compatibility) */
.section-slant-down { position: relative; }
.section-slant-up   { position: relative; }

/* --- Container --------------------------------------------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* --- Section label ----------------------------------------- */
.section-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

/* --- Mobile: common page shell adjustments ----------------- */

/* Show laptop-frame at all breakpoints (inline page CSS may hide it at ≤860px) */
@media (max-width: 860px) {
  .page-hero-frame { display: block !important; }
}

@media (max-width: 768px) {
  section { padding: 60px 20px; }

  /* Feature page hero: stack vertically, show frame */
  .page-hero-inner {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
  .page-hero-frame { display: block !important; }

  /* Feature page rows */
  .page-row {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
  .page-row .laptop-frame { order: -1; }

  /* Button sizing */
  .btn-primary, .btn-ghost-dark, .btn-ghost-light {
    padding: 13px 22px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  section { padding: 48px 16px; }

  /* Make buttons full-width on very small screens */
  .page-hero-btns {
    flex-direction: column;
    align-items: stretch;
  }
  .page-hero-btns .btn-primary,
  .page-hero-btns .btn-ghost-light {
    text-align: center;
    width: 100%;
  }
}
