/* Hallmark · genre: editorial · macrostructure: Catalogue · theme: Editorial
 * enrichment: real photography (13 plates, no generated assets) · nav: N3 side-rail · footer: Ft2 inline single line
 * tone: warm / soft · audience: all locals, broad age range · job: compare treatments + prices, then call
 * anchor hue: warm sand 54-68 · accent: muted teal 205 · type: EB Garamond 700 + Geist 400
 * knob deltas vs portfolio: accent hue teal (siblings are warm 42-62) · nav N3 (siblings 7x N6, 4x N9) · footer Ft2 (siblings 9x Ft4)
 *
 * slop test 58/58 · contrast: pass (40-41, computed WCAG on every token pair)
 * mobile: pass (34, 49, 50-57 verified at 320/375/414/768) · honest: pass (46) · chrome: pass (47)
 * tokens: pass (48) · icons: pass (30) · nav+footer+hero: pass (42-45)
 * Hallmark · pre-emit critique: P5 H5 E5 S4 R5 V5
 *   S4 not 5: every business fact on the page is a marked placeholder and the photography is
 *   stock. Specificity tops out until real prices, contact details and photos of Juha land.
 *   See PAIKKAMERKIT.md.
 */

@import url("tokens.css");

/* ============================================================ base */

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

html {
  overflow-x: clip;
  scroll-behavior: smooth;
  scroll-padding-top: var(--space-xl);
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  overflow-x: clip;
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 700;
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-display);
  margin: 0;
  overflow-wrap: anywhere;
  min-width: 0;
  text-wrap: balance;
}

p,
figure,
blockquote,
ul,
ol {
  margin: 0;
}

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

a {
  color: var(--color-accent);
  text-underline-offset: 0.18em;
  text-decoration-thickness: from-font;
}

:focus-visible {
  outline: var(--rule-thick) solid var(--color-focus);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

.tnum {
  font-variant-numeric: tabular-nums;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: var(--z-toast);
  background: var(--color-ink);
  color: var(--color-paper);
  padding: var(--space-sm) var(--space-md);
}

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

/* ============================================================ layout shell */

.shell {
  padding-left: 0;
  padding-bottom: var(--bar-h);
}

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

/* Section rhythm is deliberately uneven — the catalogue breathes wider than the prose. */
.band {
  padding-block: var(--space-3xl) var(--space-2xl);
}

.band--tight {
  padding-block: var(--space-2xl);
}

.band--wide {
  padding-block: var(--space-4xl) var(--space-3xl);
}

.band--tinted {
  background: var(--color-paper-2);
}

/* S2 · hanging section head — floats in negative space, no rule, no eyebrow */
.head {
  display: grid;
  gap: var(--space-sm);
  max-width: var(--measure);
  margin-bottom: var(--space-xl);
}

.head h2 {
  font-size: var(--text-2xl);
}

.head p {
  color: var(--color-muted);
  max-width: var(--measure);
}

/* ============================================================ N3 · side-rail */

.rail {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--rail-w);
  z-index: var(--z-sticky);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-lg);
  background: var(--color-paper);
  border-right: var(--rule-hair) solid var(--color-rule);
}

.rail__mark {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-base);
  letter-spacing: 0.02em;
  color: var(--color-ink);
  text-decoration: none;
}

.rail__mark span {
  color: var(--color-muted);
  font-weight: 400;
}

.rail__dots {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-lg);
  justify-items: center;
}

.rail__dot {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  text-decoration: none;
  position: relative;
}

.rail__dot::after {
  content: "";
  width: 7px;
  height: 7px;
  border: var(--rule-hair) solid var(--color-neutral);
  background: transparent;
  transition:
    background-color var(--dur-short) var(--ease-out),
    border-color var(--dur-short) var(--ease-out);
}

.rail__dot:hover::after,
.rail__dot:focus-visible::after {
  border-color: var(--color-accent);
}

.rail__dot.is-active::after {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

/* the label rides out of the rail on hover/focus — never the only affordance */
.rail__label {
  position: absolute;
  left: calc(100% + var(--space-xs));
  white-space: nowrap;
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-ink);
  background: var(--color-paper);
  padding: var(--space-2xs) var(--space-xs);
  border: var(--rule-hair) solid var(--color-rule);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-short) var(--ease-out);
}

.rail__dot:hover .rail__label,
.rail__dot:focus-visible .rail__label {
  opacity: 1;
}

.rail__tel {
  writing-mode: vertical-rl;
  font-size: var(--text-sm);
  letter-spacing: 0.06em;
  color: var(--color-muted);
  text-decoration: none;
}

.rail__tel:hover {
  color: var(--color-accent);
}

/* Top bar — the mobile / tablet nav. Replaced by the rail at 60rem. */
.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: var(--color-paper);
  border-bottom: var(--rule-hair) solid var(--color-rule);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  min-height: 3.5rem;
}

