/* ===================================================================
   Darklight Empire — Playful Dynamic Theme (Flexbox-only)
   One global stylesheet for all pages
   =================================================================== */

/* ------------------------------
   0) RESET & BASELINE
   ------------------------------ */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img { max-width: 100%; height: auto; display: block; }
figure { margin: 0; }
ul, ol { margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; border: 0; background: transparent; cursor: pointer; }
:focus { outline: none; }
:focus-visible { outline: 3px solid #FFD84D; outline-offset: 2px; }

/* ------------------------------
   1) THEME TOKENS
   ------------------------------ */
:root {
  /* Brand */
  --primary: #0B2545;   /* Deep navy */
  --secondary: #2E8B8B; /* Teal */
  --accent: #F2F4F8;    /* Light accent */

  /* Playful dynamic extras */
  --pink: #FF4D8D;
  --yellow: #FFD84D;
  --purple: #6C63FF;
  --aqua: #2DE2E6;
  --lime: #9BFF7A;

  /* Inks & surfaces */
  --ink: #0B2545;          /* main text */
  --ink-subtle: #2b4a73;   /* secondary text */
  --surface: #FFFFFF;      /* cards / base */
  --surface-muted: #FAFCFF;/* soft page bg */

  /* Shadows & radii */
  --shadow-sm: 0 2px 8px rgba(11, 37, 69, 0.12);
  --shadow-md: 0 6px 20px rgba(11, 37, 69, 0.16);
  --shadow-lg: 0 14px 40px rgba(11, 37, 69, 0.22);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;

  /* Spacing scale */
  --sp-8: 8px;
  --sp-12: 12px;
  --sp-16: 16px;
  --sp-20: 20px;
  --sp-24: 24px;
  --sp-30: 30px;
  --sp-32: 32px;
  --sp-40: 40px;
  --sp-48: 48px;
  --sp-60: 60px;
  --maxw: 1120px;
}

body {
  background: var(--surface-muted);
  color: var(--ink);
  font-family: 'Trebuchet MS', 'Segoe UI', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: Georgia, 'Times New Roman', serif;
  margin: 0;
  color: var(--primary);
}

h1 { font-size: 36px; line-height: 1.15; letter-spacing: -0.5px; }
h2 { font-size: 28px; line-height: 1.2; }
h3 { font-size: 20px; line-height: 1.3; }

p { margin: 0; color: var(--ink); }
small { font-size: 14px; }

/* ------------------------------
   2) LAYOUT PRIMITIVES (FLEX-ONLY)
   ------------------------------ */
.container {
  display: flex; flex-direction: column; align-items: center;
  max-width: var(--maxw);
  margin: 0 auto; padding: 0 20px;
}

.content-wrapper {
  display: flex; flex-direction: column; align-items: flex-start;
  gap: var(--sp-20);
}

section { /* Base spacing for all sections */
  display: flex; /* layout container (flex only) */
  width: 100%;
  margin: 0; padding: var(--sp-40) 0;
}

/* MANDATORY CSS SPACING AND ALIGNMENT PATTERNS */
.section { margin-bottom: 60px; padding: 40px 20px; display: flex; }
.card-container { display: flex; flex-wrap: wrap; gap: 24px; }
.card { margin-bottom: 20px; position: relative; background: var(--surface); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); padding: var(--sp-20); }
.content-grid { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; }
.text-image-section { display: flex; align-items: center; gap: 30px; flex-wrap: wrap; }
.testimonial-card { display: flex; align-items: center; gap: 20px; padding: 20px; }
.feature-item { display: flex; flex-direction: column; align-items: flex-start; gap: 15px; }

/* Utility helpers */
.hide { display: none !important; }
.center { justify-content: center; align-items: center; }

/* ------------------------------
   3) HEADER & NAVIGATION
   ------------------------------ */
