:root {
  --color-bg: #ffffff;
  --color-bg-alt: #f6f8fb;
  --color-bg-dark: #17395e;       /* myChallengeCloud navy (logo cloud) */
  --color-bg-darker: #0f2742;
  --color-text: #0f172a;
  --color-text-muted: #475569;
  --color-text-inverse: #f1f5f9;
  --color-accent: #29abe2;        /* myChallengeCloud blue (logo CLOUD) */
  --color-accent-hover: #1b8cbd;
  --color-accent-rgb: 41, 171, 226;
  --color-border: #e2e8f0;
  --max-width: 1200px;
  --radius: 8px;
  --shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  --transition: 150ms ease;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--color-accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-accent-hover); }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.5em; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }

/* Header — brand navy banner with the wide logo */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--color-border);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 0.75rem; padding-bottom: 0.75rem;
}

/* Brand (header): the wide logo image, sized by height (no separate text) */
.brand { display: flex; align-items: center; color: #fff; font-weight: 700; }
.site-header .brand { gap: 0; }
.site-header .brand img {
  width: auto;
  height: 62px;
  display: block;
}
@media (max-width: 768px) {
  .site-header .brand img { height: 48px; }
}

.nav { display: flex; align-items: center; gap: 2rem; }
.nav a { color: var(--color-text); font-weight: 500; letter-spacing: 0.01em; }
.nav a:hover, .nav a.active { color: var(--color-accent); }
.nav-cta {
  background: var(--color-accent); color: #fff !important;
  padding: 0.5rem 1.1rem; border-radius: var(--radius); font-weight: 700;
}
.nav-cta:hover { background: var(--color-accent-hover); color: #fff !important; }

.mobile-toggle { display: none; background: none; border: 0; cursor: pointer; font-size: 1.5rem; color: var(--color-text); }

@media (max-width: 768px) {
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: #fff;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--color-border); }
  .nav.open { display: flex; }
  .nav a { padding: 0.75rem 0; border-bottom: 1px solid var(--color-border); color: var(--color-text); }
  .nav a:last-child { border-bottom: 0; }
  .mobile-toggle { display: block; }
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--color-bg-darker) 0%, var(--color-bg-dark) 100%);
  color: var(--color-text-inverse);
  padding: 6rem 0 5rem;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 20% 30%, rgba(var(--color-accent-rgb), 0.18), transparent 50%),
              radial-gradient(circle at 80% 70%, rgba(var(--color-accent-rgb), 0.10), transparent 50%);
  pointer-events: none;
}
.hero .container { position: relative; z-index: 2; }

