/* ============================================================
   ARMAKUNI CANONICAL BASE LAYER
   Reset, typography, layout primitives, buttons, reveal.
   Linked from every page. Do not inline this on new pages —
   use <link rel="stylesheet" href="{...}/base.css"> instead.
   Requires tokens.css to be loaded first.
   ============================================================ */

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* No overflow rule on html — setting `overflow-x: clip` here forces body
     to become the de-facto root scroller, which makes the browser compute
     body's overflow-y as `auto`. With body overflow on the y axis, body's
     `overflow-x: clip` then resolves as `hidden`, which establishes a
     scroll container and breaks `position: sticky` everywhere on the page.
     Horizontal-leak prevention is now handled per-element on the specific
     offenders (.tm-rail-viewport, .horizontal-scroll, .hero) rather than
     at the document root. */
}
body {
  font-family: var(--font-body);
  font-weight: 350;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  background:
    radial-gradient(circle at 14% 12%, var(--accent-a15, color-mix(in srgb, var(--accent) 15%, transparent)), transparent 24%),
    radial-gradient(circle at 84% 18%, rgba(0,155,229,0.09), transparent 24%),
    radial-gradient(circle at 50% 80%, var(--accent-a08, color-mix(in srgb, var(--accent) 8%, transparent)), transparent 22%),
    linear-gradient(180deg, #04040a, #05050c 38%, #070c15 100%);
  background-attachment: fixed;
  /* No overflow rule on body either. See comment above on html. */
  opacity: 0;
  transition: opacity 0.6s var(--ease-default);
}
body.loaded { opacity: 1; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }

/* Accent-alpha variants for inline use — all derived from color-mix() on --accent */
:root {
  --accent-a04: color-mix(in srgb, var(--accent) 4%, transparent);
  --accent-a06: color-mix(in srgb, var(--accent) 6%, transparent);
  --accent-a08: color-mix(in srgb, var(--accent) 8%, transparent);
  --accent-a12: color-mix(in srgb, var(--accent) 12%, transparent);
  --accent-a15: color-mix(in srgb, var(--accent) 15%, transparent);
  --accent-a18: color-mix(in srgb, var(--accent) 18%, transparent);
  --accent-a26: color-mix(in srgb, var(--accent) 26%, transparent);
  --accent-a45: color-mix(in srgb, var(--accent) 45%, transparent);

  --text-s: var(--text-secondary);
  --text-m: var(--text-muted);

  --f-h: var(--font-heading);
  --f-b: var(--font-body);
  --f-m: var(--font-mono);

  --ease: var(--ease-default);
}

/* Layout primitives */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 2; }
.wrap-narrow { max-width: 680px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 2; }
section { position: relative; }

/* Typography
   2026-05-03 (homepage typography QA):
     - h1 cap is 52px site-wide, matching the case-studies listing scale.
     - h2 cap is 38px site-wide. Pages must NOT inline font-size overrides
       on h1/h2 (anti-pattern AP-23). The token cap is the contract. */
h1, h2, h3, h4 { font-family: var(--f-h); font-weight: 200; letter-spacing: -0.01em; line-height: 1.08; }
h1 { font-size: clamp(34px, 4vw, 52px); letter-spacing: -0.0156em; line-height: 1.06; }
h2 { font-size: clamp(28px, 3vw, 38px); line-height: 1.14; color: var(--text); margin-bottom: 18px; }
h3 { font-size: 24px; }
.lead { font-size: 16px; color: var(--text-s); line-height: 1.78; max-width: 680px; }
.lbl {
  font-family: var(--f-m); font-size: 11px; font-weight: 400;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--accent-bright); margin-bottom: 20px;
}
.hi { color: var(--accent-bright); }
.eyebrow {
  display: inline-block;
  font-family: var(--f-m); font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--accent-bright); margin-bottom: 18px;
  position: relative; padding-left: 26px;
}
.eyebrow::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 16px; height: 1px; background: var(--accent-bright);
}

/* Canonical blur-lift reveal — adds .visible or .in via IntersectionObserver */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  filter: blur(6px);
  transition:
    opacity 0.65s var(--ease-default),
    transform 0.65s var(--ease-default),
    filter 0.65s var(--ease-default);
}
.reveal.visible, .reveal.in {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}
.reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal[data-delay="2"] { transition-delay: 0.16s; }
.reveal[data-delay="3"] { transition-delay: 0.24s; }
.reveal[data-delay="4"] { transition-delay: 0.32s; }
.reveal[data-delay="5"] { transition-delay: 0.40s; }

/* Canonical buttons — glass pill */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--accent-a26);
  background: linear-gradient(180deg, var(--accent-a18), var(--accent-a06));
  border-radius: 12px; padding: 12px 24px;
  font-family: var(--f-m); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text);
  transition: transform 350ms var(--ease-default), box-shadow 350ms var(--ease-default), border-color 350ms var(--ease-default);
}
.btn:hover {
  border-color: var(--accent-a45);
  background: linear-gradient(180deg, var(--accent-a26), var(--accent-a12));
  box-shadow: inset 0 0 24px 8px var(--accent-a12), inset 0 1px 0 rgba(255,255,255,0.1), 0 0 40px var(--accent-a12), 0 4px 16px var(--accent-a08);
  transform: translateY(-2px) scale(1.02);
}
.btn:active { transform: translateY(0) scale(0.98); transition-duration: 100ms; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border-hover); box-shadow: none; }
.arr { display: inline-block; transition: transform 0.25s var(--ease-default); }
.btn:hover .arr { transform: translateX(4px); }
.btn-glow-pulse { animation: btnGlowPulse 2.5s ease-in-out infinite; }
@keyframes btnGlowPulse {
  0%, 100% { box-shadow: inset 0 0 16px 6px var(--accent-a06), 0 0 24px var(--accent-a04); }
  50%      { box-shadow: inset 0 0 24px 8px var(--accent-a12), 0 0 60px var(--accent-a15), 0 0 30px var(--accent-a08); }
}
.link-secondary {
  font-family: var(--f-b); font-size: 15px; color: var(--text-s);
  transition: color 0.25s var(--ease-default); border-bottom: 1px solid transparent;
}
.link-secondary:hover { color: var(--text); border-bottom-color: var(--accent); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none; opacity: 1; transform: none; filter: none; }
  .btn-glow-pulse { animation: none; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   ACCESSIBILITY: skip link + keyboard focus indicators
   ============================================================ */
/* Hidden until focused. First-tab link lets keyboard users jump past
   the nav to the main content. */
.skip-to-main {
  position: absolute; top: 8px; left: 8px; z-index: 9999;
  padding: 10px 16px; border-radius: 8px;
  background: var(--accent); color: var(--text);
  font-family: var(--font-body); font-size: 14px; font-weight: 500;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform 0.2s var(--ease-default);
}
.skip-to-main:focus, .skip-to-main:focus-visible { transform: translateY(0); outline: 2px solid var(--accent-bright); outline-offset: 2px; }

/* Brand-consistent keyboard focus ring on all focusable elements.
   Hidden on mouse interaction (:focus without :focus-visible) so the
   ring only appears for keyboard navigation. */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 3px;
  border-radius: 4px;
}
/* Buttons and links keep their natural shape under focus rings. */
a:focus-visible, button:focus-visible, [role="button"]:focus-visible {
  outline-offset: 4px;
}

