/*=============== ETHERLOCKED – WARM PRINTED-ILLUSTRATION THEME ===============
  Loaded only by etherlocked.html, after styles.css. Everything is scoped to
  .ether-page, so no other page is affected.

  Look: dark brown page with a faint grain, chunky orange condensed headings,
  earthy fills, soft pencil outlines and slightly uneven ("wobbly") corners.

  How this file is organised
    1. Tokens          colours, spacing, type, radii, strokes – change them here
    2. Page            grain, layout, section rhythm, shared text styles
    3. Sections        hero → overview → contribution → TOC → content sections
    4. Components      technical panels, decision cards, buttons, footer

  Breakpoints: 1150px (nav bar / drawer), 900px (TOC hides, from styles.css),
  768px (tablet), 480px (phone)
===================================================================== */

/* ───────────── 1. TOKENS ───────────── */
.ether-page {
  /* colours: ground */
  --paper: rgb(45, 25, 13); /* page background (same as the rest of the site) */
  --paper-2: rgb(62, 38, 24); /* cards */
  --paper-3: rgb(78, 48, 30); /* chips and small buttons */
  --night: rgb(30, 17, 9); /* footer, diagram frames */
  --text: #f1e8d0;
  --ink: #3b2c22; /* dark text on light fills */
  --pencil: #8f7a67; /* every outline */

  /* colours: accents */
  --orange: #dc5a28;
  --orange-hi: #ee7a3a;
  --orange-dk: #f08a4b; /* orange for small text */
  --mustard: #e0a73a;
  --brick: #e08a6a;
  --itch: #8f3a33;
  --itch-hi: #a84840;
  --mark: rgba(226, 152, 68, 0.14); /* highlighter behind key words */

  /* colours: four tag palettes (fill + line), used by the loop diagram,
     the puzzle map, the technical panel pills and the decision cards */
  --moss: #5f6b2b;
  --olive: #9aa94a;
  --teal: #3f5d63;
  --sage: #7fb0a8;
  --rust: #7a3b22;
  --plum: #54405a;
  --mauve: #a98cc9;

  /* spacing scale – use these for every margin, padding and gap */
  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-s: 1rem;
  --space-m: 1.5rem;
  --space-l: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;
  --space-4xl: 8rem;

  /* spacing roles */
  --section-gap: var(--space-4xl); /* between the big page sections */
  --title-gap: var(--space-m); /* under a section title */
  --flow-gap: var(--space-l); /* between a text block and the block after it */
  --card-pad: var(--space-l); /* inside every card */
  --page-gutter: var(--gutter); /* page side padding (--gutter comes from styles.css) */

  /* widths */
  --content-width: 800px; /* text column, images, cards */
  --intro-width: 720px; /* centred intro paragraphs */

  /* type */
  --cartoon-font: "Londrina Solid", "Caveat Brush", cursive;
  --fs-hero: clamp(2.5rem, 12vw, 8rem);
  --fs-display: clamp(3.2rem, 7.4vw, 6.5rem); /* home and contact page heroes */
  --fs-h1: clamp(2.6rem, 6vw, 4.5rem); /* Overview, My contribution */
  --fs-h2: clamp(2.4rem, 5vw, 4rem); /* numbered content sections */
  --fs-h3: clamp(1.5rem, 2.6vw, 1.9rem); /* card titles */
  --fs-h4: clamp(1.1rem, 2vw, 1.3rem); /* small titles and pills */
  --fs-button: clamp(1.25rem, 2vw, 1.5rem);
  --fs-lead: clamp(1.1rem, 2vw, 1.5rem); /* centred intro paragraphs */
  --fs-body: clamp(1.1rem, 2vw, 1.4rem);
  --fs-body-s: clamp(1.08rem, 1.9vw, 1.28rem); /* text inside cards and panels */
  --fs-small: 1.05rem;
  --fs-label: 0.95rem;
  --lh-display: 0.95; /* big cartoon titles */
  --lh-tight: 1.2;
  --lh-snug: 1.4; /* captions, chips, small print in cards */
  --lh-body: 1.7;

  /* shapes: hand-drawn corners are never quite equal */
  --wobble: 18px 24px 16px 26px / 24px 16px 26px 18px;
  --wobble-sm: 12px 16px 11px 15px / 15px 11px 16px 12px;
  --radius-sm: 8px; /* chips and swatches */
  --radius: 14px;
  --radius-pill: 999px;
  --stroke-thick: 3px; /* cards, chips, buttons */
  --stroke: 2px; /* tags, timeline, diagram lines */
  --stroke-thin: 1px; /* dividers */
  --divider: color-mix(in srgb, var(--pencil) 35%, transparent); /* hairline between rows */

  color: var(--text);
}

@media (max-width: 768px) {
  .ether-page {
    --section-gap: var(--space-3xl);
    --page-gutter: clamp(1.25rem, 5vw, 2.5rem);
  }
}

@media (max-width: 480px) {
  .ether-page {
    --card-pad: var(--space-m);
    --page-gutter: 1.25rem;
  }
}

/* ───────────── 2. PAGE ───────────── */
/* faint paper grain over the whole page */
.ether-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.1;
  mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.9 0 0 0 0 0.8 0 0 0 0 0.65 0 0 0 0.9 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* one side padding for every full-width block */
.ether-page .about-work1 .container,
.ether-page .project-layout,
.ether-page .project-layout ~ .next-work .container {
  padding-inline: var(--page-gutter);
}

/* section rhythm: every big block is --section-gap away from the next */
.ether-page .about-work1 {
  order: 0;
  padding-bottom: 0;
}

.ether-page .about-work1 .container {
  padding-block: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
}

.ether-page .contribution,
.ether-page .project-layout,
.ether-page .next-work {
  padding-top: var(--section-gap);
}

.ether-page .project-sections {
  gap: var(--section-gap);
  counter-reset: sec;
}

/* flat sections: no tilt, card or shadow from styles.css */
.ether-page .project-sections > .project-section {
  counter-increment: sec;
  counter-reset: sub;
  transform: none;
  background: transparent;
  border: none;
  box-shadow: none;
}

/* two paragraphs in a row: a small gap between them */
.ether-page .about-description1 + .about-description1 {
  margin-top: var(--space-s);
}

/* titles */
.ether-page .section-title {
  margin: 0 0 var(--title-gap);
  font-family: var(--cartoon-font);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: var(--lh-display);
  color: var(--orange);
}

.ether-page .about-work1 .section-title {
  font-size: var(--fs-h1);
}

/* content sections: a tilted number chip before the title */
.ether-page .project-section .section-title {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  text-align: left;
  font-size: var(--fs-h2);
}

.ether-page .project-section .section-title::before {
  content: counter(sec);
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 1.15em;
  height: 1.15em;
  font-size: 0.62em;
  background: var(--paper-3);
  border: var(--stroke-thick) solid var(--pencil);
  border-radius: var(--wobble-sm);
  transform: rotate(-4deg);
}

/* subsections share their parent's number: 4.1, 4.2 … */
.ether-page .project-sections > .project-section--sub {
  counter-increment: sub;
  counter-reset: none;
}

.ether-page .project-section--sub .section-title::before {
  content: counter(sec) "." counter(sub);
  width: auto;
  min-width: 1.15em;
  padding: 0 0.25em;
}

/* body text: key words get an orange highlighter mark */
.ether-page .about-description1 {
  max-width: var(--content-width);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text);
}

.ether-page .about-work1 .about-description1 {
  max-width: var(--intro-width);
  font-size: var(--fs-lead);
  margin: 0 auto;
  text-align: center;
}

.ether-page .about-description1 span {
  padding: 0.02em 0.18em;
  margin-inline: -0.05em;
  color: var(--orange-dk);
  background: var(--mark);
  border-radius: 0.4em;
  box-decoration-break: clone;
}

