/* Extension of the approved editorial shell. The header-menu and robot stay intact. */
:root {
  --stage-bottom: calc((100svh - var(--ph)) / 2);
  --control-ease: cubic-bezier(.16, 1, .3, 1);
}
::selection { background: var(--royal-900); color: var(--white); }
a, button, summary { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--royal-700);
  outline-offset: 5px;
}

/* Every desktop scene ends on the same datum. */
.panel--hero { padding-bottom: var(--stage-bottom); }
.hero-title { letter-spacing: -.04em; font-weight: 750; line-height: .98; }
.hero-body { padding-bottom: 0; line-height: 1.45; }
.hero-subtitle {
  margin: 0 0 .65em;
  font-size: clamp(24px, 2.15vw, 40px);
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: -.025em;
}
.set {
  align-items: flex-end;
  padding-bottom: var(--stage-bottom);
}
.set-head { min-height: var(--ph); height: auto; }
.set-title { margin-top: 0; letter-spacing: -.035em; }
.set-meta { margin-bottom: 0; }
.set-line { line-height: 1.45; }
.plates { align-items: flex-end; }
.set--fair { gap: var(--m); }
.fair-story { display: flex; align-items: flex-end; gap: var(--m); }
.robot-arm { margin-block-end: 0; }
.plate-label { padding: 1em; text-align: center; }

@media (min-width: 900px) and (min-aspect-ratio: 1/1) and (min-height: 520px) {
  :root {
    --text-image-gap: clamp(24px, 2.5vw, 64px);
    --section-space: calc(var(--text-image-gap) * 2);
  }
  .panel--hero {
    /* Preserve the opening H1 width, but remove the unused space after its
       companion copy: the following photo belongs to that copy's section. */
    width: max-content;
    grid-template-columns:
      calc(100vw - var(--side-inset) - var(--side-w) - 2 * var(--m) - 4 * var(--g) - max(14em, 20vw))
      min(max(14em, 20vw), calc(19 * var(--fs-m)));
    column-gap: var(--section-space);
    padding-right: 0;
  }
  .set { gap: var(--text-image-gap); margin-left: var(--section-space); padding-right: 0; }
  .set--fair { gap: var(--section-space); margin-left: var(--text-image-gap); }
  .fair-story, .plates { gap: var(--text-image-gap); }
  .track > .panel--brands { margin-left: var(--section-space); }
  .hero-body {
    min-height: var(--ph);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.5em;
  }
  .hero-subtitle { margin-bottom: 0; }
  /* Flatten only the desktop row so the original live robot can close the fair
     sequence immediately before the shop, without changing the mobile DOM. */
  .set--fair > .plates { display: contents; }
  .set--fair > .fair-story { order: 1; }
  .set--fair > .plates > .robot-arm { order: 2; }
}

/* Contact details belong to the fixed black header, never a floating card. */
.side-contact:not([open]) > .side-contact__body { display: none; }
.sidebar { color: var(--white); }
.side-brand {
  margin-top: clamp(16px, 2.5svh, 30px);
  font-size: clamp(24px, 2.2vw, 38px);
  font-weight: 650;
  line-height: 1;
  letter-spacing: -.035em;
}
.side-contact { width: 86%; margin-top: clamp(28px, 5svh, 56px); text-align: center; }
.side-contact summary { display: none; }
.side-contact__body {
  font-size: clamp(13px, .98vw, 18px);
  font-style: normal;
  line-height: 1.6;
  letter-spacing: -.01em;
  display: grid;
  justify-items: center;
}
.side-contact__body a { display: block; width: fit-content; text-decoration: none; }
.side-contact__body > a { font-size: clamp(15px, 1.08vw, 20px); font-weight: 500; }
.side-contact__body p { color: color-mix(in oklab, var(--white) 75%, var(--ink-2)); }
.side-contact__body a:hover { color: var(--royal-300); }
.side-contact__body a:active { opacity: .7; }
.side-contact__body a:focus-visible { outline-color: var(--royal-300); }
.side-contact__body .contact-fair-link { display: none; }
.side-phones { display: grid; justify-items: center; gap: .3em; margin-block: 1.4em; font-variant-numeric: tabular-nums; }

