/* ==========================================================================
   MikusWorks – stylesheet
   Slate and engraving: the page is the colour of the slate the logo gets
   lasered into, text is the pale engraved line, and the orange dot from the
   Wave m mark is the only accent. Light mode follows the OS setting.
   Headings use Rajdhani, the same family as the boat dashboard's own UI.
   ========================================================================== */

/* Self-hosted fonts (fonts/, SIL OFL 1.1, see fonts/OFL.txt and fonts/FONTS.md) */
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/inter-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/inter-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/inter-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/inter-latin-ext-600-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Rajdhani"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/rajdhani-latin-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Rajdhani"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/rajdhani-latin-ext-700.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --------------------------------------------------------------------------
   Tokens
   -------------------------------------------------------------------------- */
:root {
  --slate: #22262a;       /* page */
  --slate-2: #2a2f34;     /* raised: screen bezel, panels */
  --line: #3b4148;        /* hairlines, frames */
  --stone: #ddd7ca;       /* text: the engraved line */
  --stone-dim: #a39f95;   /* secondary text */
  --dot: #f5a524;         /* the mark's dot; focus, active state */
  --dot-text: #f5a524;
  --water: #8fc0d6;       /* status tag: on the water */
  --ok: #8fd3a4;          /* status tag: in use */
  --paper: #f3f2ee;       /* backing for light diagrams */
  --band: #2f353b;        /* front page: every other part's full-width band */
  --band-line: #474e56;   /* hairlines on a band (as visible there as --line on the page) */

  --display: "Rajdhani", "Inter", system-ui, sans-serif;
  --text: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --page: 74rem;
  --measure: 36rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --r-media: 10px;
}

@media (prefers-color-scheme: light) {
  :root {
    --slate: #eceeed;
    --slate-2: #f7f8f7;
    --line: #cbd1d3;
    --stone: #1e2327;
    --stone-dim: #586066;
    --dot-text: #9a5600;
    --water: #2b6f8c;
    --ok: #2c7a4b;
    --band: #ffffff;
    --band-line: #cbd1d3;
  }
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--slate);
  color: var(--stone);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}
p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--dot-text); }
:focus-visible { outline: 2px solid var(--dot); outline-offset: 3px; border-radius: 3px; }

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

/* Hidden <svg> holding the <symbol>s; a class, not style="", so the CSP needs no inline styles */
.sprite { position: absolute; }

.skip {
  position: absolute; left: 1rem; top: -3rem; z-index: 10;
  background: var(--dot); color: #1c1407; padding: 0.5rem 0.9rem; border-radius: 6px; text-decoration: none;
}
.skip:focus { top: 1rem; }