/* pictures and diagrams under a paragraph */
.ether-page .loop-diagram {
  max-width: var(--content-width);
  margin: var(--flow-gap) auto 0;
  border-radius: var(--wobble);
}

.ether-page .loop-img,
.ether-page .loop-svg {
  display: block;
  width: 100%;
}

/* opaque screenshots: the frame hugs the image */
.ether-page .loop-diagram--framed {
  overflow: hidden;
}

/* ───────────── 3. HERO ───────────── */
.ether-page .work-details {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: auto;
  min-height: 62vh;
  padding-block: var(--space-4xl);
  /* lighter wash overall, darker toward the bottom edge where the wave sits */
  background:
    radial-gradient(ellipse at center, rgba(45, 25, 13, 0) 0%, rgba(45, 25, 13, 0.55) 100%),
    linear-gradient(to bottom, rgba(45, 25, 13, 0.1) 0%, rgba(45, 25, 13, 0.55) 100%),
    url("../img/EtherLocked/EtherLocked_Hero_Background.webp") center / cover no-repeat;
}

.ether-page .work-details .intro {
  width: 100%;
  text-align: center;
}

.ether-page .work-title {
  margin: 0 0 var(--space-l);
  font-family: var(--cartoon-font);
  font-weight: 900;
  font-size: var(--fs-hero);
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--orange);
  text-shadow: 0 4px 0 rgba(45, 25, 13, 0.55), 0 10px 40px rgba(0, 0, 0, 0.6);
  cursor: inherit;
}

/* facts: one quiet centred row, thin dividers between them */
.ether-page .work-meta {
  justify-content: center;
  gap: 0;
  margin: 0 0 var(--space-xl);
}

.ether-page .meta-item {
  align-items: center;
  padding: 0 var(--space-l);
  border-left: var(--stroke-thin) solid var(--pencil);
}

.ether-page .meta-item:first-child {
  border-left: none;
}

.ether-page .meta-label {
  font-family: var(--cartoon-font);
  font-size: var(--fs-label);
  letter-spacing: 0.1em;
  opacity: 1;
  color: var(--mustard);
}

.ether-page .meta-value {
  font-size: var(--fs-small);
  line-height: 1.35;
  color: var(--text);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
}

/* the one thing to click, in a muted itch.io red */
.ether-page .hero-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  padding: var(--space-2xs) var(--space-s) var(--space-2xs) var(--space-m);
  font-family: var(--cartoon-font);
  font-weight: 700;
  font-size: var(--fs-button);
  color: #fff;
  background: var(--itch);
  border: var(--stroke-thick) solid var(--brick); /* every button: 3px outline */
  border-radius: var(--wobble-sm);
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease,
    border-color 0.2s ease;
}

/* same hover as every other button on the page (prev/next project, contact,
   scroll-up): turns mustard, lifts and tilts */
.ether-page .hero-cta:hover,
.ether-page .hero-cta:focus-visible {
  color: var(--ink);
  background: var(--mustard);
  border-color: var(--mustard);
  transform: rotate(-1deg) translateY(-3px);
}

/* THE arrow of the site: a solid, slightly uneven chevron in the text
   colour. Used in every button (hero, contact, prev/next project,
   scroll-up, cards). It points right; the modifiers turn it. */
.ether-page .hand-arrow {
  flex: 0 0 auto;
  width: 0.5em;
  height: auto;
  fill: currentColor;
  stroke: none;
  overflow: visible;
}

.ether-page .hand-arrow--left {
  transform: scaleX(-1);
}

.ether-page .hand-arrow--up {
  transform: rotate(-90deg);
}

.ether-page .hand-arrow--down {
  transform: rotate(90deg);
}

/* disclosure caret in the same pencil line */
.ether-page .hand-chevron {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* rolling hills where the hero meets the page */
.ether-page .hero-wave {
  position: absolute;
  bottom: -1px;
  z-index: 1;
  width: 100%;
  height: clamp(36px, 5vw, 72px);
}

.ether-page .hero-wave .wave-fill {
  fill: var(--paper);
}

.ether-page .hero-wave .wave-line {
  fill: none;
  stroke: var(--pencil);
  stroke-width: 3;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

@media (max-width: 768px) {
  .ether-page .work-details {
    min-height: 56vh;
    padding-top: var(--space-3xl);
  }

  .ether-page .work-meta {
    gap: var(--space-s) 0;
  }

  .ether-page .meta-item {
    padding: 0 var(--space-s);
  }
}

@media (max-width: 480px) {
  .ether-page .work-meta {
    flex-direction: column;
    align-items: center;
  }

  .ether-page .meta-item {
    padding: 0;
    border-left: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ether-page .hero-cta:hover,
  .ether-page .hero-cta:focus-visible {
    transform: none;
  }
}

/* ───────────── 3. OVERVIEW ───────────── */
/* trailer: a slightly tilted picture window */
.ether-page .ether-video-wrapper {
  position: relative;
  max-width: var(--content-width);
  margin: var(--flow-gap) auto 0;
  overflow: hidden;
  line-height: 0;
  border-radius: var(--wobble);
  transform: rotate(0.4deg);
}

.ether-page .ether-video {
  display: block;
  width: 100%;
}

.ether-page .ether-video-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: var(--cursor-click), pointer;
  transition: opacity 0.3s ease;
}

.ether-page .ether-video-play.is-hidden {
  opacity: 0;
  pointer-events: none;
}

/* the svg has no size attributes of its own */
.ether-page .ether-video-play svg {
  width: 92px;
  height: 92px;
  overflow: visible;
  transition: transform 0.2s ease;
}

.ether-page .ether-video-play:hover svg {
  transform: scale(1.1) rotate(-5deg);
}

.ether-page .ether-video-play circle {
  fill: var(--orange);
  stroke: var(--text);
  /* exactly 3px on screen, same outline as every other button */
  stroke-width: var(--stroke-thick);
  vector-effect: non-scaling-stroke;
}

.ether-page .ether-video-play polygon {
  fill: var(--text);
  stroke: var(--text);
  stroke-width: 4;
  stroke-linejoin: round;
}

/* ───────────── 3. MY CONTRIBUTION ───────────── */
/* four plain filled rectangles in a 2 x 2 grid */
.ether-page .contribution-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-m);
  max-width: 1100px;
  margin: var(--flow-gap) auto 0;
  text-align: left;
}

.ether-page .contribution-card {
  padding: var(--card-pad);
  background: var(--paper-2);
  border-radius: var(--radius);
}

/* an odd last contribution card spans the whole row instead of leaving a gap */
.ether-page .contribution-grid > :last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

/* shared work: dashed frame, no fill, muted title. The dashes are an SVG
   used as a mask (stroke 6, half clipped = 3px showing), so they are short
   with even gaps and always take the page's own --pencil colour */
.ether-page .contribution-card--shared {
  position: relative;
  background: none;
}

.ether-page .contribution-card--shared::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--pencil);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3E%3Crect width='100%25' height='100%25' rx='14' fill='none' stroke='%23000' stroke-width='6' stroke-dasharray='10 9'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3E%3Crect width='100%25' height='100%25' rx='14' fill='none' stroke='%23000' stroke-width='6' stroke-dasharray='10 9'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
  pointer-events: none;
}

.ether-page .contribution-name {
  margin: 0 0 var(--space-s);
  font-family: var(--cartoon-font);
  font-weight: 400;
  font-size: var(--fs-h3);
  letter-spacing: 0.03em;
  line-height: var(--lh-tight);
  color: var(--orange-dk);
}

.ether-page .contribution-card--shared .contribution-name {
  color: var(--text);
  opacity: 0.8;
}

/* one column (styles.css splits this list into two on wide screens) */
.ether-page .contribution-list {
  column-count: 1;
}

.ether-page .contribution-list li {
  font-size: var(--fs-body-s);
  line-height: var(--lh-body);
  hyphens: none;
}

