/* MHT instruments - black and yellow, built around the logo colours.
   Pure #000 is used as page background so the logo PNGs blend in seamlessly. */

:root {
  --bg: #000000;
  --panel: #0f0f0f;
  --panel-2: #181818;
  --line: #2a2a2a;
  --line-strong: #444444;
  --text: #f1f0ea;
  --muted: #b4b2a6;
  --yellow: #ffcc00;
  --yellow-dark: #aa8800;
  --focus: #ffffff;

  --sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, Menlo, "Liberation Mono", monospace;

  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2rem);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1 0 auto; }
img { max-width: 100%; height: auto; }

a { color: var(--yellow); text-underline-offset: 0.18em; }
a:hover { color: #fff; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

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

.skip-link { position: absolute; left: 1rem; top: -4rem; background: var(--yellow); color: #000; padding: 0.6rem 1rem; font-weight: 600; z-index: 100; }
.skip-link:focus { top: 1rem; color: #000; }

/* ---------- Type ---------- */
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.015em; margin: 0 0 0.55em; color: #fff; }
h1 { font-size: clamp(2.5rem, 6.2vw, 4.6rem); line-height: 1.02; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.65rem, 3.2vw, 2.3rem); line-height: 1.15; }
h3 { font-size: 1.3rem; line-height: 1.3; }
h4 { font-size: 1.08rem; line-height: 1.35; }

p { margin: 0 0 1.1em; }
ul, ol { margin: 0 0 1.2em; padding-left: 1.4rem; }
li { margin-bottom: 0.35em; }
li::marker { color: var(--yellow-dark); }
ol li::marker { color: var(--yellow); font-weight: 700; }

.lead { font-size: 1.25rem; line-height: 1.55; color: var(--muted); max-width: 40rem; }
/* Narrow reading column that stays aligned with the left edge of the page */
.prose > *, p.prose { max-width: 42rem; }
.prose > .tracks { max-width: 58rem; }
.prose > h2:not(:first-child) { margin-top: 2.75rem; }

code, samp {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--panel-2);
  padding: 0.1em 0.38em;
  border-radius: 2px;
  color: #fff;
}

pre {
  margin: 1.2rem 0 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--yellow-dark);
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.9rem;
  line-height: 1.55;
  tab-size: 2;
}
pre code { background: none; padding: 0; font-size: inherit; }

figure { margin: 1.5rem 0 1.75rem; }
figure img { display: block; border: 1px solid var(--line-strong); }
figcaption { margin-top: 0.5rem; font-size: 0.92rem; color: var(--muted); }

