/* Hallmark · genre: editorial · macrostructure: Split Studio · theme: Sport
 * business: detailing (pesut, fiksit, maalipinnan myllytys) — NOT a garage
 * tone: utilitarian · audience: Joensuun autoilijat · anchor hue: 27 (warm red, from the logo)
 * nav: N6 Newspaper masthead (knobs: issue-line=below-wordmark, wordmark=logo-image, rule=double)
 * footer: Ft4 Dense colophon (knobs: family=monospace, layout=single-block, includes=address+hours+Y-tunnus)
 * hero: H2 Split diptych (knobs: ratio=7/5, right=photo, divider=negative-space)
 * features: Split Studio alternating modules · F3 Tabular spec sheet (hinnasto) · S5 bottom-anchored (figcaption)
 * CTA: filled accent slab (primary) + C1 outlined chip (secondary) + C4 sticky bottom bar (mobile)
 * enrichment: real photography, user-supplied — no generated assets
 * motion: 3 primitives — hero stagger reveal · CTA hover lift · callbar slide-in (Sport 0.7x, sharp)
 * lang: fi · every colour + font references tokens.css
 *
 * pre-emit critique: P5 H4 E5 S5 R5 V4
 * contrast: pass (40–41) · nav/footer/hero slop: pass (42–45) · honest: pass (46)
 * chrome: pass (47) · tokens: pass (48) · responsive: pass (49) · icons: pass (30)
 * mobile: pass (34, 49, 50–57) — verified at 320 / 375 / 414 / 768 px
 */

/* ── Reset + root ────────────────────────────────────────────────────── */

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

html {
  overflow-x: clip;                 /* never `hidden` — it breaks position:sticky */
  -webkit-text-size-adjust: 100%;
}

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: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 800;
  margin: 0;
  /* Finnish compounds are long — let display type break inside a word
     rather than push the layout past the viewport. */
  overflow-wrap: anywhere;
  min-width: 0;
  text-wrap: balance;
}

p { margin: 0; }

a { color: inherit; }

/* ── Shared: focus, hit targets, affordances ─────────────────────────── */

:focus-visible {
  outline: var(--rule-heavy) solid var(--color-focus);
  outline-offset: 2px;
  /* never transitioned — the ring is present the instant focus lands */
}

.skip {
  position: absolute;
  top: var(--space-xs);
  left: var(--space-md);
  z-index: var(--z-modal);
  background: var(--color-ink);
  color: var(--color-paper);
  padding: var(--space-sm) var(--space-md);
  font-weight: 600;
  clip-path: inset(50%);            /* hidden without negative offsets */
}
.skip:focus { clip-path: none; }

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

/* Placeholder slots. Delete class="fill" once the real value is in. */
.fill {
  color: var(--color-accent-deep);
  text-decoration: underline dashed;
  text-decoration-thickness: var(--rule-hair);
  text-underline-offset: 3px;
}

/* ── Buttons ─────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: var(--space-sm) var(--space-lg);
  border: var(--rule-hair) solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1;                  /* intrinsic-height item in a flex row — gate 36 */
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;             /* affordances are one-line objects — gate 49 */
  transition: background-color var(--dur-short) var(--ease-out),
              color var(--dur-short) var(--ease-out),
              border-color var(--dur-short) var(--ease-out),
              transform var(--dur-micro) var(--ease-out);
}

.btn--solid {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-accent-ink);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.btn--chip {                        /* C1 · outlined chip, slab shape */
  background: transparent;
  border-color: var(--color-ink);
  color: var(--color-ink);
}

.btn--compact { padding-inline: var(--space-md); }

@media (hover: hover) and (pointer: fine) {
  .btn--solid:hover { background: var(--color-accent-deep); border-color: var(--color-accent-deep); transform: translateY(-1.5px); }
  .btn--chip:hover  { background: var(--color-ink); color: var(--color-paper); transform: translateY(-1.5px); }
}
.btn:active { transform: translateY(1px); }