/* Wave m mark: arches follow the text colour, the water line is muted, the dot is orange */
.mark__m, .mark__wave { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.mark__m { stroke: currentColor; stroke-width: 22; }
.mark__wave { stroke: var(--stone-dim); stroke-width: 15; }
.mark__dot { fill: var(--dot); }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.top {
  max-width: var(--page);
  margin: 0 auto;
  padding: 1.25rem var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; gap: 0.7rem; text-decoration: none; }
.brand__mark { width: 2.4rem; height: 1.75rem; }
.brand__name { font-family: var(--display); font-weight: 700; font-size: 1.45rem; letter-spacing: 0; }
/* Bigger on wider screens: 1.25 times from 48rem, 1.5 times from 62rem (mark, name and gap together) */
@media (min-width: 48rem) {
  .brand { gap: 0.875rem; }
  .brand__mark { width: 3rem; height: 2.1875rem; }
  .brand__name { font-size: 1.8125rem; }
}
@media (min-width: 62rem) {
  .brand { gap: 1.05rem; }
  .brand__mark { width: 3.6rem; height: 2.625rem; }
  .brand__name { font-size: 2.175rem; }
}
.top { position: relative; z-index: 20; }
.top__nav { display: flex; align-items: baseline; gap: 1.4rem; font-size: 0.98rem; }
.top__nav > a, .menu__button { text-decoration: none; color: var(--stone-dim); }
.top__nav > a:hover, .menu__button:hover { color: var(--stone); }

/* Projects menu: <details>, so it opens without JavaScript. site.js closes it on Esc,
   on a click outside and when a link is followed. Phone: a full-width panel under the
   header. Wider: a dropdown under the nav, right-aligned to it. */
.menu__button { cursor: pointer; list-style: none; user-select: none; }
.menu__button::-webkit-details-marker { display: none; }
.menu__button::after {
  content: ""; display: inline-block; width: 0.42em; height: 0.42em; margin-left: 0.45em;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: translateY(-0.2em) rotate(45deg); transition: transform 0.15s;
}
.menu[open] > .menu__button { color: var(--stone); }
.menu[open] > .menu__button::after { transform: translateY(0.05em) rotate(-135deg); }
@media (prefers-reduced-motion: reduce) { .menu__button::after { transition: none; } }

.menu__panel {
  position: absolute; left: 0; right: 0; top: 100%;
  padding: 0.5rem var(--gutter) 1.25rem;
  background: var(--slate-2); border-block: 1px solid var(--line);
  box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.55);
  display: grid; gap: 0.25rem 2.5rem;
}
.menu__title {
  margin: 0.9rem 0 0.2rem; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--dot-text);
}
.menu__panel ul { list-style: none; margin: 0; padding: 0; }
.menu__panel a {
  display: flex; align-items: center; min-height: 2.75rem; padding: 0.2rem 0;
  color: var(--stone); text-decoration: none; font-size: 1.02rem; border-top: 1px solid var(--line);
}
.menu__panel li:first-child a { border-top: 0; }
.menu__panel a:hover { color: var(--dot-text); }
.menu__panel a[aria-current="page"] { color: var(--dot-text); font-weight: 600; }
.menu__panel a[aria-current="page"]::after { content: "this page"; margin-left: auto; font-size: 0.78rem; font-weight: 400; color: var(--stone-dim); }
@media (min-width: 48rem) {
  .top__nav { position: relative; }
  .menu__panel {
    left: auto; right: -0.75rem; top: calc(100% + 0.9rem); width: 36rem;
    grid-template-columns: 1fr 1fr; padding: 0.4rem 1.5rem 1.1rem;
    border: 1px solid var(--line); border-radius: var(--r-media);
  }
  .menu__panel a { min-height: 2.4rem; font-size: 0.98rem; }
}

/* --------------------------------------------------------------------------
   Hero: the headline and the dashboard, side by side
   -------------------------------------------------------------------------- */
.hero {
  max-width: var(--page);
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 4rem) var(--gutter) clamp(3rem, 8vw, 6rem);
  display: grid;
  gap: clamp(1.75rem, 4vw, 3.5rem);
  align-items: center;
}
.hero h1 { font-size: clamp(2.6rem, 6.4vw, 4.6rem); max-width: 13ch; }
.lead { margin-top: 1.4rem; font-size: 1.15rem; color: var(--stone-dim); max-width: 34rem; }
@media (min-width: 62rem) {
  .hero { grid-template-columns: 5fr 7fr; }
}
/* Phones get the hero's text only: the dashboard card follows straight after, and the clip read
   as a repeat of it. The clip's sources apply from 48rem only and its poster is a background
   from 48rem (under .screen), so below 48rem it downloads nothing at all, not even metadata. */
@media (max-width: 47.99rem) {
  .hero__screen { display: none; }
}

/* A display in a bezel: the one framed thing on the page */
.screen { margin: 0; }
.screen video, .screen img, .screen .viewer__stage {
  border-radius: 14px;
  border: 10px solid var(--slate-2);
  outline: 1px solid var(--line);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.6);
  background: #15181b;
}
/* The hero clip's poster, from 48rem only (below that the clip is hidden and loads nothing) */
@media (min-width: 48rem) {
  .hero__screen video { background: #15181b url("/media/dash/01-overview.webp") center / cover no-repeat; }
}
.screen figcaption, .media figcaption, .viewer__caption {
  margin-top: 0.7rem; font-size: 0.875rem; color: var(--stone-dim);
}
/* A viewer's caption is the description of the selected feature: body text, not fine print */
.viewer__caption { margin-top: 1rem; font-size: 1.0625rem; color: var(--stone); max-width: 46rem; }
/* ...shown in the viewer's text slot instead, where it has one (the dashboard, beside the facts) */
.viewer__text .viewer__caption { margin: 0; }
.viewer__text .viewer__caption[hidden] { display: none; }

/* --------------------------------------------------------------------------
   Project groups
   -------------------------------------------------------------------------- */
.work { max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); }
.group { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
/* On phones each group starts with more air above its title than between its projects */
@media (max-width: 47.99rem) { .group { padding-top: 4rem; } }

/* Front page: each part on its own full-width band, alternating between the page colour and
   --band: hero page, On the water band, On the bench page, laptop band, web page, House rules
   band, About page. The bands run edge to edge; the padding keeps the content at the page width
   and gutters. The groups alternate by position (odd ones raised), so with an even number of
   groups House rules is raised; adding or removing a group means moving that to About.
   Hairlines on a band use --band-line. */
.work--bands { max-width: none; padding: 0; }
.work--bands > .group, .rules, .about {
  padding-inline: max(var(--gutter), calc((100% - var(--page)) / 2 + var(--gutter)));
}
.work--bands > .group:nth-of-type(odd), .rules { background: var(--band); --line: var(--band-line); }
/* Phones only: "Projects" as a small label at the top of the first band, directly above
   "On the water". From 48rem the hero's clip makes the break, and the section's aria-label
   names it. */
.work__title { display: none; }
@media (max-width: 47.99rem) {
  .work__title {
    display: block; margin: -0.75rem 0 1.5rem;
    font-size: 1rem; font-weight: 600; line-height: 1.2; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--stone-dim);
  }
}

