/* ==========================================================================
   site.css — RMTKS Phase 1
   Single stylesheet for the whole site. No build step, no external fonts.

   PHASE 2 RE-SKIN: change the custom properties in :root (and the dark-mode
   block directly below it). Nothing else should need editing to change the
   brand's colours, type scale, or spacing rhythm.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. BRAND TOKENS — the only place colours, type, and spacing are defined
   -------------------------------------------------------------------------- */

:root {
  /* Colour — light theme (the default) */
  --color-bg:           #fcfcfb;
  --color-surface:      #ffffff;
  --color-surface-alt:  #f4f4f1;
  --color-ink:          #1b1e22;
  --color-ink-muted:    #53595f;
  --color-border:       #dcdcd6;
  --color-border-firm:  #b9b9b1;
  --color-accent:       #1d4f47;
  --color-accent-hover: #123934;
  --color-focus:        #1d4f47;

  /* Type — system stack only, so there is no font request to block render */
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas,
               "Liberation Mono", Menlo, monospace;

  /* Type scale */
  --size-xs:   0.8125rem;
  --size-sm:   0.9375rem;
  --size-base: 1.0625rem;
  --size-lg:   1.1875rem;
  --size-xl:   1.375rem;
  --size-2xl:  1.75rem;
  --size-3xl:  2.25rem;

  --leading-tight: 1.25;
  --leading-body:  1.65;

  /* Spacing rhythm */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;

  /* Shape and layout */
  --radius:      6px;
  --radius-lg:   10px;
  --measure:     40rem;   /* comfortable reading width for prose */
  --page-max:    64rem;   /* outer page container */
  --page-gutter: var(--space-5);
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg:           #14171a;
    --color-surface:      #1a1e22;
    --color-surface-alt:  #20252a;
    --color-ink:          #e9ebec;
    --color-ink-muted:    #a7aeb4;
    --color-border:       #2e343a;
    --color-border-firm:  #454d55;
    --color-accent:       #8ac9ba;
    --color-accent-hover: #a9dccf;
    --color-focus:        #8ac9ba;
  }
}

/* --------------------------------------------------------------------------
   2. RESET AND BASE
   -------------------------------------------------------------------------- */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  /* Never below 320px without horizontal scroll */
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-size: var(--size-base);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  line-height: var(--leading-tight);
  font-weight: 600;
  letter-spacing: -0.011em;
  margin: 0 0 var(--space-3);
  text-wrap: balance;
}

h1 { font-size: var(--size-3xl); }
h2 { font-size: var(--size-2xl); }
h3 { font-size: var(--size-lg); }
h4 { font-size: var(--size-base); }

p, ul, ol, dl { margin: 0 0 var(--space-4); }
ul, ol { padding-left: 1.35em; }
li { margin-bottom: var(--space-2); }
li:last-child { margin-bottom: 0; }

strong { font-weight: 600; }

a {
  color: var(--color-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { color: var(--color-accent-hover); }

/* Visible focus on every interactive element — never removed. */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: 2px;
}

img, svg { max-width: 100%; height: auto; }

hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: var(--space-6) 0;
}

/* --------------------------------------------------------------------------
   3. LAYOUT PRIMITIVES
   -------------------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}

/* Prose column — keeps long-form legal text at a readable measure. */
.prose { max-width: var(--measure); }

.skip-link {
  position: absolute;
  left: var(--space-3);
  top: var(--space-3);
  z-index: 100;
  transform: translateY(-200%);
  background: var(--color-accent);
  color: #ffffff;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius);
  text-decoration: none;
  font-size: var(--size-sm);
  font-weight: 600;
}
.skip-link:focus {
  transform: translateY(0);
  color: #ffffff;
}
@media (prefers-color-scheme: dark) {
  .skip-link, .skip-link:focus { color: #10221f; }
}

main { flex: 1 0 auto; }

/* --------------------------------------------------------------------------
   4. HEADER AND NAVIGATION
   -------------------------------------------------------------------------- */

.site-header {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

.site-header .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3) var(--space-5);
  padding-block: var(--space-4);
}

/* The RM Turnkey Solutions wordmark — a text mark, deliberately. No logo asset
   to maintain. Tight tracking and a non-wrapping line: this is a 20-character
   name rather than an acronym, so wide letter-spacing would stretch it across
   the header, and it must never break across two lines. */
.wordmark {
  font-size: var(--size-lg);
  font-weight: 700;
  letter-spacing: 0.005em;
  white-space: nowrap;
  color: var(--color-ink);
  text-decoration: none;
}
.wordmark:hover { color: var(--color-ink); }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav li { margin: 0; }