.topbar__mark {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem; /* 44 px tap target */
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--color-ink);
  text-decoration: none;
  white-space: nowrap;
}

.topbar__toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  min-height: 2.75rem;
  padding-inline: var(--space-sm);
  background: none;
  border: var(--rule-hair) solid var(--color-neutral);
  border-radius: var(--radius-xs);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-ink);
  cursor: pointer;
  white-space: nowrap;
}

.topbar__toggle:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.topbar__menu {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0 0 var(--space-md);
  border-top: var(--rule-hair) solid var(--color-rule);
}

.topbar__menu.is-open {
  display: block;
}

.topbar__menu a {
  display: block;
  padding-block: var(--space-sm);
  min-height: 2.75rem;
  color: var(--color-ink);
  text-decoration: none;
  border-bottom: var(--rule-hair) solid var(--color-rule);
  white-space: nowrap;
}

.topbar__menu a:hover {
  color: var(--color-accent);
}

@media (min-width: 60rem) {
  .rail {
    display: flex;
  }

  .topbar {
    display: none;
  }

  .shell {
    padding-left: var(--rail-w);
  }
}

/* ============================================================ masthead
 * Catalogue heading discipline: brand mark + tagline, no display-size hero. */

.mast {
  /* bottom-heavy on purpose (gate 44): the masthead pulls into the catalogue below it */
  padding-block: var(--space-xl) var(--space-2xl);
}

.mast__grid {
  display: grid;
  gap: var(--space-xl);
  align-items: end;
}

@media (min-width: 52rem) {
  .mast__grid {
    /* deliberately unequal — the name column is wider than the facts column */
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
    gap: var(--space-2xl);
  }
}

.mast__name {
  font-size: var(--text-display);
  line-height: var(--leading-display);
}

.mast__role {
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-sm);
}

.mast__lede {
  margin-top: var(--space-md);
  font-size: var(--text-md);
  color: var(--color-ink-2);
  max-width: var(--measure);
}

.mast__facts {
  display: grid;
  gap: var(--space-sm);
  padding-top: var(--space-md);
  border-top: var(--rule-thick) solid var(--color-ink);
}

.fact {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-md);
  justify-content: space-between;
  padding-bottom: var(--space-sm);
  border-bottom: var(--rule-hair) solid var(--color-rule);
}

.fact:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.fact__key {
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-muted);
}

.fact__val {
  color: var(--color-ink);
  text-align: right;
}

.fact__val a {
  color: var(--color-ink);
  text-decoration-color: var(--color-rule-2);
}

.fact__val a:hover {
  color: var(--color-accent);
}

/* the one grid-break on the page: the plate runs past the content column */
.plate {
  margin-top: var(--space-xl);
  position: relative;
}

.plate img {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 52vh; /* the band never eats the whole fold; object-fit crops, never distorts */
  object-fit: cover;
  background: var(--color-paper-3);
}

@media (min-width: 60rem) {
  .plate {
    margin-right: calc(var(--page-pad) * -1);
  }
}

/* ============================================================ F6 · treatment cards */

.grid-cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-xl) var(--space-lg);
}

@media (min-width: 34rem) {
  .grid-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 62rem) {
  .grid-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.card {
  display: grid;
  gap: var(--space-sm);
  align-content: start;
  min-width: 0;
}

.card__media {
  display: block;
  overflow: hidden;
  background: var(--color-paper-3);
}

.card__media img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  transition: transform var(--dur-long) var(--ease-out);
}

.card:hover .card__media img {
  transform: scale(1.02);
}

.card__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-md);
  padding-top: var(--space-2xs);
  border-top: var(--rule-hair) solid var(--color-rule-2);
}

.card__name {
  font-size: var(--text-md);
  font-weight: 700;
  min-width: 0;
}

.card__price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  white-space: nowrap;
  color: var(--color-ink);
}

.card__dur {
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-muted);
}

.card__note {
  color: var(--color-muted);
  font-size: var(--text-base);
  max-width: 34ch;
}

@media (prefers-reduced-motion: reduce) {
  .card__media img {
    transition: none;
  }

  .card:hover .card__media img {
    transform: none;
  }
}

/* ============================================================ F3 · spec sheet */

.sheet-scroll {
  overflow-x: auto;
}

.sheet {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.sheet caption {
  text-align: left;
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-muted);
  padding-bottom: var(--space-sm);
}

.sheet th,
.sheet td {
  padding: var(--space-sm) var(--space-md) var(--space-sm) 0;
  border-bottom: var(--rule-hair) solid var(--color-rule);
  vertical-align: baseline;
}

.sheet tbody tr:first-child th,
.sheet tbody tr:first-child td {
  border-top: var(--rule-thick) solid var(--color-ink);
}

.sheet th {
  font-weight: 500;
  color: var(--color-ink);
}

