/* ==========================================================================
   Blueprint: MareCraftAI drawn as a technical drawing.

   | Ground  | #0B0E12  near black with a blue cast, never pure black        |
   | Raised  | #10151B  panels, the form, the chat                           |
   | Ink     | #E6ECF0  text and drawn lines, 16.1:1 on ground               |
   | Muted   | #9AA7B2  secondary text, 8.0:1 on ground                      |
   | Teal    | #4FB3B8  the one colour, for what is live; ground on it 8.4:1 |
   | Display | Archivo stretched to 125%, light, capitals                    |
   | Text    | Archivo at normal width; Plex Mono for notes                  |

   Corners are square everywhere. Dark only, by choice.
   ========================================================================== */

@font-face { font-family: "Archivo Wide"; src: url("/assets/archivo-wdth.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("/assets/plex-mono.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --ground: #0B0E12;
  --raised: #10151B;
  --ink: #E6ECF0;
  --muted: #9AA7B2;
  --teal: #4FB3B8;
  --teal-hi: #72C7CB;
  --line: rgba(212, 222, 230, .16);
  --line-2: rgba(212, 222, 230, .38);
  --font: "Archivo Wide", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Plex Mono", ui-monospace, "Cascadia Mono", monospace;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --wide: 76rem;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 1.0625rem/1.6 var(--font); overflow-x: hidden; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
h1, h2, h3 { margin: 0; font-weight: 500; text-wrap: balance; }
p { margin: 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* The hidden attribute always wins, whatever display a class gives. */
[hidden] { display: none !important; }
.skip { position: absolute; left: -9999px; top: 0; z-index: 10; background: var(--teal); color: var(--ground); padding: .75rem 1.2rem; }
.skip:focus { left: 0; }

/* Type and controls */
.display { font-stretch: 125%; font-weight: 250; text-transform: uppercase; letter-spacing: .01em; line-height: 1.06; }
.lede { color: var(--muted); font-size: clamp(1.02rem, 1rem + .25vw, 1.15rem); max-width: 56ch; }
.note { font: 400 .8rem/1.55 var(--mono); color: var(--muted); }
.btn { display: inline-flex; align-items: center; min-height: 48px; padding: .85rem 1.35rem; background: var(--teal); color: var(--ground); border: 1px solid var(--teal); text-decoration: none; font: 600 .92rem/1 var(--font); letter-spacing: .02em; white-space: nowrap; transition: background-color .2s ease, transform .12s ease; }
.btn:hover { background: var(--teal-hi); border-color: var(--teal-hi); }
.btn:active { transform: translateY(1px); }
.btn--line { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn--line:hover { background: transparent; border-color: var(--teal); }
.link { text-decoration: underline; text-decoration-color: var(--line-2); text-decoration-thickness: 1px; text-underline-offset: .3em; }
.link:hover { text-decoration-color: var(--teal); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .9rem 1.4rem; margin-top: 1.4rem; }

/* Header */
.top { position: relative; z-index: 3; display: flex; align-items: center; gap: 1.5rem; min-height: 72px; padding: .8rem var(--gutter); border-bottom: 1px solid var(--line); background: rgba(11, 14, 18, .72); }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; font: 600 1rem/1 var(--font); }
.menu { display: flex; gap: 1.8rem; margin-left: auto; }
.menu a { display: inline-flex; align-items: center; min-height: 24px; text-decoration: none; font-size: .92rem; color: var(--muted); }
.menu a:hover { color: var(--ink); }
.top__cta { display: inline-flex; align-items: center; min-height: 44px; padding: .5rem 1rem; border: 1px solid var(--teal); color: var(--teal); text-decoration: none; font: 500 .9rem/1 var(--font); white-space: nowrap; }
.top__cta:hover { background: var(--teal); color: var(--ground); }
.menu-toggle { margin-left: auto; min-height: 44px; padding: .5rem .9rem; background: transparent; color: var(--ink); border: 1px solid var(--line-2); font: 500 .9rem/1 var(--font); cursor: pointer; }
.menu-toggle[hidden], .menu[hidden] { display: none; }

/* Footer: the drawing's title block */
.sheet { position: relative; z-index: 2; margin-top: clamp(4rem, 9vw, 7rem); padding: 0 var(--gutter) 5.5rem; background: var(--ground); }
.sheet__block { display: grid; grid-template-columns: 1.1fr 1.3fr 1fr 1.4fr; max-width: var(--wide); border: 1px solid var(--line-2); }
.sheet__cell { display: grid; gap: .45rem; align-content: start; padding: 1.1rem 1.2rem; border-left: 1px solid var(--line); }
.sheet__cell:first-child { border-left: 0; }
.sheet__nav { grid-template-columns: 1fr 1fr; gap: .35rem 1rem; }
.sheet__nav a { text-decoration: none; color: var(--muted); font-size: .9rem; min-height: 24px; }
.sheet__nav a:hover { color: var(--ink); }
.sheet__signoff { margin-top: 1rem; max-width: var(--wide); }

/* Chat dock and the motion switch */
.dock { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 5; display: grid; justify-items: end; gap: .6rem; }
.dock__toggle { min-height: 44px; padding: .55rem 1.1rem; background: var(--raised); color: var(--ink); border: 1px solid var(--line-2); font: 500 .9rem/1 var(--font); cursor: pointer; }
.dock__toggle:hover, .dock__toggle[aria-expanded="true"] { border-color: var(--teal); }
.dock__panel { display: flex; flex-direction: column; width: min(24rem, calc(100vw - 2.5rem)); max-height: min(34rem, calc(100dvh - 7rem)); background: var(--raised); border: 1px solid var(--line-2); }
.dock__panel[hidden] { display: none; }
.dock__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
.dock__title { font-size: .95rem; font-weight: 600; }
.dock__note { margin: 0; padding: .55rem 1rem; border-bottom: 1px solid var(--line); }
.dock__close { min-height: 44px; padding: .3rem .8rem; background: transparent; color: var(--muted); border: 1px solid var(--line); font: 500 .8rem/1 var(--font); cursor: pointer; }
.dock__close:hover { color: var(--ink); border-color: var(--line-2); }
/* The chat inside the dock. The widget adds a message list and a bare input
   to #marecraft-chat: the list scrolls, the input stays at the foot. The
   visitor's words sit in an outlined block on the right; each reply hangs
   off a teal rule on the left, like a note on the drawing. */
#marecraft-chat { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.marecraft-messages { display: flex; flex-direction: column; gap: .9rem; flex: 1; min-height: 12rem; overflow-y: auto; overscroll-behavior: contain; padding: 1rem; background: var(--ground); }
.marecraft-messages:empty::before { content: "Try: How does setup work?"; margin-top: auto; font: 400 .8rem/1.55 var(--mono); color: var(--muted); }
.marecraft-message { max-width: 92%; font-size: .94rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.marecraft-message--user { align-self: flex-end; padding: .55rem .8rem; background: var(--raised); border: 1px solid var(--line-2); }
.marecraft-message--assistant { align-self: flex-start; padding: .15rem 0 .15rem .9rem; border-left: 2px solid var(--teal); }
.marecraft-messages:has(+ input:disabled)::after { content: "Writing a reply"; font: 400 .8rem/1.55 var(--mono); color: var(--muted); animation: dock-wait 1.1s ease-in-out infinite alternate; }
@keyframes dock-wait { to { opacity: .75; } }
#marecraft-chat input { width: 100%; min-height: 48px; padding: .75rem 1rem; background: var(--raised); color: var(--ink); border: 0; border-top: 1px solid var(--line-2); border-radius: 0; font: 400 1rem/1.4 var(--font); }
#marecraft-chat input::placeholder { color: var(--muted); opacity: 1; }
#marecraft-chat input:focus { outline: none; box-shadow: inset 0 -2px 0 var(--teal); }
#marecraft-chat input:disabled { color: var(--muted); }
.motion-toggle { position: fixed; left: 1.25rem; bottom: 1.25rem; z-index: 5; min-height: 40px; padding: .5rem .95rem; background: rgba(11, 14, 18, .85); color: var(--ink); border: 1px solid var(--line-2); font: 500 .8rem/1 var(--font); cursor: pointer; }
.motion-toggle[hidden] { display: none; }

/* Homepage: the room, fixed behind the words */
.stage { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.stage > svg, .stage > canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
/* The static room sits where the WebGL camera's view offset puts the room. */
.stage > svg { transform: translateX(21%); }
.room path { fill: none; stroke: #D4DEE6; stroke-width: 1; vector-effect: non-scaling-stroke; }
.room .faint { stroke-opacity: .12; }
.room .line { stroke-opacity: .5; }
.room .teal { stroke: var(--teal); stroke-opacity: .9; }
.stage > canvas { opacity: 0; transition: opacity .8s ease; }
.stage.has-canvas > canvas { opacity: 1; }
.stage.has-canvas > svg { opacity: 0; transition: opacity .6s ease .3s; }
.stage.is-gone ~ .motion-toggle { display: none; }
/* The washes behind the hero and chapters reach past the words; clip them
   at the page's edges so they never make the page scroll sideways. */
.home main { position: relative; z-index: 1; overflow-x: clip; }

.hero { position: relative; min-height: calc(100dvh - 72px); display: grid; align-content: center; gap: 1.4rem; max-width: 60rem; padding: 2rem var(--gutter) 10vh; }
.hero::before, .chapter::before { content: ""; position: absolute; inset: 0 -12vw 0 -3rem; z-index: -1; pointer-events: none; background: linear-gradient(90deg, rgba(11, 14, 18, .94) 0%, rgba(11, 14, 18, .85) 45%, rgba(11, 14, 18, 0) 100%); }
/* As on a drawing, lines break around the words: a halo of ground behind
   the text wherever it crosses the room. Buttons keep their own fill. */
.hero, .chapter, .parts > h2, .parts > .lede { text-shadow: 0 0 6px var(--ground), 0 0 14px var(--ground); }
.hero .btn { text-shadow: none; }
.hero__title { font-size: clamp(1.6rem, .6rem + 4vw, 4rem); text-shadow: -1.5px 0 rgba(255, 72, 96, .38), 1.5px 0 rgba(72, 206, 255, .38), 0 0 14px var(--ground); }
.hero .lede { max-width: 36ch; }
.hero .actions { margin-top: .6rem; }

.story { position: relative; }
.chapter { position: relative; min-height: 100dvh; display: grid; align-content: center; gap: 1.2rem; max-width: 48rem; padding: 12vh var(--gutter); }
.chapter__title { font-size: clamp(1.5rem, .8rem + 1.7vw, 2.4rem); }
.exchange { margin: .6rem 0 0; padding: .2rem 0 .2rem 1rem; border-left: 1px solid var(--teal); }
.exchange blockquote { margin: 0; font-size: 1.15rem; }
.exchange figcaption { margin-top: .5rem; }

.parts { position: relative; padding: clamp(5rem, 10vw, 8rem) var(--gutter) clamp(4rem, 8vw, 6rem); background: linear-gradient(180deg, rgba(11, 14, 18, 0), rgba(11, 14, 18, .86) 18%, rgba(11, 14, 18, .94)); }
.parts h2, .route h2, .trust h2 { font-size: clamp(1.6rem, 1rem + 2vw, 2.9rem); max-width: var(--wide); }
.parts .lede, .route .lede, .trust .lede { margin-top: 1rem; }
.parts__grid { list-style: none; margin: 2.5rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: var(--wide); border-top: 1px solid var(--line-2); border-left: 1px solid var(--line-2); }
.part { display: grid; gap: .6rem; align-content: start; height: 100%; padding: 1.4rem 1.4rem 1.6rem; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); text-decoration: none; }
.part h3 { font-size: 1.05rem; font-weight: 600; }
.part p { color: var(--muted); font-size: .95rem; }
.part:hover h3 { text-decoration: underline; text-decoration-color: var(--teal); text-underline-offset: .25em; }
.drawing { width: 100%; height: auto; aspect-ratio: 4 / 3; margin-bottom: .4rem; }
.drawing path { fill: none; stroke: #D4DEE6; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.drawing .faint { stroke-opacity: .3; }
.drawing .line { stroke-opacity: .8; }
.drawing .teal { stroke: var(--teal); }
.draws .drawing path { stroke-dashoffset: 1; }
.draws .drawing.is-drawn path { stroke-dashoffset: 0; transition: stroke-dashoffset 1.4s cubic-bezier(.16, 1, .3, 1); }
.draws .drawing.is-drawn .teal { transition-delay: .5s; }
.parts__foot { margin-top: 1.6rem; display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; color: var(--muted); }

.route, .trust, .closing { position: relative; background: var(--ground); padding: clamp(4.5rem, 9vw, 7rem) var(--gutter) 0; }
.route__steps { position: relative; list-style: none; margin: 3rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; max-width: var(--wide); }
.route__steps::before { content: ""; position: absolute; left: .45rem; right: 12%; top: .45rem; border-top: 1px solid var(--line-2); }
.route__steps li { position: relative; display: grid; gap: .5rem; align-content: start; padding-top: 2rem; }
.route__steps li::before { content: ""; position: absolute; left: 0; top: 0; width: .9rem; height: .9rem; border: 1px solid var(--teal); background: var(--ground); }
.route__steps h3 { font-size: 1.05rem; font-weight: 600; }
.route__steps p { color: var(--muted); }
.trust__points { margin: 2.4rem 0 0; display: grid; max-width: 52rem; border: 1px solid var(--line-2); }
.trust__points div { display: grid; grid-template-columns: 10rem 1fr; gap: 1rem; padding: 1rem 1.2rem; border-top: 1px solid var(--line); }
.trust__points div:first-child { border-top: 0; }
.trust__points dt { font: 400 .8rem/1.6 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.trust__points dd { margin: 0; }
.closing { display: grid; gap: 1.4rem; justify-items: start; }
.closing h2 { font-size: clamp(2rem, 1rem + 3vw, 4rem); }
.closing p { color: var(--muted); max-width: 44ch; }

/* Inside pages */
.page { background-image: linear-gradient(rgba(212, 222, 230, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(212, 222, 230, .035) 1px, transparent 1px); background-size: 32px 32px; background-attachment: fixed; }
.page main { max-width: var(--wide); padding: 0 var(--gutter); }
.intro { display: grid; gap: 1.2rem; padding: clamp(3.5rem, 9vw, 6.5rem) 0 clamp(2rem, 5vw, 3rem); }
/* A page headline fills its column from its longest line (--fit characters,
   0.82em each at most in this face), between 1.4rem and 3.6rem. */
.intro, .contact__intro, .prose { container-type: inline-size; }
.fit { font-size: clamp(1.4rem, calc(100cqi / (var(--fit) * .82)), 3.6rem); text-wrap: balance; }
.fit__line { display: block; }
.jump { display: flex; flex-wrap: wrap; gap: .4rem 1.6rem; padding: 1rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.jump a { display: inline-flex; align-items: center; min-height: 24px; text-decoration: none; color: var(--muted); font-size: .92rem; }
.jump a:hover { color: var(--ink); }
.topic, .group, .closer { margin-top: clamp(2.5rem, 6vw, 4rem); padding-top: clamp(2rem, 5vw, 3rem); border-top: 1px solid var(--line); }
.topic { display: grid; gap: .9rem; max-width: 46rem; }
.topic__name, .group__title { font-size: clamp(1.4rem, 1rem + 1.2vw, 2rem); font-stretch: 125%; font-weight: 300; text-transform: uppercase; }
.topic__title { font-size: 1.2rem; }
.status { justify-self: start; padding: .35rem .6rem; border: 1px solid var(--teal); color: var(--teal); font: 400 .75rem/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.points { display: grid; gap: .45rem; margin: 0; padding-left: 1.1rem; list-style: square; }
.points li::marker { color: var(--muted); }
.steps { list-style: none; margin: 0; padding: 0; }
.group { display: grid; gap: 1rem; }
.facts { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); border-top: 1px solid var(--line-2); }
.facts > li { display: grid; gap: .5rem; align-content: start; padding: 1.2rem 1.4rem 1.4rem 0; }
.facts h3, .panel h3 { font-size: 1.02rem; font-weight: 600; }
.facts p { color: var(--muted); }
.panel { display: grid; gap: .6rem; max-width: 46rem; margin-top: 1.4rem; padding: 1.2rem 1.4rem; background: var(--raised); border: 1px solid var(--line-2); }
.closer { display: grid; gap: 1.2rem; justify-items: start; }
.closer h2 { font-size: clamp(1.6rem, 1rem + 2vw, 2.8rem); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th, .table td { text-align: left; vertical-align: top; padding: .85rem .9rem .85rem 0; border-bottom: 1px solid var(--line); }
.table thead th { font: 400 .75rem/1.4 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; border-bottom-color: var(--line-2); }
.table tbody th { font-weight: 600; white-space: nowrap; }
.plans { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line-2); }
.plan { display: grid; gap: .8rem; align-content: start; padding: 1.4rem 1.4rem 1.6rem; border-right: 1px solid var(--line); }
.plan:last-child { border-right: 0; }
.plan--featured { box-shadow: inset 0 2px 0 var(--teal); }
.plan__name { font-size: 1.3rem; font-stretch: 125%; font-weight: 300; text-transform: uppercase; }
.plan .btn { justify-self: start; margin-top: .4rem; }
.rows { display: grid; margin: 1rem 0 0; border-top: 1px solid var(--line-2); }
.rows div { display: grid; grid-template-columns: minmax(0, 16rem) 1fr; gap: 1.5rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.rows dt { font-weight: 600; }
.rows dd { margin: 0; color: var(--muted); }
.faq { display: grid; max-width: 52rem; border-top: 1px solid var(--line-2); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { position: relative; padding: 1rem 2rem 1rem 0; font-weight: 600; list-style: none; cursor: pointer; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: .2rem; top: 1rem; color: var(--teal); font-family: var(--mono); }
.faq details[open] summary::after { content: "-"; }
.faq details p { max-width: 62ch; padding: 0 0 1.1rem; color: var(--muted); }
.contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(2rem, 6vw, 5rem); padding: clamp(3.5rem, 9vw, 6rem) 0 0; }
.contact__intro { display: grid; gap: 1.2rem; align-content: start; }
.contact__aside { display: grid; gap: .6rem; margin-top: 1rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.contact__aside h2 { font-size: 1rem; font-weight: 600; }
.form { display: grid; gap: 1.1rem; align-content: start; padding: 1.6rem; background: var(--raised); border: 1px solid var(--line-2); }
.field { display: grid; gap: .45rem; }
.field label { font-size: .92rem; }
.form input:not([type="checkbox"]), .form select, .form textarea { width: 100%; min-height: 46px; padding: .7rem .8rem; background: var(--ground); color: var(--ink); border: 1px solid var(--line-2); border-radius: 0; font: inherit; }
.form input:focus-visible, .form select:focus-visible, .form textarea:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }
.consent { display: flex; gap: .7rem; align-items: flex-start; font-size: .92rem; color: var(--muted); }
.consent input { flex: none; width: 20px; height: 20px; margin: .15rem 0 0; accent-color: var(--teal); }
.form .btn { justify-self: start; }
.status-line { min-height: 1.4em; }
.samples { list-style: none; margin: 1.4rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; }
.sample { display: grid; gap: .7rem; align-content: start; }
.sample__shot { display: block; border: 1px solid var(--line-2); }
.sample__shot img { width: 100%; height: auto; }
.sample h3 { margin-top: .4rem; font-size: 1.15rem; font-weight: 600; }
.demos { list-style: none; margin: 0; padding: 0; display: grid; border-top: 1px solid var(--line-2); }
.demos > li { display: grid; grid-template-columns: minmax(0, 20rem) 1fr; gap: .6rem 2rem; padding: 1.4rem 0; border-bottom: 1px solid var(--line); }
.demos h2 { font-size: 1.1rem; font-weight: 600; }
.demos p { grid-column: 1; color: var(--muted); }
.demos__links { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; grid-column: 2; grid-row: 1 / span 2; }
.prose { display: grid; gap: 1.1rem; max-width: 46rem; padding: clamp(3.5rem, 9vw, 6rem) 0 0; }
.prose h2 { margin-top: 1.4rem; font-size: 1.15rem; font-weight: 600; }
.prose ul { display: grid; gap: .55rem; margin: 0; padding-left: 1.2rem; }
.prose a { text-decoration-color: var(--line-2); text-underline-offset: .25em; }

/* Drawings beside the words: a column to the right at desktop, above the
   words and smaller on narrow screens. */
.figure { width: 100%; max-width: 15rem; }
.figure .drawing { margin: 0; }
.topic--drawn { grid-template-columns: minmax(0, 46rem) minmax(8rem, 15rem); column-gap: clamp(2rem, 6vw, 5rem); max-width: none; align-items: start; }
.topic__text { display: grid; gap: .9rem; }
.facts--drawn .figure { max-width: 9rem; margin-bottom: .2rem; }
.plan .figure { max-width: 8rem; }
.drawn-row { display: grid; grid-template-columns: minmax(0, 46rem) minmax(8rem, 12rem); column-gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.drawn-row .panel { margin-top: 0; }
.contact__intro .figure { max-width: 13rem; margin-top: 1rem; }
/* How it works: one route down the side, a square node at each step, the
   homepage's route turned on end. */
.route-down { position: relative; }
.route-down > .topic { position: relative; margin-top: clamp(2rem, 5vw, 3rem); padding: 0 0 0 2.4rem; border-top: 0; }
.route-down > .topic::before { content: ""; position: absolute; left: 0; top: .45rem; width: .9rem; height: .9rem; border: 1px solid var(--teal); background: var(--ground); z-index: 1; }
.route-down > .topic:not(:last-child)::after { content: ""; position: absolute; left: .45rem; top: 1.35rem; bottom: calc(-1 * clamp(2rem, 5vw, 3rem) - .45rem); border-left: 1px solid var(--line-2); }

/* Narrow or squarish screens: the words above the room, one column. The
   room's camera uses the same test (wider than 860px and more than 6:5). */
@media (max-width: 860px), (max-aspect-ratio: 6/5) {
  .stage > svg { transform: translateY(24%); }
  .hero { align-content: start; max-width: none; padding-top: 8vh; }
  .hero::before, .chapter::before { inset: 0 -3rem; background: linear-gradient(180deg, rgba(11, 14, 18, .92), rgba(11, 14, 18, .75) 45%, rgba(11, 14, 18, 0) 75%); }
  .chapter { align-content: start; max-width: none; padding-top: 10vh; }
}
@media (max-width: 860px) {
  .parts__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top { flex-wrap: wrap; gap: .75rem; }
  .menu-toggle { padding: .5rem .8rem; }
  .menu { order: 3; flex-direction: column; gap: 0; width: 100%; margin: .4rem 0 0; }
  .menu a { padding: .75rem 0; border-top: 1px solid var(--line); font-size: 1rem; color: var(--ink); }
  .top__cta { order: 2; padding: .5rem .8rem; }
  .sheet__block { grid-template-columns: 1fr; }
  .sheet__cell { border-left: 0; border-top: 1px solid var(--line); }
  .sheet__cell:first-child { border-top: 0; }
  .route__steps { grid-template-columns: 1fr; }
  .route__steps::before { top: .45rem; bottom: .45rem; left: .45rem; right: auto; border-top: 0; border-left: 1px solid var(--line-2); }
  .route__steps li { padding: 0 0 0 2.2rem; }
  .plans { grid-template-columns: 1fr; }
  .plan { border-right: 0; border-bottom: 1px solid var(--line); }
  .rows div { grid-template-columns: 1fr; gap: .3rem; }
  .contact { grid-template-columns: minmax(0, 1fr); }
  .topic--drawn, .drawn-row { grid-template-columns: minmax(0, 1fr); }
  .topic--drawn .figure { order: -1; max-width: 9rem; }
  .drawn-row .figure { display: none; }
  .contact__intro .figure { display: none; }
}
@media (max-width: 760px) {
  .samples { grid-template-columns: 1fr; }
  .demos > li { grid-template-columns: 1fr; }
  .demos__links { grid-column: 1; grid-row: auto; }
}
@media (max-width: 600px) {
  .parts__grid { grid-template-columns: 1fr; }
  .trust__points div { grid-template-columns: 1fr; gap: .3rem; }
}
/* The smallest phones: a tighter header, and long button labels may wrap
   rather than push the page sideways. */
@media (max-width: 400px) {
  .top { gap: .5rem; }
  .menu-toggle, .top__cta { padding: .5rem .6rem; }
  .btn { white-space: normal; line-height: 1.3; }
}
/* Below 360px the header's one line cannot hold the name as well: the logo
   stays, and the name stays for screen readers and in the footer. */
@media (max-width: 359px) {
  .top .brand span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  /* A shortened endless pulse would flicker, so the waiting line holds still. */
  .marecraft-messages:has(+ input:disabled)::after { animation: none; }
}
