/*!
 * Massage Therapy by Angela — site styles
 *
 * One hand-written stylesheet, no build step. Order of the file:
 *   1. reset       – minimal normalisation
 *   2. base        – design tokens, typography, links, focus
 *   3. layout      – backdrop, containers, section bands, split grid
 *   4. components  – header/nav, hero, buttons, lists, rates, forms, footer
 *   5. pages       – the few rules that only one page needs
 *   6. utilities   – single-purpose helpers
 *
 * Cascade layers (@layer) keep that order authoritative regardless of selector
 * specificity, so a later layer always wins over an earlier one.
 */

@layer reset, base, layout, components, pages, utilities;

/* ==========================================================================
   1. Reset
   ========================================================================== */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  img, picture, svg { display: block; max-width: 100%; height: auto; }
  input, button, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
  button { cursor: pointer; }
  ul, ol { padding: 0; }
  [hidden] { display: none !important; }
}

/* ==========================================================================
   2. Base: tokens, typography, links, focus
   ========================================================================== */
@layer base {
  :root {
    color-scheme: light;

    /* Palette — carried over from the original theme */
    --c-slate: #2e3842;                 /* page / header background          */
    --c-deep: #1d242a;                  /* footer                            */
    --c-sand: #d0c19d;                  /* warm accent on dark backgrounds   */
    --c-sand-line: rgb(208 193 157 / .35);
    --c-taupe: rgb(70 56 32 / .84);     /* translucent band over the photo   */
    --c-ink: #4e4852;                   /* body text on white                */
    --c-ink-strong: #2e3842;            /* headings on white                 */
    --c-brown: #6f5d2a;                 /* accent on white (6.4:1 contrast)  */
    --c-paper: #f6f3ec;                 /* tinted fields / panels            */
    --c-line: #e2ddd0;                  /* hairlines on white                */
    --c-error: #b3261e;

    /* Context tokens. Default context = light text over the dark photo.
       Section modifiers below re-point these, so components never hard-code
       a colour that depends on where they are placed. */
    --c-text: #fff;
    --c-heading: #fff;
    --c-link: #fff;
    --c-focus: var(--c-sand);
    --c-rule: rgb(255 255 255 / .25);

    /* Type */
    --font-sans: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    --track-body: .02em;
    --track-heading: .18em;
    --track-caps: .2em;

    /* Layout */
    --gutter: clamp(1.25rem, 4vw, 2.5rem);
    --section-y: clamp(3.5rem, 8vw, 6.5rem);
    --container: 70rem;
    --header-h: 3.5rem;
    --measure: 42rem;
  }

  html { scroll-padding-top: calc(var(--header-h) + 1rem); }
  @media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
  }

  body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--c-slate);
    color: var(--c-text);
    font-family: var(--font-sans);
    font-size: clamp(1rem, .96rem + .22vw, 1.125rem);
    line-height: 1.7;
    letter-spacing: var(--track-body);
    -webkit-font-smoothing: antialiased;
  }

  main { flex: 1 0 auto; }

  h1, h2, h3, h4 {
    color: var(--c-heading);
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: var(--track-heading);
    text-transform: uppercase;
    text-wrap: balance;
  }
  h1 { font-size: clamp(1.4rem, 1.05rem + 1.6vw, 2.1rem); }
  h2 { font-size: clamp(1.2rem, 1rem + 1vw, 1.7rem); }
  h3 { font-size: clamp(1rem, .95rem + .45vw, 1.2rem); }
  h4 { font-size: 1rem; }

  p { text-wrap: pretty; }
  strong, b { font-weight: 700; }
  small { font-size: .875em; }

  a {
    color: var(--c-link);
    text-decoration: underline dotted 1px;
    text-underline-offset: .25em;
    transition: color .2s ease, text-decoration-color .2s ease;
  }
  a:hover { text-decoration-style: solid; }

  :focus-visible {
    outline: 3px solid var(--c-focus);
    outline-offset: 3px;
    border-radius: 2px;
  }

  ::selection { background: var(--c-sand); color: var(--c-deep); }
}

/* ==========================================================================
   3. Layout
   ========================================================================== */