.site-nav a {
  color: var(--color-ink-muted);
  text-decoration: none;
  font-size: var(--size-sm);
}
.site-nav a:hover { color: var(--color-accent); text-decoration: underline; }

/* Current page is marked by weight AND colour, never colour alone. */
.site-nav a[aria-current="page"] {
  color: var(--color-ink);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.3em;
}

/* --------------------------------------------------------------------------
   5. SECTIONS
   -------------------------------------------------------------------------- */

.section { padding-block: var(--space-7); }
.section + .section { border-top: 1px solid var(--color-border); }

.hero { padding-block: var(--space-8) var(--space-7); }
.hero h1 { margin-bottom: var(--space-4); }

.lede {
  font-size: var(--size-lg);
  color: var(--color-ink-muted);
  max-width: var(--measure);
}

.eyebrow {
  font-size: var(--size-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-ink-muted);
  margin-bottom: var(--space-3);
}

/* --------------------------------------------------------------------------
   6. COMPONENTS
   -------------------------------------------------------------------------- */

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  max-width: var(--measure);
}

.button {
  display: inline-block;
  background: var(--color-accent);
  color: #ffffff;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius);
  text-decoration: none;
  font-size: var(--size-sm);
  font-weight: 600;
}
.button:hover { background: var(--color-accent-hover); color: #ffffff; }
@media (prefers-color-scheme: dark) {
  .button, .button:hover { color: #10221f; }
}

/* Callout — used for the medical disclaimer and the beta notice. The left rule
   plus the bold label carry the meaning; colour is never the only signal. */
.callout {
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-border-firm);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-5);
  max-width: var(--measure);
  margin-bottom: var(--space-5);
}
.callout > :last-child { margin-bottom: 0; }
.callout-title {
  font-size: var(--size-sm);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-ink);
  margin-bottom: var(--space-2);
}

/* [CONFIRM: ...] placeholders. Visibly marked so an unanswered one cannot be
   published by accident. Bracketed text reads as a placeholder without colour. */
.confirm {
  display: inline;
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--color-surface-alt);
  border: 1px dashed var(--color-border-firm);
  border-radius: 3px;
  padding: 0.1em 0.4em;
  color: var(--color-ink);
}

.meta {
  font-size: var(--size-sm);
  color: var(--color-ink-muted);
}

/* Two-column list that collapses to one column on small screens. */
.grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: 1fr;
}
@media (min-width: 46rem) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Definition-style list used on the deletion page. */
.facts { margin: 0 0 var(--space-4); max-width: var(--measure); }
.facts dt {
  font-weight: 600;
  margin-top: var(--space-4);
}
.facts dt:first-child { margin-top: 0; }
.facts dd { margin: var(--space-1) 0 0; color: var(--color-ink-muted); }

/* Legal / policy pages ---------------------------------------------------- */

.policy-section { margin-bottom: var(--space-6); }
.policy-section h2 {
  font-size: var(--size-xl);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-border);
}
.policy-section h3 {
  font-size: var(--size-base);
  margin-top: var(--space-5);
}

.toc { margin-bottom: var(--space-7); }
.toc ol {
  columns: 2;
  column-gap: var(--space-6);
  font-size: var(--size-sm);
}
@media (max-width: 34rem) {
  .toc ol { columns: 1; }
}

blockquote {
  margin: 0 0 var(--space-4);
  padding-left: var(--space-4);
  border-left: 3px solid var(--color-border-firm);
  color: var(--color-ink);
}
blockquote > :last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   7. FOOTER
   -------------------------------------------------------------------------- */

.site-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  padding-block: var(--space-6);
  font-size: var(--size-sm);
  color: var(--color-ink-muted);
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3) var(--space-5);
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-footer li { margin: 0; }
.site-footer a { color: var(--color-ink-muted); text-decoration: underline; }
.site-footer a:hover { color: var(--color-accent); }

/* Copyright / attribution line. A class rather than an inline style attribute:
   the Content-Security-Policy in _headers sets style-src 'self', which blocks
   inline style attributes in production. */
.footer-copy { margin: 0; }

/* --------------------------------------------------------------------------
   8. SMALL SCREENS — must hold down to 320px
   -------------------------------------------------------------------------- */

@media (max-width: 30rem) {
  :root {
    --page-gutter: var(--space-4);
    --size-3xl: 1.875rem;
    --size-2xl: 1.5rem;
  }
  .site-header .container { padding-block: var(--space-3); }
  .hero { padding-block: var(--space-6) var(--space-5); }
  .section { padding-block: var(--space-6); }
}
