/* EPIC CSX orientation threshold, 14 September 2026.
   A compact, skippable orientation block that sits in the page flow directly above the
   first customer input. Not a modal, not a splash, never blocks scrolling, never traps focus.
   Every colour and font is a custom property with a fallback so each host page can tune it:
   --th-bg, --th-fg, --th-muted, --th-accent, --th-accent-hover, --th-on-accent, --th-border,
   --th-font-d (display), --th-font-b (body), --th-radius, --th-pad, --th-max.
   Markup contract and JS contract: see README.md beside this file. */

.epic-threshold,
.epic-threshold * {
  box-sizing: border-box;
}

.epic-threshold {
  --th-bg-d: var(--th-bg, #0B1220);
  --th-fg-d: var(--th-fg, #FCF8F0);
  --th-muted-d: var(--th-muted, #C6CEDC);
  --th-accent-d: var(--th-accent, #E3C377);
  --th-accent-hover-d: var(--th-accent-hover, #e8c98a);
  --th-on-accent-d: var(--th-on-accent, #0B1220);
  --th-border-d: var(--th-border, rgba(227, 195, 119, 0.35));
  --th-font-d-d: var(--th-font-d, 'Cormorant Garamond', 'Iowan Old Style', 'Palatino Linotype', Georgia, 'Times New Roman', serif);
  --th-font-b-d: var(--th-font-b, 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif);
  --th-radius-d: var(--th-radius, 14px);
  --th-pad-d: var(--th-pad, 18px 22px 20px);
  --th-max-d: var(--th-max, 100%);

  display: block;
  position: relative;
  width: 100%;
  max-width: var(--th-max-d);
  margin: 0 0 16px;
  padding: var(--th-pad-d);
  background: var(--th-bg-d);
  color: var(--th-fg-d);
  border: 1px solid var(--th-border-d);
  border-radius: var(--th-radius-d);
  font-family: var(--th-font-b-d);
  font-size: 14.5px;
  line-height: 1.5;
  text-align: left;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;
}

/* Reset the few elements the block uses, so host resets cannot reshape it. */
.epic-threshold p,
.epic-threshold h2,
.epic-threshold ul {
  margin: 0;
  padding: 0;
}
.epic-threshold ul {
  list-style: none;
}
.epic-threshold a,
.epic-threshold button {
  font: inherit;
  color: inherit;
}

/* Eyebrow heading */
.epic-threshold .th-h {
  font-family: var(--th-font-d-d);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--th-accent-d);
  margin: 0 0 8px;
}

/* Body: the six parts in reading order. A wrapping flex row so that, where the container is
   wide enough, the facts row (badges and time) and the actions row share one line, badges left,
   actions right; where it is not, the actions wrap to their own line. DOM order is unchanged. */
.epic-threshold .th-body {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px 24px;
}

.epic-threshold .th-can,
.epic-threshold .th-reveal {
  flex: 0 0 100%;
  margin: 0;
  max-width: 78ch;
}
.epic-threshold .th-reveal {
  color: var(--th-muted-d);
  font-size: 14px;
}

/* Small inline label before each part */
.epic-threshold .th-k {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--th-muted-d);
  margin-right: 8px;
  vertical-align: 1px;
  white-space: nowrap;
}
.epic-threshold .th-can .th-k {
  color: var(--th-accent-d);
}

/* Facts row: badges and the time expectation share a line and wrap on phones */
.epic-threshold .th-facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  flex: 0 1 auto;
  margin: 2px 0 0;
}

.epic-threshold .th-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}
.epic-threshold .th-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 4px 11px 4px 10px;
  border: 1px solid var(--th-border-d);
  border-radius: 999px;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--th-muted-d);
  background: rgba(255, 255, 255, 0.03);
}
.epic-threshold .th-badge-k {
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--th-accent-d);
  white-space: nowrap;
}
.epic-threshold .th-badge[data-badge="live"] .th-badge-k::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--th-accent-d);
  margin-right: 6px;
  vertical-align: 1px;
}

.epic-threshold .th-time {
  margin: 0;
  font-size: 13.5px;
  color: var(--th-fg-d);
  white-space: nowrap;
}