/* Fixed chrome: script control is deliberately the highest page layer. */
.script-switch {
  position: fixed;
  z-index: 300;
  top: clamp(8px, 1.1vw, 22px);
  left: calc(var(--side-w) + var(--m));
  display: inline-flex;
  align-items: center;
  gap: .1em;
  background: var(--paper);
  color: var(--ink);
  line-height: 1;
  font-size: clamp(13px, .95vw, 18px);
}
.script-switch button {
  min-height: 44px;
  min-width: 44px;
  padding: .6em .45em;
  background: none;
  border: 0;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color 160ms var(--control-ease), transform 160ms var(--control-ease);
}
.script-switch button[aria-pressed="true"] { color: var(--ink); font-weight: 700; }
.script-switch button:hover { color: var(--royal-900); }
.script-switch button:active { transform: translateY(1px); }
.script-switch > span { color: var(--ink-soft); }
.fair-link {
  position: static;
  width: 78%;
  margin-top: auto;
  margin-bottom: calc(var(--rail-b) + var(--rail-h) + 3rem);
  min-height: 44px;
  display: block;
  padding: .4em .2em;
  text-align: center;
  text-wrap: balance;
  text-decoration: none;
  background: none;
  font-size: clamp(16px, 1.2vw, 22px);
  line-height: 1.4;
  letter-spacing: -.02em;
  transition: color 160ms var(--control-ease), transform 160ms var(--control-ease);
}
.fair-link:hover { color: var(--royal-300); }
.fair-link:focus-visible { outline-color: var(--royal-300); }
.fair-link:active { transform: translateY(1px); }
.fair-link__dot {
  display: inline-block;
  width: .3em;
  height: .3em;
  margin-left: .25em;
  border-radius: 50%;
  background: var(--royal-300);
  animation: fair-pulse 1.8s ease-in-out infinite;
}
@keyframes fair-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .18; } }

/* A generous hit area, while keeping the original thin rail's exact position. */
.rail {
  height: 44px;
  bottom: calc(var(--rail-b) + var(--rail-h) / 2 - 22px);
  pointer-events: auto;
  touch-action: none;
  cursor: ew-resize;
  border-radius: 0;
}
.rail:hover .rail-line, .rail:focus-visible .rail-line { height: 2px; }
.rail:focus-visible { outline: 2px solid var(--royal-700); outline-offset: 3px; }
.loop-buffer { pointer-events: none; user-select: none; }

/* Genuine web/mobile captures, presented like the paired reference previews. */
.site-link {
  display: inline-flex;
  align-items: center;
  align-self: start;
  width: fit-content;
  gap: .5em;
  min-height: 32px;
  font-size: var(--fs-s);
  text-decoration-thickness: 1px;
  text-underline-offset: .25em;
  text-decoration-color: transparent;
  transition: color 160ms var(--control-ease), text-decoration-color 160ms var(--control-ease);
}
.site-link svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.5; }
.site-link:hover { color: var(--royal-900); text-decoration-color: currentColor; }
.site-link:active { opacity: .7; }
.preview-surface { padding: 0; background: var(--paper-2); border-radius: 0; }
.preview-viewport { position: relative; height: 100%; overflow: hidden; background: var(--paper-2); }
.preview-viewport img, .preview-viewport video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center top;
  pointer-events: none;
}
.preview-viewport video { opacity: 0; }
.preview-viewport video.is-playing { opacity: 1; }