/* ── N6 · Newspaper masthead ─────────────────────────────────────────── */

.mast {
  display: grid;
  justify-items: center;
  gap: var(--space-xs);
  padding: var(--space-md) var(--page-gutter) 0;
  text-align: center;
}

.mast__logo {
  width: min(16rem, 60vw);
  height: auto;
  /* logo.jpg carries a white box. multiply drops the white into the warm
     paper. Remove this line once a transparent PNG/SVG replaces the JPG. */
  mix-blend-mode: multiply;
}

/* Body face, not the outlier — the outlier is reserved for two slots only
   (figures: hours + phone · the colophon). Gate 38. */
.mast__line {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
}
.mast__sep { color: var(--color-rule); padding-inline: var(--space-3xs); }
/* Sits inline inside a block of text, so it takes the WCAG 2.5.8 inline
   exemption from the 44px floor rather than distorting the masthead line.
   The two full-size phone affordances are the hero CTA and the call bar. */
.mast__tel { color: var(--color-ink); text-decoration: none; white-space: nowrap; }
.mast__tel:hover { color: var(--color-accent-deep); }

.mast__nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--space-lg);
  list-style: none;
  margin: var(--space-2xs) 0 0;
  padding: 0;
}
.mast__nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;                 /* touch target floor — measured 39px before */
  padding-block: var(--space-xs);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: var(--rule-hair) solid transparent;
}
.mast__nav a:hover { border-bottom-color: var(--color-accent); }

.mast__rule {
  width: 100%;
  height: 4px;
  margin: var(--space-md) 0 0;
  border: 0;
  border-top: var(--rule-hair) solid var(--color-rule);
  border-bottom: var(--rule-heavy) solid var(--color-ink);
}

/* ── H2 · Split diptych hero ─────────────────────────────────────────── */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);   /* never bare 1fr on image tracks */
  gap: var(--space-xl);
  align-items: center;
  padding: var(--space-2xl) var(--page-gutter) var(--space-3xl);
}

.hero__title {
  font-size: var(--text-display);
  line-height: 1.08;                        /* caps floor — Ä/Ö need the headroom */
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.hero__lede {
  max-width: 46ch;
  margin-top: var(--space-lg);
  font-size: var(--text-md);
  color: var(--color-muted);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;             /* gate 36 — mixed-height flex row */
  gap: var(--space-sm);
  margin-top: var(--space-xl);
}

.hero__note {
  max-width: 48ch;
  margin-top: var(--space-md);
  font-size: var(--text-sm);
  color: var(--color-neutral);
}

.hero__figure { margin: 0; }
.hero__figure img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-bottom: var(--rule-heavy) solid var(--color-accent);
}

/* ── Palvelut ────────────────────────────────────────────────────────── */

.services { padding: 0 var(--page-gutter) var(--space-2xl); }

.services__head, .contact__head { max-width: 48ch; }

.services__head h2, .contact__head h2 {
  font-size: var(--text-display-s);
  line-height: 1.08;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.deck {
  margin-top: var(--space-xs);
  font-size: var(--text-md);
  color: var(--color-muted);
}

.mod {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-lg);
  align-items: center;
  padding-block: var(--space-2xl);
  border-top: var(--rule-hair) solid var(--color-rule);
}
.mod:first-of-type { margin-top: var(--space-2xl); }

.mod__text h3 {
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1.15;
}
.mod__text p {
  max-width: 46ch;
  margin-top: var(--space-sm);
  color: var(--color-muted);
}

.mod__figure { margin: 0; }
.mod__figure img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}
.mod__figure figcaption {           /* S5 · the label closes the photograph */
  margin-top: var(--space-xs);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  color: var(--color-neutral);
}

/* The refusal band — no photo; the statement is the proof.
   Rule sits above, not on the inline edge: a thick coloured side-stripe is
   the 2018-SaaS card tell (gate 5), a top rule is print. */
