/* ═══════════════════════════════════════════════════
   site.css · CyMEC shared design system
   All main site pages link to this file.
   Course pages (course/) use their own dark theme.
   ═══════════════════════════════════════════════════ */

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; }

/* ── DESIGN TOKENS ── */
:root {
  /* BRAND PALETTE (single source of truth) */
  --color-bg:            #f7f6f2;
  --color-surface:       #ffffff;
  --color-surface-alt:   #eeeee6;
  --color-text:          #262626;
  --color-text-muted:    #58595b;
  --color-border:        #dcdad0;
  --color-primary:       #1f4e5f;
  --color-primary-hover: #163a47;
  --color-on-primary:    #ffffff;
  --color-accent:        #f5b82e;
  --color-charcoal:      #3a3a3a;
  --color-on-charcoal:   #ffffff;
  --color-link:          #0f5fa8;
  --color-focus:         #0f5fa8;

  /* STATUS COLORS (kept outside the brand palette) */
  --color-success:       #1f6b46;
  --color-success-bg:    #e7f2ea;
  --color-warning:       #7a5200;
  --color-warning-bg:    #fbf1dc;
  --color-danger:        #b03a2e;
  --color-danger-bg:     #fbeae9;

  /* LEGACY ALIASES (page rules resolve to the palette above) */
  --white:        var(--color-surface);
  --off-white:    var(--color-bg);
  --cream:        var(--color-surface-alt);
  --green:        var(--color-primary);
  --green-mid:    var(--color-primary-hover);
  --green-light:  var(--color-surface-alt);
  --terra:        var(--color-primary);
  --terra-dark:   var(--color-primary-hover);
  --terra-light:  var(--color-surface-alt);
  --amber:        var(--color-accent);
  --amber-light:  var(--color-surface-alt);
  --purple:       var(--color-primary);
  --purple-light: var(--color-surface-alt);
  --red:          var(--color-danger);
  --red-light:    var(--color-danger-bg);
  --sand:         rgba(255,255,255,0.78);
  --text:         var(--color-text);
  --text-mid:     var(--color-text-muted);
  --text-soft:    var(--color-text-muted);
  --border:       var(--color-border);
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.06);
  --shadow-md:    0 4px 20px -4px rgba(0,0,0,0.08);
  --shadow-lg:    0 12px 40px -8px rgba(0,0,0,0.10);
  --r:            12px;
  --r-lg:         16px;
  --font-serif:   'Lora', Georgia, serif;
  --font-sans:    'Nunito', 'Segoe UI', sans-serif;
  --ease:         0.3s cubic-bezier(0.4,0,0.2,1);

  /* TYPE SCALE (shared across the site, follows viewport width and height) */
  --fs-hero:      clamp(24px, min(2.5vw, 3.2vh), 36px);
  --fs-section:   clamp(22px, min(2.2vw, 3vh), 30px);
}

/* ── BODY & GLOBALS ── */
body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
p a, .legal-body a {
  color: var(--color-link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
p a:hover, .legal-body a:hover { color: var(--color-primary-hover); }
:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; }
ul { list-style: none; }
button { font-family: var(--font-sans); cursor: pointer; border: none; }
img { display: block; max-width: 100%; }

/* ── LAYOUT ── */
.container        { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 24px; }
.container--narrow{ width: 100%; max-width: 740px;  margin: 0 auto; padding: 0 24px; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 30px; border-radius: 50px;
  font-size: 16px; font-weight: 700; font-family: var(--font-sans);
  transition: transform var(--ease), box-shadow var(--ease), background var(--ease);
  cursor: pointer; white-space: nowrap; border: none;
}
.btn:hover { transform: translateY(-2px); }

.btn--primary {
  background: var(--color-primary); color: var(--color-on-primary);
  box-shadow: 0 4px 20px -4px rgba(22,58,71,0.28);
}
.btn--primary:hover { background: var(--color-primary-hover); box-shadow: 0 6px 28px -4px rgba(22,58,71,0.32); }
.btn--primary svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }

.btn--ghost { background: transparent; color: var(--color-primary); border: 2px solid var(--color-primary); }
.btn--ghost:hover { background: var(--color-surface-alt); }

.btn--lg { padding: 17px 38px; font-size: 17px; }

