/* Hallmark · genre: editorial · macrostructure: Narrative Workflow · theme: Sport
 * tone: utilitarian · anchor hue: warm 52 · enrichment: none (supplied photography)
 * nav: N6 Newspaper masthead (adapted as workshop nameplate) · footer: Ft4 Dense colophon
 * H2 Split-diptych knobs: ratio=7/5, right=photo, divider=negative-space
 * F6 Product-card knobs: ratio=4/3, density=irregular-spans (3+3+2+2+2 of 6), micro-action=none
 * F4 Step-sequence knobs: numbering=1.0/2.0/3.0, layout=vertical-stack, connector=rule
 * F3 Spec-sheet knobs: columns=2, rules=every-row, numbers=tabular
 * outlier face (mono) role: machine data — 2 slots only (.data, .step__stage)
 * pre-emit critique: P5 H5 E5 S5 R5 V4
 * contrast: pass (40–41) · 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)
 */

@import url("tokens.css");

/* ============================================================
   Reset + root
   ============================================================ */

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

html {
  overflow-x: clip;
  -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;
  padding-bottom: env(safe-area-inset-bottom);
}

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

figure {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-style: normal; /* Headers are roman. Never italic. */
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.005em;
  line-height: 1.05; /* Floor for all-caps display is 1.0 — cap-collision on wrap. */
  overflow-wrap: anywhere;
  min-width: 0;
  margin: 0;
}

p {
  margin: 0;
}

a {
  color: inherit;
}

:focus-visible {
  outline: var(--rule-slab) solid var(--color-focus);
  outline-offset: 2px;
  /* Never animated — keyboard users need the ring instantly. */
}

.shell {
  max-width: 82rem;
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}

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

/* Outlier face · slot 1 of 2 — machine data (Y-tunnus, ALV, TOL code). */
.data {
  font-family: var(--font-outlier);
  font-variant-numeric: tabular-nums;
  font-size: var(--text-sm);
  letter-spacing: 0.02em;
}

/* Body face doing label duty — uppercase + tracking, not a third family. */
.label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.skip {
  position: absolute;
  inset-inline-start: -9999px;
}

.skip:focus {
  inset-inline-start: var(--space-md);
  inset-block-start: var(--space-md);
  z-index: var(--z-sticky);
  background: var(--color-paper-2);
  color: var(--color-ink);
  padding: var(--space-sm) var(--space-md);
}

/* ============================================================
   N6 · Masthead, adapted as a workshop nameplate
   ============================================================ */

.mast {
  display: grid;
  gap: var(--space-2xs);
  justify-items: center;
  text-align: center;
  padding-block: var(--space-lg) 0;
}

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

.mast__name {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.05;
  font-size: clamp(1.75rem, 4.5vw, 2.9rem);
  letter-spacing: 0.01em;
  margin: 0;
}

.mast__nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  /* Row-gap 0: the 44 px min-height on each link already gives the tap target,
     so a wrapped second row reads as one nav block, not two stray rows. */
  gap: 0 var(--space-lg);
  list-style: none;
  margin: var(--space-xs) 0 0;
  padding: 0;
}

.mast__nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  white-space: nowrap;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-muted);
  border-block-end: var(--rule-hair) solid transparent;
  transition: color var(--dur-micro) var(--ease-out),
    border-color var(--dur-micro) var(--ease-out);
}

.mast__nav a:hover,
.mast__nav a:focus-visible {
  color: var(--color-ink);
  border-block-end-color: var(--color-accent);
}

.mast__nav a:active {
  color: var(--color-accent);
}

.mast__rule {
  border: 0;
  border-block-start: var(--rule-hair) solid var(--color-rule);
  border-block-end: var(--rule-hair) solid var(--color-rule);
  height: var(--space-2xs);
  width: 100%;
  margin: var(--space-md) 0 0;
}

/* ============================================================
   H2 · Hero split diptych — 7/5, text left, photo right
   ============================================================ */

.hero {
  display: grid;
  gap: var(--space-xl);
  padding-block: var(--space-2xl) var(--space-3xl);
  align-items: center;
}

@media (min-width: 60rem) {
  .hero {
    /* minmax(0, …) — the track holds an image; bare fr blows the layout out. */
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: var(--space-2xl);
    padding-block: var(--space-3xl) var(--space-4xl);
  }
}

.hero__display {
  font-size: var(--text-display);
  line-height: 1.02;
  letter-spacing: -0.005em;
}

.hero__lede {
  max-width: 48ch;
  margin-block-start: var(--space-lg);
  font-size: var(--text-md);
  line-height: 1.5;
  color: var(--color-muted);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md) var(--space-lg);
  margin-block-start: var(--space-xl);
}

.hero__figure img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: var(--rule-hair) solid var(--color-rule);
}

/* ============================================================
   C1 · Outlined chip + typographic link
   ============================================================ */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  min-height: 48px;
  padding: var(--space-sm) var(--space-lg);
  border: var(--rule-slab) solid var(--color-accent);
  color: var(--color-ink);
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-decoration: none;
  white-space: nowrap;
  background-color: transparent;
  transition: background-color var(--dur-micro) var(--ease-out),
    transform var(--dur-micro) var(--ease-out);
}

.chip:hover,
.chip:focus-visible {
  background-color: var(--color-accent-quiet);
}

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

.chip[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
  border-color: var(--color-rule);
}

