/* Mobile first: every rule up here is the phone layout, and tablets use it too.
   Desktop changes are all in one place at the bottom (wider than 1024px).
   The one exception is a small step to four columns for the sign grid and footer (wider than 700px). */
:root {
  color-scheme: light dark; /* follow the system's light or dark setting */
  --bg: light-dark(#ffffff, #000);
  --text: light-dark(#111, #e1e1e1);
  --subtle: light-dark(#8a8a8a, #8B8B8B);
  --rule: light-dark(#e1e1e1, #222);
  --surface: light-dark(#f5f5f7, #141414); /* the boxes behind the signs */
  --placeholder: light-dark(#ececec, #1c1c1c); /* behind photos while they load */
  --bare: #f0f0f0; /* symbols with no frame, in dark mode */
  --ease: cubic-bezier(0.76, 0, 0.24, 1);
  --hoverDuration: 100ms;
  --font: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --bar: 80px;
  --pad: 20px; /* page margin */
  --gutter: 20px; /* gap between columns */
  --base: 14px;
  --label: 13px;
}
:root[data-theme="light"] {
  color-scheme: light;
}
:root[data-theme="dark"] {
  color-scheme: dark;
} /* a choice made in the footer overrides the system */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.4s; /* the cross-fade when the footer switches theme */
  animation-timing-function: var(--ease);
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html,
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--base);
  line-height: 1.3;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}
body.lock {
  overflow: hidden;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  letter-spacing: inherit;
}
a {
  color: inherit;
  text-decoration: none;
}
ul {
  list-style: none;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  text-wrap: pretty;
}
h2,
h3 {
  font-size: inherit;
  font-weight: 400;
}
:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 0;
} /* keyboard focus: a ring in the text colour, not the browser's blue one */

/* header: always there, stuck to the top of the page */
header.bar {
  position: sticky;
  top: 0;
  height: var(--bar);
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 20px var(--pad);
  backdrop-filter: blur(8px);
}
header.bar .logo {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}
.mark {
  width: 1em;
  height: 1em;
  flex: none;
  overflow: visible;
}
.mark path {
  fill: currentColor; /* the logo shape follows the text colour (overrides the script's fill) */
}
header.bar .close {
  display: none;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  margin-right: calc(20px - var(--pad)); /* the close button sits 20px from the edge */
  border: 1px solid var(--rule);
  transition: border-color var(--hoverDuration) ease;
}
header.bar .close svg {
  width: 11px;
  height: 11px;
}
header.bar .close:hover {
  border-color: var(--text);
}
body.lock header.bar .close {
  display: grid;
}

/* intro: the statement, the main photo and its credit, stacked */
.intro {
  display: flex;
  flex-direction: column;
  padding: 40px var(--pad) 80px; /* 40px under the header, 40px down to the signs */
}
.intro h1 {
  max-width: 12.9em; /* sets the line breaks, the same at every width */
  font-size: 24px;
  line-height: 1.25;
  font-weight: 500;
  letter-spacing: -0.05em;
}
.intro h1 span {
  color: var(--subtle);
}
.intro .hero {
  margin-top: 40px;
}
.intro .hero img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1320 / 924; /* the photo's own shape, so nothing is cropped */
  background: var(--placeholder);
}
.intro .credit {
  margin-top: 8px;
  color: var(--subtle);
}

/* grid: rows of grey boxes holding only the sign; the name and number of versions sit below each box */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  row-gap: 40px;
  margin: 0 var(--pad) 140px; /* the bottom value is the whole space down to the footer */
}
.cell a {
  display: block;
}
.tile {
  aspect-ratio: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  overflow: hidden;
  background: var(--surface);
}
.tile svg {
  width: 78%;
  height: 78%;
  display: block;
  transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.tile.away svg {
  visibility: hidden;
} /* while its sign is flying to or from the detail page the grey box stays */
.cell:hover .tile svg {
  transform: scale(1.05);
}
.cell h2 {
  margin-top: 20px;
  line-height: 1.25;
} /* box to label: 20px at every width */
.cell p {
  margin-top: 8px;
  line-height: 1.25;
  color: var(--subtle);
} /* name to number of versions: 8px */

/* footer: the name across the full width, then the links and three photos in two columns */
.foot {
  padding: 0 var(--pad) var(--pad);
}
.foot .word {
  container-type: inline-size; /* the name is sized from this box, so it always spans the page margins */
}
.foot .word span {
  display: block;
  font-size: 12.2cqw; /* the letters of this name in Inter bold are 8.19 times the font size wide */
  margin-left: -0.041em; /* cancels the space built into the left of the S */
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  white-space: nowrap;
}
.foot .row {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* like the sign grid: links in the first box, photos in the other three */
  gap: var(--gutter);
  margin-top: clamp(40px, 6vw, 96px);
}
.foot .links {
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* links at the top, theme switcher level with the bottom of the photos */
  align-items: flex-start;
  gap: 24px;
}
.foot nav ul {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}
.foot nav button,
.foot nav a {
  line-height: 1.3;
  transition: opacity var(--hoverDuration) ease;
}
.foot nav button:hover,
.foot nav a:hover {
  opacity: 0.55;
}
.foot .theme {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}
.foot .theme button {
  line-height: 1.3;
  color: var(--subtle);
  transition: color var(--hoverDuration) ease;
}
.foot .theme button:hover,
.foot .theme button[aria-pressed="true"] {
  color: var(--text);
}
.foot .shot {
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--placeholder);
}
.foot .shot picture {
  display: block;
  height: 100%;
}
.foot .shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(1);
}