/* .btn--sand and .btn-sand are the same; both exist in the HTML */
.btn--sand, .btn-sand {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--white); color: var(--green);
  box-shadow: var(--shadow-md); font-size: 16px; font-weight: 800;
  padding: 15px 36px; border-radius: 50px;
  transition: transform var(--ease), box-shadow var(--ease);
  font-family: var(--font-sans); cursor: pointer; border: none;
}
.btn--sand:hover, .btn-sand:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn--sand svg, .btn-sand svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* ── HEADER ── */
.header {
  position: sticky; top: 0; z-index: 100;
  background: var(--color-charcoal);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.logo {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--font-serif); font-size: 24px; font-weight: 700;
  color: var(--color-on-charcoal); letter-spacing: -0.01em;
}
.logo__mark {
  width: 34px; height: 34px; background: var(--color-surface);
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.logo__mark svg { width: 18px; height: 18px; fill: none; stroke: var(--color-primary); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.logo__sub {
  font-family: var(--font-sans); font-size: 10px; color: rgba(255,255,255,0.72);
  font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
  display: block; line-height: 1.3; margin-top: 2px;
}

.nav__links { display: flex; align-items: center; gap: 2px; }
.nav__links a {
  padding: 7px 13px; border-radius: 50px;
  font-size: 15px; font-weight: 600; color: rgba(255,255,255,0.82);
  transition: background var(--ease), color var(--ease);
  position: relative;
}
.nav__links a:hover { background: rgba(255,255,255,0.12); color: var(--color-on-charcoal); }
.nav__links a.active { background: var(--color-accent); color: var(--color-text); }

.nav__cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 20px; border-radius: 50px;
  font-size: 15px; font-weight: 800; color: var(--color-text);
  background: var(--color-accent); margin-left: 6px;
  transition: background var(--ease), transform var(--ease);
}
.nav__cta:hover { background: color-mix(in srgb, var(--color-accent) 86%, var(--color-text)); transform: translateY(-1px); }
#nav-cta { background: var(--color-accent); color: var(--color-text); box-shadow: none; }
#nav-cta:hover { background: color-mix(in srgb, var(--color-accent) 86%, var(--color-text)); }

#nav-cta { display: none; margin-left: 6px; }

/* ── HAMBURGER ── */
.hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; padding: 8px; border-radius: 8px; border: none; cursor: pointer;
}
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--color-on-charcoal); border-radius: 2px;
  transition: transform 0.28s ease, opacity 0.28s ease;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── MOBILE NAV ── */
.mobile-nav {
  display: none; flex-direction: column; gap: 2px;
  background: var(--color-surface); border-top: 1px solid var(--color-border);
  padding: 12px 20px 20px; box-shadow: var(--shadow-md);
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  padding: 11px 14px; border-radius: var(--r);
  font-weight: 600; font-size: 16px; color: var(--text-mid);
  transition: background var(--ease);
}
.mobile-nav a:hover { background: var(--color-surface-alt); color: var(--color-primary); }
.mobile-nav .nav__cta { margin: 8px 0 0; justify-content: center; color: var(--color-text); }
.mobile-nav .btn { margin-top: 8px; justify-content: center; }

/* ── SECTION HEADINGS (shared across index, courses, etc.) ── */
.eyebrow {
  text-align: center; font-size: 12px; font-weight: 800;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--green); margin-bottom: 10px;
}
.sec-h2 {
  text-align: center; font-family: var(--font-sans);
  font-weight: 800;
  font-size: var(--fs-section); color: var(--text);
  letter-spacing: -0.02em; margin-bottom: 14px; line-height: 1.2;
}
.sec-sub {
  text-align: center; max-width: 540px; margin: 0 auto 36px;
  color: var(--text-soft); font-size: 17px; line-height: 1.65;
}

/* ── PAGE HERO (interior pages) ── */
.page-hero {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  padding: clamp(32px, 5vh, 56px) 0 clamp(28px, 4vh, 44px);
}
.page-hero__inner { max-width: 680px; }
.page-hero__eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 800; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--green); margin-bottom: 14px;
}
.page-hero__eyebrow::before {
  content: ''; display: block;
  width: 20px; height: 2px; background: var(--green);
  border-radius: 2px; flex-shrink: 0;
}
.page-hero__h1 {
  font-family: var(--font-serif);
  font-size: var(--fs-hero); color: var(--text);
  letter-spacing: -0.02em; line-height: 1.18; margin-bottom: 14px;
  max-width: 600px;
}
.page-hero__sub {
  font-size: 17px; color: var(--text-soft);
  line-height: 1.65; max-width: 520px; margin-bottom: 20px;
}