@media (max-width: 768px) {
  .ether-page .contribution-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ───────────── 3. TABLE OF CONTENTS ───────────── */
/* a thin rail with an outlined dot per entry; the current dot fills orange */
.ether-page .toc {
  flex: 0 0 250px;
}

.ether-page .toc .about-label1 {
  padding: 0 0 var(--space-3xs);
  font-family: var(--cartoon-font);
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: 0.06em;
  color: var(--orange);
  background: transparent;
  border-radius: 0;
}

.ether-page .toc-nav {
  position: relative;
  gap: var(--space-s);
  padding: var(--space-3xs) 0;
}

.ether-page .toc-nav::before {
  content: "";
  position: absolute;
  top: 0.6rem;
  bottom: 0.6rem;
  left: 8px; /* rail centre = dot centre (9px) */
  width: var(--stroke);
  background: var(--pencil);
  border-radius: var(--stroke);
}

.ether-page .toc-item,
.ether-page .toc-subitem {
  position: relative;
  gap: var(--space-s);
  padding-block: var(--space-3xs);
  padding-left: 0;
  opacity: 1;
  color: var(--text);
  transition: opacity 0.3s, transform 0.2s ease;
}

.ether-page .toc-item {
  font-size: clamp(1.15rem, 2.2vw, 1.6rem);
}

/* smaller dot, shifted 3px so it sits centred on the rail; the extra 3px of
   gap keeps the labels lined up with the main entries */
.ether-page .toc-subitem {
  margin-left: 3px;
  gap: calc(var(--space-s) + 3px);
  font-size: clamp(1rem, 1.8vw, 1.3rem);
}

.ether-page .toc-label {
  opacity: 0.6;
  transition: opacity 0.2s, color 0.2s;
}

.ether-page .toc-item:hover .toc-label,
.ether-page .toc-subitem:hover .toc-label {
  opacity: 1;
}

.ether-page .toc-item.active .toc-label,
.ether-page .toc-subitem.active .toc-label {
  opacity: 1;
  color: var(--orange-dk);
}

.ether-page .toc-bar,
.ether-page .toc-subbar {
  position: relative;
  z-index: 1;
  width: 18px;
  height: 18px;
  background: var(--paper);
  border: var(--stroke) solid var(--pencil);
  border-radius: 50%;
  transition: none;
}

.ether-page .toc-subbar {
  width: 12px;
  height: 12px;
}

.ether-page .toc-item:hover .toc-bar,
.ether-page .toc-subitem:hover .toc-subbar {
  border-color: var(--text);
}

.ether-page .toc-item.active .toc-bar,
.ether-page .toc-subitem.active .toc-subbar {
  width: 18px;
  height: 18px;
  background: var(--orange);
  border-color: var(--orange);
  box-shadow: none; /* styles.css stretches the active entry and adds a glow */
}

.ether-page .toc-subitem.active .toc-subbar {
  width: 12px;
  height: 12px;
}

/* subsections follow the reader: toc-scrollspy.js puts each topic's
   subsections in a .toc-group, and only the group of the topic on screen is
   open. It slides open and shut (0fr → 1fr rows). */
.ether-page .toc-group {
  display: grid;
  grid-template-rows: 0fr;
  /* the nav's own gap would leave space under a closed group */
  margin-top: calc(-1 * var(--space-s));
  transition: grid-template-rows 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    margin-top 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.ether-page .toc-group.is-open {
  grid-template-rows: 1fr;
  margin-top: 0;
}

.ether-page .toc-group__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
  min-height: 0;
  overflow: hidden;
}

/* tablet and phone: no table of contents, the page just reads top to bottom */
@media (max-width: 900px) {
  .ether-page .toc {
    display: none;
  }

  /* jumping to a section clears the header */
  .ether-page .project-section {
    scroll-margin-top: calc(var(--header-height) + 1rem);
  }

  .ether-page .tech-toggle-wrapper .tech-toggle-btn {
    scroll-margin-top: calc(var(--header-height) + 1rem);
  }
}

/* phone menu button: a full-size touch target */
@media screen and (max-width: 1150px) {
  .ether-page .nav-toggle {
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    min-height: 2.75rem;
  }
}

/* ───────────── 3. NARRATIVE ───────────── */
.ether-page .narrative-row {
  display: flex;
  align-items: center;
  gap: var(--space-2xl);
  max-width: var(--content-width);
  margin-top: var(--space-2xl);
}

.ether-page .narrative-text {
  flex: 1;
}

/* illustrations: tilted a little, lifted with a soft shadow */
.ether-page .narrative-image {
  flex: 0 0 320px;
  max-width: 320px;
  border-radius: var(--wobble);
  transform: rotate(-2deg);
}

.ether-page .narrative-image--small {
  flex-basis: 240px;
  max-width: 240px;
  transform: rotate(2deg);
}

.ether-page .narrative-img {
  width: 100%;
  border-radius: var(--radius);
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.4));
}

/* a row straight under a section title only gets the title's own gap */
.ether-page .section-title + .narrative-row {
  margin-top: 0;
}

@media (max-width: 768px) {
  .ether-page .narrative-row {
    flex-direction: column;
  }

  .ether-page .narrative-image {
    flex-basis: auto;
    max-width: 240px;
  }
}

/* ───────────── 3. GAMEPLAY LOOP (built in code) ───────────── */
/* sizes follow the width of the diagram's container so it never overflows */
.ether-page .loop-diagram:has(> .loop-flow) {
  container-type: inline-size;
}

.ether-page .loop-flow {
  --flow-line: var(--mustard);
  display: grid;
  grid-template-columns: auto minmax(0.8rem, 1fr) auto minmax(0.8rem, 1fr) auto;
  grid-template-rows: auto 2.6rem;
  align-items: center;
}

.ether-page .loop-flow__node {
  padding: 0.3em 0.8em;
  font-family: var(--cartoon-font);
  font-weight: 400;
  font-size: clamp(0.8rem, 4.2cqi, 1.9rem);
  line-height: var(--lh-tight);
  white-space: nowrap;
  color: var(--text);
  border: var(--stroke) solid var(--text);
  border-radius: var(--wobble-sm);
}

/* TAG PALETTE, shared by every coloured tag on the site (home page tags and
   the gameplay loop boxes). Each colour is a fill with a lighter outline in
   the same family, both at half strength so they stay subtle. No orange:
   that colour belongs to titles and buttons. (body.… .tag.tag--… so the
   colour wins over the plain tag styles in home.css.) */