@layer layout {
  /* Fixed photo behind every page. A fixed <img> (rather than
     background-attachment: fixed) is smooth on iOS and can use srcset. */
  .backdrop {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: var(--c-slate);
  }
  .backdrop picture { display: block; height: 100%; }
  .backdrop img { width: 100%; height: 100%; object-fit: cover; }
  .backdrop::after {              /* the original 50% black wash */
    content: "";
    position: absolute;
    inset: 0;
    background: rgb(0 0 0 / .5);
  }

  .skip-link {
    position: fixed;
    top: .75rem;
    left: .75rem;
    z-index: 200;
    padding: .6rem 1rem;
    background: var(--c-sand);
    color: var(--c-deep);
    font-weight: 700;
    text-decoration: none;
    transform: translateY(-200%);
  }
  .skip-link:focus { transform: none; }

  .container { width: 100%; max-width: var(--container); margin-inline: auto; }
  .container--narrow { max-width: 48rem; }

  /* Horizontal bands. Vertical rhythm lives here, nowhere else. */
  .section { padding: var(--section-y) var(--gutter); color: var(--c-text); }

  .section--light {
    --c-text: var(--c-ink);
    --c-heading: var(--c-ink-strong);
    --c-link: var(--c-ink-strong);
    --c-focus: var(--c-brown);
    --c-rule: var(--c-line);
    background: #fff;
  }
  .section--sand {
    --c-text: var(--c-sand);
    --c-heading: #fff;
    --c-link: #fff;
    --c-focus: #fff;
    --c-rule: var(--c-sand-line);
    background: var(--c-taupe);
  }

  /* Label-left / content-right pattern used on the home page */
  .split { display: grid; gap: clamp(1.25rem, 4vw, 3.5rem); }
  @media (min-width: 56em) {
    .split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; }
    .split > :first-child { position: sticky; top: calc(var(--header-h) + 2rem); }
  }

  .split + .split { margin-top: clamp(2.5rem, 6vw, 4.5rem); padding-top: clamp(2.5rem, 6vw, 4.5rem); border-top: 1px solid var(--c-rule); }

  .stack > :where(* + *) { margin-top: var(--stack, 1.25rem); }
}

/* ==========================================================================
   4. Components
   ========================================================================== */
