/* =====================================================================
   Timeline-it · Archive flow (home + item detail) — scoped tokens, reset and fonts
   Source design: Archive Version 2 2026-10-16.dc.html (19 Oct 2026)
   Drop into wwwroot/css/ and reference once from App.razor / index.html.
   Every rule is scoped to .tl-arc-scope. Nothing here targets :root, html,
   body, or bare elements. No !important.
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. Fonts
   Unique family name "tl-arc-Inter" so the host app's own "Inter" (if any)
   is never overridden and this UI never depends on it.
   Files: Inter v4.0 static woff2 (official web build, inter-ui@4.0.2, OFL),
   self-hosted under wwwroot/fonts/tl-arc/ (shipped in fonts/tl-arc/). Weights used by the design:
   400, 500, 600. (700 is the design-system ceiling; not used here.)
   --------------------------------------------------------------------- */
@font-face {
  font-family: "tl-arc-Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/tl-arc/Inter-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "tl-arc-Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/tl-arc/Inter-Medium.woff2") format("woff2");
}
@font-face {
  font-family: "tl-arc-Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/tl-arc/Inter-SemiBold.woff2") format("woff2");
}

/* ---------------------------------------------------------------------
   2. Tokens — light (default)
   --------------------------------------------------------------------- */
.tl-arc-scope {
  /* Type */
  --tl-arc-font: "tl-arc-Inter", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  --tl-arc-fw-regular: 400;
  --tl-arc-fw-medium: 500;
  --tl-arc-fw-semibold: 600;

  /* Brand */
  --tl-arc-navy: #0B1F3A;
  --tl-arc-gold: #F4A623;
  --tl-arc-blue: #2D6CDF;

  /* Status */
  --tl-arc-success: #22C55E;
  --tl-arc-warning: #F4A623;
  --tl-arc-error: #EF4444;
  --tl-arc-info: #3B82F6;

  /* Semantic surfaces & text */
  --tl-arc-bg: #F0F2F5;
  --tl-arc-surface: #FFFFFF;
  --tl-arc-surface-alt: #F8F7F4;
  --tl-arc-border: #E2E6EB;
  --tl-arc-text: #0B1F3A;
  --tl-arc-text-2: #555555;
  --tl-arc-text-muted: #8A8A8A;
  --tl-arc-link: #2D6CDF;
  --tl-arc-primary: #0B1F3A;        /* selected chip fill / border */
  --tl-arc-primary-text: #FFFFFF;   /* text on --tl-arc-primary */
  --tl-arc-accent: #F4A623;
  --tl-arc-accent-text: #0B1F3A;    /* text on gold */
  --tl-arc-warning-fg: #B4790F;     /* "on" button text, org-pinned badge */
  --tl-arc-warning-bg: #FDF3E1;     /* active / now / flash / personal call-outs */
  --tl-arc-rail-fill: #0B1F3A;      /* knowledge rail bar, journey "done" nodes */

  /* Knowledge kinds (marker colours) */
  --tl-arc-k-decision: #0B1F3A;
  --tl-arc-k-insight: #3B82F6;
  --tl-arc-k-action: #22C55E;
  --tl-arc-k-learning: #6B5BD2;
  --tl-arc-k-milestone: #F4A623;
  --tl-arc-k-highlight: #B4790F;
  --tl-arc-k-document: #7A8699;
  --tl-arc-k-pin: #F4A623;
  --tl-arc-k-note: #2D6CDF;
  --tl-arc-k-bookmark: #0B1F3A;
  /* Ink on filled kind tiles */
  --tl-arc-k-decision-ink: #FFFFFF;
  --tl-arc-k-insight-ink: #FFFFFF;
  --tl-arc-k-action-ink: #FFFFFF;
  --tl-arc-k-learning-ink: #FFFFFF;
  --tl-arc-k-milestone-ink: #0B1F3A;
  --tl-arc-k-highlight-ink: #FFFFFF;
  --tl-arc-k-document-ink: #FFFFFF;
  /* Video-stage colours never change with theme (stage is always navy) */
  --tl-arc-k-decision-onstage: #F1F1F1;
  --tl-arc-k-highlight-onstage: #E6C88A;

  /* Player overlay colours (fixed, both themes) */
  --tl-arc-stage-bg: #0B1F3A;
  --tl-arc-stage-pill-bg: rgba(8, 15, 26, 0.8);
  --tl-arc-stage-caption-bg: rgba(8, 15, 26, 0.85);
  --tl-arc-stage-focus-bg: rgba(8, 15, 26, 0.9);
  --tl-arc-stage-tip-bg: rgba(8, 15, 26, 0.95);
  --tl-arc-stage-bar-bg: rgba(8, 15, 26, 0.72);
  --tl-arc-stage-track: rgba(255, 255, 255, 0.2);
  --tl-arc-stage-lesson-tick: rgba(255, 255, 255, 0.5);
  --tl-arc-stage-tick-border: rgba(255, 255, 255, 0.35);
  --tl-arc-stage-tip-border: rgba(255, 255, 255, 0.22);
  --tl-arc-stage-btn-border: rgba(255, 255, 255, 0.3);
  --tl-arc-stage-btn-bg: rgba(255, 255, 255, 0.14);
  --tl-arc-stage-btn-bg-hover: rgba(255, 255, 255, 0.22);
  --tl-arc-stage-avatar-bg: rgba(255, 255, 255, 0.1);
  --tl-arc-stage-avatar-border: rgba(255, 255, 255, 0.25);
  --tl-arc-stage-text: #FFFFFF;
  --tl-arc-stage-text-2: #CBD5E1;
  --tl-arc-stage-dot-idle: #64748B;
  --tl-arc-search-mark: rgba(244, 166, 35, 0.6);

  /* Hero (Archive home) */
  --tl-arc-hero-gradient: linear-gradient(120deg, #0B1F3A 0%, #12336A 30%, #2D6CDF 58%, #8C86A6 80%, #F4A623 100%);
  --tl-arc-hero-text: #FFFFFF;
  --tl-arc-hero-text-90: rgba(255, 255, 255, 0.9);
  --tl-arc-hero-text-85: rgba(255, 255, 255, 0.85);
  --tl-arc-hero-btn-bg: rgba(255, 255, 255, 0.14);
  --tl-arc-hero-btn-bg-hover: rgba(255, 255, 255, 0.22);
  --tl-arc-hero-btn-border: rgba(255, 255, 255, 0.3);
  --tl-arc-hero-kbar-bg-hover: rgba(255, 255, 255, 0.24);
  --tl-arc-hero-kbar-bg-on: rgba(255, 255, 255, 0.28);

  /* Spacing (values actually used by the design) */
  --tl-arc-s-2: 2px;
  --tl-arc-s-4: 4px;
  --tl-arc-s-6: 6px;
  --tl-arc-s-8: 8px;
  --tl-arc-s-10: 10px;
  --tl-arc-s-12: 12px;
  --tl-arc-s-14: 14px;
  --tl-arc-s-16: 16px;
  --tl-arc-s-20: 20px;
  --tl-arc-s-24: 24px;
  --tl-arc-s-32: 32px;
  --tl-arc-s-40: 40px;
  --tl-arc-s-48: 48px;
  --tl-arc-s-64: 64px;
  --tl-arc-max-width: 1280px;

  /* Radii */
  --tl-arc-r-hero: 16px;     /* hero only — exceeds DS card radius, see spec §1.6 */
  --tl-arc-r-card: 12px;
  --tl-arc-r-button: 8px;
  --tl-arc-r-badge: 6px;
  --tl-arc-r-tick: 3px;
  --tl-arc-r-track: 2px;
  --tl-arc-r-pill: 20px;
  --tl-arc-r-round: 50%;

  /* Borders */
  --tl-arc-bw: 1px;
  --tl-arc-border-1: 1px solid var(--tl-arc-border);
  --tl-arc-border-gold: 1px solid var(--tl-arc-gold);

  /* Shadows (design deviations — knowledge rail only, see spec §1.6) */
  --tl-arc-shadow-soft: 0 8px 24px rgba(11, 31, 58, 0.10);
  --tl-arc-shadow-bar: 0 10px 20px rgba(11, 31, 58, 0.14);

  /* Focus ring (added for accessibility; not in the prototype) */
  --tl-arc-focus-outline: 2px solid #2D6CDF;
  --tl-arc-focus-offset: 2px;

  /* Opacity */
  --tl-arc-o-disabled: 0.4;     /* focus chip with 0 items */
  --tl-arc-o-off: 0.5;          /* timeline kind chip turned off */
  --tl-arc-o-dim-tick: 0.45;    /* scrubber ticks while another is singled out */
  --tl-arc-o-dim-marker: 0.3;   /* rail markers while another is focused */
  --tl-arc-o-gridline: 0.6;     /* timeline month/week gridlines */
  --tl-arc-o-stem: 0.75;        /* rail marker stem */
  --tl-arc-o-foot: 0.18;        /* rail marker foot ellipse */
  --tl-arc-o-btn-disabled: 0.45;/* DS Button disabled */

  /* z-index layers (local to .tl-arc-scope stacking context) */
  --tl-arc-z-tl-marker-sec: 1;
  --tl-arc-z-tl-marker: 2;
  --tl-arc-z-tl-marker-sel: 3;
  --tl-arc-z-tick: 2;
  --tl-arc-z-tick-hover: 3;
  --tl-arc-z-search-mark: 4;
  --tl-arc-z-tick-tip: 5;
  --tl-arc-z-rail-marker: 10;
  --tl-arc-z-rail-playhead: 15;
  --tl-arc-z-rail-marker-hover: 20;
  --tl-arc-z-rail-tip: 30;
  --tl-arc-z-toast: 60;

  /* Motion */
  --tl-arc-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --tl-arc-dur-fast: 120ms;
  --tl-arc-dur: 180ms;
  --tl-arc-dur-marker: 200ms;
  --tl-arc-dur-flash: 800ms;
  --tl-arc-flash-hold: 2600ms;   /* JS timer, documented here for reference */
  --tl-arc-toast-hold: 2200ms;   /* JS timer, documented here for reference */

  /* Container for responsive rules (see spec §2.2) */
  container-name: tl-arc-page;
  container-type: inline-size;
}

/* ---------------------------------------------------------------------
   3. Tokens — dark
   Applied by setting data-tl-arc-theme="dark" on the .tl-arc-scope element.
   --------------------------------------------------------------------- */
.tl-arc-scope[data-tl-arc-theme="dark"] {
  --tl-arc-bg: #080F1A;
  --tl-arc-surface: #0D1B2E;
  --tl-arc-surface-alt: #152336;
  --tl-arc-border: #1E2F45;
  --tl-arc-text: #FFFFFF;
  --tl-arc-text-2: #CBD5E1;
  --tl-arc-text-muted: #64748B;
  --tl-arc-link: #6C9BFF;
  --tl-arc-primary: #F4A623;
  --tl-arc-primary-text: #0B1F3A;
  --tl-arc-warning-fg: #F4A623;
  --tl-arc-warning-bg: #2A2110;
  --tl-arc-rail-fill: #1E3A8A;

  --tl-arc-k-decision: #F1F1F1;
  --tl-arc-k-decision-ink: #0B1F3A;
  --tl-arc-k-highlight: #E6C88A;
  --tl-arc-k-highlight-ink: #0B1F3A;
  --tl-arc-k-bookmark: #F1F1F1;

  --tl-arc-shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.45);
  --tl-arc-shadow-bar: 0 10px 20px rgba(0, 0, 0, 0.5);
}

