/* ==========================================================================
   CONTROL Resonant — Kadence UI skin
   Palette: Bureau ink, concrete, Hiss signal red, phosphor green
   ========================================================================== */

:root {
  --cr-void: #07080a;
  --cr-ink: #0c0e12;
  --cr-concrete: #151922;
  --cr-panel: #1b212c;
  --cr-panel-2: #232a36;
  --cr-line: rgba(232, 236, 239, 0.1);
  --cr-line-strong: rgba(214, 40, 40, 0.45);
  --cr-paper: #eef1f4;
  --cr-muted: #9aa4b2;
  --cr-signal: #e03131;
  --cr-signal-deep: #a61b1b;
  --cr-phosphor: #6dffb0;
  --cr-phosphor-dim: rgba(109, 255, 176, 0.16);
  --cr-amber: #d4a017;
  --cr-display: "Syne", system-ui, sans-serif;
  --cr-body: "IBM Plex Sans", system-ui, sans-serif;
  --cr-radius: 2px;
  --cr-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);

  /* Override Kadence globals site-wide */
  --global-palette1: var(--cr-signal) !important;
  --global-palette2: var(--cr-signal-deep) !important;
  --global-palette3: var(--cr-paper) !important;
  --global-palette4: #c8d0da !important;
  --global-palette5: var(--cr-muted) !important;
  --global-palette6: #7d8794 !important;
  --global-palette7: var(--cr-panel-2) !important;
  --global-palette8: var(--cr-ink) !important;
  --global-palette9: var(--cr-concrete) !important;
  --global-palette-highlight: var(--cr-signal) !important;
  --global-palette-highlight-alt: var(--cr-phosphor) !important;
  --global-palette-btn-bg: var(--cr-signal) !important;
  --global-palette-btn-bg-hover: #ff4a4a !important;
  --global-palette-btn: #fff !important;
  --global-body-font-family: var(--cr-body) !important;
  --global-heading-font-family: var(--cr-display) !important;
}

/* ---- Base ---- */
html {
  scroll-behavior: smooth;
}

body.crk-skin,
body.crk-skin #wrapper,
body.crk-skin #inner-wrap,
body.crk-skin .site,
body.crk-skin .content-bg,
body.crk-skin.content-style-unboxed .site {
  background: var(--cr-ink) !important;
  color: var(--cr-paper);
  font-family: var(--cr-body);
}

body.crk-skin {
  background-image:
    radial-gradient(ellipse 90% 55% at 85% -10%, rgba(224, 49, 49, 0.18), transparent 55%),
    radial-gradient(ellipse 60% 40% at -10% 90%, rgba(109, 255, 176, 0.06), transparent 50%),
    linear-gradient(180deg, var(--cr-void), var(--cr-ink) 40%, #10141c 100%);
  background-attachment: fixed;
}

body.crk-skin a {
  color: var(--cr-phosphor);
  text-underline-offset: 0.18em;
}

body.crk-skin a:hover {
  color: #fff;
}

body.crk-skin h1,
body.crk-skin h2,
body.crk-skin h3,
body.crk-skin h4,
body.crk-skin .entry-title,
body.crk-skin .wp-block-heading {
  font-family: var(--cr-display) !important;
  letter-spacing: -0.02em;
  color: var(--cr-paper) !important;
}

/* ---- Header ---- */
body.crk-skin #masthead,
body.crk-skin .site-header-wrap,
body.crk-skin .site-main-header-wrap,
body.crk-skin .site-header-upper-inner-wrap,
body.crk-skin .site-header-row-container-inner {
  background: rgba(7, 8, 10, 0.88) !important;
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--cr-line);
}

body.crk-skin .site-branding .site-title,
body.crk-skin .site-title a {
  font-family: var(--cr-display) !important;
  font-weight: 800 !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cr-paper) !important;
  font-size: clamp(1rem, 2vw, 1.2rem) !important;
}

