/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/*
 * ── Tone-B presentation discipline (Story 1.20 AC-3, AMENDED Story 2.14 AC-12) ──
 *
 * AMENDMENT (2026-06-17, "Locker Room" course-correction): the original rule was
 * "static — the only motion is a single ≤150ms fade." Tone-B now permits
 * PURPOSEFUL MICRO-MOTION: transitions ≤200ms, hover/focus state changes, and the
 * FAQ accordion expand/collapse + marker rotate. Everything below is STILL banned:
 *   - NO scroll-jacking — native/standard scroll only.
 *   - NO sticky/fixed chrome — no `position: sticky` / `position: fixed` on any
 *     header/footer/CTA (the global header in Story 2.14 is static by design).
 *   - NO entrance / "lighting up" animations, NO parallax, NO autoplay/auto-refresh.
 *   - NO transition or animation longer than 200ms.
 *   - `prefers-reduced-motion` disables ALL motion (see the media query at the end).
 *
 * CSS approach: as of Story 2.1 the locked styling system is Tailwind
 * (tailwindcss-rails, standalone CLI, no Node) — Mason's tiebreak, 2026-06-16. The
 * color + type design tokens live in app/assets/tailwind/application.css `@theme`
 * (Story 2.14) and Tailwind emits them as `:root` custom properties (--color-*,
 * --font-*). THIS file references those variables (single source of truth — no
 * duplicated token hex) for the hand-written base rules that sit beneath Tailwind:
 * the flash + error-page chrome (1.20/1.21) and the FAQ accordion marker (2.14).
 */

/* ── Flash region (Story 1.20) — dark "Locker Room" treatment + the ≤150ms fade.
   Variant classes + roles are asserted by layout_rendering_test.rb. Each variant is
   a dark surface with a colored left rule. The error variant reuses --color-accent;
   success/notice use semantic green/blue (no token exists for those). ── */
.flash-message {
  padding: 0.75rem 1rem;
  margin: 0.5rem auto;
  max-width: 64rem;
  border: 1px solid var(--color-line);
  border-left-width: 4px;
  border-radius: 4px;
  background: var(--color-surface);
  color: var(--color-ink);
  animation: flash-fade-in 150ms ease-in;
}

.flash-success { border-left-color: #34d399; }
.flash-error   { border-left-color: var(--color-accent); }
.flash-notice  { border-left-color: #60a5fa; }

@keyframes flash-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Error pages (Story 1.21) — dark treatment. Renders through the layout (dark
   base + tokens already applied to <body>). ── */
.error-page {
  max-width: 40rem;
  margin: 5rem auto;
  padding: 0 1rem;
}

.error-page h1 {
  /* Oswald display, but NOT uppercased: these are conversational founder-voice
     sentences (1.21), not scoreboard labels — sentence case reads right. */
  font-family: var(--font-display);
  line-height: 1.1;
  font-size: clamp(1.875rem, 5vw, 3rem);
  font-weight: 600;
  color: var(--color-ink);
}

.error-page p {
  margin-top: 1.5rem;
  color: var(--color-muted);
}

.error-page a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ── FAQ accordion (Story 2.14) — native <details>/<summary>, no JS. The +/× marker
   is a CSS ::after pseudo-element (NOT a text node) so it never enters the section's
   rendered text — the byte-for-byte FAQ drift guard reads the answer text verbatim.
   The marker rotates on open (≤200ms micro-motion, Tone-B amendment); implemented in
   CSS so the [open]-state selector is expressible. ── */
summary.faq-summary {
  list-style: none;
  cursor: pointer;
}
summary.faq-summary::-webkit-details-marker {
  display: none;
}
summary.faq-summary::after {
  content: "+";
  flex: none;
  margin-left: 1rem;
  font-family: var(--font-sans);
  font-size: 1.75rem;
  line-height: 1;
  color: var(--color-accent);
  transition: transform 200ms ease;
}
details[open] > summary.faq-summary::after {
  transform: rotate(45deg);
}

/* Inline <code> (FAQ + legal answers) — readable on the dark surface. */
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  padding: 0.1em 0.35em;
  border-radius: 3px;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  color: var(--color-ink);
}

/* ── About mission cards (Story 2.14) — the three locked commitments render as a
   card grid (the <ol>/<li> structure is preserved for the drift guard). The card
   index (01/02/03) is a CSS counter on ::before so it is decorative only and never
   enters the element's text (the byte-for-byte guard reads li.text). ── */
ol.mission-cards {
  counter-reset: mission;
  list-style: none;
}
ol.mission-cards > li::before {
  counter-increment: mission;
  content: counter(mission, decimal-leading-zero);
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.5rem;
  line-height: 1;
  color: var(--color-accent);
  margin-bottom: 0.75rem;
}

/* Site footer (Story 2.11/2.14) — a hairline top rule on the dark base. The
   <footer> keeps the bare `class="site-footer"` marker (the landing UX-DR23 order
   test matches that literal string), so the border lives here, not as a utility. */
.site-footer {
  border-top: 1px solid var(--color-line);
}

/* Deep-link comfort: the header is static (not sticky), but give anchored sections
   a little breathing room when jumped to via /faq#slug etc. */
:target {
  scroll-margin-top: 2rem;
}

/* ── Skip link (Story 1.28, WCAG 2.4.1 Bypass Blocks) — the first focusable
   element in <body>. Off-screen until focused (NOT display:none, which removes it
   from the tab order), then a solid dark-blaze chip top-left. The fill is
   --color-accent-on-chalk (#AD2F12): white text on it is 6.6:1, so the revealed
   chip itself clears AA (raw --color-accent would be 3.3:1 and fail). Authored
   here rather than via Tailwind sr-only/focus: variants so it can't be
   tree-shaken out of the build (Story 1.28 Dev Notes). ── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  background: var(--color-accent-on-chalk);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* ── Visible keyboard focus (Story 1.28, WCAG 2.4.7) — the dark broadcast theme
   must never leave focus invisible. A crisp ink ring on the canvas, offset so it
   reads even on filled (accent) controls. The chalk/oxblood inversion bands
   override this with their own contrast-safe rings (app/assets/tailwind/
   application.css @layer components). :focus-visible (not :focus) so a mouse
   click doesn't paint a ring. ── */
:focus-visible {
  outline: 2px solid var(--color-ink);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ── Respect reduced-motion: fully disable every transition/animation (0s, not a
   token 0.01ms) — Tone-B says reduced motion disables ALL motion, and no JS here
   relies on transition/animation events firing. ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0s !important;
    animation-delay: 0s !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
}
