/* EdgeRift — reset, base, utilities (concept/DESIGN-BRIEF.md §2.3, §2.8, §2.9 accessibility)
   2 of 3 shared stylesheets. Tokens only, no colour literals. */

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ol, ul { margin: 0; }
  ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
  img, picture, svg, video { display: block; max-width: 100%; }
  img { height: auto; }
  input, button, select, textarea { font: inherit; color: inherit; }
  button { background: none; border: 0; padding: 0; cursor: pointer; }
  fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
  dialog { padding: 0; border: 0; max-width: none; max-height: none; color: inherit; }
  :target { scroll-margin-top: 16px; }
}

@layer base {
  html { background: var(--c-bg); scroll-behavior: smooth; }
  html:has(dialog[open]) { overflow: hidden; }
  body {
    min-height: 100vh;
    background: var(--c-bg);
    color: var(--c-ink);
    font-family: var(--f-text);
    font-size: var(--t-body);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }
  h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 600; line-height: 1.05; letter-spacing: 0; text-wrap: balance; }
  p { text-wrap: pretty; }
  a { color: inherit; text-decoration: none; }
  a:hover { text-decoration: underline; text-underline-offset: .18em; }
  sup { font-size: .6em; line-height: 0; vertical-align: .6em; }
  b, strong { font-weight: 500; }   /* Roboto ships 400/500 only: no faux bold */
  sup a { color: inherit; }
  kbd { font-family: var(--f-text); font-size: .92em; }

  :focus { outline: none; }
  :focus-visible { outline: 2px solid var(--c-red); outline-offset: 2px; border-radius: 4px; }
  :is(.theme-dark, .tile--dark, .band--dark, .band--midnight, .breadcrumb) :focus-visible { outline-color: var(--c-red-on-dark); }

  /* Long-form text: FAQ articles, policies */
  .prose { max-width: var(--w-copy); font-size: clamp(17px, .19vw + 16.3px, 19px); line-height: 1.6; }
  .prose > * + * { margin-top: 1em; }
  .prose h2 { font-size: var(--t-title); font-weight: 700; line-height: 1.15; margin-top: 2em; }
  .prose h3 { font-size: 21px; font-weight: 700; margin-top: 1.6em; }
  .prose a { color: var(--c-red-text); text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }
  .prose a:hover { text-decoration-thickness: 2px; }
  .prose ul, .prose ol { padding-left: 1.25em; }
  .prose li + li { margin-top: .4em; }
}

@layer utilities {
  .visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
    text-transform: none;   /* hidden labels inside UPPERCASE CTAs keep their real case ("iPhone") */
  }
  .skip-link {
    position: absolute; left: 16px; top: -100px; z-index: 100;
    padding: 12px 16px; border-radius: 8px;
    background: var(--c-skip-bg); color: var(--c-skip-ink); font-size: 15px; font-weight: 500;
  }
  .skip-link:focus { top: 8px; }
  .center { text-align: center; }
  /* Text inside UPPERCASE type that keeps its own case (proposal §4.4): Apple's names (iPad, iPhone,
     App Store, Apple TV, Mac, macOS, tvOS …) and e-mail addresses. Same face and tracking, no transform:
     "REAL SOLITAIRE FOR iPhone", never "IPHONE" or "iPHONE".
     Twig: {{ caps_safe('Real Solitaire for iPhone') }} does the wrapping. */
  .case-as-written { text-transform: none; }
  [hidden] { display: none !important; }
}

/* Reduced motion (§2.8): every transition becomes instant. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; scroll-behavior: auto !important; }
  html { scroll-behavior: auto; }
}

/* Print: ink on white, no chrome. */
@media print {
  .site-header, .dropdown, .breadcrumb, .local-nav, .search-dialog, .menu-dialog, .skip-link { display: none !important; }
  body { color: var(--c-ink); background: var(--c-bg); }
  .band, .tile, .hero { background: none !important; color: var(--c-ink) !important; }
  a { text-decoration: underline; }
  .cta { color: var(--c-red-text) !important; }
}