/* Group title runs into the wave line from the mark */
.group__title {
  display: flex; align-items: center; gap: 1.2rem;
  font-size: clamp(1.9rem, 4.2vw, 2.8rem);
  margin-bottom: clamp(1.75rem, 4vw, 3rem);
  color: var(--dot-text);   /* the mark's orange; the darker one on the light scheme */
}
.group__title::after {
  content: ""; flex: 1; height: 12px; min-width: 3rem;
  background: var(--dot-text);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='12'%3E%3Cpath d='M0 6q12-5 24 0t24 0' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E") repeat-x left center;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='12'%3E%3Cpath d='M0 6q12-5 24 0t24 0' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E") repeat-x left center;
}

.project + .project { margin-top: clamp(3rem, 7vw, 5rem); }
.project__head { max-width: 44rem; margin-bottom: 1.75rem; }
.project__head :is(h1, h2, h3) { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-bottom: 0.6rem; }
.project__head h3 a { text-decoration-thickness: 2px; }
.project__what { font-size: 1.1rem; }
.project__body { max-width: var(--measure); margin-top: 2rem; color: var(--stone); }
.project--wide .project__body { max-width: none; display: grid; gap: 1rem 3rem; }
@media (min-width: 62rem) {
  .project--wide .project__body { grid-template-columns: 1fr 1fr; }
  .project--wide .project__body .facts { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; }
}
.project__body--split { max-width: none; display: grid; gap: 2rem 3rem; align-items: start; }
@media (min-width: 60rem) { .project__body--split { grid-template-columns: 7fr 5fr; } }

/* Facts: a short definition list with hairlines */
.facts { margin: 1.5rem 0 0; }
.facts div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: 0.7rem 0; border-top: 1px solid var(--line); }
.facts div:last-child { border-bottom: 1px solid var(--line); }
.facts dt { color: var(--stone-dim); font-size: 0.92rem; padding-top: 0.08rem; }
.facts dd { margin: 0; }
.facts--inline { max-width: 44rem; }

/* Autopilot status table */
.status { width: 100%; border-collapse: collapse; margin-top: 1.75rem; font-size: 0.97rem; }
.status caption { text-align: left; font-family: var(--display); font-weight: 700; font-size: 1.25rem; margin-bottom: 0.6rem; }
.status th, .status td { text-align: left; vertical-align: top; padding: 0.75rem 0.75rem 0.75rem 0; border-top: 1px solid var(--line); }
.status tbody tr:last-child > * { border-bottom: 1px solid var(--line); }
.status thead th { color: var(--stone-dim); font-weight: 400; font-size: 0.88rem; }
.status tbody th { font-weight: 600; width: 34%; }
.tag {
  display: inline-block; margin-right: 0.45rem; padding: 0.05rem 0.5rem; border-radius: 4px;
  font-size: 0.82rem; font-weight: 600; border: 1px solid var(--stone-dim); color: var(--stone);
}
.tag--water { border-color: var(--water); color: var(--water); }
.tag--plan { border-style: dashed; color: var(--stone-dim); }
.tag--progress { border-color: var(--dot-text); color: var(--dot-text); }
.tag--use { border-color: var(--ok); color: var(--ok); }
:is(h1, h2, h3) .tag { vertical-align: middle; margin-left: 0.6rem; font-family: var(--text); letter-spacing: 0; }

/* Front-page cards for the projects that have a page of their own.
   The "More" link's ::after covers the card, so the whole card is clickable. */
