/* ============================================================
   CYPEX Documentation — Landing Page Styles
   Design system: CI variables from custom.css
   Primary  #153558  |  Secondary  #4ec1ec  |  Tertiary  #3880ad
   ============================================================ */

/* ── Dark mode color adjustments ── */
:root[color-theme="dark"],
:root[color-theme="dark"] .cx-logo-fill-1 {
  --ci-color-primary-dark: #4ec1ec;
}

/* ── Visited links — soft blue within CI palette ──
   Do not apply to buttons/cards: :visited specificity beats .cx-btn--outline
   and turns label text into near-white (#eaf4ff), which disappears on light
   section backgrounds. Cards already neutralize via .cx-start-card:visited. */
.cx-landing a:visited:not(.cx-btn):not(.cx-start-card) {
  color: var(--ci-lightest-of-blues, #eaf4ff);
}

:root:not([color-theme="dark"])
  .cx-landing
  a:visited:not(.cx-btn):not(.cx-start-card) {
  color: var(--ci-color-tertiary, #3880ad);
}

/* ── Logo fill ── */
.cx-logo-fill-1,
.svg-fill-1 {
  fill: var(--ci-color-secondary, #4ec1ec);
  transition: fill 0.3s ease;
}
.cx-logo-fill-2,
.svg-fill-2 {
  fill: var(--ci-color-primary, #153558);
  transition: fill 0.3s ease;
}

/* ── Hero logo: full logo (inline SVG) + EPY text (inline SVG) side by side ── */
.cx-hero__logo-wrap {
  display: inline-block;
  vertical-align: middle;
}
.cx-hero__logo-svg {
  height: clamp(72px, 13vw, 170px);
  width: auto;
  display: block;
}
.cx-hero__logo-text {
  display: inline-block;
  vertical-align: middle;
  margin-left: -8px;
}
.cx-hero__logo-text-svg {
  height: clamp(72px, 12vw, 80px);
  width: auto;
  display: block;
}

.cx-logo-accent {
  fill: #4ec1ec;
}
.cx-logo-dark {
  fill: white;
}
.cx-logo-text {
  fill: white;
}

.cx-hero__logo-text:hover .cx-hero__logo-text-svg .cx-logo-text {
  filter: drop-shadow(0 0 12px rgba(78, 193, 236, 0.7));
}

.cx-logo-animate,
.animate-logo {
  animation: cx-logo-spin 3s cubic-bezier(0.4, 0, 0.2, 1) 0s 1;
  transform-origin: center;
}
.cx-hero__logo-wrap:hover .cx-logo-animate,
.cx-hero__logo-wrap:hover .animate-logo {
  animation-play-state: paused;
  filter: drop-shadow(0 0 16px rgba(78, 193, 236, 0.5));
}

/* ── Mobile-first: base styles (all screens) ── */
.cx-hero {
  padding: 48px 16px 40px;
}
.cx-hero__logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 48px;
}
.cx-hero__logo-text-svg {
  height: 48px;
}
.cx-hero__actions {
  flex-direction: column;
  align-items: center;
}
.cx-btn {
  width: 100%;
  max-width: 280px;
  justify-content: center;
}
.cx-section {
  padding: 48px 0;
}
.cx-start-here__grid {
  grid-template-columns: 1fr;
}
.cx-whatsnew__grid {
  grid-template-columns: 1fr;
}
.cx-elements-compact__inner {
  grid-template-columns: 1fr;
  gap: 28px;
}
.cx-elements-compact__title {
  font-size: 1.3rem;
  text-align: left;
}

/* ── Logo spin animation ── */
@keyframes cx-logo-spin {
  0% {
    transform: rotateY(0deg);
  }
  20% {
    transform: rotateY(0deg);
  }
  80% {
    transform: rotateY(360deg);
  }
  100% {
    transform: rotateY(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .cx-logo-animate,
  .animate-logo {
    animation: none;
  }
}

/* ── Layout fixes: full-width home, no sidebar, no ToC ── */
/* Prefer .cx-landing (home-only) so these win even if theme CSS loads late. */
body.gdoc-layout--custom:has(.cx-landing) main.gdoc-main,
body.gdoc-layout--custom:has(.cx-landing) .container.gdoc-main {
  display: block !important;
  grid-template-columns: none !important;
  padding: 0 !important;
  max-width: none !important;
  min-height: 0 !important;
  height: auto !important;
  overflow: visible !important;
}

body.gdoc-layout--custom:has(.cx-landing) .gdoc-nav,
body.gdoc-layout--custom:has(.cx-landing) .cx-toc-panel,
body.gdoc-layout--custom:has(.cx-landing) .cx-page-bg-art,
body.gdoc-layout--custom:has(.cx-landing) .cx-version-band,
body.gdoc-layout--custom:has(.cx-landing) .gdoc-page__footer {
  display: none !important;
}

body.gdoc-layout--custom:has(.cx-landing) .gdoc-page {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
  box-shadow: none !important;
  background: transparent !important;
  border-right: none !important;
  padding: 0 !important;
}

body.gdoc-layout--custom .gdoc-page {
  height: auto;
  min-height: auto;
  overflow: visible;
  box-shadow: none;
  background: transparent;
  border-right: none;
  padding-top: 0;
}
body.gdoc-layout--custom .cx-toc-panel {
  display: none;
}
body.gdoc-layout--custom .cx-page-bg-art {
  display: none;
}
body.gdoc-layout--custom .cx-version-band {
  display: none;
}
body.gdoc-layout--custom main.gdoc-main {
  display: block !important;
  grid-template-columns: none !important;
  padding: 0;
  max-width: none;
}

/* ============================================================
   ROOT LAYOUT
   ============================================================ */
.cx-landing {
  min-height: calc(100vh - var(--cx-header-total, 80px));
  background:
    radial-gradient(
      ellipse 80% 40% at 50% -10%,
      color-mix(in srgb, var(--ci-color-secondary, #4ec1ec) 18%, transparent),
      transparent 70%
    ),
    radial-gradient(
      ellipse 60% 30% at 85% 60%,
      color-mix(in srgb, var(--ci-color-primary, #153558) 8%, transparent),
      transparent 60%
    ),
    var(--body-background, #eaf4ff);
  color: var(--body-font-color, #40424a);
}

/* ── Container ── */
.cx-container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Section shared ── */
.cx-section {
  padding: 80px 0;
}
.cx-section__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
}
.cx-section__title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ci-color-primary, #153558);
  text-align: center;
  margin: 0 0 14px;
  line-height: 1.2;
}
.cx-section__title--left {
  text-align: left;
  margin-bottom: 20px;
}
.cx-section__sub {
  text-align: center;
  color: var(--body-font-color, #40424a);
  font-size: 1.05rem;
  max-width: 640px;
  margin: 0 auto 52px;
  line-height: 1.65;
  opacity: 0.85;
}
.cx-section__sub a {
  color: var(--ci-color-tertiary, #3880ad);
  font-weight: 600;
}

/* ============================================================
   HERO
   ============================================================ */
.cx-hero {
  position: relative;
  padding: 88px 24px 80px;
  text-align: center;
  overflow: hidden;
}
.cx-hero__bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 50% 80% at 50% 0%,
    color-mix(in srgb, var(--ci-color-secondary, #4ec1ec) 22%, transparent),
    transparent 60%
  );
  pointer-events: none;
}
.cx-hero__inner {
  position: relative;
  z-index: 1;
  max-width: 740px;
  margin: 0 auto;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 24px;
}
.cx-hero__logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 50px;
}
.cx-hero__logo {
  width: min(260px, 52vw);
  height: auto;
  display: block;
}

/* Eyebrow: docs identity + version, not a marketing tagline */
.cx-hero__eyebrow {
  display: inline-block;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 999px;
  :where([color-theme="dark"]) & {
    color: var(--ci-color-secondary, #4ec1ec);
    background: color-mix(
      in srgb,
      var(--ci-color-secondary, #4ec1ec) 12%,
      transparent
    );
    border-color: color-mix(
      in srgb,
      var(--ci-color-secondary, #4ec1ec) 30%,
      transparent
    );
  }
  :where(:root:not([color-theme="dark"])) & {
    color: var(--ci-color-success, #009688);
    background: color-mix(
      in srgb,
      var(--ci-color-success, #009688) 12%,
      transparent
    );
    border-color: color-mix(
      in srgb,
      var(--ci-color-success, #009688) 30%,
      transparent
    );
  }
}

.cx-hero__headline {
  font-size: clamp(2rem, 5vw, 3.1rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ci-color-primary, #153558);
  line-height: 1.15;
  margin: 0 0 24px;
  font-family: "DM Sans", var(--geekdoc-font-family), sans-serif;
}
.cx-hero__sub {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--body-font-color, #40424a);
  line-height: 1.7;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  opacity: 0.9;
}
.cx-hero__actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}
.cx-hero__tertiary {
  font-size: 0.9rem;
  opacity: 0.75;
  margin: 4px 0 0;
}
.cx-hero__tertiary a {
  color: var(--ci-color-tertiary, #3880ad);
  font-weight: 600;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.cx-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 0.965rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 2px solid transparent;
  letter-spacing: 0.01em;
  line-height: 1;
}
.cx-btn__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  /* Follow the button's text color (same pattern as .cx-start-card__icon svg).
     `fill: inherit` pulled ancestor fills and made icons vanish on dark theme. */
  color: inherit;
  fill: currentColor;
}
.cx-btn--primary {
  background: var(--ci-color-primary, #153558);
  color: #fff;
  border-color: var(--ci-color-primary, #153558);
}
.cx-btn--primary:hover {
  background: var(--ci-color-tertiary, #3880ad);
  border-color: var(--ci-color-tertiary, #3880ad);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(21, 53, 88, 0.3);
  color: #fff;
}
.cx-btn--secondary {
  background: transparent;
  color: var(--ci-color-primary, #153558);
  border-color: var(--ci-color-primary, #153558);
}
.cx-btn--secondary:hover {
  background: var(--ci-color-primary, #153558);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(21, 53, 88, 0.2);
}
.cx-btn--outline {
  background: transparent;
  color: var(--ci-color-primary, #153558);
  border-color: color-mix(
    in srgb,
    var(--ci-color-primary, #153558) 40%,
    transparent
  );
}
.cx-btn--outline:hover {
  background: var(--ci-color-primary, #153558);
  color: #fff;
  border-color: var(--ci-color-primary, #153558);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(21, 53, 88, 0.2);
}
.cx-btn--outline-light {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}
.cx-btn--outline-light:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.8);
  transform: translateY(-2px);
}
/* Visited CTAs keep each variant's intended colors (text + icon via currentColor). */
.cx-landing a.cx-btn--primary:visited,
.cx-landing a.cx-btn--primary:visited:hover {
  color: #fff;
}
.cx-landing a.cx-btn--secondary:visited {
  color: var(--ci-color-primary, #153558);
}
.cx-landing a.cx-btn--secondary:visited:hover {
  color: #fff;
}
.cx-landing a.cx-btn--outline:visited {
  color: var(--ci-color-primary, #153558);
}
.cx-landing a.cx-btn--outline:visited:hover {
  color: #fff;
}
.cx-landing a.cx-btn--outline-light:visited,
.cx-landing a.cx-btn--outline-light:visited:hover {
  color: #fff;
}
.cx-btn:active {
  transform: translateY(0);
}

/* ============================================================
   START HERE — link cards into real docs destinations
   ============================================================ */
.cx-start-here {
  background: var(--ci-color-white, #fff);
}
.cx-start-here__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
.cx-start-card {
  display: block;
  background: var(--body-background, #eaf4ff);
  border: 1px solid rgba(21, 53, 88, 0.08);
  border-radius: 14px;
  padding: 24px;
  text-decoration: none;
  color: inherit;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}
.cx-start-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 40px rgba(21, 53, 88, 0.1);
  border-color: rgba(78, 193, 236, 0.35);
}
.cx-start-card:visited {
  color: inherit;
}
.cx-start-card__icon {
  width: 40px;
  height: 40px;
  background: color-mix(
    in srgb,
    var(--ci-color-secondary, #4ec1ec) 15%,
    transparent
  );
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.cx-start-card__icon svg {
  width: 20px;
  height: 20px;
  color: var(--ci-color-primary, #153558);
  fill: currentColor;
}
.cx-start-card__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ci-color-primary, #153558);
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.cx-start-card__desc {
  font-size: 0.875rem;
  color: var(--body-font-color, #40424a);
  line-height: 1.6;
  margin: 0;
  opacity: 0.87;
}

/* ============================================================
   PLATFORM MODEL — numbered list, technical
   ============================================================ */
.cx-model {
  background: var(--body-background, #eaf4ff);
}
.cx-model__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 760px;
  margin: 0 auto;
}
.cx-model__item {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.cx-model__num {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  background: var(--ci-color-primary, #153558);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  margin-top: 2px;
}
.cx-model__item h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ci-color-primary, #153558);
  margin: 0 0 8px;
}
.cx-model__item p {
  font-size: 0.925rem;
  color: var(--body-font-color, #40424a);
  line-height: 1.7;
  margin: 0;
  opacity: 0.9;
}
.cx-model__item p a,
.cx-model__item p code {
  font-weight: 600;
}
.cx-model__item p a {
  color: var(--ci-color-tertiary, #3880ad);
}

/* ============================================================
   WHAT'S NEW IN v2.0.0
   ============================================================ */
.cx-whatsnew {
  background: var(--ci-color-white, #fff);
}
.cx-whatsnew__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
.cx-whatsnew-item {
  background: var(--body-background, #eaf4ff);
  border: 1px solid rgba(21, 53, 88, 0.07);
  border-radius: 14px;
  padding: 24px;
}
.cx-whatsnew-item h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ci-color-primary, #153558);
  margin: 0 0 8px;
}
.cx-whatsnew-item p {
  font-size: 0.875rem;
  color: var(--body-font-color, #40424a);
  line-height: 1.65;
  margin: 0;
  opacity: 0.88;
}
.cx-whatsnew__cta {
  text-align: center;
  margin-top: 40px;
}

/* ============================================================
   DEPLOYMENT & OWNERSHIP
   ============================================================ */
.cx-deployment {
  background: var(--body-background, #eaf4ff);
}
.cx-deployment__inner {
  max-width: 720px;
  margin: 0 auto;
}
.cx-deployment__inner p {
  font-size: 0.975rem;
  color: var(--body-font-color, #40424a);
  line-height: 1.75;
  margin: 0 0 18px;
  opacity: 0.92;
}
.cx-deployment__inner p a {
  color: var(--ci-color-tertiary, #3880ad);
  font-weight: 600;
}

/* ============================================================
   ELEMENTS — compact secondary section
   ============================================================ */
.cx-elements-compact {
  background: var(--ci-color-white, #fff);
  padding: 64px 0;
}
.cx-elements-compact__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
.cx-elements-compact__title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ci-color-primary, #153558);
  margin: 0 0 12px;
  text-align: left;
}
.cx-elements-compact__desc {
  font-size: 0.925rem;
  color: var(--body-font-color, #40424a);
  line-height: 1.7;
  margin: 0 0 24px;
  opacity: 0.87;
}
.cx-elements-compact__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cx-element-chip-sm {
  display: inline-flex;
  align-items: center;
  padding: 6px 13px;
  background: var(--body-background, #eaf4ff);
  border: 1px solid rgba(21, 53, 88, 0.12);
  border-radius: 6px;
  font-size: 0.815rem;
  font-weight: 500;
  color: var(--ci-color-primary, #153558);
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: all 0.15s ease;
}
.cx-element-chip-sm:hover {
  background: color-mix(
    in srgb,
    var(--ci-color-secondary, #4ec1ec) 10%,
    transparent
  );
  border-color: var(--ci-color-secondary, #4ec1ec);
}
.cx-element-chip-sm--more {
  background: transparent;
  border-color: rgba(21, 53, 88, 0.2);
  color: var(--ci-color-tertiary, #3880ad);
  font-weight: 600;
}

.cx-trademark-footer {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 24px 48px;
  font-size: 0.7rem;
  line-height: 1.6;
  text-align: center;
  color: var(--body-font-color, #40424a);
  opacity: 0.65;
}

/* ============================================================
   DARK MODE overrides
   ============================================================ */
:root[color-theme="dark"] .cx-start-here,
:root[color-theme="dark"] .cx-whatsnew,
:root[color-theme="dark"] .cx-elements-compact {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}
:root[color-theme="dark"] .cx-start-card,
:root[color-theme="dark"] .cx-whatsnew-item {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.07);
}
:root[color-theme="dark"] .cx-start-card:hover {
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}
:root[color-theme="dark"] .cx-section__title,
:root[color-theme="dark"] .cx-start-card__title,
:root[color-theme="dark"] .cx-whatsnew-item h3,
:root[color-theme="dark"] .cx-model__item h3,
:root[color-theme="dark"] .cx-elements-compact__title {
  color: var(--ci-color-secondary, #4ec1ec);
}
:root[color-theme="dark"] .cx-start-card__icon svg {
  color: var(--ci-color-secondary, #4ec1ec);
}
:root[color-theme="dark"] .cx-element-chip-sm {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}
:root[color-theme="dark"] .cx-hero__headline {
  color: #eaf4ff;
}
:root[color-theme="dark"] .cx-btn--secondary {
  color: var(--ci-color-secondary, #4ec1ec);
  border-color: var(--ci-color-secondary, #4ec1ec);
}
:root[color-theme="dark"] .cx-landing a.cx-btn--secondary:visited {
  color: var(--ci-color-secondary, #4ec1ec);
}
:root[color-theme="dark"] .cx-landing a.cx-btn--secondary:visited:hover {
  color: #fff;
}
:root[color-theme="dark"] .cx-btn--outline {
  color: rgba(255, 255, 255, 0.85);
  border-color: rgba(255, 255, 255, 0.3);
}
:root[color-theme="dark"] .cx-landing a.cx-btn--outline:visited {
  color: rgba(255, 255, 255, 0.85);
}
:root[color-theme="dark"] .cx-landing a.cx-btn--outline:visited:hover {
  color: #fff;
}
:root[color-theme="dark"] .cx-logo-fill-1,
:root[color-theme="dark"] .svg-fill-1 {
  fill: #4ec1ec;
}
:root[color-theme="dark"] .cx-logo-fill-2,
:root[color-theme="dark"] .svg-fill-2 {
  fill: white;
}

/* ============================================================
   RESPONSIVE — Progressive Enhancement
   ============================================================ */

/* Tablet (≥640px): slight expansion of spacing */
@media (min-width: 640px) {
  .cx-hero {
    padding: 64px 24px 56px;
  }
  .cx-section {
    padding: 56px 0;
  }
  .cx-start-here__grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .cx-whatsnew__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Desktop (≥900px): multi-column layouts */
@media (min-width: 900px) {
  .cx-hero {
    padding: 88px 24px 80px;
  }
  .cx-hero__logo-wrap {
    margin-bottom: 50px;
  }
  .cx-section {
    padding: 80px 0;
  }
  .cx-hero__actions {
    flex-direction: row;
    align-items: center;
    justify-content: center;
  }
  .cx-btn {
    width: auto;
    max-width: none;
  }

  .cx-start-here__grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .cx-whatsnew__grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .cx-elements-compact__inner {
    grid-template-columns: 1fr 1fr;
    gap: 48px;
  }
  .cx-elements-compact__title {
    font-size: 1.5rem;
  }
}