.refusal {
  max-width: 46ch;
  padding-top: var(--space-md);
  border-top: var(--rule-heavy) solid var(--color-accent);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: 1.2;
}

/* ── Hinnasto — F3 · tabular spec sheet ──────────────────────────────── */

.pricing {
  padding: var(--space-2xl) var(--page-gutter) var(--space-3xl);
  border-top: var(--rule-heavy) solid var(--color-ink);
}
.pricing__head { max-width: 48ch; }
.pricing__head h2 {
  font-size: var(--text-display-s);
  line-height: 1.08;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.prices {
  width: 100%;
  margin-top: var(--space-xl);
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  text-align: left;
}
/* Mobile first: each row is name-above-price (cookbook F3 collapse).
   At >=40rem it becomes a real two-column spec sheet. */
.prices tr, .prices th, .prices td { display: block; }
.prices th {
  padding: var(--space-md) 0 var(--space-2xs);
  font-family: var(--font-body);
  font-size: var(--text-md);
  font-weight: 600;
}
.prices td { padding: 0 0 var(--space-md); border-bottom: var(--rule-hair) solid var(--color-rule); }
.prices tr:first-child th { border-top: var(--rule-hair) solid var(--color-rule); }
.prices__note {
  display: block;
  max-width: 46ch;
  margin-top: var(--space-2xs);
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--color-muted);
}
.prices__line { display: block; white-space: nowrap; }
.prices__line + .prices__line { margin-top: var(--space-2xs); }
.prices__amt {
  font-family: var(--font-outlier);
  font-size: var(--text-md);
  font-weight: 500;
}
.prices__amt--soft { font-size: var(--text-sm); color: var(--color-muted); }
.prices__tier {
  font-size: var(--text-xs);
  color: var(--color-neutral);
}

/* ── Yhteystiedot ────────────────────────────────────────────────────── */

.contact {
  padding: var(--space-3xl) var(--page-gutter) var(--space-2xl);
  background: var(--color-paper-2);
  border-top: var(--rule-hair) solid var(--color-rule);
}

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

.minor {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-neutral);
}

/* Opening hours — a definition list, not a second spec sheet. F3 is spent
   on the price table; repeating the archetype would flatten the page. */
.hours {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0 var(--space-md);
  margin: var(--space-sm) 0 0;
  font-variant-numeric: tabular-nums;
}
.hours dt, .hours dd {
  margin: 0;
  padding-block: var(--space-sm);
  border-bottom: var(--rule-hair) solid var(--color-rule);
}
.hours dt { color: var(--color-muted); }
.hours dd { text-align: right; font-family: var(--font-outlier); font-weight: 500; }
.hours .closed { color: var(--color-neutral); }

.micro {
  margin-top: var(--space-xs);
  font-size: var(--text-xs);
  color: var(--color-neutral);
}

.addr {
  margin: var(--space-sm) 0 var(--space-md);
  font-style: normal;
  font-size: var(--text-md);
  line-height: 1.45;
}

.reach {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-2xs) var(--space-md);
  margin: var(--space-xl) 0 var(--space-lg);
  font-size: var(--text-sm);
}
.reach dt { color: var(--color-neutral); }
.reach dd { margin: 0; }
.reach a { text-decoration-thickness: var(--rule-hair); text-underline-offset: 3px; }