.cards { display: grid; gap: 2.5rem 2rem; }
@media (min-width: 40rem) { .cards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 62rem) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card { position: relative; display: flex; flex-direction: column; }
.card__img {
  width: 100%; aspect-ratio: 16 / 10; object-fit: cover; margin-bottom: 1.1rem;
  border-radius: var(--r-media); outline: 1px solid var(--line); outline-offset: -1px; background: #15181b;
}
.card--paper .card__img { object-position: top; background: var(--paper); }
.card__img--remote { object-position: 50% 62%; }   /* a tall photo: the keys and the wordmark */
/* The dashboard card: on phones the overview clip (uncropped, with its caption) instead of the
   still; from 48rem the still, and the hero above plays the clip. */
.card__media--phone .card__img { aspect-ratio: 16 / 9; }
.card__media--phone figcaption { margin-top: 0.7rem; font-size: 0.875rem; color: var(--stone-dim); }
@media (max-width: 47.99rem) {
  .card__img--wide { display: none; }
  .card__media--phone video { background: #15181b url("/media/dash/01-overview.webp") center / cover no-repeat; }
}
@media (min-width: 48rem) { .card__media--phone { display: none; } }
/* A short label on a card image that isn't a photo of the build */
.card__media { position: relative; margin: 0 0 1.1rem; }
.card__media .card__img { margin-bottom: 0; }
.card__label {
  position: absolute; left: 0.6rem; bottom: 0.6rem;
  font: 600 0.8rem/1 var(--text); color: #f3f2ee; background: rgba(20, 23, 26, 0.78);
  border: 1px dashed rgba(243, 242, 238, 0.45); border-radius: 4px; padding: 0.35rem 0.55rem;
}
.card h3 { font-size: 1.6rem; margin-bottom: 0.6rem; }
.card p { margin-bottom: 1rem; }
/* "More" is a pill in the title orange; filled when the card is hovered or the link has keyboard
   focus. .more-link is the same pill on its own (a page's closing link), filled on its own hover. */
.card__more, .more-link {
  display: inline-flex; align-items: center;
  padding: 0.4rem 0.95rem; border: 1.5px solid var(--dot-text); border-radius: 999px;
  color: var(--dot-text); font-weight: 600; line-height: 1.25; text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.card__more { margin-top: auto; align-self: flex-start; }
.card:hover .card__more, .card__more:focus-visible,
.more-link:hover, .more-link:focus-visible { background: var(--dot); color: #22262a; }
/* the edge and the focus ring stay in --dot-text: plain --dot is only 2:1 on the light band */
.card__more:focus-visible, .more-link:focus-visible { outline-color: var(--dot-text); }
@media (prefers-reduced-motion: reduce) { .card__more, .more-link { transition: none; } }
.card__more::after { content: ""; position: absolute; inset: 0; }
/* A clip in a card (the bench): the clip itself is part of the card's link, its buttons sit
   above the link layer. site.js gives it no full-screen button there. */
.card .clip__bar, .card .clip__play { z-index: 1; }
.project__more { margin: clamp(2rem, 5vw, 3rem) 0 0; }
/* A card alone in its group: spans the row, image left and text right.
   Below 48rem it is an ordinary stacked card. */
@media (min-width: 48rem) {
  .card--wide {
    grid-column: 1 / -1; display: grid; column-gap: clamp(1.5rem, 4vw, 3rem);
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-rows: auto auto 1fr;
  }
  .card--wide .card__img { grid-row: 1 / -1; aspect-ratio: 16 / 9; margin-bottom: 0; }
  .card--wide h3 { margin-top: 0.4rem; }
  .card--wide p { max-width: 32rem; }
  .card--wide .card__more { margin-top: 0.25rem; align-self: start; justify-self: start; }
}
.card:hover .card__img { outline-color: var(--dot); }

/* Sub-pages: one or two project sections under a link back to the front page */
.sub { padding-block: clamp(1rem, 3vw, 2rem) clamp(3rem, 8vw, 6rem); }
.back { margin: 0 0 clamp(1.5rem, 4vw, 2.5rem); font-size: 0.95rem; }
.back a { color: var(--stone-dim); text-decoration: none; }
.back a:hover { color: var(--stone); }
.project__head h1 { font-size: clamp(2.4rem, 5.5vw, 3.6rem); }

/* --------------------------------------------------------------------------
   Media
   -------------------------------------------------------------------------- */
.media { margin: 0; }
.media img, .media video { border-radius: var(--r-media); outline: 1px solid var(--line); outline-offset: -1px; }
.media--paper img { background: var(--paper); }
.media a { display: block; }

/* Pod indicator design study: the tall handheld beside its two screens */
.pod__grid { display: grid; grid-template-columns: 0.55fr 1fr; gap: 0.9rem; align-items: center; }
.pod__hand { grid-row: 1 / span 2; }
.pod__grid img { width: 100%; background: #15181b; }

.gallery { display: grid; gap: 1.25rem; }
@media (min-width: 40rem) { .gallery { grid-template-columns: 1fr 1fr; } .g-main { grid-column: 1 / -1; } }
@media (min-width: 62rem) {
  .gallery--pcb { grid-template-columns: 1.25fr 1fr 1fr; align-items: start; }
  .gallery--pcb .g-main { grid-column: 1 / -1; }
  .gallery--slate { grid-template-columns: 3fr 2fr; }
  .gallery--slate .g-main { grid-column: 1; grid-row: 1 / span 2; }
}

/* Looping clips get a small pause button and a full-screen button from site.js, together
   in the bottom-right corner, and a large play button that shows only when the browser
   refused to start the clip. */
.clip { position: relative; }
.clip__bar {
  position: absolute; right: 0.6rem; bottom: 0.6rem;
  display: flex; gap: 0.4rem;
}
.clip__toggle, .clip__fs {
  font: 600 0.8rem/1 var(--text); color: #f3f2ee; background: rgba(20, 23, 26, 0.72);
  border: 1px solid rgba(243, 242, 238, 0.25); border-radius: 6px; padding: 0.45rem 0.65rem; cursor: pointer;
}
.clip__toggle, .clip__fs { white-space: nowrap; }
.clip__fs { display: inline-flex; align-items: center; gap: 0.4rem; }
.clip__fs svg { width: 0.85rem; height: 0.85rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
/* On a narrow clip (the sensor hub on a phone) the full-screen button shows only its icon;
   the words stay for screen readers. */
.clip { container-type: inline-size; }
.screen .clip__bar, .viewer.is-live .clip__bar { right: 1.3rem; bottom: 1.3rem; }
.clip__toggle:hover, .clip__fs:hover { background: rgba(20, 23, 26, 0.9); }
.clip__play {
  display: none; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 4.5rem; height: 4.5rem; border-radius: 50%; cursor: pointer; padding: 0;
  color: #f3f2ee; background: rgba(20, 23, 26, 0.72); border: 2px solid rgba(243, 242, 238, 0.6);
  align-items: center; justify-content: center;
}
.clip__play svg { width: 2rem; height: 2rem; fill: currentColor; margin-left: 0.2rem; }
.clip__play:hover { background: rgba(20, 23, 26, 0.9); }
.clip.is-stopped .clip__play { display: flex; }
.clip.is-stopped .clip__toggle { display: none; }   /* one Play is enough */
/* Full screen, nothing happening: the buttons fade out (site.js sets .is-idle) */
.clip__bar { transition: opacity 0.4s; }
.clip.is-idle .clip__bar { opacity: 0; pointer-events: none; }
.clip.is-idle { cursor: none; }
@media (prefers-reduced-motion: reduce) { .clip__bar { transition: none; } }
/* Narrow clips, after the base rules so these win */
@container (max-width: 15rem) {
  .clip__fs span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .clip__fs { padding-inline: 0.55rem; }
  .clip__fs svg { width: 0.95rem; height: 0.95rem; }
  .clip__play { width: 2.75rem; height: 2.75rem; top: 40%; }
  .clip__play svg { width: 1.3rem; height: 1.3rem; margin-left: 0.15rem; }
}
/* Full screen: the clip's box fills the screen, the clip without its bezel, its buttons
   bigger and always in view. Two copies: an unknown selector would drop the whole rule. */
.clip:fullscreen { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; background: #000; }
.clip:-webkit-full-screen { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; background: #000; }
:root .clip:fullscreen video { width: 100%; height: 100%; max-width: none; object-fit: contain; aspect-ratio: auto; border: 0; border-radius: 0; outline: 0; box-shadow: none; background: #000; }
:root .clip:-webkit-full-screen video { width: 100%; height: 100%; max-width: none; object-fit: contain; aspect-ratio: auto; border: 0; border-radius: 0; outline: 0; box-shadow: none; background: #000; }
:root .clip:fullscreen .clip__bar { right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom)); gap: 0.6rem; }
:root .clip:-webkit-full-screen .clip__bar { right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom)); gap: 0.6rem; }
.clip:fullscreen .clip__toggle, .clip:fullscreen .clip__fs { font-size: 1rem; padding: 0.7rem 1rem; background: rgba(20, 23, 26, 0.8); }
.clip:-webkit-full-screen .clip__toggle, .clip:-webkit-full-screen .clip__fs { font-size: 1rem; padding: 0.7rem 1rem; background: rgba(20, 23, 26, 0.8); }
.clip:fullscreen .clip__fs svg { width: 1rem; height: 1rem; }
.clip:-webkit-full-screen .clip__fs svg { width: 1rem; height: 1rem; }

/* --------------------------------------------------------------------------
   Dashboard feature viewer. Without JS every clip is listed; with JS it
   becomes one screen with a row of feature buttons.
   -------------------------------------------------------------------------- */
.viewer { display: grid; gap: 2rem; }
.viewer figure { margin: 0; }
.viewer video { border-radius: var(--r-media); outline: 1px solid var(--line); outline-offset: -1px; }
.viewer.is-live { gap: 0; }
.viewer__tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
.viewer__tab {
  font: 600 0.95rem/1 var(--text); color: var(--stone-dim);
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  padding: 0.6rem 1rem; cursor: pointer;
}
/* From 62rem a little less side padding and gap, so the ten tabs fit one row once the column is
   at its full width; the tab height (the tap target) stays the same */
@media (min-width: 62rem) {
  .viewer__tabs { gap: 0.35rem; }
  .viewer__tab { padding-inline: 0.75rem; }
}
.viewer__tab:hover { color: var(--stone); border-color: var(--stone-dim); }
.viewer__tab[aria-selected="true"] { color: var(--stone); border-color: var(--dot); box-shadow: inset 0 0 0 1px var(--dot); }
.viewer.is-live figure[hidden] { display: none; }
.viewer.is-live video {
  width: 100%; aspect-ratio: 16 / 9; object-fit: contain;
  border-radius: 14px; border: 10px solid var(--slate-2); outline: 1px solid var(--line); outline-offset: 0;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.6); background: #15181b;
}

/* Survey report: three PDF pages as paper thumbnails, linked to the PDFs */
.reports { margin-top: clamp(2rem, 5vw, 3rem); }
.reports__title { font-family: var(--display); font-weight: 700; font-size: 1.25rem; margin: 0 0 0.9rem; }
.pages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(0.75rem, 2.5vw, 1.5rem); max-width: 58rem; }
.media--page img { width: 100%; height: auto; background: #fff; box-shadow: 0 18px 36px -24px rgba(0, 0, 0, 0.7); }
.media--page a:hover img, .media--page a:focus-visible img { outline-color: var(--dot); }
.reports__note { margin-top: 1rem; font-size: 0.95rem; color: var(--stone-dim); max-width: 44rem; }


/* Report pages opened large over the site (site.js). The page image is white paper, so the
   viewer is dark in both schemes, like the clip buttons. */
html.has-lightbox { overflow: hidden; }
.lightbox {
  width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; border: 0;
  padding: max(0.75rem, env(safe-area-inset-top)) var(--gutter) max(0.9rem, env(safe-area-inset-bottom));
  background: rgba(14, 16, 18, 0.9); color: #f3f2ee;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.lightbox[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; gap: 0.7rem; }
.lightbox::backdrop { background: rgba(0, 0, 0, 0.6); }
.lightbox__top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.lightbox__count { margin: 0; font-size: 0.9rem; color: #c9c4b8; }
.lightbox__stage { min-height: 0; display: flex; align-items: center; justify-content: center; touch-action: pan-y pinch-zoom; }
.lightbox__img {
  display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain;
  background: #fff; border-radius: 4px; box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.8);
}
.lightbox__cap { margin: 0 auto; max-width: 40rem; text-align: center; font-size: 0.9rem; color: #c9c4b8; }
.lightbox__nav { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; max-width: 40rem; width: 100%; margin: 0 auto; }
.lightbox__btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem;
  font: 600 0.92rem/1 var(--text); color: #f3f2ee; text-decoration: none; white-space: nowrap;
  background: rgba(243, 242, 238, 0.08); border: 1px solid rgba(243, 242, 238, 0.3); border-radius: 6px;
  padding: 0.55rem 0.85rem; cursor: pointer;
}
.lightbox__btn:hover { background: rgba(243, 242, 238, 0.16); color: #f3f2ee; }
.lightbox__btn:disabled { opacity: 0.35; cursor: default; }
@media (max-width: 26rem) { .lightbox__btn { padding-inline: 0.6rem; font-size: 0.85rem; } }

/* --------------------------------------------------------------------------
   Command Center page: the wall in a bezel, text beside the phone shot,
   a gallery of views, a strip of themes and the remote
   -------------------------------------------------------------------------- */
.cc-main { margin-bottom: clamp(2rem, 5vw, 3rem); }
.cc-main a { display: block; }
.cc-main img { width: 100%; }
.cc-body { display: grid; gap: 2rem 3rem; align-items: start; }
.cc-body > div { max-width: 44rem; }
@media (min-width: 60rem) { .cc-body { grid-template-columns: 1fr 16rem; } }
.cc-phone { max-width: 16rem; }
.cc-phone img { border-radius: 18px; }
.shots { display: grid; gap: 1.5rem 1.25rem; margin-top: clamp(2.5rem, 6vw, 4rem); align-items: start; }
@media (min-width: 40rem) { .shots { grid-template-columns: 1fr 1fr; } }
@media (min-width: 62rem) { .shots { grid-template-columns: repeat(3, 1fr); } }
.cc-themes { margin-top: clamp(2rem, 5vw, 3rem); }
.cc-themes__row { display: grid; gap: 0.75rem; }
@media (min-width: 40rem) { .cc-themes__row { grid-template-columns: repeat(3, 1fr); } }
.cc-remote { margin-top: clamp(3rem, 7vw, 5rem); }
.cc-remote h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-bottom: 0.6rem; }
.cc-remote > p { max-width: 44rem; font-size: 1.1rem; }
.cc-remote__figs { display: grid; gap: 1.25rem; align-items: start; margin-top: 1.5rem; }
.cc-remote__renders { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
@media (min-width: 62rem) {
  .cc-remote__figs { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 2rem; }
}
/* The sensor hub: the photo and the build clip side by side */
.cc-hub__figs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem;
                align-items: start; margin-top: 1.5rem; max-width: 34rem; }

/* --------------------------------------------------------------------------
   Laptop tools: three columns of text, not cards
   -------------------------------------------------------------------------- */
.tools { display: grid; gap: 2.5rem 3rem; }
.cards + .tools { margin-top: clamp(2.5rem, 6vw, 4rem); }
@media (min-width: 62rem) { .tools { grid-template-columns: repeat(3, 1fr); } }
.tool { border-top: 2px solid var(--stone); padding-top: 1.1rem; }
.tool h3 { font-size: 1.6rem; margin-bottom: 0.6rem; }
.tool__what { margin-bottom: 1rem; }
.tool ul { margin: 0; padding: 0; list-style: none; color: var(--stone-dim); font-size: 0.97rem; }
.tool li { padding: 0.6rem 0; border-top: 1px solid var(--line); }

/* --------------------------------------------------------------------------
   House rules
   -------------------------------------------------------------------------- */
.rules { padding-block: clamp(3rem, 8vw, 6rem); }
.rules h2 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.rules__intro { color: var(--stone-dim); margin-top: 0.8rem; }
.rules__list { list-style: none; margin: 2.25rem 0 0; padding: 0; display: grid; gap: 0; }
.rules__list li {
  display: grid; gap: 0.3rem 3rem; padding: 1.1rem 0; border-top: 1px solid var(--line);
}
.rules__list li:last-child { border-bottom: 1px solid var(--line); }
.rules__list strong { font-family: var(--display); font-weight: 700; font-size: clamp(1.35rem, 2.6vw, 1.75rem); line-height: 1.1; }
.rules__list span { color: var(--stone-dim); }
@media (min-width: 52rem) { .rules__list li { grid-template-columns: 1fr 1fr; align-items: baseline; } }

/* --------------------------------------------------------------------------
   About and footer
   -------------------------------------------------------------------------- */
.about {
  padding-block: clamp(3rem, 8vw, 6rem);
  display: grid; gap: 2rem; align-items: start;
}
@media (min-width: 52rem) { .about { grid-template-columns: 1fr 2fr; } }
.about__mark { width: min(16rem, 60%); aspect-ratio: 360 / 262; color: var(--stone); overflow: visible; }

/* Back to the top (site.js): a round button in the bottom-right corner, on every page, shown
   once the page has been scrolled down a screen and a half */
.to-top {
  position: fixed; z-index: 15;
  right: max(1rem, env(safe-area-inset-right, 0px)); bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  width: 2.9rem; height: 2.9rem; padding: 0; display: grid; place-items: center;
  color: var(--stone); background: var(--slate-2); border: 1px solid var(--line); border-radius: 50%;
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.55); cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(0.5rem);
  transition: opacity 0.2s, transform 0.2s, visibility 0s 0.2s;
}
.to-top.is-on { opacity: 1; visibility: visible; transform: none; transition: opacity 0.2s, transform 0.2s; }
.to-top:hover { color: var(--dot-text); border-color: var(--dot); }
.to-top svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
@media (prefers-reduced-motion: reduce) { .to-top, .to-top.is-on { transition: none; } }

/* The easter egg (site.js, /mark3d/): with JavaScript and without "reduce motion", the About
   mark sits in a button. Its dot hops when the section comes into view, on hover and on
   keyboard focus; a click plays the mark in 3D over the page. */
.about__egg {
  display: block; width: min(16rem, 60%); margin: 0; padding: 0; border: 0; border-radius: 8px;
  background: none; color: inherit; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.about__egg > .about__mark { display: block; width: 100%; }
.about__egg:focus-visible { outline: 2px solid var(--dot); outline-offset: 8px; }
.mark__dot.is-hop { animation: dot-hop 0.6s linear 1; }
@keyframes dot-hop {
  0%   { transform: translateY(0); animation-timing-function: cubic-bezier(0.3, 0.6, 0.5, 1); }
  38%  { transform: translateY(-12px); animation-timing-function: cubic-bezier(0.5, 0, 0.8, 0.5); }
  66%  { transform: translateY(0); animation-timing-function: cubic-bezier(0.3, 0.6, 0.5, 1); }
  80%  { transform: translateY(-2.5px); animation-timing-function: cubic-bezier(0.5, 0, 0.8, 0.5); }
  92%, 100% { transform: translateY(0); }
}

/* The 3D mark's overlay: always the standalone version's night sea, in both schemes, so its
   colours are fixed rather than the page's tokens. Every opacity and transform here is driven
   frame by frame from /mark3d/mark3d.js. */
html.has-egg { overflow: hidden; }
.egg {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; overflow: hidden; background: transparent; color: #ddd7ca;
  color-scheme: dark;
}
.egg::backdrop { background: transparent; }
.egg:fullscreen { background: #171a1d; }
.egg__sky, .egg__vignette { position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.egg__sky { background: #171a1d; }
.egg__vignette { background: radial-gradient(120% 90% at 50% 45%, transparent 55%, #171a1d 100%); }
.egg__stage {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block;
  transform-origin: 0 0; touch-action: none; cursor: grab; opacity: 0;
}
.egg__stage:active { cursor: grabbing; }
.egg__flat { position: absolute; transform-origin: 0 0; overflow: visible; pointer-events: none; }
.egg__hud {
  position: absolute; left: 0; right: 0; bottom: 0; pointer-events: none;
  padding-block: 20px calc(20px + env(safe-area-inset-bottom, 0px));
  padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px));
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.egg__address { margin: 0; font-family: var(--display); font-weight: 700; font-size: clamp(1.5rem, 4.5vw, 2.2rem); line-height: 1; opacity: 0; }
.egg__address b { color: #f5a524; font-weight: 700; }
.egg__row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.egg__btn {
  pointer-events: auto; min-height: 2.75rem; font: 600 0.9rem/1 var(--text); color: #ddd7ca;
  background: #22262a; border: 1px solid #3b4148; border-radius: 999px; padding: 0.6rem 1.1rem; cursor: pointer;
}
.egg__btn:hover { border-color: #a39f95; }
.egg__btn:focus-visible { outline: 2px solid #f5a524; outline-offset: 2px; }
.about h2 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin-bottom: 1.25rem; }
.about__text { max-width: var(--measure); }
.mail { font-family: var(--display); font-weight: 700; font-size: 1.35rem; text-decoration-thickness: 2px; }

.foot {
  max-width: var(--page); margin: 0 auto;
  padding: 2rem var(--gutter) 3rem; background: linear-gradient(var(--line), var(--line)) no-repeat top center / calc(100% - 2 * var(--gutter)) 1px;
  font-size: 0.85rem; color: var(--stone-dim);
}
.foot p { margin: 0 0 0.4rem; max-width: 60rem; }
.foot__title { font-size: 1.15rem; margin: 1.5rem 0 0.6rem; color: var(--stone); }
.foot__list { margin: 0; padding: 0 0 0 1.1rem; max-width: 60rem; }
.foot__list li { margin: 0 0 0.4rem; }