/* detail: stacked as title, stage, facts */
#detail {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: var(--bg);
  overflow: auto;
  display: none;
  opacity: 0;
  padding: var(--bar) var(--pad) var(--pad);
}
#detail.open {
  display: flex;
  flex-direction: column;
}
.info,
.art {
  display: contents; /* wrappers that only matter on desktop */
}
.dtitle {
  font-size: clamp(30px, 3.4vw, 60px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  padding: 40px 0 40px; /* 40px under the header, 40px down to the stage */
}
.facts {
  order: 3;
  display: flex;
  flex-direction: column;
  gap: 40px;
  line-height: 1.5;
  align-self: start;
  max-width: 520px; /* a comfortable line length */
  padding: 40px 0 60px; /* 40px from the stage */
}
.facts .row h2,
.facts .row h3 {
  margin-bottom: 4px;
}
.facts .row p,
.facts .row ul {
  color: var(--subtle);
  text-wrap: pretty;
}
.facts .row a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.facts .row a:hover {
  color: var(--text);
}
/* the stage takes its height from its width: a square for the sign with the switcher (if any) under it, 800px at most */
.stage {
  order: 2;
  flex: none;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  container-type: inline-size;
}
#hero {
  position: relative;
  aspect-ratio: 1;
  width: min(80cqw, 570px, 64vh); /* the later limits are for tablets and phones held sideways */
  margin: min(10cqw, 71px, 8vh) auto;
}
#hero svg,
#hero img {
  width: 100%;
  height: 100%;
  display: block;
}
#hero img {
  transform: scale(0.682); /* the plain image on a sign's own page: the same size as the live drawing (600 of its 880 units) */
}
#hero.pending svg {
  visibility: hidden;
}
.dsw {
  --inset: 14px; /* space between the switcher and the stage's edges */
}
.tag {
  margin: 0 var(--inset) 6px;
  color: var(--subtle);
}
.tag:empty {
  display: none;
}
.vars {
  display: flex;
  gap: 8px;
  padding: 2px var(--inset) var(--inset); /* inside the scroller, so thumbnails slide to the box edges and focus rings are not clipped */
  overflow-x: auto; /* too many to fit: swipe sideways */
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  /* an edge fades out while there are more thumbnails beyond it (app.js sets the two widths) */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--fade-l, 0px), #000 calc(100% - var(--fade-r, 0px)), transparent);
  mask-image: linear-gradient(to right, transparent, #000 var(--fade-l, 0px), #000 calc(100% - var(--fade-r, 0px)), transparent);
}
.vars:empty {
  display: none;
}
.vars button,
.vars img { /* img: the plain thumbnails on a sign's own page, before the script takes over */
  flex: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--rule);
  background: transparent;
  padding: 4px;
  overflow: hidden;
  transition: border-color var(--hoverDuration) ease;
}
.vars button:hover {
  border-color: var(--text);
}
.vars img {
  padding: 6px;
}
.vars button.on {
  border-color: var(--text);
}
.vars svg {
  width: 100%;
  height: 100%;
  display: block;
  transform: scale(1.3);
}
.dtitle,
.facts {
  opacity: 0;
  transition: opacity 0.2s;
} /* closing: fade out over 200ms, straight away */
#detail.in .dtitle,
#detail.in .facts {
  opacity: 1;
  transition: opacity 0.3s 0.25s;
} /* opening: fade in over 300ms, once the sign has landed */
.flyer {
  position: fixed;
  z-index: 40;
  overflow: hidden;
  pointer-events: none;
}
.flyer svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* a 1px outline: grey around a white edge in light mode, faint white around a black edge in dark mode
   (app.js marks which edge the outer frame layer has) */