/* Actions row: one gold start action, one quiet skip */
.epic-threshold .th-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  flex: 0 0 auto;
  gap: 10px 18px;
  margin: 2px 0 0;
}

.epic-threshold .th-start {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 24px;
  border: 0;
  border-radius: 10px;
  background: var(--th-accent-d);
  color: var(--th-on-accent-d);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.18s ease, transform 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}
.epic-threshold .th-start:hover {
  background: var(--th-accent-hover-d);
}
.epic-threshold .th-start:active {
  transform: translateY(1px);
}

.epic-threshold .th-skip,
.epic-threshold .th-show {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 6px;
  border: 0;
  background: transparent;
  color: var(--th-muted-d);
  font-size: 13.5px;
  text-decoration: underline;
  text-decoration-color: var(--th-border-d);
  text-underline-offset: 3px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.epic-threshold .th-skip:hover,
.epic-threshold .th-show:hover {
  color: var(--th-fg-d);
  text-decoration-color: var(--th-accent-d);
}

/* Visible focus for every control, keyboard and assistive */
.epic-threshold .th-start:focus,
.epic-threshold .th-skip:focus,
.epic-threshold .th-show:focus,
.epic-threshold .th-h:focus {
  outline: 2px solid var(--th-accent-d);
  outline-offset: 3px;
}
.epic-threshold .th-start:focus:not(:focus-visible),
.epic-threshold .th-skip:focus:not(:focus-visible),
.epic-threshold .th-show:focus:not(:focus-visible),
.epic-threshold .th-h:focus:not(:focus-visible) {
  outline: none;
}

/* Collapsed state: one line, the eyebrow and a Show link. Applied before first paint by the
   inline restore snippet in the README, so a remembered choice does not jump the layout. */
.epic-threshold .th-bar {
  display: none;
}
.epic-threshold.is-collapsed {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  padding: 8px 18px;
}
.epic-threshold.is-collapsed .th-h {
  margin: 0;
}
.epic-threshold.is-collapsed .th-body {
  display: none;
}
.epic-threshold.is-collapsed .th-bar {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 6px;
  margin: 0;
  font-size: 13px;
  color: var(--th-muted-d);
}
.epic-threshold.is-collapsed .th-show {
  min-height: 44px;
  padding: 10px 6px;
}

/* A 200ms fade before collapsing, skipped entirely under reduced motion */
.epic-threshold .th-body {
  opacity: 1;
}
.epic-threshold.is-collapsing .th-body {
  opacity: 0;
  transition: opacity 200ms ease;
}
@media (prefers-reduced-motion: reduce) {
  .epic-threshold .th-start,
  .epic-threshold.is-collapsing .th-body {
    transition: none;
  }
  .epic-threshold .th-start:active {
    transform: none;
  }
}

/* Phones: the six parts stack, badges wrap, the start action fills the width */
@media (max-width: 600px) {
  .epic-threshold {
    --th-pad-d: var(--th-pad, 16px 16px 18px);
    font-size: 14px;
  }
  .epic-threshold .th-h {
    font-size: 13px;
    margin-bottom: 8px;
  }
  .epic-threshold .th-reveal {
    font-size: 13.5px;
  }
  .epic-threshold .th-k {
    display: block;
    margin: 0 0 2px;
  }
  .epic-threshold .th-body {
    display: block;
  }
  .epic-threshold .th-can {
    margin: 0 0 8px;
  }
  .epic-threshold .th-facts {
    margin: 10px 0 12px;
    gap: 8px 12px;
  }
  .epic-threshold .th-time {
    white-space: normal;
  }
  .epic-threshold .th-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    margin: 0;
  }
  .epic-threshold .th-start {
    width: 100%;
  }
  .epic-threshold .th-skip {
    justify-content: center;
  }
  .epic-threshold.is-collapsed {
    padding: 6px 14px;
  }
}

/* Forced colours (Windows high contrast): keep the badge and block edges visible */
@media (forced-colors: active) {
  .epic-threshold,
  .epic-threshold .th-badge {
    border-color: CanvasText;
  }
  .epic-threshold .th-start {
    border: 1px solid ButtonText;
  }
}