header {
  position: sticky; top: 0; z-index: 1000;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
header > .container {
  padding: var(--sp-12) 20px; width: 100%;
  flex-direction: row; justify-content: space-between; align-items: center;
}
.brand { display: flex; align-items: center; gap: var(--sp-12); }
.brand img { height: 36px; width: auto; }

.main-nav {
  display: none; /* mobile-first: hidden */
  align-items: center; gap: var(--sp-16); flex-wrap: wrap;
}
.main-nav a {
  color: var(--primary); padding: 8px 10px; border-radius: var(--radius-sm);
  transition: color .2s ease, background-color .2s ease, transform .2s ease;
}
.main-nav a:hover { background: var(--accent); color: var(--secondary); transform: translateY(-1px); }

.mobile-menu-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 10px;
  background: var(--primary); color: #fff; box-shadow: var(--shadow-sm);
  transition: transform .2s ease, background-color .2s ease;
}
.mobile-menu-toggle:hover { transform: scale(1.05); background: #123865; }

/* Mobile full-screen menu */
.mobile-menu {
  position: fixed; inset: 0; z-index: 1200; display: flex;
  background: rgba(11,37,69,0.06);
  transform: translateX(100%);
  transition: transform .35s ease;
}
.mobile-menu .mobile-nav {
  margin-left: auto; width: min(86%, 360px); background: var(--surface);
  display: flex; flex-direction: column; padding: var(--sp-32);
  gap: var(--sp-16); box-shadow: var(--shadow-lg);
}
.mobile-menu .mobile-nav a {
  font-size: 18px; padding: 12px 10px; border-radius: var(--radius-sm);
  color: var(--primary);
}
.mobile-menu .mobile-nav a:hover { background: var(--accent); color: var(--secondary); }
.mobile-menu-close {
  position: absolute; top: 16px; right: 16px; z-index: 1300;
  width: 40px; height: 40px; border-radius: 10px; background: var(--secondary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm);
}
/* Open states supported: .open, .active, .is-open */
.mobile-menu.open, .mobile-menu.active, .mobile-menu.is-open { transform: translateX(0); }

/* Desktop nav */
@media (min-width: 992px) {
  .mobile-menu-toggle { display: none; }
  .main-nav { display: flex; }
}

/* ------------------------------
   4) HERO SECTION — playful dynamic
   ------------------------------ */
.hero {
  position: relative; overflow: hidden; width: 100%;
  background: var(--surface);
}
.hero > .container { position: relative; z-index: 1; }
.hero .content-wrapper { align-items: flex-start; gap: var(--sp-20); }

/* Decorative playful shapes */
.hero::before, .hero::after {
  content: ""; position: absolute; z-index: 0; pointer-events: none;
  width: 220px; height: 220px; border-radius: 32px; opacity: 0.14;
  animation: floatY 9s ease-in-out infinite;
}
.hero::before { background: var(--pink); top: -40px; left: -40px; transform: rotate(6deg); }
.hero::after  { background: var(--yellow); bottom: -60px; right: -60px; transform: rotate(-8deg); animation-delay: 1.6s; }

.subheadline { color: var(--ink-subtle); font-size: 16px; }

/* CTA Row */
.cta-row { display: flex; flex-wrap: wrap; gap: var(--sp-16); align-items: center; }

/* Supporting bullets & trust badges */
.supporting-bullets { display: flex; flex-wrap: wrap; gap: var(--sp-12); list-style: none; }
.supporting-bullets li { display: flex; align-items: center; gap: 10px; background: var(--surface); border-radius: 999px; padding: 8px 12px; box-shadow: var(--shadow-sm); }
.supporting-bullets img { width: 18px; height: 18px; }

.trust-badges { display: flex; flex-wrap: wrap; gap: var(--sp-12); align-items: center; }
.trust-badges span { display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px dashed var(--secondary); color: var(--primary); border-radius: 999px; padding: 8px 12px; }
.trust-badges img { width: 18px; height: 18px; }

/* ------------------------------
   5) BUTTONS & LINKS
   ------------------------------ */
.btn-primary, .btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border-radius: 14px; font-weight: 700; letter-spacing: 0.2px;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, color .18s ease;
  text-decoration: none; min-height: 44px;
}