body.crk-skin .header-navigation .header-menu-container > ul > li > a,
body.crk-skin .header-navigation[class*="header-navigation-style"] .header-menu-container > ul > li > a {
  color: var(--cr-muted) !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.crk-skin .header-navigation .header-menu-container > ul > li > a:hover,
body.crk-skin .header-navigation .header-menu-container > ul > li.current-menu-item > a {
  color: var(--cr-paper) !important;
}

body.crk-skin .header-navigation .header-menu-container > ul > li.current-menu-item > a {
  box-shadow: inset 0 -2px 0 var(--cr-signal);
}

/* ---- Content cards ---- */
body.crk-skin .entry.content-bg,
body.crk-skin .entry.single-content,
body.crk-skin article.entry {
  background: linear-gradient(165deg, rgba(27, 33, 44, 0.96), rgba(15, 18, 24, 0.98)) !important;
  border: 1px solid var(--cr-line) !important;
  box-shadow: var(--cr-shadow) !important;
  border-radius: var(--cr-radius) !important;
}

body.crk-skin .entry-content-wrap {
  padding-top: 2.25rem !important;
  padding-bottom: 2.5rem !important;
}

/* In-content page titles (Timeline, Editions, etc.) — compact, content-width */
body.crk-skin .entry-header.page-title,
body.crk-skin .entry-content-wrap > .entry-header {
  margin: 0 0 1rem !important;
  padding: 0.35rem 0 0.85rem !important;
  border-bottom: 1px solid var(--cr-line);
  max-width: 100%;
}

body.crk-skin .entry-header.page-title .entry-title,
body.crk-skin .entry-content-wrap > .entry-header .entry-title {
  font-size: clamp(1.35rem, 3vw, 1.75rem) !important;
  line-height: 1.15 !important;
  margin: 0 !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Kill any leftover full-bleed title hero wrappers sitewide */
body.crk-skin .entry-hero.page-hero-section {
  width: min(100% - 2rem, var(--global-content-width, 1290px)) !important;
  max-width: var(--global-content-width, 1290px) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* ---- Hero (home HTML) ---- */
.cr-disclaimer {
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--cr-muted);
  padding: 0.55rem 1rem;
  background: rgba(0, 0, 0, 0.45);
  border-bottom: 1px solid var(--cr-line);
}

.cr-disclaimer strong {
  color: var(--cr-paper);
  font-weight: 600;
}

.cr-hero {
  position: relative;
  isolation: isolate;
  min-height: min(88vh, 760px);
  display: flex;
  align-items: flex-end;
  margin: -2.25rem -2rem 2rem;
  padding: clamp(3.5rem, 10vh, 6rem) clamp(1.25rem, 4vw, 2.5rem) clamp(2.5rem, 6vh, 3.5rem);
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 55% at 78% 18%, rgba(224, 49, 49, 0.32), transparent 58%),
    radial-gradient(ellipse 45% 40% at 12% 88%, var(--cr-phosphor-dim), transparent 55%),
    linear-gradient(155deg, #12161f 0%, #0a0c10 48%, #1a1014 100%);
  border-bottom: 1px solid var(--cr-line-strong);
}

.cr-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 85%);
  pointer-events: none;
}

.cr-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(255, 255, 255, 0.012) 2px,
    rgba(255, 255, 255, 0.012) 4px
  );
  opacity: 0.65;
  pointer-events: none;
  animation: cr-grain 9s steps(5) infinite;
}

@keyframes cr-grain {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-0.6%, 0.4%); }
  50% { transform: translate(0.5%, -0.5%); }
  75% { transform: translate(-0.3%, -0.4%); }
}

@media (prefers-reduced-motion: reduce) {
  .cr-hero::after {
    animation: none;
  }
  html {
    scroll-behavior: auto;
  }
}

