/* ==========================================================================
   Tapetech UK Ltd · product pages · option 1 "Signal Blue"
   The logo's royal blue as flat fields, white for the photographs,
   and the logo's red level-meter bars as the one sharp accent.
   ========================================================================== */

/* ---- Tokens ------------------------------------------------------------ */
:root {
  /* palette: blue and red sampled from assets/img/logo.png */
  --blue: #2754ad;            /* logo wordmark: fields, tiles, headings */
  --red: #ee242c;             /* logo level bars: graphics only */
  --red-text: #cf1f27;        /* red as text or outline on white (5.4:1) */
  --ink: #131d33;             /* body text on white (16:1) */
  --ink-soft: #49546b;        /* secondary text on white (7.6:1) */
  --line: #d3dbea;            /* hairlines on white */
  --white: #ffffff;
  --on-blue: #ffffff;         /* text on blue (7.1:1) */
  --on-blue-soft: #d2ddf4;    /* quieter text on blue (5.2:1) */

  /* type */
  --font-display: "Exo 2", "Trebuchet MS", "Segoe UI", Arial, sans-serif;
  --font-text: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;

  /* spacing scale */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4rem;
  --s-9: 6rem;

  /* layout */
  --max: 80rem;                              /* 1280px content width */
  --gutter: clamp(1rem, 5vw, 5rem);          /* page side margin */
  --col-gap: clamp(1rem, 2.4vw, 2rem);
  --section: clamp(4rem, 8vw, 7rem);         /* vertical rhythm between bands */
  --overlap: clamp(3rem, 7vw, 6rem);         /* how far the hero photo hangs below the blue */

  --focus: var(--blue);
}

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

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

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  line-height: 1.55;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }

a { color: inherit; }

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

.wrap {
  width: min(var(--max), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

.nowrap { white-space: nowrap; }

.skip {
  position: absolute;
  top: var(--s-2);
  left: var(--s-2);
  z-index: 10;
  padding: var(--s-2) var(--s-4);
  background: var(--blue);
  color: var(--on-blue);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}
.skip:focus-visible {
  transform: none;
  --focus: var(--red-text);
}

/* ---- Level meter: the logo's red bars --------------------------------- */
.meter { fill: var(--red); stroke: var(--red); }
.meter rect { stroke: none; }
.meter line {
  stroke-width: 7px;
  stroke-linecap: butt;
  vector-effect: non-scaling-stroke;
}

/* ---- Header ------------------------------------------------------------ */
.site-header { background: var(--white); }

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  column-gap: var(--s-6);
  row-gap: var(--s-2);
  padding-block: var(--s-3);
}

/* the logo artwork is a white oval; pulling it left by the oval's margin
   (73px of its 247px height) sets the wordmark on the page's left edge */
.brand img,
.site-footer img {
  flex: none;
  width: auto;
  max-width: none;               /* keep the artwork's own proportions */
  height: var(--logo-h);
  margin-left: calc(var(--logo-h) * -0.2955);
}
.brand img { --logo-h: clamp(3rem, 2.2rem + 2.2vw, 4.625rem); }
/* the header logo links to the first product page, the site's front page for now */
.brand { display: block; flex: none; }

.nav {
  display: flex;
  gap: clamp(1.25rem, 3vw, 2.75rem);
}

.nav a {
  position: relative;
  display: block;
  padding-block: var(--s-3);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
  text-decoration: none;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.25rem;
  height: 3px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
}

.nav a:hover { color: var(--blue); }
.nav a:hover::after { transform: scaleX(1); background: var(--line); }

.nav a[aria-current="page"] { color: var(--blue); }
.nav a[aria-current="page"]::after { transform: scaleX(1); background: var(--red); }

/* ---- Hero: blue band, photo panel overlapping its lower edge ---------- */
.hero {
  --focus: var(--white);
  background: var(--blue);
  color: var(--on-blue);
  padding-top: clamp(2.5rem, 5vw, 4.5rem);
  padding-bottom: var(--s-7);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  column-gap: var(--col-gap);
  row-gap: clamp(2rem, 4vw, 3rem);
  align-items: start;
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.125rem, 1rem + 5.2vw, 3.75rem);
  font-weight: 800;
  font-style: italic;
  line-height: 0.98;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.hero__meter {
  width: auto;
  height: clamp(2rem, 1.6rem + 1.4vw, 3rem);
  margin-top: clamp(1.25rem, 2.2vw, 1.75rem);
}

.hero__sub {
  margin-top: clamp(1.75rem, 3.5vw, 2.75rem);
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1.15rem + 1.2vw, 2rem);
  font-weight: 700;
  font-style: italic;
  line-height: 1.12;
  text-wrap: balance;
}