@layer components {

  /* ---- Header & navigation ------------------------------------------- */
  .site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 100;
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-inline: var(--gutter);
    background: var(--c-slate);
    color: #fff;
    transition: background-color .2s ease;
  }
  .js .site-header.is-over-hero { background: transparent; }

  .brand,
  .site-nav a,
  .nav-toggle {
    font-size: .8125rem;
    font-weight: 600;
    letter-spacing: var(--track-caps);
    text-transform: uppercase;
    color: #fff;
    text-decoration: none;
  }

  @media (max-width: 30em) {
    .brand { font-size: .75rem; letter-spacing: .12em; }
  }

  .site-nav ul { display: flex; gap: clamp(1rem, 2.5vw, 2.25rem); list-style: none; }
  .site-nav a {
    display: inline-block;
    padding-block: .35rem;
    border-bottom: 2px solid transparent;
    transition: border-color .2s ease;
  }
  .site-nav a:hover,
  .site-nav a[aria-current="page"] { border-bottom-color: var(--c-sand); }

  .nav-toggle, .nav-close { display: none; }

  /* Small screens: slide-in panel (only when JS is available; without JS the
     links simply stay in a wrapped row — see .no-js rules in pages layer). */
  @media (max-width: 49.999em) {
    .js .nav-toggle {
      display: inline-flex;
      align-items: center;
      gap: .75rem;
      padding: .5rem 0;
      background: none;
      border: 0;
    }
    .nav-toggle__bars {
      position: relative;
      width: 1.25rem;
      height: .875rem;
      border-block: 2px solid currentColor;
    }
    .nav-toggle__bars::before {
      content: "";
      position: absolute;
      inset-inline: 0;
      top: 50%;
      height: 2px;
      margin-top: -1px;
      background: currentColor;
    }

    .js .site-nav {
      position: fixed;
      inset-block: 0;
      right: 0;
      z-index: 110;
      width: min(20rem, 85vw);
      height: 100vh;
      height: 100dvh;
      padding: 5rem 2rem 2rem;
      overflow-y: auto;
      background: #38444f;
      transform: translateX(100%);
      visibility: hidden;                         /* keeps closed links out of the tab order */
      transition: transform .5s ease, visibility 0s linear .5s;
    }
    .js .site-nav.is-open { transform: none; visibility: visible; transition-delay: 0s; }
    .js .site-nav ul { flex-direction: column; gap: 0; }
    .js .site-nav a {
      display: block;
      padding-block: .9rem;
      font-size: .9375rem;
      border-bottom: 1px solid rgb(255 255 255 / .14);
    }
    .js .site-nav a:hover,
    .js .site-nav a[aria-current="page"] { border-bottom-color: var(--c-sand); }

    .js .nav-close {
      position: absolute;
      top: .75rem;
      right: 1rem;
      display: block;
      width: 2.75rem;
      height: 2.75rem;
      background: none;
      border: 0;
      color: #fff;
    }
    .nav-close::before, .nav-close::after {
      content: "";
      position: absolute;
      top: 50%;
      left: 50%;
      width: 1.375rem;
      height: 2px;
      margin: -1px 0 0 -.6875rem;
      background: currentColor;
      transform: rotate(45deg);
    }
    .nav-close::after { transform: rotate(-45deg); }

    body::before {                                 /* scrim behind the open panel */
      content: "";
      position: fixed;
      inset: 0;
      z-index: 90;                                /* below the header (100), which contains the panel */
      background: rgb(0 0 0 / .55);
      opacity: 0;
      pointer-events: none;
      transition: opacity .5s ease;
    }
    body.nav-open { overflow: hidden; }
    body.nav-open::before { opacity: 1; pointer-events: auto; }
  }

  /* ---- Hero (home page) ------------------------------------------------
     The opening sequence from the original theme, unchanged in timing:
       0.00s  headline fades in from 95% scale, rules start drawing at .25s
       1.25s  dark veil begins fading out over 3s, revealing text + photo
       3.50s  "More information" arrow slides up
     <html class="is-loading"> (set by the inline boot script until window
     load) holds everything in its starting state; removing it lets the
     transitions below play. No JS, or prefers-reduced-motion: no animation. */
  .hero {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100svh;
    padding: calc(var(--header-h) + 2rem) var(--gutter) 9rem;
    overflow: hidden;
    text-align: center;
  }

  .hero__title {
    position: relative;
    z-index: 1;
    display: inline-block;
    padding: .45em 1em;
    font-size: clamp(1.15rem, .8rem + 1.7vw, 1.9rem);
    line-height: 1.5;
    opacity: 1;
    transform: scale(1);
    transition: transform .5s ease, opacity .5s ease;
  }
  .hero__title span { display: block; }
  .hero__title::before,
  .hero__title::after {
    content: "";
    position: absolute;
    width: 100%;
    height: 2px;
    background: #fff;
    transition: width .85s ease .25s;
  }
  .hero__title::before { top: 0; left: 0; }
  .hero__title::after { bottom: 0; right: 0; }

  .hero__lead {
    max-width: 38rem;
    margin-top: 1.75rem;
    font-size: clamp(.8125rem, .75rem + .3vw, 1rem);
    letter-spacing: .2em;
    line-height: 1.8;
    text-transform: uppercase;
  }
  .hero__actions { margin-top: 2.25rem; }

  .hero__more {
    position: absolute;
    z-index: 1;
    bottom: 0;
    left: 0;
    right: 0;
    width: 16em;
    height: 8.5em;
    margin-inline: auto;
    font-size: .8125rem;
    letter-spacing: var(--track-caps);
    text-align: center;
    text-transform: uppercase;
    color: #fff;
    text-decoration: none;
    opacity: 1;
    transform: translateY(0);
    transition: transform .75s ease 3.5s, opacity .75s ease 3.5s;
  }
  .hero__more::after {
    content: "";
    position: absolute;
    bottom: 3.5em;
    left: 50%;
    width: 1.5em;
    height: 1.5em;
    margin-left: -.75em;
    background: url("../img/arrow-down.svg") center / contain no-repeat;
  }

  .hero::after {                                   /* the veil */
    content: "";
    position: absolute;
    inset: 0;
    background: var(--c-slate);
    opacity: 0;
    pointer-events: none;
    transition: opacity 3s ease-in-out 1.25s;
  }

  /* Starting state while loading */
  .is-loading .hero *,
  .is-loading .hero *::before,
  .is-loading .hero *::after,
  .is-loading .site-header { transition: none !important; }
  .is-loading .hero__title { opacity: 0; transform: scale(.95); }
  .is-loading .hero__title::before,
  .is-loading .hero__title::after { width: 0; }
  .is-loading .hero__more { opacity: 0; transform: translateY(8.5em); }
  .is-loading .hero::after { opacity: 1; }

  @media (max-width: 46em) {
    .hero { min-height: 0; padding-block: calc(var(--header-h) + 4rem) 5rem; }
    .hero__more { display: none; }
  }

  @media (prefers-reduced-motion: reduce) {
    .hero *, .hero *::before, .hero *::after, .hero::after { transition: none !important; }
  }

  /* ---- Page title (inner pages) -------------------------------------- */
  .page-title {
    padding: calc(var(--header-h) + clamp(3rem, 8vw, 6.5rem)) var(--gutter) clamp(3rem, 7vw, 5.5rem);
    text-align: center;
  }
  .page-title > * { max-width: var(--measure); margin-inline: auto; }
  .page-title p { margin-top: 1rem; letter-spacing: .1em; color: var(--c-sand); }
  .page-title .button { margin-top: 1.75rem; }

  /* ---- Buttons --------------------------------------------------------- */
  .button {
    --btn-bg: transparent;
    --btn-fg: #fff;
    --btn-bd: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3.125rem;
    padding: .65rem 2.25rem;
    background: var(--btn-bg);
    color: var(--btn-fg);
    border: 2px solid var(--btn-bd);
    border-radius: 3px;
    font-size: .8125rem;
    font-weight: 700;
    letter-spacing: var(--track-caps);
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
  }
  .button:hover { --btn-bg: #fff; --btn-fg: var(--c-slate); }
  .button--primary { --btn-bg: var(--c-sand); --btn-fg: var(--c-deep); --btn-bd: var(--c-sand); }
  .button--primary:hover { --btn-bg: #fff; --btn-fg: var(--c-deep); --btn-bd: #fff; }
  .button--dark { --btn-bg: var(--c-slate); --btn-fg: #fff; --btn-bd: var(--c-slate); }
  .button--dark:hover { --btn-bg: var(--c-deep); --btn-fg: #fff; --btn-bd: var(--c-deep); }
  .button[disabled] { opacity: .65; cursor: progress; }

  .actions { display: flex; flex-wrap: wrap; gap: 1rem; }
  .actions--center { justify-content: center; }
  .actions--spaced { margin-top: 2rem; }

  /* ---- Prose helpers -------------------------------------------------- */
  .lead { font-size: 1.1em; }
  .note { font-size: .875em; font-style: italic; }

  /* ---- Benefit & issue lists (home) ------------------------------------ */
  .benefits {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    column-gap: 2rem;
    list-style: none;
  }
  .benefits li {
    padding-block: .85rem;
    border-top: 1px solid var(--c-rule);
    font-weight: 600;
    color: var(--c-heading);
  }

  .issues { columns: 2 15rem; column-gap: 2rem; list-style: none; }
  .issues li {
    break-inside: avoid;
    padding-block: .7rem;
    border-top: 1px solid var(--c-rule);
  }
  .issues strong { color: var(--c-heading); }

  /* ---- Rates ---------------------------------------------------------- */
  .rates {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    max-width: 40rem;
    margin: 2.5rem auto 0;
    list-style: none;
  }
  .rates li { padding: .5rem 1rem; text-align: center; }
  .rates li + li { border-left: 1px solid var(--c-rule); }
  .rates__time {
    display: block;
    font-size: clamp(2rem, 1.3rem + 3vw, 3.25rem);
    font-weight: 800;
    line-height: 1.1;
    color: #fff;
  }
  .rates__unit {
    display: block;
    font-size: .8125rem;
    letter-spacing: var(--track-caps);
    text-transform: uppercase;
  }
  .rates__price {
    display: block;
    margin-top: .9rem;
    font-size: clamp(1.25rem, 1rem + 1.2vw, 1.75rem);
    font-weight: 700;
    color: var(--c-sand);
  }

  @media (max-width: 30em) {
    .rates { grid-template-columns: 1fr; }
    .rates li {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 1rem;
      padding: 1rem 0;
      text-align: left;
    }
    .rates li + li { border-left: 0; border-top: 1px solid var(--c-rule); }
    .rates__time { font-size: 1.75rem; }
    .rates__time, .rates__unit { display: inline; }
    .rates__price { margin-top: 0; }
  }

  /* ---- Forms ---------------------------------------------------------- */
  .form { display: grid; gap: 1.25rem; }
  .form__row { display: grid; gap: 1.25rem; }
  @media (min-width: 40em) {
    .form__row--2 { grid-template-columns: 1fr 1fr; }
  }

  .field { display: grid; gap: .4rem; align-content: start; }
  .field label { font-weight: 600; color: var(--c-heading); }
  .field__hint, .field__error { font-size: .875em; line-height: 1.5; }
  .field__error { color: var(--c-error); font-weight: 600; }

  .field input,
  .field textarea {
    width: 100%;
    min-height: 3rem;
    padding: .7rem .9rem;
    background: var(--c-paper);
    color: var(--c-ink-strong);
    border: 1px solid #cdc6b6;
    border-radius: .375rem;
  }
  .field textarea { min-height: 10rem; resize: vertical; }
  .field input:focus-visible,
  .field textarea:focus-visible { outline-offset: 0; border-color: var(--c-brown); }
  .field [aria-invalid="true"] { border-color: var(--c-error); border-width: 2px; }

  .field--trap {                                   /* honeypot: off-screen, not display:none */
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
  }

  .alert {
    padding: 1rem 1.25rem;
    border-left: 4px solid var(--c-error);
    background: #fbefee;
    color: #5c1a15;
  }
  .alert:focus { outline-offset: 2px; }
  .alert p { font-weight: 700; }
  .alert ul { margin-top: .5rem; padding-left: 1.25rem; }
  .alert a { color: inherit; }

  /* ---- Footer ---------------------------------------------------------- */
  .site-footer {
    --c-focus: var(--c-sand);
    padding: clamp(3rem, 6vw, 4.5rem) var(--gutter) 2rem;
    background: var(--c-deep);
    color: #c9ccd0;
    font-size: .9375rem;
  }
  .site-footer__inner {
    display: grid;
    gap: 2.5rem;
    align-items: start;
  }
  @media (min-width: 48em) {
    .site-footer__inner { grid-template-columns: 1.2fr 1fr auto; }
  }
  .site-footer__name {
    font-weight: 800;
    letter-spacing: var(--track-heading);
    text-transform: uppercase;
    color: #fff;
  }
  .site-footer__about p + p { margin-top: .5rem; }
  .site-footer ul { list-style: none; }
  .site-footer li + li { margin-top: .35rem; }
  .site-footer a { color: #fff; }
  .site-footer__legal {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: .5rem 2rem;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgb(255 255 255 / .14);
    font-size: .8125rem;
  }
}

/* ==========================================================================
   5. Pages (one-off rules)
   ========================================================================== */
@layer pages {

  /* No-JS: header scrolls away and nav simply wraps beneath the brand. */
  .no-js .site-header { position: relative; height: auto; min-height: var(--header-h); flex-wrap: wrap; padding-block: .5rem; }
  .no-js .site-nav ul { flex-wrap: wrap; row-gap: .25rem; }

  /* About */
  .about { display: grid; gap: clamp(1.75rem, 5vw, 4rem); align-items: start; }
  @media (min-width: 52em) {
    .about { grid-template-columns: minmax(0, 20rem) minmax(0, 1fr); }
  }
  .about__photo { width: min(100%, 20rem); margin-inline: auto; border-radius: 15%; overflow: hidden; }
  .about__photo img { width: 100%; }

  .pullquote {
    padding-left: 1.25rem;
    border-left: 3px solid var(--c-sand);
    font-size: clamp(1.2rem, 1.05rem + .7vw, 1.6rem);
    font-style: italic;
    line-height: 1.5;
    letter-spacing: .01em;
    color: var(--c-ink-strong);
  }

  .facts {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .5rem 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--c-rule);
  }
  .facts dt { font-weight: 700; color: var(--c-heading); }

  /* Scheduling */
  .policies > * + * { margin-top: 2.25rem; padding-top: 2.25rem; border-top: 1px solid var(--c-rule); }
  .signoff { font-size: 1.15em; font-style: italic; text-align: center; }

  /* Contact */
  .contact { display: grid; gap: clamp(2rem, 5vw, 4rem); }
  @media (min-width: 56em) {
    .contact { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; }
  }
  .contact__notes { list-style: none; }
  .contact__notes li { padding-block: .8rem; border-top: 1px solid var(--c-rule); }
}

/* ==========================================================================
   6. Utilities
   ========================================================================== */
@layer utilities {
  .text-center { text-align: center; }
  .visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }
}

@media print {
  .backdrop, .site-header, .hero__more, .hero::after, .skip-link, .nav-toggle { display: none !important; }
  body { background: #fff; color: #000; }
  .hero, .page-title { min-height: 0; padding: 1rem 0; color: #000; }
  .hero__title, h1, h2, h3, .page-title p { color: #000; }
  .section--sand { background: none; --c-text: #000; --c-heading: #000; }
  .site-footer { background: none; color: #000; }
}