.sheet td:last-child {
  text-align: right;
  padding-right: 0;
  white-space: nowrap;
  font-family: var(--font-display);
  font-weight: 700;
}

.sheet .muted {
  color: var(--color-muted);
  font-size: var(--text-sm);
}

/* ============================================================ prose + split blocks */

.prose {
  max-width: var(--measure);
  display: grid;
  gap: var(--space-md);
  color: var(--color-ink-2);
}

.prose strong {
  color: var(--color-ink);
  font-weight: 500;
}

.split {
  display: grid;
  gap: var(--space-xl);
  align-items: start;
}

@media (min-width: 56rem) {
  .split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
    gap: var(--space-2xl);
  }

  .split--flip > :first-child {
    order: 2;
  }
}

.split img {
  width: 100%;
  object-fit: cover;
  background: var(--color-paper-3);
}

.figure {
  display: grid;
  gap: var(--space-xs);
}

.figure figcaption {
  font-size: var(--text-sm);
  color: var(--color-muted);
}

/* symptom list — hairlines, no bullets, no icons */
.list-plain {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
}

.list-plain li {
  padding-block: var(--space-sm);
  border-bottom: var(--rule-hair) solid var(--color-rule);
  color: var(--color-ink-2);
}

.list-plain li:first-child {
  border-top: var(--rule-hair) solid var(--color-rule);
}

/* ============================================================ C3 · typographic link */

.link {
  display: inline-block;
  color: var(--color-accent);
  font-weight: 500;
  text-decoration: none;
  border-bottom: var(--rule-hair) solid var(--color-accent);
  padding-bottom: var(--space-3xs);
  white-space: nowrap;
  transition: border-bottom-color var(--dur-micro) var(--ease-out);
}

.link:hover {
  border-bottom-color: transparent;
}

/* ============================================================ contact */

.contact {
  display: grid;
  gap: var(--space-xl);
}

@media (min-width: 56rem) {
  .contact {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--space-2xl);
  }
}

.hours {
  width: 100%;
  border-collapse: collapse;
}

.hours th,
.hours td {
  padding-block: var(--space-sm);
  border-bottom: var(--rule-hair) solid var(--color-rule);
  text-align: left;
  font-weight: 400;
}

.hours td {
  text-align: right;
  color: var(--color-ink);
}

.hours tr:first-child th,
.hours tr:first-child td {
  border-top: var(--rule-thick) solid var(--color-ink);
}

.contact__tel {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-xl);
  color: var(--color-ink);
  text-decoration: none;
  display: inline-block;
  white-space: nowrap;
  border-bottom: var(--rule-thick) solid var(--color-accent);
}

.contact__tel:hover {
  color: var(--color-accent);
}

/* ============================================================ C4 · sticky bottom bar */

.bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  min-height: var(--bar-h);
  padding: var(--space-xs) var(--page-pad);
  background: var(--color-paper);
  border-top: var(--rule-thick) solid var(--color-ink);
}

.bar__note {
  font-size: var(--text-sm);
  color: var(--color-muted);
  min-width: 0;
}

.bar__cta {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding-inline: var(--space-md);
  background: var(--color-accent);
  color: var(--color-accent-ink);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  border-radius: var(--radius-xs);
  transition:
    background-color var(--dur-micro) var(--ease-out),
    transform var(--dur-micro) var(--ease-out);
}

.bar__cta:hover {
  background: var(--color-accent-deep);
}

.bar__cta:active {
  transform: translateY(1px);
}

@media (min-width: 60rem) {
  .bar {
    left: var(--rail-w);
  }
}

/* ============================================================ Ft2 · inline single line */

.foot {
  border-top: var(--rule-hair) solid var(--color-rule);
  padding-block: var(--space-lg) var(--space-xl);
}

.foot p {
  font-size: var(--text-sm);
  color: var(--color-muted);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-sm);
}

.foot a {
  color: var(--color-muted);
}

.foot a:hover {
  color: var(--color-accent);
}

/* ============================================================ one load reveal */

.reveal {
  opacity: 0;
  transform: translateY(8px);
  animation: reveal var(--dur-long) var(--ease-out) forwards;
  animation-delay: calc(var(--i, 0) * 70ms);
}

@keyframes reveal {
  to {
    opacity: 1;
    transform: none;
  }
}

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

  .reveal {
    transform: none;
    animation: reveal-reduced 150ms linear forwards;
  }

  @keyframes reveal-reduced {
    to {
      opacity: 1;
    }
  }
}

/* ============================================================ narrow-viewport type */

@media (max-width: 40rem) {
  .head h2 {
    font-size: var(--text-xl);
  }

  .contact__tel {
    font-size: var(--text-lg);
  }

  .bar__note {
    display: none; /* the CTA must never share a cramped row with prose */
  }

  .bar {
    justify-content: stretch;
  }

  .bar__cta {
    flex: 1;
    justify-content: center;
  }
}