body.ether-page .tag.tag--moss {
  background: color-mix(in srgb, #5f6b2b 50%, transparent);
  border-color: color-mix(in srgb, #9aa94a 55%, transparent);
}

body.ether-page .tag.tag--teal {
  background: color-mix(in srgb, #3f5d63 50%, transparent);
  border-color: color-mix(in srgb, #7fb0a8 55%, transparent);
}

body.ether-page .tag.tag--plum {
  background: color-mix(in srgb, #54405a 50%, transparent);
  border-color: color-mix(in srgb, #a98cc9 55%, transparent);
}

body.ether-page .tag.tag--slate {
  background: color-mix(in srgb, #34466a 50%, transparent);
  border-color: color-mix(in srgb, #8ea6d6 55%, transparent);
}

body.ether-page .tag.tag--wine {
  background: color-mix(in srgb, #6a2f4a 50%, transparent);
  border-color: color-mix(in srgb, #d98aa8 55%, transparent);
}

body.ether-page .tag.tag--stone {
  background: color-mix(in srgb, #4a4a42 50%, transparent);
  border-color: color-mix(in srgb, #b5b3a0 55%, transparent);
}

body.ether-page .tag.tag--khaki {
  background: color-mix(in srgb, #5e5434 50%, transparent);
  border-color: color-mix(in srgb, #c9b77a 55%, transparent);
}

/* the loop diagram's own class names, mapped onto the palette */
.ether-page .loop-flow .tag--blue {
  background: color-mix(in srgb, #5f6b2b 50%, transparent);
  border-color: color-mix(in srgb, #9aa94a 55%, transparent);
}

.ether-page .loop-flow .tag--steel {
  background: color-mix(in srgb, #54405a 50%, transparent);
  border-color: color-mix(in srgb, #a98cc9 55%, transparent);
}

.ether-page .loop-flow .tag--amber {
  background: color-mix(in srgb, #3f5d63 50%, transparent);
  border-color: color-mix(in srgb, #7fb0a8 55%, transparent);
}

/* arrows between the boxes */
.ether-page .loop-flow__arrow {
  position: relative;
  height: var(--stroke);
  margin-inline: var(--space-xs);
  /* shaft stops 1px short of the tip, same as the return arrow */
  background: linear-gradient(var(--flow-line), var(--flow-line)) left center / calc(100% - 1px) 100% no-repeat;
}

.ether-page .loop-flow__arrow::after {
  content: "";
  position: absolute;
  right: 1.9px; /* tip of the head sits exactly at the end of the arrow */
  top: 50%;
  width: 9px;
  height: 9px;
  border-top: var(--stroke) solid var(--flow-line);
  border-right: var(--stroke) solid var(--flow-line);
  transform: translateY(-50%) rotate(45deg);
}

/* return path: from the last box, under the row, back up into the first */
.ether-page .loop-flow__return {
  grid-column: 1 / -1;
  grid-row: 2;
  align-self: stretch;
  display: grid;
  grid-template-columns: subgrid;
}

.ether-page .loop-flow__return > span {
  position: relative;
  grid-row: 1;
  align-self: stretch;
}

.ether-page .loop-flow__return-start {
  grid-column: 1;
}

.ether-page .loop-flow__return-mid {
  grid-column: 2 / 5;
  margin-bottom: 0.3rem;
  border-bottom: var(--stroke) solid var(--flow-line);
}

.ether-page .loop-flow__return-end {
  grid-column: 5;
}

.ether-page .loop-flow__return-start::before,
.ether-page .loop-flow__return-end::before {
  content: "";
  position: absolute;
  top: 7px; /* shaft ends inside the arrow head, never past its tip */
  bottom: 0.3rem;
  width: 50%;
  border-bottom: var(--stroke) solid var(--flow-line);
}

/* last box: goes down on its centre line, curves left */
.ether-page .loop-flow__return-end::before {
  border-right: var(--stroke) solid var(--flow-line);
  border-bottom-right-radius: var(--radius);
}

/* first box: curves up on its centre line, arrow points at the box */
.ether-page .loop-flow__return-start::before {
  left: 50%;
  border-left: var(--stroke) solid var(--flow-line);
  border-bottom-left-radius: var(--radius);
}

.ether-page .loop-flow__return-start::after {
  content: "";
  position: absolute;
  left: calc(50% + 1px); /* centre of the 2px shaft */
  top: calc(6px + 6.4px); /* tip of the head 6px under the box */
  width: 9px;
  height: 9px;
  border-top: var(--stroke) solid var(--flow-line);
  border-left: var(--stroke) solid var(--flow-line);
  transform: translate(-50%, -50%) rotate(45deg);
}

@media (max-width: 480px) {
  .ether-page .loop-flow__arrow {
    margin-inline: var(--space-3xs);
  }
}

/* narrow: a box's words may wrap onto two lines, so the three boxes always
   fit across (instead of the last one running off the screen) */
@container (max-width: 34rem) {
  .ether-page .loop-flow {
    grid-template-columns: minmax(0, auto) minmax(0.9rem, 1fr) minmax(0, auto) minmax(0.9rem, 1fr) minmax(0, auto);
  }

  .ether-page .loop-flow__node {
    padding: 0.35em 0.6em;
    font-size: clamp(0.95rem, 4.6cqi, 1.25rem);
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

/* ───────────── 3. CONTROLS ───────────── */
/* the table is shown as a plain list: key art, the input name in orange with
   the action underneath, thin lines between the entries */
.ether-page .controls-table,
.ether-page .controls-table tbody {
  display: block;
  max-width: var(--content-width);
}

.ether-page .controls-table {
  margin: var(--flow-gap) 0 0;
}

.ether-page .controls-table thead {
  display: none;
}

.ether-page .controls-table tbody tr {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  grid-template-areas:
    "icon name"
    "icon action";
  gap: var(--space-3xs) var(--space-m);
  align-items: center;
  padding: var(--space-s) 0;
  border-top: var(--stroke-thin) solid var(--pencil);
}

.ether-page .controls-table tbody tr:first-child {
  padding-top: 0;
  border-top: none;
}

.ether-page .controls-table tbody tr:last-child {
  padding-bottom: 0;
}

/* cell padding is already 0 in styles.css */
.ether-page .controls-table tbody td {
  line-height: var(--lh-snug);
}

/* input column: key caps and a drawn mouse, centred */
.ether-page .controls-table tbody td:first-child {
  grid-area: icon;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ether-page .controls-table tbody td:nth-child(2) {
  grid-area: name;
  align-self: end;
  font-family: var(--cartoon-font);
  font-size: var(--fs-h3);
  letter-spacing: 0.03em;
  line-height: var(--lh-tight);
  color: var(--orange-dk);
}

.ether-page .controls-table tbody td:nth-child(3) {
  grid-area: action;
  align-self: start;
  font-size: var(--fs-body-s);
}

@media (max-width: 768px) {
  .ether-page .controls-table tbody tr {
    column-gap: var(--space-s);
  }
}

/* ───────────── 3. CONTROLS: KEY CAPS AND MOUSE ───────────── */
.ether-page .keycaps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3xs);
}

.ether-page .keycap {
  display: inline-grid;
  place-items: center;
  min-width: 3.2rem;
  height: 3.2rem;
  padding: 0 var(--space-xs);
  font-family: var(--cartoon-font);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--orange-hi);
  background: var(--paper-3);
  border: var(--stroke-thick) solid var(--pencil);
  border-radius: var(--wobble-sm);
}

.ether-page .keycap--wide {
  min-width: 5.2rem;
}

.ether-page .keycap--space {
  min-width: 9rem;
}

/* key caps and the mouse are drawn, not fixed-height pictures: the cell grows
   with them (the W A S D cluster takes two rows) */
.ether-page .controls-table tbody td:first-child {
  height: auto;
  min-height: 76px;
}

/* W A S D laid out like on the keyboard: W above S */
.ether-page .keycaps--wasd {
  display: inline-grid;
  grid-template-columns: repeat(3, auto);
}

.ether-page .keycap--w {
  grid-row: 1;
  grid-column: 2;
}

/* A S D always on the second row (without this, A fills the slot after W) */
.ether-page .keycaps--wasd > .keycap:not(.keycap--w) {
  grid-row: 2;
}

/* hand-drawn mouse in the key cap colours; the button or wheel in use is lit */
.ether-page .mouse-icon {
  width: 2.6rem;
  height: auto;
  overflow: visible;
}

.ether-page .mouse-body {
  fill: var(--paper-3);
  stroke: var(--pencil);
  stroke-width: 3;
}

.ether-page .mouse-line {
  fill: none;
  stroke: var(--pencil);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.ether-page .mouse-wheel {
  fill: var(--paper-2);
  stroke: var(--pencil);
  stroke-width: 2;
}

.ether-page .mouse-hi {
  fill: var(--orange-hi);
}

/* "click and drag": the mouse with arrows on both sides */
.ether-page .mouse-icon--drag {
  width: 4.9rem;
}

.ether-page .mouse-drag {
  fill: none;
  stroke: var(--orange-hi);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 768px) {
  .ether-page .keycap {
    min-width: 2.4rem;
    height: 2.4rem;
    font-size: 1.15rem;
  }

  .ether-page .keycap--wide {
    min-width: 4rem;
  }

  .ether-page .keycap--space {
    min-width: 6.5rem;
  }

  .ether-page .mouse-icon {
    width: 2rem;
  }

  .ether-page .mouse-icon--drag {
    width: 3.8rem;
  }

  /* room for three small key caps side by side */
  .ether-page .controls-table tbody tr {
    grid-template-columns: 8rem minmax(0, 1fr);
  }
}

/* ───────────── 3. PUZZLE MAP (inline SVG) ───────────── */
.ether-page .puzzle-map {
  display: block;
  width: 100%;
  overflow: visible;
  font-family: var(--cartoon-font);
  font-weight: 700;
}

.ether-page .puzzle-map .pm-group {
  fill: var(--night);
  stroke: var(--pencil);
  stroke-width: 3;
}

.ether-page .puzzle-map .pm-line {
  fill: none;
  stroke: var(--mustard);
  stroke-width: 2.5;
}

.ether-page .puzzle-map .pm-head {
  fill: none;
  stroke: var(--mustard);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* labels sit on a gap in the line: a stroke in the background colour */
.ether-page .puzzle-map .pm-label text {
  font-size: 20px;
  fill: var(--mustard);
  text-anchor: middle;
  dominant-baseline: central;
  paint-order: stroke;
  stroke: var(--paper);
  stroke-width: 10px;
  stroke-linejoin: round;
}

.ether-page .puzzle-map .pm-label .pm-label--group {
  stroke: var(--night);
}

.ether-page .puzzle-map .pm-node rect {
  stroke-width: 2.5;
}

.ether-page .puzzle-map .pm-node text {
  font-size: 34px;
  fill: var(--text);
  text-anchor: middle;
  dominant-baseline: central;
}

.ether-page .puzzle-map .pm-node--olive rect {
  fill: var(--moss);
  stroke: var(--olive);
}

.ether-page .puzzle-map .pm-node--teal rect {
  fill: var(--teal);
  stroke: var(--sage);
}

.ether-page .puzzle-map .pm-node--mauve rect {
  fill: var(--plum);
  stroke: var(--mauve);
}

.ether-page .puzzle-map .pm-node--brick rect {
  fill: var(--rust);
  stroke: var(--orange-hi);
}

/* ───────────── 3. PADLOCK COLLAGE (screenshot + 4 tickets) ─────────────
   Positions are percentages of the canvas, so everything scales together.
   The tickets already carry their own arrows, each aimed at one wheel. */
.ether-page .padlock-collage {
  position: relative;
  aspect-ratio: 1051 / 675;
}

.ether-page .padlock-collage img,
.ether-page .padlock-collage__cursor {
  position: absolute;
}

.ether-page .padlock-collage__screen {
  left: 1.33%;
  top: 2.96%;
  width: 93.91%;
  border-radius: 1.42% / 2.54%;
}

.ether-page .padlock-collage__ticket--1 { left: 1.62%;  top: 39.26%; width: 34.7%; }
.ether-page .padlock-collage__ticket--2 { left: 33.21%; top: 47.56%; width: 19.98%; }
.ether-page .padlock-collage__ticket--3 { left: 49.48%; top: 47.7%;  width: 17.79%; }
.ether-page .padlock-collage__ticket--4 { left: 62.51%; top: 35.26%; width: 32.73%; }

/* the cursor resting on the third wheel */
.ether-page .padlock-collage__cursor {
  left: 52.9%;
  top: 41.3%;
  width: 3.4%;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

/* ───────────── 4. "CURIOUS?" TOGGLE BUTTON ───────────── */
.ether-page .tech-toggle-wrapper {
  display: flex;
  justify-content: center;
  padding-top: var(--flow-gap);
}

/* pill in the colours of the section number chips */
.ether-page .tech-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  padding: var(--space-2xs) var(--space-s) var(--space-2xs) var(--space-m);
  font-family: var(--cartoon-font);
  font-weight: 900;
  font-size: var(--fs-button);
  letter-spacing: 0.03em;
  color: var(--orange-hi);
  background: var(--paper-3);
  border: var(--stroke-thick) solid var(--pencil);
  border-radius: var(--radius-pill);
  cursor: var(--cursor-click), pointer;
  user-select: none;
  transition: background 0.2s ease, color 0.2s ease;
  /* opening a panel scrolls the button to just below the fixed header */
  scroll-margin-top: calc(var(--header-height) + 1rem);
}

/* while a panel is opening or closing the button ignores clicks
   (etherlocked.js adds .is-busy): show the crossed-out cursor */
.ether-page .tech-toggle-btn.is-busy,
.ether-page .tech-toggle-btn.is-busy * {
  cursor: var(--cursor-no), not-allowed;
}

/* ───────────── 4. CLICK TO ENLARGE (assets/js/image-zoom.js) ─────────────
   Every picture and diagram can be clicked to see it big. */
.is-zoomable {
  cursor: var(--cursor-click), zoom-in;
}

.is-zoomable *,
.is-zoomable:active,
.is-zoomable:active * {
  cursor: var(--cursor-click), zoom-in;
}

.is-zoomable:focus-visible {
  outline: var(--stroke-thick) solid var(--mustard);
  outline-offset: 3px;
}

/* the page behind does not scroll while a picture is open */
html.is-zoomed {
  overflow: hidden;
}

/* phones: wide diagrams also get a visible "Tap to enlarge" button */
.ether-page .diagram-zoom-hint {
  display: none;
}

@media (max-width: 600px) {
  .ether-page .diagram-zoom-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4em;
    width: 100%;
    margin-top: var(--space-2xs);
    padding: 0.35em 0.8em;
    font-family: var(--cartoon-font);
    font-size: 1.05rem;
    color: var(--mustard);
    background: var(--paper-3);
    border: var(--stroke) solid var(--pencil);
    border-radius: var(--radius-pill);
  }
}

/* the full-screen view */
.diagram-zoom {
  position: fixed;
  inset: 0;
  z-index: 10020; /* above the header and the loader */
  background: rgba(20, 12, 8, 0.96);
  animation: diagram-zoom-in 0.2s ease;
}

@keyframes diagram-zoom-in {
  from { opacity: 0; }
}

.diagram-zoom__stage {
  position: absolute;
  top: calc(50% - 1.25rem);
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(100vw - 9rem);
  height: calc(100dvh - 9rem);
  transform: translate(-50%, -50%);
}

@media (max-width: 600px) {
  .diagram-zoom__stage {
    width: calc(100vw - 1.5rem);
    height: calc(100dvh - 10rem);
  }
}

/* portrait phone: the stage is turned a quarter, so a wide picture uses the
   long side of the screen */
.diagram-zoom.is-turned .diagram-zoom__stage {
  top: 50%;
  width: calc(100dvh - 8rem);
  height: calc(100vw - 1.5rem);
  transform: translate(-50%, -50%) rotate(90deg);
}

.diagram-zoom__stage > img,
.diagram-zoom__stage > svg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0.5rem;
}

/* an annotated screenshot: its picture fills the box, outlines on top */
.diagram-zoom__stage > .diagram-zoom__item:not(img):not(svg) {
  flex: none;
  margin: 0;
}

.diagram-zoom__stage > .diagram-zoom__item:not(img):not(svg) img {
  display: block;
  width: 100%;
  height: auto;
}

.diagram-zoom__caption {
  position: absolute;
  left: 50%;
  bottom: 1.25rem;
  width: min(44rem, 100vw - 2rem);
  margin: 0;
  font-size: var(--fs-small, 1rem);
  line-height: 1.35;
  text-align: center;
  color: var(--text, #f1e8d0);
  transform: translateX(-50%);
}

.diagram-zoom.is-turned .diagram-zoom__caption {
  display: none;
}

.diagram-zoom__count {
  position: absolute;
  top: 1.6rem;
  left: 1.25rem;
  font-family: var(--cartoon-font);
  font-size: 1.1rem;
  color: var(--pencil, #8a7a6a);
}

.diagram-zoom__close,
.diagram-zoom__nav {
  position: absolute;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  font-size: 1.6rem;
  color: var(--orange-hi, #f0a06a);
  background: var(--paper-3, #3a2a20);
  border: 3px solid var(--pencil, #8a7a6a);
  border-radius: 0.8rem 0.7rem 0.9rem 0.6rem;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.diagram-zoom__close {
  top: 1rem;
  right: 1rem;
}

.diagram-zoom__nav {
  top: calc(50% - 1.25rem);
  transform: translateY(-50%);
  font-size: 2rem;
}

.diagram-zoom__nav--prev {
  left: 1rem;
}

.diagram-zoom__nav--next {
  right: 1rem;
}

.diagram-zoom:not(.has-many) .diagram-zoom__nav {
  display: none;
}

.diagram-zoom__close:hover,
.diagram-zoom__close:focus-visible,
.diagram-zoom__nav:hover,
.diagram-zoom__nav:focus-visible {
  color: var(--mustard, #e0a73a);
  border-color: var(--orange, #e2623b);
}

.diagram-zoom__close:focus-visible,
.diagram-zoom__nav:focus-visible {
  outline: 3px solid var(--text, #f1e8d0);
  outline-offset: 3px;
}

/* phones: the arrows sit at the bottom corners, out of the picture's way */
@media (max-width: 600px) {
  .diagram-zoom__nav {
    top: auto;
    bottom: 1rem;
    transform: none;
  }

  .diagram-zoom__caption {
    bottom: 1.3rem;
    width: calc(100vw - 9rem);
    font-size: 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .diagram-zoom {
    animation: none;
  }
}

/* ───────────── 4. SLIDER DOTS (etherlocked.js) ─────────────
   Under a sideways image slider on phones, in place of a scrollbar: one dot
   per picture, the one in view is a longer orange pill. */
.slider-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: var(--space-s);
}

.slider-dots[hidden] {
  display: none;
}

.slider-dots__dot {
  width: 0.6rem;
  height: 0.6rem;
  padding: 0;
  background: var(--pencil);
  border: 0;
  border-radius: var(--radius-pill);
  transition: width 0.25s ease, background-color 0.25s ease;
}

/* a bigger invisible touch area around each small dot */
.slider-dots__dot {
  position: relative;
}

.slider-dots__dot::before {
  content: "";
  position: absolute;
  inset: -0.7rem -0.35rem;
}

.slider-dots__dot[aria-current="true"] {
  width: 1.6rem;
  background: var(--orange);
}

.slider-dots__dot:focus-visible {
  outline: var(--stroke) solid var(--text);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .slider-dots__dot {
    transition: none;
  }
}


.ether-page .tech-toggle-btn:hover,
.ether-page .tech-toggle-btn:active,
.ether-page .tech-toggle-btn.is-open {
  color: var(--mustard);
  background: var(--paper-3);
  border-color: var(--orange);
  box-shadow: none;
  transform: none;
}

.ether-page .tech-toggle-caret {
  display: inline-flex;
  align-items: center;
  font-size: 1.4rem;
  line-height: 1;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.ether-page .tech-toggle-btn.is-open .tech-toggle-caret {
  transform: rotate(180deg);
}

/* ───────────── 4. TECHNICAL PANELS ───────────── */
/* collapsed until opened – the script in etherlocked.html animates it */
.ether-page .tech-reveal {
  height: 0;
  overflow: hidden;
  opacity: 0;
}

.ether-page .tech-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-m);
  margin-top: var(--space-m);
  /* .tech-reveal clips its overflow, so leave a little room for the outline */
  padding: var(--space-2xs) var(--space-2xs) var(--space-s);
}

.ether-page .tech-section {
  position: relative;
  max-width: var(--content-width);
  padding: var(--card-pad);
  background: var(--paper-2);
  border: var(--stroke-thick) solid var(--pencil);
  border-radius: var(--wobble);
}

.ether-page .tech-subsection + .tech-subsection {
  margin-top: var(--space-2xl);
}

/* each part has its own tag palette: the title pill, highlights and bullets */
.ether-page .tech-subsection--flow {
  --acc: var(--sage);
  --acc-fill: var(--teal);
}

.ether-page .tech-subsection--how {
  --acc: var(--olive);
  --acc-fill: var(--moss);
}

.ether-page .tech-subsection--behind {
  --acc: var(--mauve);
  --acc-fill: var(--plum);
}

.ether-page .tech-section-title {
  display: inline-block;
  margin-bottom: var(--space-s);
  padding: var(--space-3xs) var(--space-s);
  font-family: var(--cartoon-font);
  font-weight: 700;
  font-size: var(--fs-h4);
  letter-spacing: 0.02em;
  color: var(--text);
  background: var(--acc-fill);
  border: var(--stroke) solid var(--acc);
  border-radius: var(--wobble-sm);
}

.ether-page .tech-text,
.ether-page .tech-list {
  font-size: var(--fs-body-s);
  line-height: var(--lh-body);
}

.ether-page .tech-text {
  margin-bottom: var(--space-s);
}

.ether-page .tech-text:last-child {
  margin-bottom: 0;
}

/* a diagram at the top of a flow panel sits flush under its pill */
.ether-page .tech-subsection--flow > .loop-diagram {
  margin-top: 0;
}

/* a list straight under a pill only gets the pill's own gap */
.ether-page .tech-section-title + .how-list,
.ether-page .tech-section-title + .behind-lines {
  margin-top: 0;
}

/* inline code names: highlighter-marker chips in the part's colour */
.ether-page .term-highlight {
  padding: 0 0.3em;
  color: var(--acc, var(--text));
  background: color-mix(in srgb, var(--acc, var(--mustard)) 38%, transparent);
  border-radius: 0.35em;
  box-decoration-break: clone;
}

/* "How it works": numbered steps, the explanation under each title */
.ether-page .how-list {
  margin: var(--space-m) 0 0;
  list-style: none;
  counter-reset: how;
}

.ether-page .how-list > li {
  position: relative;
  padding-left: 1.3rem;
  counter-increment: how;
}

.ether-page .how-list > li + li {
  margin-top: var(--space-m);
}

.ether-page .how-title {
  display: block;
  font-family: var(--cartoon-font);
  font-weight: 400;
  font-size: var(--fs-h4);
  line-height: var(--lh-tight);
  letter-spacing: 0.04em;
}

.ether-page .how-title::before {
  content: counter(how);
  position: absolute;
  left: 0;
  color: var(--acc);
}

.ether-page .how-text {
  display: block;
  margin-top: var(--space-3xs);
  font-size: var(--fs-body-s);
  line-height: var(--lh-body);
  opacity: 0.85;
}

/* "Behind the scenes": plain sentences, script names highlighted */
.ether-page .behind-lines {
  margin: var(--space-m) 0 0;
}

.ether-page .behind-lines li {
  font-size: var(--fs-body-s);
  line-height: var(--lh-body);
}

/* list bullets: small dots that sit inline, so a wrapped line goes back to
   the left edge instead of starting in an indented "second column" */
.ether-page .contribution-list li + li,
.ether-page .behind-lines li + li {
  margin-top: var(--space-3xs);
}

.ether-page .contribution-list li::before,
.ether-page .behind-lines li::before {
  content: "";
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: var(--space-xs);
  vertical-align: 0.12em;
  background: var(--mustard);
  border-radius: 50%;
}

.ether-page .behind-lines li::before {
  background: var(--acc);
}

/* single sentences: no dot */
.ether-page .contribution-card--shared .contribution-list li::before,
.ether-page .behind-lines li.no-bullet::before {
  content: none;
}

/* ───────────── 4. DESIGN DECISIONS ───────────── */
.ether-page .decision-list {
  display: grid;
  gap: var(--space-xl);
  margin-top: var(--flow-gap);
}

.ether-page .decision-card {
  position: relative;
  padding: var(--card-pad);
  background: var(--paper-2);
  border: var(--stroke-thick) solid var(--pencil);
  border-radius: var(--wobble);
}

.ether-page .decision-card--olive { --acc: var(--olive); }
.ether-page .decision-card--teal { --acc: var(--sage); }
.ether-page .decision-card--brick { --acc: var(--brick); }

/* little tilted number chip on the top edge, like a sticker */
.ether-page .decision-number {
  position: absolute;
  top: -1.1rem;
  left: 1.75rem;
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  font-family: var(--cartoon-font);
  font-weight: 900;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--ink);
  background: var(--acc);
  border: var(--stroke-thick) solid var(--pencil);
  border-radius: var(--wobble-sm);
  transform: rotate(-6deg);
}

.ether-page .decision-title {
  margin: 0 0 var(--space-s);
  font-family: var(--cartoon-font);
  font-weight: 400;
  font-size: var(--fs-h3);
  letter-spacing: 0.03em;
  line-height: var(--lh-tight);
  color: var(--orange-dk);
}

/* label column + text column; a thin pencil line between the steps */
.ether-page .decision-step {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 0 var(--space-m);
  padding: var(--space-s) 0;
}

.ether-page .decision-step + .decision-step {
  border-top: var(--stroke-thin) solid var(--pencil);
}

.ether-page .decision-step dt {
  padding-top: var(--space-3xs);
  font-family: var(--cartoon-font);
  font-size: var(--fs-label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--acc);
}

.ether-page .decision-step dd {
  font-size: var(--fs-body-s);
  line-height: var(--lh-body);
}

@media (max-width: 768px) {
  .ether-page .decision-step {
    grid-template-columns: 1fr;
    gap: var(--space-3xs);
  }

  .ether-page .decision-step dt {
    padding-top: 0;
  }
}

/* ───────────── 4. PREVIOUS / NEXT PROJECT ───────────── */
.ether-page .next-subtitle {
  font-family: var(--cartoon-font);
  font-weight: 900;
  color: var(--text);
}

/* same button as "Get in touch" (orange fill, lighter-orange outline, small
   wobbly corners, same hover), just bigger because it is the page's last step */
.ether-page .next-button {
  font-family: var(--cartoon-font);
  font-weight: 700;
  /* white label and arrow on every button */
  color: #fff;
  background: var(--orange);
  border: var(--stroke-thick) solid var(--orange-hi);
  border-radius: var(--wobble-sm);
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease,
    border-color 0.2s ease;
}

.ether-page .next-button .hand-arrow {
  width: 0.48em;
}

.ether-page .next-button:hover,
.ether-page .next-button:focus-visible {
  color: var(--ink);
  background: var(--mustard);
  border-color: var(--mustard);
  box-shadow: none;
  transform: rotate(-1deg) translateY(-3px);
}

@media (prefers-reduced-motion: reduce) {
  .ether-page .next-button:hover,
  .ether-page .next-button:focus-visible {
    transform: none;
  }
}

/* ───────────── 4. SCROLL-UP BUTTON ─────────────
   Same chip as the footer social links: dark fill, grey outline, orange
   icon; on hover the outline turns orange, the arrow mustard, and it lifts. */
.ether-page .scrollup {
  width: 3.25rem;
  height: 3.25rem;
  color: var(--orange-hi);
  background: var(--paper-3);
  border: var(--stroke-thick) solid var(--pencil);
  border-radius: var(--wobble-sm);
  box-shadow: none;
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.2s ease,
    border-color 0.2s ease, color 0.2s ease;
}

.ether-page .scrollup .hand-arrow {
  width: 0.75rem;
}

.ether-page .scrollup.show-scroll {
  transform: none;
}

.ether-page .scrollup:hover,
.ether-page .scrollup:focus-visible {
  color: var(--mustard);
  background: var(--paper-3);
  border-color: var(--orange);
  box-shadow: none;
  transform: rotate(-6deg);
}

.ether-page .scrollup:focus-visible {
  outline: var(--stroke-thick) solid var(--text);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .ether-page .scrollup:hover,
  .ether-page .scrollup:focus-visible {
    transform: none;
  }
}

/* phones: smaller and tucked into the corner so it covers less text */
@media (max-width: 576px) {
  .ether-page .scrollup {
    right: 0.6rem;
    bottom: 0.75rem;
    width: 2.5rem;
    height: 2.5rem;
  }

  .ether-page .scrollup .hand-arrow {
    width: 0.6rem;
  }
}

/* ───────────── 4. CONTACT BUTTON (menu drawer + footer) ─────────────
   The hero button in the page orange; hover comes from .hero-cta. */
.ether-page .contact-cta {
  /* darkest label: light text on the orange/yellow fill was hard to read, and
     the deeper orange on the home pages needs more than the brown ink */
  color: #fff;
  background: var(--orange);
  border-color: var(--orange-hi);
}

/* ───────────── 4. NAV BAR ─────────────
   Fixed at the top, with no full-width bar. On desktop the links sit in one
   rounded pill on the right; each link is a small pill of its own and the
   current page gets a soft orange fill. At the top of the page everything is
   transparent; once the page scrolls (main.js adds .blur-header) the pill,
   the logo and the menu button get a solid dark backing, so they stay
   readable over anything. */
/* above the paper grain (9998) and the home robot and hero text (9999,
   10000), so the bar looks the same, clean and grain-free, on every page */
.ether-page .header {
  position: fixed;
  z-index: 10001;
}

.ether-page .blur-header::after {
  display: none;
}

.ether-page .nav-logo {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

.ether-page .nav-logo img {
  width: 1.6rem;
  height: 1.6rem;
}

/* menu button on tablet and phone: a smaller icon in a round backing */
.ether-page .nav-actions {
  font-size: 1.6rem;
}

/* the solid backing once the page has scrolled */
.ether-page .blur-header .nav-logo,
.ether-page .blur-header .nav-toggle {
  background: var(--night);
}

.ether-page .nav-toggle {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

@media screen and (min-width: 1150px) {
  /* styles.css makes the desktop bar 2rem taller than --header-height */
  .ether-page .nav {
    height: calc(var(--header-height) + 0.5rem);
  }

  /* the link pill sits on the right of the bar (styles.css pushes
     .nav-menu right with margin-left: auto) */

  .ether-page .nav-list {
    column-gap: 0.25rem;
    padding: 0.3rem;
    border-radius: 999px;
    transition: background-color 0.3s ease;
  }

  .ether-page .blur-header .nav-list {
    background: var(--night);
  }

  .ether-page .nav-link {
    display: block;
    padding: 0.45em 1.15em;
    font-family: var(--cartoon-font);
    font-weight: 400;
    font-size: 1.1rem;
    line-height: 1;
    letter-spacing: 0.03em;
    text-transform: none;
    color: var(--text);
    opacity: 0.75;
    border-radius: 999px;
    transition: opacity 0.2s ease, background-color 0.2s ease;
  }

  .ether-page .nav-link:hover,
  .ether-page .nav-link:focus-visible {
    color: var(--text);
    opacity: 1;
    background: rgba(241, 232, 208, 0.08);
  }

  .ether-page .nav-link.active-link {
    color: var(--text);
    opacity: 1;
    text-shadow: none;
    background: rgba(220, 90, 40, 0.22);
  }

  .ether-page .nav-link.active-link::after {
    content: none;
  }
}

/* ───────────── 4. SLIDE-OUT MENU (tablet & phone, below 1150px) ─────────────
   The drawer from styles.css restyled as a printed card: dark ground, pencil
   outline with wobbly corners, chunky condensed links. Phones get it full screen.
   .nav-extra (contact button + socials) only exists inside the drawer. */
.ether-page .nav-extra {
  display: none;
}

/* the menu open/close controls are real buttons: strip the browser look */
.ether-page .nav-toggle,
.ether-page .nav-close {
  padding: 0;
  font: inherit;
}

.ether-page .nav-toggle,
.ether-page .nav-close {
  background: none;
  border: 0;
}

.ether-page .nav-toggle:focus-visible,
.ether-page .nav-close:focus-visible {
  outline: var(--stroke-thick) solid var(--text);
  outline-offset: 3px;
}

@media screen and (max-width: 1150px) {
  .ether-page .nav-toggle {
    color: var(--text);
    transition: color 0.2s ease;
  }

  .ether-page .nav-toggle:hover {
    color: var(--orange-hi);
  }

  .ether-page .nav-menu {
    display: flex;
    flex-direction: column;
    padding: var(--space-3xl) var(--space-xl) var(--space-xl);
    background: var(--night);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: var(--stroke-thick) solid var(--pencil);
    border-right: none;
    border-radius: 26px 0 0 18px / 18px 0 0 26px;
    box-shadow: -14px 0 40px rgba(0, 0, 0, 0.55);
  }

  .ether-page .nav-list {
    row-gap: var(--space-l);
  }

  .ether-page .nav-link {
    display: inline-block;
    font-family: var(--cartoon-font);
    font-weight: 900;
    font-size: clamp(1.9rem, 4vw, 2.25rem);
    line-height: 1;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--text);
    transition: color 0.2s ease, transform 0.2s ease;
  }

  .ether-page .nav-link:hover,
  .ether-page .nav-link:focus-visible,
  .ether-page .nav-link.active-link {
    color: var(--orange);
    text-shadow: none;
    transform: rotate(-1.5deg);
  }

  /* close button: round chip like the section number badges */
  .ether-page .nav-close {
    top: var(--space-m);
    right: var(--space-m);
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    font-size: 1.5rem;
    color: var(--orange-hi);
    background: var(--paper-3);
    border: var(--stroke-thick) solid var(--pencil);
    border-radius: var(--wobble-sm);
    transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  }

  .ether-page .nav-close:hover {
    color: var(--mustard);
    border-color: var(--orange);
    transform: rotate(-6deg);
  }

  /* bottom of the drawer: contact button, then socials */
  .ether-page .nav-extra {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-l);
    margin-top: auto;
    padding-top: var(--space-xl);
    border-top: var(--stroke-thin) solid var(--pencil);
  }

  .ether-page .nav-social {
    display: flex;
    gap: var(--space-m);
    font-size: 1.6rem;
  }

  .ether-page .nav-social a {
    color: var(--text);
    transition: color 0.2s ease;
  }

  .ether-page .nav-social a:hover {
    color: var(--orange-hi);
  }
}

/* phones: the drawer covers the whole screen, everything centred */
@media screen and (max-width: 576px) {
  .ether-page .nav-menu {
    width: 100%;
    border: none;
    border-radius: 0;
    box-shadow: none;
    text-align: center;
  }

  .ether-page .nav-list {
    align-items: center;
    margin-block: auto;
  }

  .ether-page .nav-extra {
    align-items: center;
    margin-top: 0;
  }
}

/* ───────────── 5. FOOTER ─────────────
   A darker ground strip whose top edge is the same pencil wave as the hero.
   Desktop: invitation on the left, social chips on the right, copyright row
   underneath. Phones: everything stacked and centred. */
.ether-page .footer {
  --footer-width: calc(min(1440px, 100%) - 2 * var(--page-gutter));
  position: relative;
  overflow: visible;
  margin-top: var(--space-3xl);
  padding-block: var(--space-2xl) var(--space-l);
  background: var(--night);
}

/* wave sits on top of the strip, filled with the strip colour */
.ether-page .footer-wave {
  position: absolute;
  top: 1px;
  left: 0;
  width: 100%;
  height: clamp(36px, 5vw, 72px);
  transform: translateY(-100%);
}

.ether-page .footer-wave .wave-fill {
  fill: var(--night);
}

.ether-page .footer-wave .wave-line {
  fill: none;
  stroke: var(--pencil);
  stroke-width: 3;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.ether-page .footer-container {
  width: var(--footer-width);
  padding: 0;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--space-xl);
  text-align: left;
}

.ether-page .reach-out {
  align-items: flex-start;
  gap: var(--space-s);
  text-align: left;
}

.ether-page .footer-kicker {
  font-family: var(--cartoon-font);
  font-size: var(--fs-label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mustard);
}

.ether-page .reach-label {
  max-width: 12ch;
  margin: 0;
  font-family: var(--cartoon-font);
  font-weight: 900;
  font-size: var(--fs-h1);
  line-height: 0.95;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--orange);
}

.ether-page .footer-cta {
  margin-top: var(--space-xs);
}

/* social links: small chips like the close button and scroll-up button */
.ether-page .footer-social {
  gap: var(--space-s);
}

.ether-page .footer-social-link {
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  background: var(--paper-3);
  border: var(--stroke-thick) solid var(--pencil);
  border-radius: var(--wobble-sm);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.ether-page .footer-social-link i {
  font-size: 1.4rem;
  color: var(--orange-hi);
  transition: color 0.2s ease;
}

.ether-page .footer-social-link:hover {
  border-color: var(--orange);
  transform: rotate(-6deg);
}

.ether-page .footer-social-link:hover i {
  color: var(--mustard);
}

.ether-page .footer-copy {
  width: var(--footer-width);
  margin-top: var(--space-2xl);
  padding-top: var(--space-m);
  border-top: var(--stroke-thin) solid var(--pencil);
  font-size: var(--fs-label);
  text-align: left;
  color: var(--pencil);
}

@media (max-width: 576px) {
  .ether-page .footer-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .ether-page .reach-out {
    align-items: center;
    text-align: center;
  }

  .ether-page .footer-copy {
    margin-top: var(--space-xl);
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ether-page .footer-social-link:hover {
    transform: none;
  }
}

/* ───────────── 4. PAGE LOADER ─────────────
   A dark screen with the logo and three bouncing dots that covers the page
   until it (and its images) have loaded; main.js then fades it out. If the
   script never runs, the failsafe animation removes it after a few seconds,
   so the page can never stay hidden. */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 10010; /* above the header (10001) and the paper grain */
  display: grid;
  place-content: center;
  justify-items: center;
  gap: var(--space-m);
  background: var(--night);
  transition: opacity 0.45s ease, visibility 0.45s ease;
  animation: page-loader-failsafe 0.45s ease 6s forwards;
}

.page-loader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* the logo in a round chip, like the navbar's; it stays still. The circle is on the
   wrapper, so the corners of the (square) logo image are never clipped */
.page-loader__logo {
  display: grid;
  place-items: center;
  width: 4.8rem;
  height: 4.8rem;
  background: var(--paper-2);
  border-radius: 50%;
}

.page-loader__logo img {
  display: block;
  width: 2.6rem;
  height: 2.6rem;
  object-fit: contain;
}

.page-loader__dots {
  display: flex;
  gap: 0.45rem;
}

.page-loader__dots i {
  width: 0.6rem;
  height: 0.6rem;
  background: var(--orange);
  border-radius: 50%;
  animation: page-loader-dot 1s ease-in-out infinite;
}

.page-loader__dots i:nth-child(2) {
  animation-delay: 0.15s;
}

.page-loader__dots i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes page-loader-dot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30% { transform: translateY(-0.55rem); opacity: 1; }
}

@keyframes page-loader-failsafe {
  to { opacity: 0; visibility: hidden; pointer-events: none; }
}

@media (prefers-reduced-motion: reduce) {
  .page-loader__dots i {
    animation: none;
  }

  .page-loader__dots i {
    opacity: 0.7;
  }
}

/* ───────────── 4. SCROLL REVEAL (see assets/js/scroll-reveal.js) ───────────── */
.reveal-pending {
  opacity: 0;
}