/* Spacious optical logo grid, not bordered cards or an auto-carousel. */
.panel--brands {
  width: calc(100vw - var(--side-w) - var(--m));
  min-width: 780px;
  margin-left: calc(var(--m) * 2);
  padding: 0 var(--m) var(--stage-bottom) 0;
  display: flex;
  align-items: flex-end;
}
.brands-content { width: 100%; }
.brands-title { max-width: 24ch; font-size: min(4.1vw, 7.4svh); line-height: 1.02; letter-spacing: -.04em; font-weight: 700; }
.brands-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: center;
  column-gap: clamp(24px, 2.5vw, 64px);
  row-gap: clamp(42px, 8svh, 100px);
  margin-top: clamp(48px, 8svh, 96px);
}
.brand-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: clamp(48px, 7svh, 90px);
  text-decoration: none;
  transition: opacity 180ms var(--control-ease), transform 180ms var(--control-ease);
}
.brand-link img {
  display: block;
  width: 100%;
  height: auto;
  max-width: var(--brand-width, 150px);
  max-height: var(--brand-height, 52px);
  object-fit: contain;
  filter: grayscale(1) brightness(0);
}
.brand-link:hover { opacity: .6; }
.brand-link--cornelsen img, .brand-link--gratnells img, .brand-link--tts img { filter: grayscale(1); mix-blend-mode: multiply; }
.brand-link--cornelsen { --brand-width: 180px; }
.brand-link--smc { --brand-width: 112px; --brand-height: 58px; }
.brand-link--leybold { --brand-width: 150px; }
.brand-link--phywe { --brand-width: 140px; }
.brand-link--lucas-nuelle { --brand-width: 54px; --brand-height: 54px; }
.brand-link--cool-tool { --brand-width: 130px; --brand-height: 58px; }
.brand-link--microbit { --brand-width: 150px; }
.brand-link--skilltoolkit { --brand-width: 135px; --brand-height: 56px; }
.brand-link--dobot { --brand-width: 125px; }
.brand-link--gunt { --brand-width: 110px; --brand-height: 50px; }
.brand-link--gratnells { --brand-width: 128px; --brand-height: 56px; }
.brand-link--tts { --brand-width: 96px; --brand-height: 52px; }
.brand-link:active { transform: translateY(1px); }
.is-motion-paused .swing { transform: none !important; }
.is-motion-paused video[data-preview] { display: none; }
.is-motion-paused .fair-link__dot { animation: none; }

@media (min-width: 900px) and (min-aspect-ratio: 1/1) and (min-height: 520px) and (max-height: 740px) {
  .side-contact { margin-top: 3svh; }
  .side-phones { margin-block: 1em; }
  .fair-link { margin-bottom: calc(var(--rail-b) + var(--rail-h) + 1.3rem); }
}