.btn-primary {
  background: var(--pink); color: #0b0b0b; box-shadow: 0 4px 0 #d7346e, var(--shadow-sm);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #d7346e, var(--shadow-md); }
.btn-primary:active { transform: translateY(0); box-shadow: 0 2px 0 #d7346e, var(--shadow-sm); }

.btn-secondary {
  background: var(--yellow); color: #0b0b0b; box-shadow: 0 4px 0 #d7b73a, var(--shadow-sm);
}
.btn-secondary:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #d7b73a, var(--shadow-md); }
.btn-secondary:active { transform: translateY(0); box-shadow: 0 2px 0 #d7b73a, var(--shadow-sm); }

/* Text links */
a { color: var(--secondary); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: #1f6e6e; }

/* ------------------------------
   6) CONTENT BLOCKS
   ------------------------------ */
.grid { /* Flex-only responsive grid */
  display: flex; flex-wrap: wrap; gap: var(--sp-20);
}
.grid > .text-section { flex: 1 1 260px; }

.text-section {
  display: flex; flex-direction: column; gap: 10px; color: var(--ink);
  background: var(--surface); padding: var(--sp-20); border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm); transition: transform .2s ease, box-shadow .2s ease;
}
.text-section:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.text-section img { display: inline-block; vertical-align: middle; margin-right: 8px; }

.value-props { display: flex; flex-wrap: wrap; gap: var(--sp-12); list-style: none; }
.value-props li {
  flex: 1 1 260px;
  background: var(--accent); color: var(--primary); border: 1px solid #e4ebf5;
  border-radius: var(--radius-md); padding: 12px 14px; box-shadow: var(--shadow-sm);
}

.stepper { display: flex; flex-direction: column; gap: 10px; counter-reset: step; padding-left: 0; }
.stepper li { list-style: none; background: #fff; border-radius: var(--radius-md); padding: 12px 14px; box-shadow: var(--shadow-sm); border-left: 6px solid var(--purple); }
.stepper li:nth-child(2n) { border-left-color: var(--aqua); }
.stepper li:nth-child(3n) { border-left-color: var(--pink); }

/* Testimonials: high-contrast, light background */
.testimonial-card {
  background: var(--accent); color: var(--primary);
  border: 1px solid #e2e8f3; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.testimonial-card p { margin: 0; }

/* Footer */
footer { background: var(--primary); color: #fff; margin-top: var(--sp-48); }
footer a { color: #fff; text-decoration: underline; }
footer > .container { padding: var(--sp-40) 20px; }
footer .content-wrapper {
  width: 100%; flex-direction: column; gap: var(--sp-20);
}
.footer-nav { display: flex; flex-wrap: wrap; gap: var(--sp-12); }
.social { display: flex; gap: var(--sp-12); flex-wrap: wrap; }

/* ------------------------------
   7) OPTIONAL/GENERIC CARDS
   ------------------------------ */
.card-container .card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

/* ------------------------------
   8) RESPONSIVE TYPOGRAPHY & LAYOUT
   ------------------------------ */
@media (min-width: 768px) {
  body { font-size: 17px; }
  h1 { font-size: 44px; }
  h2 { font-size: 32px; }
  h3 { font-size: 22px; }
  .text-image-section { flex-direction: row; }
}

@media (max-width: 768px) {
  .text-image-section { flex-direction: column; }
}

@media (min-width: 1024px) {
  body { font-size: 18px; }
  h1 { font-size: 52px; }
  h2 { font-size: 36px; }
  h3 { font-size: 24px; }
  footer .content-wrapper { flex-direction: row; flex-wrap: wrap; justify-content: space-between; }
}

/* ------------------------------
   9) MICRO-INTERACTIONS & ANIMATIONS
   ------------------------------ */
@keyframes floatY {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-10px) rotate(2deg); }
}

@keyframes slideUp {
  0% { transform: translateY(12px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* Apply gentle entrance to common elements */
.hero .content-wrapper > * { animation: slideUp .5s ease both; }
.hero .content-wrapper > *:nth-child(2) { animation-delay: .05s; }
.hero .content-wrapper > *:nth-child(3) { animation-delay: .1s; }

/* ------------------------------
   10) FORMS & LISTS (if any appear later)
   ------------------------------ */
input, select, textarea {
  width: 100%; padding: 12px 14px; border: 1px solid #d8e1ee; border-radius: 12px; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { border-color: var(--secondary); box-shadow: 0 0 0 3px rgba(46,139,139,0.15); }
label { display: block; margin-bottom: 6px; color: var(--primary); font-weight: 700; }

/* ------------------------------
   11) COOKIE CONSENT — Banner & Modal
   ------------------------------ */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1400;
  display: flex; justify-content: center; padding: 12px;
  transform: translateY(100%); transition: transform .35s ease;
}
.cookie-banner .cookie-inner {
  display: flex; flex-direction: column; gap: 12px; align-items: flex-start;
  width: min(100%, 1080px); background: #ffffff; color: var(--primary);
  border: 2px solid var(--primary); border-radius: 16px; padding: 16px; box-shadow: var(--shadow-lg);
}
.cookie-banner.show { transform: translateY(0); }
.cookie-title { font-weight: 800; }
.cookie-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cookie-actions .btn-accept { background: var(--lime); color: #0b0b0b; border-radius: 12px; padding: 10px 14px; box-shadow: 0 4px 0 #62d65a, var(--shadow-sm); }
.cookie-actions .btn-reject { background: var(--pink); color: #0b0b0b; border-radius: 12px; padding: 10px 14px; box-shadow: 0 4px 0 #d7346e, var(--shadow-sm); }
.cookie-actions .btn-settings { background: var(--yellow); color: #0b0b0b; border-radius: 12px; padding: 10px 14px; box-shadow: 0 4px 0 #d7b73a, var(--shadow-sm); }
.cookie-actions button:hover { transform: translateY(-2px); }

/* Cookie preferences modal */
.cookie-modal {
  position: fixed; inset: 0; z-index: 1500; display: flex; align-items: stretch; justify-content: flex-end;
  background: rgba(11,37,69,0.3); transform: translateX(100%); transition: transform .35s ease;
}
.cookie-modal .cookie-panel {
  background: #fff; width: min(92%, 520px); padding: 20px; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow-lg);
}
.cookie-modal .cookie-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--accent); padding: 12px; border-radius: 12px; }
.cookie-modal .cookie-note { color: var(--ink-subtle); font-size: 14px; }
.toggle { width: 52px; height: 30px; border-radius: 999px; background: #d8e1ee; position: relative; display: inline-flex; align-items: center; padding: 3px; transition: background .2s ease; }
.toggle::after { content: ""; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transform: translateX(0); transition: transform .2s ease; }
.toggle.on { background: var(--secondary); }
.toggle.on::after { transform: translateX(22px); }
.cookie-modal.open, .cookie-modal.is-open, .cookie-modal.active { transform: translateX(0); }
.cookie-modal .cookie-actions { margin-top: 6px; }

/* ------------------------------
   12) PAGE-SPECIFIC TUNING
   ------------------------------ */
/* Hero variants by page still inherit base; ensure readable contrast */
.hero .subheadline { max-width: 60ch; }

/* Case archives, speaker profiles, etc. are just text-sections within a .grid */

/* Contact details row */
.text-section a[href^="tel:"], .text-section a[href^="mailto:"] {
  color: var(--secondary);
}

/* Footer nav visual rhythm */
.footer-nav a { padding: 6px 10px; border-radius: 10px; background: rgba(255,255,255,0.06); }
.footer-nav a:hover { background: rgba(255,255,255,0.14); }

/* ------------------------------
   13) ACCESSIBILITY & READABILITY
   ------------------------------ */
::selection { background: var(--yellow); color: #000; }

/* Ensure testimonial text remains dark on light */
.testimonial-card, .testimonial-card * { color: var(--primary); }

/* ------------------------------
   14) ENSURE MINIMUM GAPS BETWEEN ELEMENTS
   ------------------------------ */
.content-wrapper > * + * { margin-top: 0; } /* gap handled by flex */
.grid > * { margin: 0; } /* gap via flex */

/* ------------------------------
   15) PRINT (basic)
   ------------------------------ */
@media print {
  header, .mobile-menu, .cookie-banner, .cookie-modal { display: none !important; }
  a { text-decoration: underline; }
}