/* the "Cleans …" line is set exactly like the line above it */
.hero__sub.hero__cleans { margin-top: 0.45em; }

/* below desktop the white panel runs edge to edge, so the photo is as large
   as the screen allows; from desktop up it is a panel with a hairline edge,
   laid over the lower edge of the blue band */
.hero__photo {
  margin-inline: calc(-1 * var(--gutter));
  margin-bottom: calc(-1 * (var(--overlap) + var(--s-7)));
  padding: clamp(0.5rem, 2vw, 1rem);
  background: var(--white);
}
.hero__photo img { width: 100%; }

/* ---- Specifications band ---------------------------------------------- */
.specs {
  padding-top: calc(var(--overlap) + clamp(3rem, 5vw, 4.5rem));
  padding-bottom: clamp(3rem, 6vw, 5rem);
}

.specs__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
  row-gap: var(--s-8);
}

/* both halves are flex columns; the ruled list stretches to fill its half,
   the format tiles stay compact at the top of theirs */
.formats,
.features {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 1.35rem + 1.5vw, 2.5rem);
  font-weight: 800;
  font-style: italic;
  line-height: 1.05;
  color: var(--blue);
  margin-bottom: clamp(1.25rem, 2.4vw, 1.75rem);
}

/* format tiles: one line each ("NAB hubs: 2", 1", ½", ¼""), kept compact */
.tiles {
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-rows: 1fr;
  align-content: start;
  gap: var(--s-3);
}

.tile {
  display: flex;
  align-items: center;
  padding: clamp(0.625rem, 1.1vw, 0.875rem) clamp(1rem, 2vw, 1.5rem);
  background: var(--blue);
  color: var(--on-blue);
}

.tile__spec {
  font-family: var(--font-display);
  font-size: clamp(1.125rem, 0.95rem + 0.7vw, 1.5rem);
  font-style: italic;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.005em;
}

/* the sizes never break apart; the line may wrap after "NAB hubs:" on a narrow tile */
.tile__sizes { white-space: nowrap; }

/* feature list: two columns of ruled rows, each row as tall as its text */
.feature-list {
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  column-gap: var(--col-gap);
}

.feature-list li {
  display: flex;
  align-items: center;
  padding-block: clamp(0.5rem, 0.4rem + 0.4vw, 0.75rem);
  border-bottom: 1px solid var(--line);
  font-size: clamp(1.0625rem, 1rem + 0.2vw, 1.1875rem);
  line-height: 1.35;
}
.feature-list li:first-child { border-top: 1px solid var(--line); }

.fig {
  white-space: nowrap;
  font-weight: 700;
}

/* ---- Divider: a full-width level meter -------------------------------- */
.divider { padding-bottom: clamp(1rem, 3vw, 2.5rem); }
.divider svg {
  width: 100%;
  height: clamp(2.5rem, 2rem + 2vw, 4rem);
}

/* ---- Second photograph: a wide white band ----------------------------- */
.showcase { padding-bottom: clamp(2rem, 5vw, 4rem); }
.showcase img {
  width: min(100%, 56rem);
  max-height: 90vh;              /* the whole machine stays in view on short screens */
  object-fit: contain;
  margin-inline: auto;
}

/* ---- Contact: blue band ----------------------------------------------- */
.contact {
  --focus: var(--white);
  background: var(--blue);
  color: var(--on-blue);
  padding-block: clamp(2.75rem, 5vw, 4.5rem);
}

.contact__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
  row-gap: var(--s-5);
  align-items: end;
  align-items: last baseline;    /* heading and email share a baseline */
}