/* ---------- Header ---------- */
.site-header { background: #000; border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.75rem; }

.brand { display: block; line-height: 0; }
.brand img { display: block; width: 200px; height: 45px; }

.site-nav ul { display: flex; gap: 0.25rem; list-style: none; margin: 0; padding: 0; }
.site-nav li { margin: 0; }
.site-nav a { display: block; padding: 0.55rem 0.9rem; color: var(--muted); text-decoration: none; font-weight: 500; border-bottom: 3px solid transparent; }
.site-nav a:hover { color: #fff; border-bottom-color: var(--line-strong); }
.site-nav a[aria-current] { color: #fff; border-bottom-color: var(--yellow); }

.nav-toggle {
  display: none;
  font: inherit;
  font-weight: 600;
  background: none;
  color: var(--yellow);
  border: 2px solid var(--yellow);
  border-radius: 2px;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
}

/* The menu only collapses when JavaScript runs, so it is never hidden without a way to open it. */
@media (max-width: 47.99rem) {
  .site-header .wrap { flex-wrap: wrap; padding-block: 0.75rem; }
  .js .nav-toggle { display: inline-block; }
  .js .site-nav { display: none; }
  .js .site-nav.open { display: block; }
  .site-nav { width: 100%; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav a { padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
  .site-nav a[aria-current] { color: var(--yellow); border-bottom-color: var(--yellow); }
}

/* ---------- Hero ---------- */
/* The original photo runs across the full screen width. It is left untouched: black gradients
   laid over its edges blend it into the page background. On large screens the text sits in the
   dark upper-left corner of the photo; on smaller screens it stacks above the photo instead. */
.hero { position: relative; overflow: hidden; padding-top: clamp(2.5rem, 7vw, 4.5rem); }
.hero h1 { margin-bottom: 0.4em; }
.hero-text p { margin: 0 0 1em; max-width: 40rem; font-size: 1.15rem; line-height: 1.6; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; align-items: center; margin-top: 2rem; }

.hero-visual { position: relative; margin-top: 1rem; }
.hero-visual img { display: block; width: 100%; height: auto; max-height: 90vh; object-fit: cover; object-position: 50% 60%; }
.hero-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to right, #000 0, rgba(0,0,0,.8) 5%, rgba(0,0,0,.45) 11%, rgba(0,0,0,.15) 17%, rgba(0,0,0,0) 24%,
                              rgba(0,0,0,0) 76%, rgba(0,0,0,.15) 83%, rgba(0,0,0,.45) 89%, rgba(0,0,0,.8) 95%, #000 100%),
    linear-gradient(to bottom, #000 0, rgba(0,0,0,.6) 8%, rgba(0,0,0,.2) 16%, rgba(0,0,0,0) 26%,
                               rgba(0,0,0,0) 74%, rgba(0,0,0,.25) 84%, rgba(0,0,0,.7) 93%, #000 100%);
}

@media (max-width: 47.99rem) {
  .hero-visual img { aspect-ratio: 4 / 3; object-position: 66% 60%; }
  .hero-text p { font-size: 1.05rem; }
}

/* Large screens: text in the upper-left corner of the photo, anchored to the screen edge */
@media (min-width: 90rem) and (min-height: 44rem) {
  .hero { padding-top: 0; }
  .hero-visual { margin-top: 0; height: clamp(32rem, calc(100vh - 4.75rem), 80rem); height: clamp(32rem, min(56.25vw, calc(100svh - 4.75rem)), 80rem); }
  .hero-visual img { height: 100%; max-height: none; object-position: 50% 30%; }
  .hero-visual::before { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
    background: radial-gradient(ellipse 46% 78% at 12% 30%, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.45) 45%, rgba(0, 0, 0, 0) 78%); }
  .hero-visual::after { z-index: 1; }
  .hero-copy { position: absolute; z-index: 2; top: clamp(2rem, 6vh, 4.5rem); left: 0; right: auto; max-width: none; width: clamp(24rem, 30vw, 52rem); margin: 0; padding-left: clamp(1.5rem, 3.5vw, 7rem); padding-right: 0; }
  .hero h1 { font-size: clamp(3.4rem, 4.1vw, 6.4rem); white-space: nowrap; }
  .hero-text p { max-width: none; font-size: clamp(0.95rem, 0.85vw, 1.5rem); color: #d9d7cd; }
  .hero h1, .hero-text p { text-shadow: 0 2px 18px rgba(0, 0, 0, 0.9); }
  .actions { margin-top: 1.5rem; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background: var(--yellow);
  color: #000;
  font-weight: 700;
  text-decoration: none;
  padding: 0.85rem 1.6rem;
  border: 2px solid var(--yellow);
  border-radius: 2px;
  transition: background-color 0.15s, border-color 0.15s;
}
.btn:hover { background: #fff; border-color: #fff; color: #000; }

/* ---------- Sections ---------- */
.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section + .section { border-top: 1px solid var(--line); }
.section-panel { background: var(--panel); }

.page-head { padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(1.25rem, 3vw, 2rem); }
.page-head h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); margin-bottom: 0.35em; }
.page-head .lead { margin-bottom: 0; }

.subnav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; margin-top: 1.75rem; }
.subnav a { color: var(--muted); text-decoration: none; padding: 0.35rem 0; border-bottom: 3px solid transparent; font-weight: 500; }
.subnav a:hover { color: #fff; border-bottom-color: var(--line-strong); }
.subnav a[aria-current] { color: #fff; border-bottom-color: var(--yellow); }

/* Two-column split: text and picture */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.split img { display: block; width: 100%; }
@media (max-width: 47.99rem) { .split { grid-template-columns: 1fr; } }

/* Ruled rows: title left, text right */
.rows { margin: 0 0 1.5rem; padding: 0; list-style: none; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 0.4rem clamp(1.5rem, 5vw, 4rem); padding-block: 1.4rem; margin: 0; border-top: 1px solid var(--line); }
.rows .row:last-child { border-bottom: 1px solid var(--line); }
.row h3 { margin: 0; font-size: 1.15rem; color: var(--yellow); }
.row p:last-child { margin-bottom: 0; }
@media (max-width: 47.99rem) { .row { grid-template-columns: 1fr; } }

/* ---------- Product tiles ---------- */
.products { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 2rem; }
.product { display: flex; flex-direction: column; border: 1px solid var(--line-strong); background: var(--panel); }
.product-photo { position: relative; display: block; background: #fff; aspect-ratio: 4 / 3; }
.product-photo img { position: absolute; inset: 1.25rem; width: calc(100% - 2.5rem); height: calc(100% - 2.5rem); object-fit: contain; }
.product-body { display: flex; flex-direction: column; flex: 1; padding: 1.5rem 1.5rem 1.75rem; }
.product h3 { font-size: 1.5rem; margin-bottom: 0.25em; }
.product-photo-solo { background: #fff; padding: 1.25rem; }
.product-photo-solo img { display: block; width: 100%; max-height: 32rem; object-fit: contain; }
.status { margin: 0 0 0.9rem; font-size: 0.95rem; color: var(--muted); }
.status strong { color: var(--yellow); font-weight: 600; }
.status .ended { color: var(--text); }
.product-body p:last-child { margin: auto 0 0; padding-top: 0.5rem; font-weight: 600; }

/* Fact lists */
.facts { margin: 0 0 1.5rem; display: grid; grid-template-columns: max-content 1fr; gap: 0.6rem 2rem; }
.facts dt { font-weight: 600; color: #fff; }
.facts dd { margin: 0; }
@media (max-width: 34rem) { .facts { grid-template-columns: 1fr; gap: 0; } .facts dd { margin-bottom: 0.9rem; } }

.features { margin: 0 0 1.5rem; }

/* ---------- Documentation layout (tinyTag guide) ---------- */
.doc { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.doc-body { max-width: 46rem; }
.doc-body h2 { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line); scroll-margin-top: 1.5rem; }
.doc-body h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.doc-body h3 { margin-top: 2.25rem; scroll-margin-top: 1.5rem; }

.toc { position: sticky; top: 1.5rem; font-size: 0.95rem; }
.toc h2 { font-size: 1rem; margin-bottom: 0.75rem; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0; }
.toc ul ul { padding-left: 1rem; }
.toc a { display: block; padding: 0.3rem 0 0.3rem 0.8rem; border-left: 2px solid var(--line); color: var(--muted); text-decoration: none; }
.toc a:hover { color: #fff; border-left-color: var(--yellow); }
@media (max-width: 63.99rem) {
  .doc { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
}

.top-link { font-size: 0.92rem; }

.note { margin: 1.25rem 0; padding: 0.9rem 1.15rem; background: var(--panel); border-left: 3px solid var(--yellow-dark); }
.note p:last-child { margin-bottom: 0; }

/* Command list */
.cmds { margin: 1.25rem 0 1.5rem; }
.cmds dt { margin-top: 0.9rem; }
.cmds dt code { color: var(--yellow); background: var(--panel-2); }
.cmds dd { margin: 0.2rem 0 0 0; color: var(--muted); }

/* Marks content that still needs to be filled in; remove the element when done */
.todo { margin: 1.25rem 0; padding: 0.9rem 1.15rem; border: 1px dashed var(--yellow); color: var(--yellow); }
.todo p:last-child { margin-bottom: 0; }

/* ---------- Events / IMM 2021 ---------- */
.partners { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; margin-bottom: 2rem; }
.partners img { display: block; height: 3.25rem; width: auto; }
.partners .amp { font-size: 2rem; font-weight: 700; color: var(--yellow); line-height: 1; }
.partners .plate { background: #fff; padding: 0.5rem 0.9rem; }

.track { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem clamp(1.5rem, 5vw, 3.5rem); align-items: center; padding-block: 1.75rem; border-top: 1px solid var(--line); }
.tracks .track:last-child { border-bottom: 1px solid var(--line); }
.track h4 { color: var(--yellow); }
.track figure { margin: 0; }
.track img { width: auto; max-width: 100%; max-height: 22rem; }
@media (max-width: 47.99rem) { .track { grid-template-columns: 1fr; } }

.event-list { list-style: none; margin: 0 0 1.5rem; padding: 0; }
.event-list li { margin: 0; padding-block: 1.6rem; border-top: 1px solid var(--line); display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 0.4rem 2rem; }
.event-list li:last-child { border-bottom: 1px solid var(--line); }
.event-list h3 { font-size: 1.5rem; margin-bottom: 0.4em; }
.event-list .facts { margin-top: 1rem; }
.group-title { font-size: 1.05rem; color: var(--yellow); margin-bottom: 1rem; }
.event-list .when { color: var(--yellow); font-weight: 600; }
@media (max-width: 34rem) { .event-list li { grid-template-columns: 1fr; } }

/* ---------- About ---------- */
.founder { display: grid; grid-template-columns: minmax(0, 18rem) minmax(0, 1fr); gap: clamp(2rem, 6vw, 4.5rem); align-items: start; }
.founder img { display: block; width: 100%; height: auto; border: 1px solid var(--line-strong); }
blockquote { margin: 0; padding-left: 1.5rem; border-left: 3px solid var(--yellow); font-size: 1.15rem; line-height: 1.7; }
blockquote p:last-of-type { margin-bottom: 1.25rem; }
.signature { margin: 0; font-weight: 600; text-align: right; }
@media (max-width: 47.99rem) { .founder { grid-template-columns: 1fr; } .founder img { max-width: 16rem; } }

/* ---------- Call to action ---------- */
.cta { background: var(--yellow); color: #000; }
.cta h2 { color: #000; max-width: 32ch; }
.cta .lead { color: #222; }
.cta a { color: #000; }
.cta .btn { background: #000; border-color: #000; color: var(--yellow); }
.cta .btn:hover { background: #fff; border-color: #fff; color: #000; }
.cta :focus-visible { outline-color: #000; }
.section.cta { border-top: 0; }

/* ---------- Legal pages ---------- */
.legal h2 { font-size: 1.35rem; margin-top: 2rem; }
.legal .placeholder { background: #3a3000; color: var(--yellow); padding: 0 0.3em; }

/* ---------- Footer ---------- */
.site-footer { background: #000; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.95rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1.25rem 2rem; padding-block: 2rem; }
.site-footer img { display: block; width: 200px; height: 45px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem; }
.site-footer li { margin: 0; }
.site-footer a { color: var(--text); }
.site-footer a:hover { color: var(--yellow); }
.site-footer p { margin: 0; }
.footer-legal { display: flex; flex-direction: column; gap: 0.6rem; }

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

/* Download lists */
.downloads { list-style: none; padding: 0; margin: 1rem 0 1.5rem; }
.downloads li { padding: 0.7rem 0; border-bottom: 1px solid var(--line, #2a2a2a); }
.downloads li:first-child { border-top: 1px solid var(--line, #2a2a2a); }
.downloads a { font-weight: 600; }
.downloads .meta { display: block; margin-top: 0.15rem; color: var(--muted); font-size: 0.925rem; }
.downloads .meta code { color: var(--yellow); background: var(--panel-2); }

/* Event photos */
.event-photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1.25rem; max-width: 46rem; }
.event-photos figure { margin: 0; }
.event-photos img { width: 100%; height: auto; }
@media (max-width: 34rem) { .event-photos { grid-template-columns: 1fr; } }

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

/* 404 page */
.not-found { padding-block: clamp(3rem, 10vw, 7rem); text-align: center; }
.not-found .wrap { max-width: 34rem; }
.nf-code { font-size: clamp(5rem, 18vw, 9rem); font-weight: 700; line-height: 1; color: var(--yellow); margin: 0 0 0.15em; letter-spacing: -0.02em; }
.not-found h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin-bottom: 0.35em; }
.not-found .lead { margin-bottom: 0; }
.not-found pre { text-align: left; display: inline-block; margin: 1.5rem auto 0; }
.not-found .actions { justify-content: center; }