.link-t {
  color: var(--color-ink);
  text-decoration: none;
  white-space: nowrap;
  border-block-end: var(--rule-hair) solid var(--color-neutral);
  padding-block-end: var(--space-3xs);
  transition: border-color var(--dur-micro) var(--ease-out);
}

.link-t:hover,
.link-t:focus-visible {
  border-block-end-color: var(--color-accent);
}

.link-t:active {
  color: var(--color-accent);
}

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

/* ============================================================
   S2 · Hanging section heads — single column, no eyebrows
   ============================================================ */

.section {
  padding-block: var(--space-3xl);
  border-block-start: var(--rule-hair) solid var(--color-rule);
}

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

/* Single column, always. No tag-left / heading-right head anywhere on this page. */
.head {
  display: block;
  max-width: 58ch;
  margin-block-end: var(--space-2xl);
}

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

.head p {
  margin-block-start: var(--space-md);
  color: var(--color-muted);
  max-width: 56ch;
}

/* ============================================================
   F6 · Work grid — irregular spans, no micro-action
   ============================================================ */

.work {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-lg);
}

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

  .work__item:first-child {
    grid-column: span 2;
  }
}

@media (min-width: 60rem) {
  .work {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: var(--space-xl) var(--space-lg);
  }

  .work__item {
    grid-column: span 2;
  }

  .work__item:nth-child(1),
  .work__item:nth-child(2) {
    grid-column: span 3;
  }
}

.work__item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: var(--rule-hair) solid var(--color-rule);
  transition: border-color var(--dur-short) var(--ease-out);
}

@media (min-width: 60rem) {
  .work__item:nth-child(1) img,
  .work__item:nth-child(2) img {
    aspect-ratio: 16 / 9;
  }
}

@media (hover: hover) and (pointer: fine) {
  .work__item:hover img {
    border-color: var(--color-accent);
  }
}

.work__name {
  margin-block-start: var(--space-md);
  font-size: var(--text-md);
}

/* ============================================================
   F4 · Step sequence — vertical stack, stage number above title
   ============================================================ */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-xl);
}

@media (min-width: 60rem) {
  .steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-lg);
  }
}

.step {
  /* Stage number sits directly ABOVE the heading, same column.
     Never a two-column tag-left / heading-right head (gate 54). */
  border-block-start: var(--rule-slab) solid var(--color-rule);
  padding-block-start: var(--space-md);
}

.step:first-child {
  border-block-start-color: var(--color-accent);
}

/* Outlier face · slot 2 of 2 — stage numerals. */
.step__stage {
  display: block;
  font-family: var(--font-outlier);
  font-variant-numeric: tabular-nums;
  font-size: var(--text-sm);
  letter-spacing: 0.1em;
  color: var(--color-accent);
}

.step h3 {
  margin-block-start: var(--space-xs);
  font-size: var(--text-lg);
}

.step p {
  margin-block-start: var(--space-sm);
  color: var(--color-muted);
  max-width: 36ch;
}

/* ============================================================
   F3 · Tabular spec sheet — 2 columns, rule every row
   ============================================================ */

.spec {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  text-align: start;
}

.spec th,
.spec td {
  padding-block: var(--space-md);
  padding-inline: 0 var(--space-lg);
  border-block-end: var(--rule-hair) solid var(--color-rule);
  vertical-align: baseline;
  text-align: start;
}

.spec th {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-neutral);
  white-space: nowrap;
  width: 1%;
}

.spec td {
  color: var(--color-ink);
}

.spec td:last-child {
  padding-inline-end: 0;
}

/* Small screens: the two-column table becomes stacked pairs. */
@media (max-width: 40rem) {
  .spec th,
  .spec td {
    display: block;
    width: auto;
    padding-inline-end: 0;
  }

  .spec th {
    border-block-end: 0;
    padding-block: var(--space-md) var(--space-3xs);
  }

  .spec td {
    padding-block: 0 var(--space-md);
  }
}

/* ============================================================
   Contact
   ============================================================ */

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

@media (min-width: 60rem) {
  .contact {
    /* minmax(0, …) — right track holds an image. */
    grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
    gap: var(--space-2xl);
    align-items: start;
  }
}

.contact__list {
  margin: 0;
  display: grid;
  gap: var(--space-lg);
}

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

.contact__list dd {
  margin: var(--space-2xs) 0 0;
  font-size: var(--text-md);
  line-height: 1.45;
}

.contact__figure img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border: var(--rule-hair) solid var(--color-rule);
}

.contact__cta {
  margin-block-start: var(--space-xl);
}

/* ============================================================
   Ft4 · Dense typographic colophon
   ============================================================ */

.colophon {
  border-block-start: var(--rule-hair) solid var(--color-rule);
  padding-block: var(--space-xl) var(--space-2xl);
}

.colophon p {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  line-height: 1.9;
  color: var(--color-neutral);
  max-width: 74ch;
}

.colophon a {
  color: var(--color-muted);
  text-decoration-color: var(--color-neutral);
  text-underline-offset: 3px;
  white-space: nowrap;
  transition: color var(--dur-micro) var(--ease-out),
    text-decoration-color var(--dur-micro) var(--ease-out);
}

.colophon a:hover,
.colophon a:focus-visible {
  color: var(--color-ink);
  text-decoration-color: var(--color-accent);
}

.colophon a:active {
  color: var(--color-accent);
}

/* ============================================================
   Reduced motion
   ============================================================ */

@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;
  }
}