svg[data-sign] path[data-edge="white"] {
  stroke: light-dark(rgba(0, 0, 0, 0.16), transparent);
  stroke-width: 1px;
}
svg[data-sign] path[data-edge="black"] {
  stroke: light-dark(transparent, rgba(255, 255, 255, 0.12));
  stroke-width: 2px; /* the layers above cover its inner half, so 1px shows */
}

/* bare black symbols turn light grey in dark mode. app.js colours the live ones (--bare); this covers the plain images on their own pages */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) :is(img[src$="svg/recycling.svg"], img[src$="svg/biohazard-symbol.svg"], img[src*="svg/wifi-"], img[src*="svg/sun-"]) {
    filter: invert(94%); /* black becomes #f0f0f0, the same as --bare */
  }
}
:root[data-theme="dark"] :is(img[src$="svg/recycling.svg"], img[src$="svg/biohazard-symbol.svg"], img[src*="svg/wifi-"], img[src*="svg/sun-"]) {
  filter: invert(94%);
}

/* about: heading, photo, text, credit */
.about {
  display: flex;
  flex-direction: column;
  padding: 40px var(--pad) 60px;
}
.about h1 {
  font-size: clamp(30px, 3.4vw, 60px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  padding-bottom: 40px;
}
.about figure {
  position: relative;
  flex: none;
  width: 100%;
  max-width: 520px; /* the text's width, so the photos don't balloon on tablets */
  aspect-ratio: 33 / 37;
  background: var(--placeholder);
}
.about figure img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.about-text {
  max-width: 520px;
  margin-top: 40px;
  line-height: 20px;
}
.about-text p {
  text-wrap: pretty;
}
.about-text,
.about-text a {
  display: block;
}
.about-text p + p,
.about-text div + div {
  margin-top: 20px;
}
.about-text a,
.about-credit a {
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity var(--hoverDuration) ease;
}
.about-text a:hover,
.about-credit a:hover {
  opacity: 0.55;
} /* the same hover as the footer links */
.about-credit {
  margin-top: 8px;
  color: var(--subtle);
}

/* ---------------------------------------------------------------- tablet: the sign grid and footer change to four columns */
@media (min-width: 768px) {
  .grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    row-gap: 48px;
  }
  .foot .row {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ---------------------------------------------------------------- desktop */
@media (min-width: 1024px) {
  :root {
    --pad: 40px;
    --gutter: 40px;
  }

  /* landing */
  /* two halves: the statement hangs from the top of the left one and the credit sits at its bottom;
     the photo fills the right one */
  .intro {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--gutter);
    padding-top: 40px;
    padding-bottom: 200px;
  }
  .intro h1 {
    position: relative; /* above the figure, which spans both halves, so the text can be selected */
    z-index: 1;
    grid-column: 1;
    grid-row: 1;
    align-self: start;
  }
  .intro .hero {
    grid-column: 1 / -1;
    grid-row: 1;
    display: grid;
    grid-template-columns: subgrid; /* the same two halves: credit left, photo right */
    margin-top: 0;
  }
  .intro .hero picture {
    grid-column: 2;
    grid-row: 1;
  }
  .intro .credit {
    grid-column: 1;
    grid-row: 1;
    align-self: end;
    margin-top: 0;
  }
  .grid {
    row-gap: 64px;
    margin-bottom: 200px;
  }

  /* about: laid out like a detail page, mirrored. The photo fills the right half, 40px under the header and 800px tall
     at most. On the left the heading starts level with it, the text hangs from halfway down the screen and the credit
     sits at the bottom. */
  .about {
    --h: min(800px, max(100vh, 640px) - var(--bar) - 80px); /* the photo's height */
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    /* heading, space (shrinks if the text needs it), text, space, credit */
    grid-template-rows: auto minmax(24px, calc(var(--h) / 2 - 79px)) auto minmax(32px, 1fr) auto;
    column-gap: var(--gutter);
    height: calc(var(--h) + 80px);
    padding-top: 40px;
    padding-bottom: 40px;
  }
  .about h1 {
    grid-column: 1 / 3;
    grid-row: 1;
    padding: 0;
  }
  .about figure {
    grid-column: 3 / -1;
    grid-row: 1 / -1;
    max-width: none;
    aspect-ratio: auto;
    margin: 0;
  }
  .about-text {
    grid-column: 1 / 3;
    grid-row: 3;
    margin-top: 0;
  }
  .about-credit {
    grid-column: 1 / 3;
    grid-row: 5;
    margin-top: 0;
  }

  /* detail: two halves. The stage fills the screen height on the left (800px at most) and stays put while the text
     beside it scrolls. In the stage the switcher takes the height it needs (wrapping onto more rows) and the sign gets the rest. */
  #detail.open {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--gutter);
    align-content: start;
    padding-top: calc(var(--bar) + 40px);
  }
  .info {
    display: block;
    grid-column: 2;
    grid-row: 1;
  }
  .dtitle {
    padding-top: 0;
  }
  .facts {
    padding: 0;
  }
  .stage {
    grid-column: 1;
    grid-row: 1;
    position: sticky;
    top: 0;
    align-self: start;
    height: min(800px, 100vh - var(--bar) - 40px - var(--pad));
    min-height: 420px;
    padding-top: 24px;
  }
  .art {
    display: flex;
    flex: 1;
    min-height: 0;
    margin: 0 24px;
    container-type: size; /* the sign sizes itself from the space above the switcher */
  }
  #hero {
    width: min(100cqw, 100cqh);
    margin: auto;
  }
  .dsw {
    --inset: 24px;
    min-height: 24px; /* keeps the space under the sign when there is only one version */
  }
  .tag {
    margin-bottom: calc(clamp(8px, 0.8vw, 14px) - 2px);
  }
  .vars {
    flex-wrap: wrap;
    gap: clamp(8px, 0.7vw, 12px);
    overflow: visible;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .vars button,
  .vars img {
    width: clamp(44px, 4vw, 64px);
    height: clamp(44px, 4vw, 64px);
  }
}

/* wide desktop: the About text splits into two columns, on the page's first two */
@media (min-width: 1280px) {
  .about-text {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--gutter);
    align-content: start;
    max-width: none;
  }
  .about-text div + div {
    margin-top: 0;
  }
}
