/* ==========================================================================
   Sol Remedy Massage: base styles
   Reset, type roles, links, focus, surfaces, layout, accessibility helpers.
   Uses tokens from tokens.css only. No raw colors, sizes, or weights.
   ========================================================================== */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* The header is sticky: keep focused items and jump-link targets below it (WCAG 2.4.11) */
  scroll-padding-top: var(--size-header-offset);
}

body {
  min-height: 100vh;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: var(--weight-regular);
  line-height: var(--leading-relaxed);
  -webkit-font-smoothing: antialiased;
}

img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select,
code,
kbd {
  font: inherit;
  color: inherit;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}

::selection {
  background-color: var(--color-selection-bg);
  color: var(--color-selection-text);
}

/* ---------- Type roles ----------
   Eight roles: H1, H2, H3, H4, Lead, Body, Small, Label.
   Elements get a role by default; a .t-* class switches role.
   Never set a font size, weight, or line height anywhere else. */

h1, .t-h1 {
  font-family: var(--font-serif);
  font-size: var(--text-h1);
  font-weight: var(--weight-regular);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-heading);
  text-transform: none;
}

h2, .t-h2 {
  font-family: var(--font-serif);
  font-size: var(--text-h2);
  font-weight: var(--weight-regular);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-heading);
  text-transform: none;
}

h3, .t-h3 {
  font-family: var(--font-serif);
  font-size: var(--text-h3);
  font-weight: var(--weight-regular);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-normal);
  color: var(--color-heading);
  text-transform: none;
}

h4, .t-h4 {
  font-family: var(--font-sans);
  font-size: var(--text-h4);
  font-weight: var(--weight-bold);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-normal);
  color: var(--color-text);
  text-transform: none;
}

h1, h2, h3, h4 {
  text-wrap: balance;
}

.t-lead {
  font-family: var(--font-sans);
  font-size: var(--text-lead);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--color-text);
}

.t-body {
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: var(--weight-regular);
  line-height: var(--leading-relaxed);
  letter-spacing: var(--tracking-normal);
  color: var(--color-text);
  text-transform: none;
}

p, li, dd, dt, td, th, figcaption, blockquote {
  text-wrap: pretty;
}

.t-label {
  font-family: var(--font-sans);
  font-size: var(--text-label);
  font-weight: var(--weight-bold);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-label);
}

strong, b, th {
  font-weight: var(--weight-bold);
}

/* ---------- Links ----------
   Always underlined so color is never the only cue. Text links are Body
   at 700, the same weight as buttons. */
a {
  color: var(--color-link);
  font-weight: var(--weight-bold);
  text-decoration-line: underline;
  text-decoration-thickness: var(--border-thin);
  text-underline-offset: var(--underline-offset);
  transition: color var(--duration-fast) var(--ease-calm),
              text-decoration-thickness var(--duration-fast) var(--ease-calm);
}

a:hover {
  color: var(--color-link-hover);
  text-decoration-thickness: var(--border-thick);
}

/* Quiet link: same cream as the sentence around it, still bold and
   underlined so it never relies on color, terracotta on hover */
a.link--quiet {
  color: var(--color-text);
}

a.link--quiet:hover {
  color: var(--color-link);
}

/* ---------- Focus ----------
   Visible on every interactive element. Meets 3:1 on every surface. */
:focus-visible {
  outline: var(--focus-width) solid var(--color-focus);
  outline-offset: var(--focus-offset);
  border-radius: var(--radius);
}

:focus:not(:focus-visible) {
  outline: none;
}

/* ---------- Surfaces ----------
   Every section uses one of three sage surfaces. All text, link, and
   accent pairings pass on all three, so no surface remaps tokens. */
.surface-bg     { background-color: var(--color-bg); }
.surface-alt    { background-color: var(--color-bg-alt); }
.surface-raised { background-color: var(--color-bg-raised); }


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

.prose {
  max-width: var(--prose-max);
}

.section {
  padding-block: var(--section-pad);
}

/* Curved transitions: every section after the first, and the footer,
   has a domed top edge that overlaps the section above it. The dome
   echoes the arch in the logo and the arched photo frames. */
/* Every section is followed by a curved section or the footer, whose dome
   overlaps its bottom by the curve depth. Add that depth back so the space
   below the content matches the space above it. */
main > .section {
  padding-bottom: calc(var(--section-pad) + var(--curve-depth));
}

main > .section + .section,
.site-footer {
  position: relative;
  margin-top: calc(-1 * var(--curve-depth));
  border-top-left-radius: 50% var(--curve-depth);
  border-top-right-radius: 50% var(--curve-depth);
}

/* Vertical rhythm for stacked content */
.flow > * + * {
  margin-top: var(--flow-space, var(--space-4));
}

.flow > :is(h2, h3, .t-h2, .t-h3) + * {
  --flow-space: var(--space-3);
}

.flow > * + :is(h2, h3, .t-h2, .t-h3) {
  --flow-space: var(--space-7);
}

/* ---------- Accessibility helpers ---------- */
/* The 1px values below are the standard visually-hidden technique,
   not design values. */
.visually-hidden:not(:focus):not(:active) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Fixed (not absolute) so it always appears on screen when focused,
   above the sticky header, no matter how far the page is scrolled */
.skip-link {
  position: fixed;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 100;
  padding: var(--space-3) var(--space-5);
  background-color: var(--color-action);
  color: var(--color-on-action);
  font-weight: var(--weight-bold);
  text-decoration: underline;
  border-radius: var(--radius);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* Main can receive focus from the skip link without showing a ring on the whole page */
main:focus {
  outline: none;
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* Scroll reveal. Only active when main.js adds .motion to <html>, which it
   skips for Reduce Motion users, so content is always visible without it. */
.motion .reveal {
  opacity: 0;
  transform: translateY(var(--reveal-distance));
  transition: opacity var(--duration-reveal) var(--ease-calm),
              transform var(--duration-reveal) var(--ease-calm);
  transition-delay: var(--reveal-delay, 0ms);
}

.motion .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Parallax photos move with transform only, so layout never shifts */
.motion .parallax {
  will-change: transform;
}

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

/* ---------- Forced colors (Windows High Contrast) ----------
   System color keywords hand control to the viewer's own OS colors.
   They are an accessibility requirement, not brand colors. */
@media (forced-colors: active) {
  :focus-visible {
    outline-color: Highlight;
  }
}
