/* =============================================================
   ThriveMap base styles
   Imports tokens.css. Provides reset, typography defaults,
   link styles, and button primitives that every component
   inherits. No component-specific styles in this file.
   ============================================================= */

@import url('tokens.css');

/* ---------------------------------------------------------------
   RESET
   --------------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, video, svg { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: inherit; }

/* ---------------------------------------------------------------
   TYPOGRAPHY — semantic defaults
   These set sensible base values; components override with
   specific sizes/line-heights/tracking per the type scale.
   --------------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
}

h1 { font-size: clamp(40px, 5vw, 60px); }
h2 { font-size: clamp(30px, 3.5vw, 40px); }
h3 { font-size: clamp(20px, 2.2vw, 24px); }
h4 { font-size: 18px; }

/* Italic emphasis convention: <em> uses serif italic.
   This applies everywhere — in body, headings, captions, etc.
   See DESIGN-SYSTEM.md for the rules about when/where italic is used. */
em, i {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
}

p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-soft);
}
p strong, p b { color: var(--ink); font-weight: 600; }

ul, ol { margin: 0 0 16px 24px; }
li { margin-bottom: 8px; line-height: 1.6; }

/* ---------------------------------------------------------------
   LINKS
   --------------------------------------------------------------- */

a {
  color: var(--cobalt);
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}
a:hover { color: var(--cobalt-deep); }

/* Inline body links — underlined */
.prose a, article a {
  border-bottom: 1px solid var(--cobalt-soft);
}
.prose a:hover, article a:hover {
  border-bottom-color: var(--cobalt);
}

/* ---------------------------------------------------------------
   BUTTON PRIMITIVES
   Used directly via .btn, .btn-primary, .btn-secondary or
   composed into components.
   --------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--r-sm);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  font-family: var(--font-sans);
  line-height: 1;
}

.btn-primary {
  background: var(--cobalt);
  color: white;
}
.btn-primary:hover { background: var(--cobalt-deep); color: white; }

.btn-secondary {
  background: var(--canvas-card);
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-secondary:hover { border-color: var(--ink); color: var(--ink); }

.btn-on-dark {
  background: white;
  color: var(--cobalt-deep);
}
.btn-on-dark:hover { background: var(--highlight); color: var(--cobalt-deep); }

.btn-on-dark-secondary {
  background: transparent;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.btn-on-dark-secondary:hover {
  border-color: white;
  color: white;
  background: rgba(255, 255, 255, 0.05);
}

/* ---------------------------------------------------------------
   SECTION & CONTAINER PRIMITIVES
   --------------------------------------------------------------- */

.container        { max-width: var(--container); margin: 0 auto; padding: 0 32px; }
.container-narrow { max-width: var(--container-narrow); margin: 0 auto; padding: 0 32px; }

section { padding: var(--space-15) 0; }
@media (max-width: 980px) {
  section { padding: var(--space-10) 0; }
}

/* ---------------------------------------------------------------
   UTILITIES
   --------------------------------------------------------------- */

.section-label {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--cobalt);
  margin-bottom: 18px;
}
.section-label::before { content: '— '; }

/* The yellow highlight rectangle behind one word in an H1.
   STRICT RULE: applies to a maximum of one word per page,
   inside the H1 only. Never elsewhere. See DESIGN-SYSTEM.md.
   Apply with: <h1>... <span class="mark"><span>word</span></span> ...</h1> */
.mark {
  position: relative;
  display: inline-block;
  padding: 0 4px;
}
.mark::before {
  content: '';
  position: absolute;
  left: -2px; right: -2px; bottom: 8%;
  height: 38%;
  background: var(--highlight);
  z-index: 0;
  transform: skewX(-3deg) rotate(-0.6deg);
  border-radius: 2px;
}
.mark > * { position: relative; z-index: 1; }

/* Visually hidden but available to screen readers */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus outline — visible on keyboard navigation */
:focus-visible {
  outline: 2px solid var(--cobalt);
  outline-offset: 2px;
}