@media (max-width: 899px), (max-aspect-ratio: 999/1000), (max-height: 519px) {
  :root {
    --mobile-header-h: calc(64px + env(safe-area-inset-top, 0px));
    --m: max(5vw, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
    --fs-s: clamp(14px, 1.7vw, 16px);
    --fs-m: clamp(17px, 2.2vw, 21px);
    --t-l: min(15vw, 22svh, 112px);
    --t-m: min(11vw, 16svh, 86px);
  }
  html { overflow-x: clip; }
  body::after { content: none; }
  .sidebar {
    height: var(--mobile-header-h);
    padding-top: env(safe-area-inset-top, 0px);
    gap: 8px;
    background: var(--paper);
    color: var(--ink);
    box-shadow: none;
    border-bottom: 1px solid var(--line);
  }
  .side-logo { flex: none; width: 44px; height: 44px; background: var(--white); }
  .side-logo-mark { width: 32px; height: auto; }
  .side-brand { margin: 0; font-size: 18px; }

  .side-contact { width: auto; margin: 0 0 0 auto; }
  .side-contact summary { display: flex; align-items: center; justify-content: flex-end; min-width: 56px; min-height: 44px; cursor: pointer; list-style: none; font-size: 14px; }
  .side-contact summary::-webkit-details-marker { display: none; }
  .side-contact summary:active { opacity: .7; }
  .side-contact__body {
    position: absolute;
    top: var(--mobile-header-h);
    right: 0;
    left: 0;
    max-height: calc(100dvh - var(--mobile-header-h));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 24px var(--m) max(28px, env(safe-area-inset-bottom, 0px));
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    font-size: 16px;
  }
  .side-contact__body a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; }
  .side-contact__body > a { font-size: 17px; }
  .side-contact summary:hover, .side-contact__body a:hover { color: var(--royal-900); }
  .side-contact__body a:focus-visible { outline-color: var(--royal-700); }
  .side-contact__body p { color: var(--ink); }
  .side-contact__body .contact-fair-link {
    display: inline-flex;
    max-width: 24ch;
    margin-top: 16px;
    color: var(--royal-900);
    font-size: 16px;
    line-height: 1.4;
    text-wrap: balance;
  }
  .side-phones { margin-block: 1em; }
  .script-switch { top: calc(10px + env(safe-area-inset-top, 0px)); left: auto; right: calc(var(--m) + 68px); font-size: 12px; gap: 0; }
  .script-switch button { min-width: 44px; }
  .sidebar > .fair-link { display: none; }

  /* Keep the reference's low-set opening, without independently positioned text. */
  .panel--hero {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: auto;
    min-height: 100svh;
    gap: clamp(32px, 5svh, 56px);
    padding: calc(var(--mobile-header-h) + 32px) var(--m) 6svh;
  }
  .hero-title { position: static; inset: auto; align-self: stretch; font-size: var(--t-l); font-weight: 700; line-height: .98; }
  .hero-body { position: static; inset: auto; align-self: stretch; max-width: 34em; font-size: var(--fs-m); line-height: 1.45; }
  .hero-subtitle { font-size: clamp(24px, 6.4vw, 34px); line-height: 1.12; }
  .set { display: block; margin-left: 0; padding: 14svh var(--m) 4svh; }
  .fair-story { display: block; margin-top: 14svh; }
  .set-head { display: block; min-height: 0; height: auto; margin-bottom: 6svh; }
  .set-title { font-size: var(--t-m); line-height: .98; letter-spacing: -.04em; }
  .set-meta { margin-top: 4svh; gap: 1.6em; }
  .set-line { max-width: 34em; font-size: var(--fs-m); line-height: 1.45; }
  .plates { align-items: flex-start; gap: 10vw; }
  .plate { min-width: 0; }
  .plate-box { background: var(--paper-2); }
  .set--fair > .plates > .plate:first-child,
  .fair-story > .plates > .plate { width: 100vw; margin-inline: calc(-1 * var(--m)); }
  .plate--portrait { width: min(62%, 36svh); align-self: flex-end; }
  .robot-arm { align-self: flex-end; inline-size: min(78%, 57.6svh); max-block-size: 72svh; }
  .site-link { min-height: 44px; font-size: var(--fs-s); }

  .brands-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7vw 0; margin-top: 8svh; }
  .panel--brands { display: block; width: auto; min-width: 0; margin: 0; padding: 14svh var(--m) max(8svh, env(safe-area-inset-bottom, 0px)); }
  .brands-title { font-size: var(--t-m); }
  .brand-link { min-height: 20.8vw; padding-inline: clamp(12px, 4vw, 20px); }
  .brand-link img { max-height: var(--brand-height, 52px); }
  .brand-link--cornelsen { padding-inline: clamp(8px, 2vw, 16px); }
  .brand-link--smc { --brand-width: 140px; --brand-height: 68px; }

  .panel, .fair-story, .plate, .robot-arm, .brand-link, .site-link { scroll-margin-block-start: calc(var(--mobile-header-h) + 16px); }
}
@media (min-width: 600px) and (max-aspect-ratio: 999/1000), (min-width: 600px) and (max-width: 899px) {
  .brands-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 5vw; }
  .brand-link { min-height: min(11.2vw, 14.4svh); }
  .plates { gap: 6vw; }
}
@media (max-height: 519px) {
  .hero-title { font-size: min(10vw, 16svh, 64px); }
}
@media (prefers-reduced-motion: reduce) {
  .fair-link__dot { animation: none; }
  .preview-viewport video { display: none; }
}
.no-anim .preview-viewport video { display: none; }