.cr-hero h1 {
  font-family: var(--cr-display) !important;
  font-weight: 800 !important;
  font-size: clamp(2.8rem, 9vw, 5.4rem) !important;
  line-height: 0.92 !important;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  margin: 0 0 1rem !important;
  color: #fff !important;
  text-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

.cr-hero h1 span {
  display: block;
  color: var(--cr-signal);
}

.cr-hero .cr-sub {
  font-family: var(--cr-display);
  font-weight: 700;
  font-size: clamp(1.15rem, 2.6vw, 1.55rem);
  line-height: 1.25;
  max-width: 28ch;
  margin: 0 0 0.75rem;
  color: var(--cr-paper);
}

.cr-hero .cr-support {
  max-width: 44ch;
  margin: 0 0 1.6rem;
  color: var(--cr-muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.cr-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 1.35rem;
}

.cr-cta a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.85rem;
  padding: 0.75rem 1.3rem;
  font-family: var(--cr-body);
  font-weight: 650;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  text-decoration: none !important;
  border: 1px solid transparent;
  background: linear-gradient(180deg, #f04545, var(--cr-signal));
  color: #fff !important;
  box-shadow: 0 10px 28px rgba(224, 49, 49, 0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.cr-cta a:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(224, 49, 49, 0.45);
  color: #fff !important;
}

.cr-cta a.ghost {
  background: transparent;
  border-color: rgba(238, 241, 244, 0.28);
  color: var(--cr-paper) !important;
  box-shadow: none;
}

.cr-cta a.ghost:hover {
  border-color: var(--cr-phosphor);
  color: var(--cr-phosphor) !important;
}

.cr-note {
  margin: 0;
  color: var(--cr-muted);
  font-size: 0.92rem;
}

.cr-note strong {
  color: var(--cr-amber);
  font-weight: 600;
}

.cr-countdown-wrap {
  margin: 0 0 1.35rem;
}

.cr-hero .cr-countdown-wrap + h1 {
  margin-top: 0.25rem;
}

.cr-countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 5.75rem));
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

.cr-countdown__unit {
  background: rgba(7, 8, 10, 0.72);
  border: 1px solid var(--cr-line);
  border-top: 2px solid var(--cr-signal);
  padding: 0.7rem 0.4rem 0.65rem;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.cr-countdown__num {
  display: block;
  font-family: var(--cr-display);
  font-weight: 800;
  font-size: clamp(1.45rem, 4vw, 2rem);
  line-height: 1;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.cr-countdown__label {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--cr-muted);
}

.cr-ea-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.85rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid rgba(212, 160, 23, 0.45);
  background: rgba(212, 160, 23, 0.12);
  color: var(--cr-amber);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cr-ea-pill span {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--cr-amber);
  box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.25);
}

/* ---- Jump grid ---- */
.cr-jump {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  gap: 0.7rem;
}

