/* Henriksen Design
   Less, but better. One stylesheet, no framework.
   Catalogue layout: a tight grid of flat tiles, small monospace labels, one orange. */

@font-face {
  font-family: "Inter";
  src: url("assets/fonts/inter-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Wordmark only: Albert Sans 600, cut down to a–z and space (about 2 KB). */
@font-face {
  font-family: "Albert Sans Wordmark";
  src: url("assets/fonts/albert-sans-wordmark-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Plex Mono";
  src: url("assets/fonts/plex-mono-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Colour */
  --bg: #F4F2EE;           /* warm off-white page */
  --tile: #E9E7E2;         /* flat tile, one step darker than the page */
  --tile-deep: #DFDCD6;    /* image wells inside tiles */
  --ink: #1E1E1E;          /* charcoal */
  --grey: #5E5E5A;         /* small labels: 5.8:1 on --bg, 5.3:1 on --tile */
  --line: #D2D0CA;         /* hairlines */
  --accent: #E2581F;       /* Braun orange: wordmark dot, focus rings, step numbers, starter mark */
  --accent-fill: #BF4515;  /* same orange, one step deeper, so button text passes AA (4.6:1) */
  --accent-fill-hover: #A33A12;

  /* Type */
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --wordmark: "Albert Sans Wordmark", var(--sans);
  --mono: "Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --step--2: 0.8125rem;    /* 13px mono labels */
  --step--1: 0.9375rem;
  --step-0: 1rem;
  --step-1: clamp(1.125rem, 1.07rem + 0.25vw, 1.3125rem);
  --step-2: clamp(1.5rem, 1.3rem + 0.9vw, 2.125rem);
  --step-3: clamp(1.875rem, 1.5rem + 1.7vw, 3rem);
  --step-4: clamp(2.75rem, 1.8rem + 4.2vw, 6rem);

  /* Space */
  --margin: clamp(1rem, 0.6rem + 1.8vw, 2.5rem);
  --gap: 0.5rem;           /* between tiles */
  --pad: clamp(1rem, 0.85rem + 0.6vw, 1.5rem); /* inside tiles */
  --section: clamp(3.5rem, 2.5rem + 4.5vw, 7rem);
  --measure: 62ch;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-0);
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p, ul, ol, dl, dd {
  margin: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

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

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

.mono {
  font-family: var(--mono);
  font-size: var(--step--2);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
  text-transform: lowercase;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link */

.skip-link {
  position: absolute;
  left: var(--margin);
  top: 0.75rem;
  z-index: 10;
  padding: 0.5rem 0.75rem;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
  transform: translateY(-200%);
}

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

/* Frame */

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

/* Header */

.site-header {
  border-bottom: 1px solid var(--line);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.5rem;
}

.wordmark {
  font-family: var(--wordmark);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  text-decoration: none;
  white-space: nowrap;
}

.wordmark-dot,
.starter-dot {
  display: inline-block;
  width: 0.42em;
  height: 0.42em;
  margin-left: 0.14em;
  border-radius: 50%;
  background: var(--accent);
}

.nav-list {
  display: flex;
  gap: 1.5rem;
}

.nav-list a {
  display: inline-block;
  padding-block: 0.75rem;
  text-decoration: none;
}

.nav-list a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

/* Sections */

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

.section + .section {
  border-top: 1px solid var(--line);
}

.section-label {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  color: var(--grey);
}

.section-label span {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.label,
.note {
  color: var(--grey);
  max-width: var(--measure);
}

.note {
  margin-top: 1rem;
}

.heading {
  font-size: var(--step-3);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.intro {
  max-width: var(--measure);
  margin-top: 1rem;
  font-size: var(--step-1);
  line-height: 1.45;
}

/* Opening */

.opening {
  padding-block: calc(var(--section) * 0.9) var(--section);
}

.display {
  margin-top: 1.25rem;
  max-width: 16ch;
  font-size: var(--step-4);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
}

.lead {
  margin-top: 1.5rem;
  max-width: 38ch;
  font-size: var(--step-1);
  line-height: 1.45;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.75rem;
  margin-top: 2rem;
}

.button {
  display: inline-block;
  padding: 0.85rem 1.25rem;
  border-radius: 2px;
  background: var(--accent-fill);
  color: var(--bg);
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
}

.button:hover {
  background: var(--accent-fill-hover);
}

.text-link {
  padding-block: 0.75rem;
}

/* Spec strip: four small tiles of facts under the opening */

.specs {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--gap);
  margin-top: clamp(2.5rem, 2rem + 2vw, 4rem);
}

.specs > div {
  padding: 0.75rem var(--pad) 0.875rem;
  background: var(--tile);
  border-radius: 2px;
}

.specs dt {
  color: var(--grey);
}

.specs dd {
  color: var(--ink);
}

/* Principle */

.statement {
  font-size: var(--step-4);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
}

.principle .body {
  margin-top: 1.75rem;
  max-width: 46ch;
  font-size: var(--step-1);
  line-height: 1.5;
}

/* Tiles */

.tiles {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--gap);
  margin-top: clamp(2rem, 1.6rem + 1.6vw, 3rem);
}

.tile {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: var(--pad);
  background: var(--tile);
  border-radius: 2px;
}

.tile-code {
  color: var(--grey);
  font-variant-numeric: tabular-nums;
}

.tile-title {
  margin-top: 0.75rem;
  font-size: var(--step-1);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.tile-desc {
  margin-top: 0.5rem;
  font-size: var(--step--1);
  line-height: 1.5;
}

/* Sound familiar: three common starting points */

.problem-link {
  margin-top: auto;
  padding-top: 1.5rem;
}

/* Services */

.price {
  margin-top: auto;
  padding-top: 1.75rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.price-figure {
  font-size: var(--step-2);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.price-unit {
  font-size: var(--step--1);
  font-weight: 400;
  letter-spacing: 0;
  color: var(--grey);
}

.starter {
  margin-top: clamp(2rem, 1.6rem + 1.6vw, 3rem);
  border-left: 2px solid var(--accent);
}

/* The starter set now leads, so the grid below sits one gap under it */
.starter + .services {
  margin-top: var(--gap);
}

.founding {
  border-left: 2px solid var(--accent);
}

.founding .tile-desc {
  max-width: var(--measure);
}

.starter .tile-code {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.starter .tile-desc {
  max-width: var(--measure);
}

.starter .price {
  padding-top: 1rem;
}

/* The note sits between the service grid and the starter tile */
.services + .note {
  margin-block: 1rem 1.5rem;
}

/* Work */

.card picture {
  margin: calc(var(--pad) * -1) calc(var(--pad) * -1) var(--pad);
}

.card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--tile-deep);
}

/* How we work */

.step-num {
  color: var(--accent);
  /* Kept at 24px or larger so the orange counts as large text (3:1 on the tile). */
  font-size: 1.75rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.step .tile-title {
  margin-top: 1rem;
}

/* Contact */

.contact-tile dd {
  margin-top: 2.5rem;
}

.contact-alt {
  margin-top: 0.75rem;
}

.contact-link {
  display: inline-block;
  font-size: var(--step-2);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--grey);
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  padding-block: 1.5rem;
}

/* Placeholders: visible on purpose, so nothing unfinished goes live unnoticed */

.ph {
  display: inline-block;
  padding: 0 0.35em;
  outline: 1px dashed var(--grey);
  outline-offset: -1px;
  color: var(--grey);
  text-transform: none;
}

/* Offer clips: a small "see it" label on each offer; the whole tile is the target */

.has-clip {
  position: relative;
  cursor: pointer;
}

.clip-link {
  /* Sits on the same line as the tile code, at the right */
  align-self: flex-end;
  margin-top: -1.5em;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  color: var(--ink);
  text-decoration: none;
}

/* A small play mark, drawn in CSS */
.clip-link::before {
  content: "";
  width: 0;
  height: 0;
  border-block: 0.32em solid transparent;
  border-left: 0.52em solid var(--accent);
}

/* Stretch the link over the tile so a click anywhere on the offer opens it */
.clip-link::after {
  content: "";
  position: absolute;
  inset: 0;
}

.has-clip:hover .clip-link {
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.has-clip:hover {
  background: var(--tile-deep);
}

.clip-link:focus-visible {
  outline: none;
}

.clip-link:focus-visible::after {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.clip-dialog {
  width: min(60rem, calc(100vw - 2 * var(--margin)));
  max-height: calc(100dvh - 2 * var(--margin));
  padding: var(--pad);
  border: 0;
  border-radius: 2px;
  background: var(--bg);
  color: var(--ink);
}

.clip-dialog::backdrop {
  background: rgb(30 30 30 / 0.55);
}

.clip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.clip-close {
  padding: 0.5rem 0;
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.clip-dialog .tile-title {
  margin-top: 0;
}

.clip-video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  margin-top: 1rem;
  background: var(--tile);
  border-radius: 2px;
}

.clip-dialog .tile-desc {
  margin-top: 1rem;
  max-width: var(--measure);
}

/* Tablet and up */

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

  .services,
  .work,
  .contact-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .problems {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Five steps in two columns: the last one spans the row instead of sitting alone */
  .step:last-child {
    grid-column: 1 / -1;
  }

  .service {
    min-height: 17rem;
  }

  .step .tile-title {
    margin-top: 2rem;
  }
}

/* Desktop */

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

  .steps {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .step:last-child {
    grid-column: auto;
  }

  .step {
    min-height: 15rem;
  }
}

/* Scroll motion (motion.js). Only applies once the script has added .motion,
   so without script, or with reduced motion, nothing is ever hidden. */

.motion {
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

.motion .reveal:not(.kinetic),
.motion .reveal-group > * {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 620ms var(--ease-out), transform 620ms var(--ease-out);
}

.motion .reveal.is-in,
.motion .reveal-group.is-in > * {
  opacity: 1;
  transform: none;
}

/* Headline words rise from behind a mask. The mask leaves room for descenders. */
.kinetic .word {
  display: inline-block;
  overflow: hidden;
  padding-bottom: 0.12em;
  margin-bottom: -0.12em;
  vertical-align: top;
}

.kinetic .word > span {
  display: inline-block;
  transform: translateY(105%);
  transition: transform 820ms var(--ease-out);
}

.kinetic.is-in .word > span {
  transform: none;
}

/* How we work: a thin orange rule fills across each step, driven by scroll. */
.gauge .step {
  position: relative;
}

.gauge .step::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(var(--fill, 0));
  transform-origin: left;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .skip-link,
  .site-header nav {
    display: none;
  }
}

/* Running text on plain pages (privacy) */

.prose > * + * {
  margin-top: 1em;
}

.body {
  max-width: var(--measure);
  margin-top: 1.25rem;
}

.label + .heading {
  margin-top: 1.25rem;
}