/* PAGE HERO, PHOTO BAND (photo behind, words on the dark left)
   each page sets --hero-photo and, if the crop needs it, --hero-focus */
.page-hero--photo {
  position: relative;
  border-bottom: none;
  background-color: var(--color-primary-hover);
  background-image:
    linear-gradient(90deg,
      rgba(14,32,39,0.95) 0%,
      rgba(14,32,39,0.89) 28%,
      rgba(14,32,39,0.60) 50%,
      rgba(14,32,39,0.20) 74%,
      rgba(14,32,39,0.05) 100%),
    linear-gradient(180deg,
      rgba(14,32,39,0.34) 0%,
      rgba(14,32,39,0.00) 40%,
      rgba(14,32,39,0.42) 100%),
    var(--hero-photo);
  background-size: cover;
  background-position: center var(--hero-focus, 38%);
  background-repeat: no-repeat;
  padding: clamp(52px, 8vh, 84px) 0 clamp(48px, 7vh, 74px);
}
.page-hero--photo .page-hero__eyebrow { color: rgba(255,255,255,0.80); }
.page-hero--photo .page-hero__eyebrow::before { background: var(--color-accent); }
.page-hero--photo .page-hero__h1 {
  color: #fff; max-width: 700px;
  text-shadow: 0 1px 18px rgba(0,0,0,0.28);
}
.page-hero--photo .page-hero__sub { color: rgba(255,255,255,0.87); max-width: 600px; }
/* the small status pills sit on the photo, so they lose their light surface */
.page-hero--photo .coming-badge,
.page-hero--photo .free-badge {
  background: rgba(255,255,255,0.14);
  color: #fff;
  border-color: rgba(255,255,255,0.30);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.page-hero--photo .coming-badge svg,
.page-hero--photo .free-badge svg { stroke: var(--color-accent); }
@media (max-width: 760px) {
  /* a narrow band cannot carry a sideways shadow, so the wash goes top to bottom */
  .page-hero--photo {
    background-image:
      linear-gradient(180deg,
        rgba(14,32,39,0.90) 0%,
        rgba(14,32,39,0.74) 55%,
        rgba(14,32,39,0.86) 100%),
      var(--hero-photo);
    padding: 44px 0 46px;
  }
}

/* ── TRUST BAR ── */
.trust-bar {
  background: var(--color-surface);
  padding: 20px 0;
  border-bottom: 1px solid var(--color-border);
}
.trust-bar__inner {
  display: flex; align-items: center; justify-content: center;
  gap: 36px; flex-wrap: wrap;
}
.trust-item {
  display: flex; align-items: center; gap: 7px;
  font-size: 14px; font-weight: 600; color: var(--text-mid);
}
.trust-item svg {
  width: 16px; height: 16px; stroke: var(--green);
  stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0;
  opacity: 0.7;
}

/* ── FILTER BAR (courses, tools, resources) ── */
.filter-bar {
  background: var(--color-surface); border-bottom: 1px solid var(--color-border);
  padding: 14px 0; position: sticky; top: 68px; z-index: 90;
}
.filter-bar__inner { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filter-btn {
  padding: 7px 16px; border-radius: 50px; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all var(--ease); border: 1.5px solid var(--border);
  background: var(--color-surface); color: var(--color-text-muted); font-family: var(--font-sans);
}
.filter-btn:hover { border-color: var(--color-primary); color: var(--color-primary); background: var(--color-surface-alt); }
.filter-btn.active { background: var(--color-primary); color: var(--color-on-primary); border-color: var(--color-primary); }

/* ── CTA BAND ── */
.cta-band {
  padding: 80px 0;
  background: var(--color-primary);
  position: relative; overflow: hidden;
}
.cta-band::before {
  content: '';
  position: absolute;
  top: -40%; right: -15%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.cta-band::after {
  content: '';
  position: absolute;
  bottom: -30%; left: -10%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(255,255,255,0.07) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.cta-band__bg { display: none; }
.cta-band__inner {
  position: relative; z-index: 2;
  text-align: center; max-width: 620px; margin: 0 auto;
}
.cta-band__eyebrow {
  font-size: 12px; font-weight: 800; letter-spacing: 0.12em;
  text-transform: uppercase; color: rgba(255,255,255,0.70); margin-bottom: 14px;
}
.cta-band__h2 {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: var(--fs-section); color: var(--white);
  line-height: 1.2; letter-spacing: -0.02em; margin-bottom: 18px;
}
.cta-band__body {
  color: rgba(255,255,255,0.80); font-size: 17px;
  line-height: 1.65; margin-bottom: 36px;
}

/* ── BADGE ── */
.badge {
  display: inline-block; padding: 4px 12px;
  border-radius: 50px; font-size: 12px; font-weight: 800; letter-spacing: 0.05em;
}

/* ── ARTICLE TAGS (insights) ── */
.post-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag {
  display: inline-block; padding: 4px 11px; border-radius: 50px;
  font-size: 11.5px; font-weight: 800; letter-spacing: 0.03em;
  background: var(--color-surface-alt); color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}
.post-date { font-size: 13px; color: var(--text-soft); font-weight: 600; }

/* ── FORM ELEMENTS (courses modal, assessment) ── */
.form-row { margin-bottom: 14px; }
.form-label { display: block; font-size: 13px; font-weight: 800; color: var(--text-mid); margin-bottom: 6px; }
.form-input {
  width: 100%; padding: 12px 16px; border-radius: var(--r);
  border: 1.5px solid var(--border); font-size: 16px;
  font-family: var(--font-sans); color: var(--text);
  background: var(--color-surface); transition: border-color var(--ease); outline: none;
}
.form-input:focus { border-color: var(--color-focus); background: var(--color-surface); }
.form-submit {
  width: 100%; padding: 15px; border-radius: 50px;
  font-size: 16px; font-weight: 800; color: var(--white);
  background: var(--color-primary); border: none; cursor: pointer;
  font-family: var(--font-sans);
  box-shadow: 0 4px 20px -4px rgba(22,58,71,0.28);
  transition: all var(--ease); margin-top: 6px;
}
.form-submit:hover { background: var(--color-primary-hover); transform: translateY(-1px); }
.form-note { font-size: 12px; color: var(--text-soft); text-align: center; margin-top: 10px; }

/* ── FOOTER ── */
.footer {
  background: var(--color-charcoal); color: rgba(255,255,255,0.78);
  padding: 56px 0 28px;
  border-top: 3px solid var(--color-primary);
}
.footer__grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px; margin-bottom: 44px;
}
.footer__logo {
  font-family: var(--font-serif); font-size: 22px; font-weight: 700;
  color: var(--white); display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
}
.footer__logo-mark {
  width: 28px; height: 28px; background: var(--color-surface);
  border-radius: 6px; display: flex; align-items: center; justify-content: center;
}
.footer__logo-mark svg { width: 14px; height: 14px; stroke: var(--color-primary); fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.footer__tagline { font-size: 14px; line-height: 1.65; max-width: 220px; }
.footer__col h4 { font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255,255,255,0.70); margin-bottom: 16px; }
.footer__col li + li { margin-top: 10px; }
.footer__col a { font-size: 14px; color: rgba(255,255,255,0.78); transition: color var(--ease); }
.footer__col a:hover { color: var(--color-on-charcoal); }
.footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.14); padding-top: 24px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; flex-wrap: wrap; gap: 10px;
}
.footer__bottom a { color: rgba(255,255,255,0.72); transition: color var(--ease); }
.footer__bottom a:hover { color: var(--color-on-charcoal); }

/* ── SCROLL REVEAL ──
   !important is required here because inline <style> blocks in each page
   declare .reveal { opacity: 1 } which would otherwise override this.
   The reveal animation was previously broken (started visible). ── */
.reveal {
  opacity: 0 !important;
  transform: translateY(22px) !important;
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.reveal.in {
  opacity: 1 !important;
  transform: none !important;
}
.reveal-d1 { transition-delay: 0.1s; }
.reveal-d2 { transition-delay: 0.2s; }
.reveal-d3 { transition-delay: 0.3s; }

/* ── RESPONSIVE ── */
@media (max-width: 960px) {
  .nav__links { display: none; }
  .nav__cta   { display: none; }
  #nav-cta    { display: none !important; }
  .hamburger  { display: flex; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .trust-bar__inner { gap: 20px; }
}
@media (max-width: 600px) {
  .footer__grid   { grid-template-columns: 1fr; gap: 24px; }
  .footer__bottom { flex-direction: column; text-align: center; }
  .trust-bar__inner { gap: 14px; }
  .page-hero { padding: 40px 0 32px; }
}