.contact__title {
  grid-column: 1 / -1;
  font-family: var(--font-display);
  font-size: clamp(1.625rem, 1.3rem + 1.2vw, 2.25rem);
  font-weight: 800;
  font-style: italic;
  line-height: 1;
}

.contact__line {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s-2);
}

.contact__label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--on-blue-soft);
}

/* set in the plain text face so the address is easy to read and copy */
.contact__email {
  font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem);
  font-weight: 600;
  line-height: 1.3;
  color: var(--on-blue);
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
  text-decoration-color: var(--on-blue-soft);
  overflow-wrap: anywhere;
}
.contact__email:hover { text-decoration-color: var(--on-blue); }

/* ---- Text pages (privacy.html) ---------------------------------------- */
.prose {
  padding-block: clamp(2.5rem, 5vw, 4rem) clamp(3rem, 6vw, 5rem);
}
.prose > * { max-width: 46rem; }
.prose p,
.prose ul { margin-top: var(--s-4); }
.prose h2 {
  margin-top: clamp(2rem, 4vw, 2.75rem);
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 1.2rem + 0.7vw, 1.75rem);
  font-weight: 800;
  font-style: italic;
  line-height: 1.15;
  color: var(--blue);
}
.prose h2:first-child { margin-top: 0; }
.prose ul { padding-left: 1.25em; list-style: disc; }
.prose li + li { margin-top: var(--s-2); }
.prose li::marker { color: var(--red); }
.prose a { color: var(--blue); text-underline-offset: 0.2em; }
.prose code { font-size: 0.9em; overflow-wrap: anywhere; }
.prose .updated { margin-top: 0; color: var(--ink-soft); font-size: 0.9375rem; }

.hero--plain { padding-bottom: clamp(2.5rem, 5vw, 4rem); }
.hero--plain .hero__title { text-transform: uppercase; }

/* ---- Footer ------------------------------------------------------------ */
.site-footer { padding-block: var(--s-6); }

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4) var(--s-6);
}

.site-footer img { --logo-h: 3.25rem; }

.site-footer__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s-2) var(--s-6);
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-5);
}

.site-footer__links a,
.site-footer__links button {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 0.2em;
  cursor: pointer;
}
.site-footer__links a:hover,
.site-footer__links button:hover { color: var(--blue); text-decoration-color: currentColor; }

/* ---- Cookie banner (markup before </body>, shown by assets/js/analytics.js) - */
/* a plain bar at the foot of the screen; Accept and Reject look the same,
   so saying no is as easy as saying yes. The page gets room at the bottom
   while it shows, so it never hides the footer. */
body { padding-bottom: var(--consent-space, 0px); }

.consent {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 20;
  background: var(--white);
  border-top: 3px solid var(--blue);
  box-shadow: 0 -0.5rem 1.5rem rgb(19 29 51 / 0.12);
  padding-block: var(--s-4);
}
.consent[hidden] { display: none; }

.consent__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3) var(--s-6);
}

.consent__text {
  flex: 1 1 28rem;
  font-size: 0.9375rem;
  line-height: 1.5;
}
.consent__text a { color: var(--blue); font-weight: 600; text-underline-offset: 0.2em; }

.consent__actions {
  display: flex;
  gap: var(--s-3);
}

