/**
 * @file        base.css
 * @description Reset, document defaults and the banded layout primitives
 *
 * @author      Thomas Dobler - SYNTHETIXMIND LTD
 * @email       tom@synthetixmind.com
 * @company     SYNTHETIXMIND LTD, Paphos, Cyprus
 * @url         https://synthetixmind.com
 *
 * @uid         e4c91a76-8b52-4d30-9e17-0fa3c586d2b9
 * @version     0.0.0.1
 * @created     2026-09-11
 * @updated     2026-09-11
 *
 * @copyright   (c) 2026 by SYNTHETIXMIND LTD
 * @license     Proprietary — All rights reserved
 */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--surface-page);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: var(--leading-tight);
  margin: 0 0 var(--space-4);
  text-wrap: balance;
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }

p { margin: 0 0 var(--space-4); }

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

/* Links are underlined so colour never carries meaning alone (NFR21). */
a {
  color: var(--text-link);
  text-underline-offset: 0.15em;
}

a:hover { text-decoration-thickness: 2px; }

/* 2px ring, 2px offset. The inverse token is required on dark surfaces —
 * --focus-ring there would be 1.00:1 and invisible. */
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.band--inverse :focus-visible {
  outline-color: var(--focus-ring-inverse);
}

/* Keyboard-only skip target (WCAG 2.4.1). */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface-raised);
  color: var(--text-primary);
  padding: var(--space-3) var(--space-4);
  z-index: 100;
}

.skip-link:focus {
  left: var(--space-4);
  top: var(--space-4);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --- Banded layout -------------------------------------------------------
 * Direction B. Full-width horizontal sections in a fixed order, distinguished
 * by surface tone and vertical rhythm — never by borders, gradients or
 * full-bleed imagery. No band carries a background image, so all contrast
 * stays inside the token guarantee. */

.band {
  padding-block: var(--space-8);
}

@media (min-width: 768px) {
  .band { padding-block: var(--space-10); }
}

.band--page    { background: var(--surface-page); }
.band--raised  { background: var(--surface-raised); }

.band--inverse {
  background: var(--surface-inverse);
  color: var(--text-on-dark);
}

/* On Deep Space the ONLY permitted text colours are Cloud White (11.28:1) and
 * Golden Accent (4.88:1). Digital Blue (3.61:1) and Steel Mist (4.05:1) both
 * fail AA there at any size — DESIGN.md §2 rule 6. */
.band--inverse a {
  color: var(--text-on-dark);
  text-decoration: underline;
}

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

.container--reading {
  max-width: var(--container-reading);
}

/* Every interactive target clears the 44px floor (WCAG 2.5.5). */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--touch-min);
  padding: var(--space-3) var(--space-5);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-out);
}

.button--primary {
  background: var(--cta-primary-bg);
  color: var(--cta-primary-text);   /* Deep Space on gold = 4.88:1 */
}

.button--secondary {
  background: transparent;
  border-color: var(--border-subtle);
  color: var(--text-link);
}

.button--secondary:hover { background: var(--surface-page); }

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