/* ---------------------------------------------------------------------
   4. Scoped reset — stops host styles bleeding in, and ours bleeding out
   --------------------------------------------------------------------- */
.tl-arc-scope {
  display: block;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--tl-arc-font);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0;
  text-transform: none;
  text-align: left;
  color: var(--tl-arc-text);
  background: var(--tl-arc-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.tl-arc-scope *,
.tl-arc-scope *::before,
.tl-arc-scope *::after {
  box-sizing: border-box;
}
.tl-arc-scope :where(h1, h2, h3, h4, p, ul, ol, li, figure, blockquote, dl, dd) {
  margin: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  list-style: none;
}
.tl-arc-scope :where(button) {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: inherit;
  text-transform: none;
  line-height: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: none;
}
.tl-arc-scope :where(input, textarea, select) {
  margin: 0;
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  background: none;
  border-radius: 0;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}
.tl-arc-scope :where(input, textarea)::placeholder {
  color: var(--tl-arc-text-muted);
  opacity: 1;
}
.tl-arc-scope :where(a) {
  color: var(--tl-arc-link);
  text-decoration: none;
}
.tl-arc-scope :where(a:hover) {
  text-decoration: underline;
}
.tl-arc-scope :where(svg) {
  display: block;
  flex: none;
  overflow: visible;
}
.tl-arc-scope :where(img, video) {
  display: block;
  max-width: 100%;
}

/* Native scrollbars inside the scope (design uses browser defaults,
   except the "Your knowledge" list — see .tl-arc-scroll--thin) */
.tl-arc-scope,
.tl-arc-scope * {
  scrollbar-width: auto;
  scrollbar-color: auto;
}
.tl-arc-scope .tl-arc-scroll--thin {
  scrollbar-width: thin;
  scrollbar-color: var(--tl-arc-border) transparent;
  overscroll-behavior: contain;
}

/* Focus-visible for every interactive element in the scope */
.tl-arc-scope :where(button, a, input, textarea, [tabindex]):focus-visible {
  outline: var(--tl-arc-focus-outline);
  outline-offset: var(--tl-arc-focus-offset);
}
.tl-arc-scope :where(input, textarea):focus {
  outline: none;
}
.tl-arc-scope :where(input, textarea):focus-visible {
  outline: var(--tl-arc-focus-outline);
  outline-offset: 0;
}

/* Reduced motion — components must express every duration through these
   tokens, so this override wins without !important or specificity fights. */
@media (prefers-reduced-motion: reduce) {
  .tl-arc-scope {
    --tl-arc-dur-fast: 0ms;
    --tl-arc-dur: 0ms;
    --tl-arc-dur-marker: 0ms;
    --tl-arc-dur-flash: 0ms;
  }
}