.cr-jump a {
  display: block;
  padding: 0.95rem 1rem;
  background: var(--cr-panel);
  border: 1px solid var(--cr-line);
  border-left: 3px solid var(--cr-signal);
  color: var(--cr-paper) !important;
  text-decoration: none !important;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.cr-jump a:hover {
  background: var(--cr-panel-2);
  border-left-color: var(--cr-phosphor);
  color: #fff !important;
  transform: translateY(-2px);
}

/* ---- Scores ---- */
.cr-scores {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 0.9rem;
  margin: 1.5rem 0 1.75rem;
}

.cr-score {
  position: relative;
  background: linear-gradient(160deg, var(--cr-panel-2), var(--cr-panel));
  border: 1px solid var(--cr-line);
  border-top: 3px solid var(--cr-signal);
  padding: 1.35rem 1.15rem 1.2rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.cr-score strong {
  display: block;
  font-family: var(--cr-display);
  font-size: clamp(2.2rem, 5vw, 2.7rem);
  line-height: 1;
  color: #fff;
  font-weight: 800;
}

.cr-score span {
  display: block;
  margin-top: 0.45rem;
  color: var(--cr-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---- Prose / tables ---- */
body.crk-skin .entry-content p,
body.crk-skin .entry-content li {
  color: #d5dbe3;
}

body.crk-skin .entry-content ul > li::marker {
  color: var(--cr-signal);
}

body.crk-skin .wp-block-table table,
body.crk-skin table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--cr-line);
  background: rgba(0, 0, 0, 0.2);
}

body.crk-skin .wp-block-table th,
body.crk-skin th {
  background: rgba(224, 49, 49, 0.12);
  color: var(--cr-muted) !important;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
}

body.crk-skin .wp-block-table td,
body.crk-skin .wp-block-table th,
body.crk-skin td,
body.crk-skin th {
  border-bottom: 1px solid var(--cr-line) !important;
  padding: 0.8rem 0.9rem !important;
}

body.crk-skin .wp-block-table tr:hover td {
  background: rgba(109, 255, 176, 0.04);
}

/* ---- Buttons (Kadence / core) ---- */
body.crk-skin .wp-block-button__link,
body.crk-skin button:not(.menu-toggle):not(.drawer-toggle),
body.crk-skin .button,
body.crk-skin input[type="submit"] {
  border-radius: var(--cr-radius) !important;
  font-weight: 650 !important;
}

/* ---- Footer ---- */
body.crk-skin #colophon,
body.crk-skin .site-footer,
body.crk-skin .site-middle-footer-wrap,
body.crk-skin .site-bottom-footer-wrap {
  background: var(--cr-void) !important;
  color: var(--cr-muted) !important;
  border-top: 1px solid var(--cr-line);
}

body.crk-skin .site-footer a {
  color: var(--cr-muted);
}

body.crk-skin .site-footer a:hover {
  color: var(--cr-phosphor);
}

/* ---- Timeline / continue CTA ---- */
.cr-timeline {
  list-style: none;
  margin: 1.5rem 0 2rem;
  padding: 0;
  border-left: 2px solid rgba(224, 49, 49, 0.45);
}

.cr-timeline li {
  position: relative;
  padding: 0 0 1.6rem 1.5rem;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.cr-timeline li.is-visible,
.crk-motion-off .cr-timeline li {
  opacity: 1;
  transform: none;
}

.cr-timeline li::before {
  content: "";
  position: absolute;
  left: -0.4rem;
  top: 0.35rem;
  width: 0.65rem;
  height: 0.65rem;
  background: var(--cr-signal);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(224, 49, 49, 0.2);
}

.cr-timeline__date {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cr-phosphor);
  margin-bottom: 0.25rem;
}

.cr-timeline__title {
  font-family: var(--cr-display);
  font-weight: 700;
  font-size: 1.1rem;
  margin: 0 0 0.35rem;
  color: var(--cr-paper);
}

.cr-timeline p {
  margin: 0;
  color: var(--cr-muted);
  font-size: 0.95rem;
}

.cr-continue {
  margin-top: 2rem !important;
  padding-top: 1.25rem;
  border-top: 1px solid var(--cr-line);
}

.cr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.2rem;
  font-weight: 650;
  font-size: 0.9rem;
  text-decoration: none !important;
  border: 1px solid transparent;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.cr-btn--ghost {
  background: transparent;
  border-color: rgba(238, 241, 244, 0.28);
  color: var(--cr-paper) !important;
}

.cr-btn--ghost:hover {
  border-color: var(--cr-phosphor);
  color: var(--cr-phosphor) !important;
}

/* ---- Mobile hero edge ---- */
@media (max-width: 767px) {
  .cr-hero {
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    min-height: 78vh;
  }

  .cr-cta a {
    width: 100%;
  }

  .cr-countdown {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    max-width: 100%;
  }
}

/* ---- Phase 5: spacing, responsive, a11y ---- */
body.crk-skin .content-area {
  margin-top: 2.5rem !important;
  margin-bottom: 2.5rem !important;
}

@media (max-width: 767px) {
  body.crk-skin .content-area {
    margin-top: 1.25rem !important;
    margin-bottom: 1.5rem !important;
  }

  body.crk-skin .entry-content-wrap {
    padding: 1.25rem !important;
  }

  body.crk-skin h1.entry-title,
  body.crk-skin .entry-header .entry-title {
    font-size: 1.35rem !important;
  }

  body.crk-skin {
    overflow-x: hidden;
  }
}

body.crk-skin .wp-block-table,
body.crk-skin .entry-content figure.wp-block-table {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

body.crk-skin .wp-block-table table {
  min-width: 32rem;
}

body.crk-skin .entry-content h2.wp-block-heading {
  font-size: clamp(1.25rem, 3vw, 1.55rem) !important;
  margin-top: 2rem !important;
}

body.crk-skin .entry-content h3.wp-block-heading {
  font-size: clamp(1.05rem, 2.4vw, 1.2rem) !important;
  color: var(--cr-phosphor) !important;
}

/* Focus visibility */
body.crk-skin a:focus-visible,
body.crk-skin button:focus-visible,
body.crk-skin .cr-btn:focus-visible,
body.crk-skin .cr-cta a:focus-visible,
body.crk-skin .cr-jump a:focus-visible {
  outline: 2px solid var(--cr-phosphor) !important;
  outline-offset: 3px !important;
}

body.crk-skin .cr-skip:focus {
  left: var(--cr-gutter, 1rem);
  top: 0.5rem;
}

/* Site-wide footer disclaimer */
.cr-site-disclaimer {
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--cr-muted);
  padding: 0.85rem 1.25rem 1.25rem;
  background: var(--cr-void);
  border-top: 1px solid var(--cr-line);
}

.cr-site-disclaimer strong {
  color: var(--cr-paper);
  font-weight: 600;
}

.cr-site-disclaimer a {
  color: var(--cr-phosphor);
}

/* Contrast: body copy on dark panels */
body.crk-skin .entry-content p,
body.crk-skin .entry-content li {
  color: #d7dde6;
}

@media (prefers-reduced-motion: reduce) {
  .cr-hero::after,
  .cr-timeline li {
    animation: none !important;
    transition: none !important;
  }

  .cr-timeline li {
    opacity: 1 !important;
    transform: none !important;
  }
}