.tel-big {
  font-family: var(--font-outlier);
  font-size: var(--text-md);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.tel-big:hover { color: var(--color-accent-deep); }

/* ── Ft4 · Dense colophon ────────────────────────────────────────────── */

.colophon {
  padding: var(--space-xl) var(--page-gutter);
  background: var(--color-ink-deep);
  border-top: var(--rule-heavy) solid var(--color-accent);
  color: var(--color-muted-inv);
  font-family: var(--font-outlier);
  font-size: var(--text-xs);
  line-height: 1.9;
  letter-spacing: 0.02em;
}
.colophon p { max-width: 72ch; }
.colophon strong { color: var(--color-paper); font-weight: 500; }
.colophon a { color: var(--color-paper); text-underline-offset: 3px; white-space: nowrap; }
.colophon .fill { color: var(--color-accent-lift); }
/* --color-focus is only 2.46:1 against the dark band — flip the ring here. */
.colophon :focus-visible { outline-color: var(--color-focus-inv); }

/* ── C4 · Sticky bottom call bar (mobile) ────────────────────────────── */

.callbar {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-sm) var(--page-gutter);
  padding-bottom: max(var(--space-sm), env(safe-area-inset-bottom));
  background: var(--color-paper);
  border-top: var(--rule-heavy) solid var(--color-ink);
  transform: translateY(110%);
  visibility: hidden;
  transition: transform var(--dur-long) var(--ease-out),
              visibility 0s linear var(--dur-long);
}
.callbar.is-shown {
  transform: translateY(0);
  visibility: visible;
  transition: transform var(--dur-long) var(--ease-out),
              visibility 0s linear 0s;
}
.callbar__text {
  font-size: var(--text-sm);
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Motion primitive 1 · hero stagger reveal (one-shot, on load) ────── */

.hero__text, .hero__figure {
  opacity: 0;
  animation: reveal var(--dur-long) var(--ease-out) forwards;
  animation-delay: calc(var(--i, 0) * 80ms);
}
@keyframes reveal { to { opacity: 1; } }

/* ── Breakpoints — mobile first ──────────────────────────────────────── */

@media (min-width: 40rem) {
  /* F3 becomes a true two-column spec sheet */
  .prices tr { display: table-row; }
  .prices th, .prices td {
    display: table-cell;
    padding-block: var(--space-md);
    border-bottom: var(--rule-hair) solid var(--color-rule);
    vertical-align: baseline;
  }
  .prices th { padding-inline: 0 var(--space-lg); }
  .prices td { padding-inline: 0; text-align: right; }
  .prices tr:first-child th, .prices tr:first-child td {
    border-top: var(--rule-hair) solid var(--color-rule);
  }

  .contact__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--space-2xl); }
  .mod  { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: var(--space-2xl); }
  .mod--flip { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
  .mod--stated { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); align-items: start; }
}

@media (min-width: 60rem) {
  .hero {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);   /* 7/5 diptych */
    /* Top-aligned, not centred: the portrait figure is the taller item, and
       centring against it pushed the headline down ~80px, leaving the CTA
       only 21px of clearance on a 1280x800 fold (gate 44b). */
    align-items: start;
    gap: var(--space-3xl);
    /* 64 top / 144 bottom — bottom-weighted so the hero pulls into the next
       section (gate 44a ≥1.3x) and the CTA + note clear an 800 px fold. */
    padding-block: var(--space-2xl) var(--space-4xl);
  }
  .hero__figure img { aspect-ratio: 3 / 4; }
  .services { padding-bottom: var(--space-3xl); }
  .contact  { padding-block: var(--space-4xl) var(--space-3xl); }
  /* Desktop keeps the phone permanently in the masthead line — the bar is
     a small-screen affordance only. */
  .callbar { display: none; }
}

/* ── Reduced motion ──────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 150ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 150ms !important;
  }
  .hero__text, .hero__figure { animation-delay: 0s; }
  .btn:hover, .btn:active { transform: none; }
  .callbar { transition: opacity 150ms linear; }
}

/* ── Print — someone will print the address ──────────────────────────── */

@media print {
  .callbar, .mast__nav, .skip, .hero__figure, .mod__figure { display: none; }
  .colophon { background: none; color: var(--color-ink); border-top-color: var(--color-ink); }
  .colophon strong, .colophon a, .colophon .fill { color: var(--color-ink); }
  .mast__logo { mix-blend-mode: normal; }
  .hero, .services, .mod, .contact { padding-block: var(--space-md); }
}