/* Video-background hero variant */
.hero-video {
  padding: 8rem 0 7rem;
  min-height: 70vh;
  display: flex; align-items: center;
  background: var(--color-bg-darker); /* fallback before video paints */
}
.hero-video .container { width: 100%; }
.hero-video .hero-video-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
}
.hero-video::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(6,15,28,0.55) 0%, rgba(6,15,28,0.75) 100%);
  z-index: 1;
  pointer-events: none;
}
.hero-video h1, .hero-video p.lead, .hero-video .eyebrow {
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}
.hero .eyebrow {
  text-transform: uppercase; letter-spacing: 0.15em; font-size: 0.875rem; font-weight: 600;
  color: var(--color-accent); margin-bottom: 1rem;
}
.hero h1 { color: #fff; max-width: 900px; }
.hero p.lead { font-size: 1.25rem; color: rgba(241, 245, 249, 0.85); max-width: 700px; margin-bottom: 2rem; }

.btn {
  display: inline-block; padding: 0.85rem 1.75rem; border-radius: var(--radius);
  font-weight: 600; font-size: 1rem; cursor: pointer; border: 0;
  transition: all var(--transition);
}
.btn-primary { background: var(--color-accent); color: #fff !important; }
.btn-primary:hover { background: var(--color-accent-hover); color: #fff !important; transform: translateY(-1px); }
.btn-secondary {
  background: transparent; color: var(--color-text-inverse) !important;
  border: 1px solid rgba(241, 245, 249, 0.3);
}
.btn-secondary:hover { background: rgba(241, 245, 249, 0.1); }

.btn-row { display: flex; gap: 1rem; flex-wrap: wrap; }

/* Sections */
.section { padding: 5rem 0; }
.section-alt { background: var(--color-bg-alt); }
.section-dark { background: var(--color-bg-dark); color: var(--color-text-inverse); }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-dark p { color: rgba(241, 245, 249, 0.85); }

.section-eyebrow {
  text-transform: uppercase; letter-spacing: 0.15em; font-size: 0.875rem; font-weight: 600;
  color: var(--color-accent); margin-bottom: 0.75rem;
}
.section-intro { max-width: 750px; margin-bottom: 3rem; }
.section-intro p { font-size: 1.125rem; color: var(--color-text-muted); }
.section-dark .section-intro p { color: rgba(241, 245, 249, 0.75); }

/* Grid of cards */
/* minmax(300px) so the six solution cards land 3x2 on desktop rather than 4+2. */
.grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.card {
  background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius);
  padding: 2rem; transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card h3 { color: var(--color-text); margin-bottom: 0.5rem; }
.card p { color: var(--color-text-muted); margin-bottom: 0; font-size: 0.95rem; }
.card a.card-link {
  display: inline-block; margin-top: 1rem; color: var(--color-accent); font-weight: 600; font-size: 0.9rem;
}
.card a.card-link::after { content: " →"; transition: transform var(--transition); display: inline-block; }
.card a.card-link:hover::after { transform: translateX(3px); }

/* Two-column block */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
@media (max-width: 768px) { .two-col { grid-template-columns: 1fr; gap: 2rem; } }

/* Founders */
.founders { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; margin-top: 2rem; }
.founder { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius); padding: 2rem; }
.founder h3 { margin-bottom: 0.25rem; }
.founder .role { color: var(--color-accent); font-weight: 600; font-size: 0.9rem; margin-bottom: 1rem; }
.founder p { color: var(--color-text-muted); font-size: 0.95rem; }
.founder a { display: inline-block; margin-top: 0.5rem; font-size: 0.9rem; }

/* Forms */
.form-card {
  background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius);
  padding: 2.5rem; max-width: 640px; margin: 0 auto;
}
.form-grid { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
.form-row { grid-column: 1 / -1; }

label { display: block; font-weight: 600; font-size: 0.875rem; margin-bottom: 0.4rem; color: var(--color-text); }
input, textarea, select {
  width: 100%; padding: 0.75rem 0.9rem; font-size: 1rem; font-family: inherit;
  border: 1px solid var(--color-border); border-radius: var(--radius); background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus, textarea:focus, select:focus {
  outline: 0; border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(var(--color-accent-rgb), 0.18);
}
textarea { min-height: 140px; resize: vertical; }
.form-msg { margin-top: 1rem; padding: 0.75rem 1rem; border-radius: var(--radius); font-size: 0.95rem; display: none; }
.form-msg.success { display: block; background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.form-msg.error { display: block; background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* Page header (for non-home pages) */
.page-header { background: var(--color-bg-dark); color: var(--color-text-inverse); padding: 5rem 0 4rem; }
.page-header h1 { color: #fff; margin-bottom: 0.5rem; }
.page-header p { color: rgba(241, 245, 249, 0.8); font-size: 1.125rem; max-width: 700px; margin: 0; }

/* Footer */
.site-footer { background: var(--color-bg-darker); color: rgba(241, 245, 249, 0.7); padding: 4rem 0 2rem; }
.site-footer .footer-grid {
  display: grid; gap: 2rem; grid-template-columns: 2fr 1fr 1fr 1fr; margin-bottom: 3rem;
}
@media (max-width: 768px) { .site-footer .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .site-footer .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { color: #fff; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 1rem; }
.site-footer .brand { color: #fff; margin-bottom: 1rem; gap: 0; }
.site-footer .brand img {
  width: auto; height: 52px; display: block;
  background: #fff; border-radius: var(--radius); padding: 8px 12px;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.5rem; }
.site-footer a { color: rgba(241, 245, 249, 0.7); }
.site-footer a:hover { color: var(--color-accent); }
.footer-bottom {
  border-top: 1px solid rgba(241, 245, 249, 0.1); padding-top: 1.5rem;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  font-size: 0.875rem;
}

/* Products section */
.products { text-align: center; }
.products-title {
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--color-text);
  margin-bottom: 1.5rem;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}
.product-card {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  /* Brand navy field with a soft green wash — placeholder for a real product image. */
  background:
    radial-gradient(circle at 30% 25%, rgba(var(--color-accent-rgb), 0.28), transparent 55%),
    radial-gradient(circle at 75% 80%, rgba(var(--color-accent-rgb), 0.14), transparent 55%),
    linear-gradient(160deg, var(--color-bg-dark) 0%, var(--color-bg-darker) 100%);
  transition: transform var(--transition), box-shadow var(--transition);
  display: block;
}
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.product-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 1rem; z-index: 1;
}
.product-label {
  color: rgba(255,255,255,0.9); font-size: 1.125rem; font-weight: 400;
  letter-spacing: 0.02em; margin-bottom: 0.4rem;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}
.product-name {
  color: #fff; font-size: 0.95rem; font-weight: 600;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}
.product-current .product-label::before {
  content: "★ "; color: var(--color-accent);
}

/* Image-based product card (used for myChallengeCloud) */
.product-image {
  background: #fff !important;
  background-image: none !important;
  border: 1px solid var(--color-border);
}
.product-image::before,
.product-image::after {
  content: none !important;
  display: none !important;
}
.product-image img {
  position: relative; z-index: 2;
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 0.75rem;
  background: #fff;
}

/* Media column beside body copy (landing page) */
.two-col-media { align-items: center; }
.media-frame {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.media-frame img { width: 100%; height: auto; }

/* Slim 3-column footer for the landing page */
.footer-grid-slim { grid-template-columns: 2fr 1fr 1fr; }
@media (max-width: 768px) { .footer-grid-slim { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid-slim { grid-template-columns: 1fr; } }

/* Routing tag — the inbox and contact form are shared with myChallengeCloud, so
   the "To: SavingsInTheCloud" instruction has to be hard to miss. */
.routing-callout {
  background: rgba(var(--color-accent-rgb), 0.07);
  border: 1px solid rgba(var(--color-accent-rgb), 0.35);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  margin-bottom: 3rem;
}
.routing-callout p { color: var(--color-text-muted); }
.routing-tag {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.125rem; font-weight: 700;
  color: var(--color-text) !important;
  background: #fff;
  border: 1px dashed rgba(var(--color-accent-rgb), 0.5);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  display: inline-block;
}
.routing-note {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-top: 1rem;
  max-width: 640px;
}
.text-center .routing-note, .products .routing-note { margin-left: auto; margin-right: auto; }
.section-dark .routing-note { color: rgba(241, 245, 249, 0.7); }

/* Secondary button on a light background (the dark variant is white-on-navy). */
.btn-outline-dark {
  color: var(--color-text) !important;
  border-color: var(--color-border);
  background: #fff;
}
.btn-outline-dark:hover { background: var(--color-bg-alt); }

/* Termly policy embed — give the injected policy room and keep wide tables scrollable. */
.legal-embed { max-width: 900px; }
.legal-embed table { display: block; overflow-x: auto; max-width: 100%; }
.legal-embed img { display: inline-block; }

/* Footer legal links */
.footer-legal { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.footer-routing { font-size: 0.8125rem; color: rgba(241, 245, 249, 0.5); }

/* Utility */
.text-center { text-align: center; }
.mt-2 { margin-top: 1rem; }
.mt-4 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; }