.consent__button {
  min-width: 7.5rem;
  min-height: 2.75rem;
  padding: var(--s-2) var(--s-5);
  border: 2px solid var(--blue);
  border-radius: 0;
  background: var(--blue);
  color: var(--on-blue);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.consent__button:hover { background: #1f4590; border-color: #1f4590; }

/* ---- Layout: tablet and up -------------------------------------------- */
@media (min-width: 48em) {
  .tiles { grid-template-columns: 1fr 1fr; column-gap: var(--col-gap); }

  /* two columns of four rows, read top to bottom */
  .feature-list {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: repeat(4, auto);
    grid-auto-flow: column;
  }
  /* eight features split 4 + 4: rule the top of the second column too */
  .feature-list li:nth-child(5):nth-last-child(4) { border-top: 1px solid var(--line); }
  /* an odd count (the rewinder's seven): the first, headline spec runs across
     both columns and the rest split 3 + 3, so no cell is left empty */
  .feature-list li:first-child:nth-last-child(odd) { grid-column: 1 / -1; }
}

/* ---- Layout: desktop -------------------------------------------------- */
@media (min-width: 64em) {
  /* text 1 part, photo 2.7 parts: the photo is about 30% wider than in the
     earlier 5/7 split, and the text sizes itself to its narrower column */
  .hero__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 2.7fr); }
  .hero__text { grid-column: 1; align-self: center; container-type: inline-size; }
  /* sized so the longest word ("REWINDER/") fits the column; plain greedy
     wrapping gives OPEN REEL / TAPE / CLEANER rather than a lone OPEN */
  .hero__title {
    font-size: min(3.55rem, 3.95vw);   /* fallback without container units: stays under 17% of the column */
    font-size: min(3.875rem, 17cqi);
    text-wrap: wrap;
  }
  .hero__title .nowrap { white-space: normal; }
  .hero__sub { font-size: min(2rem, 11cqi); }
  .hero__photo {
    grid-column: 2;
    margin-inline: 0;
    padding: clamp(0.75rem, 1.2vw, 1.25rem);
    border: 1px solid var(--line);
  }

  .contact__title { grid-column: 1 / span 5; }
  .contact__line { grid-column: 6 / -1; }
}

/* ---- Layout: wide ----------------------------------------------------- */
/* the format tiles beside the list only once the list's two columns are wide
   enough for every feature (the longest is the rewinder's "Adjustable wind
   tension (25–450 g / 1–16 oz)") to hold one line; below this the tiles sit
   side by side above the list. The one-line tiles need only a third of the row. */
@media (min-width: 90em) {
  .formats { grid-column: 1 / span 4; }
  .features { grid-column: 5 / -1; }
  .tiles { grid-template-columns: 1fr; }
  .feature-list li { font-size: 1.0625rem; }
}

/* ---- Small screens ---------------------------------------------------- */
@media (max-width: 37.4375em) {
  .consent__actions { flex: 1 1 100%; }
  .consent__button { flex: 1; }

  .site-header__inner { padding-block: var(--s-3) 0; }
  .site-header nav { flex: 1 1 100%; }
  .nav { justify-content: space-between; gap: var(--s-4); }
  .nav a { font-size: 0.9375rem; }

  .divider line { stroke-width: 4px; }
  .divider line:nth-child(even) { display: none; }
}

/* ---- Motion: the hero meter settles once, like a needle on power-up --- */
@media (prefers-reduced-motion: no-preference) {
  .hero__meter rect {
    transform-box: fill-box;
    transform-origin: center;
    animation: level 1.6s cubic-bezier(0.3, 0.6, 0.3, 1) 0.15s both;
  }
  .hero__meter rect:nth-child(3n + 2) { animation-delay: 0.3s; animation-duration: 1.9s; }
  .hero__meter rect:nth-child(3n) { animation-delay: 0.45s; animation-duration: 1.7s; }
  .hero__meter rect:nth-child(4n) { animation-delay: 0.6s; }

  html { scroll-behavior: smooth; }
  .nav a::after { transition: transform 0.2s ease-out; }
}

@keyframes level {
  0% { transform: scaleY(0.12); }
  35% { transform: scaleY(1.08); }
  55% { transform: scaleY(0.72); }
  75% { transform: scaleY(0.96); }
  100% { transform: scaleY(1); }
}

/* ---- Print ------------------------------------------------------------ */
@media print {
  :root { --section: 1.5rem; --overlap: 0rem; }
  body { font-size: 11pt; color: #000; }
  .skip, .site-header nav, .meter, .divider, .consent, .site-footer__links { display: none; }
  .hero, .contact { background: none; color: #000; padding-block: 1rem; }
  .contact__label, .contact__email, .tile, .tile__kind { color: #000; }
  .hero__photo { margin: 0; padding: 0; border: 0; }
  .hero__photo img, .showcase img { width: 60%; }
  .tile { background: none; border: 1pt solid #000; }
  .section-title { color: #000; }
  .tile, .feature-list li, .showcase, .contact { break-inside: avoid; }
  .section-title { break-after: avoid; }
}
