/* ========================================
   RESET
======================================== */

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

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
}


/* ========================================
   PAGE
======================================== */

:root {
  --color-strip: #97b5c7;
  --color-page: #acdefb;
  --color-panel: #231f20;
  --page-padding: clamp(0.5rem, 1.5vw, 1.5rem);
  --panel-gap: clamp(0.375rem, 0.75vw, 0.75rem);
  --strip-height: max(1.875rem, 100vw * 90 / 2730.67);
  --color-glyph: #acdefb;
  --color-glyph-hover: #ffffff;
  --color-marker: #77639a;
  --color-focus: #514287;
  --color-ticker: #01395e;
  --ticker-label-height: clamp(1.75rem, 3vw, 2.5rem);
  --ticker-label-padding: clamp(0.4rem, 0.8vw, 0.65rem);
  --ticker-foot-height: max(10px, clamp(0.625rem, 1vw, 0.875rem));
  --color-fine-print: #a798b3;
  --color-deterioration-stripe-a: #0167a2;
  --color-deterioration-stripe-b: #3d0f0c;
  --color-deterioration-plate: #3d0f0c;
  --color-deterioration-glyph-hover: #0167a2;
  --color-informatics-border: #fff;
  --color-informatics-ink: #acdefb;
  --color-informatics-marker: #0167a2;
  --color-main-event-outer: #011724;
  --color-main-event-inner: #012a42;
  --color-main-event-glow: #0167a2;
  --color-biology-media: #011724;
  --color-biology-feature: #3d0f0c;
  --color-warped-bg: #adc7a9;
  --color-welcome-bg: rgb(172 222 251 / 0.9);
  --color-welcome-ink: #97b5c7;
  --color-welcome-dots: #0167a2;
  --color-welcome-cycle-a: #4c4080;
  --color-welcome-cycle-b: #866b99;
  --color-welcome-cycle-c: #a798b3;

  /* Four-diamond cursor (30px, hotspot at centre). Default #a798b3; clickable things get #ada6b3. */
  --cursor-diamonds: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 32 32'><path d='M16 2.8L21.8 8.6L16 14.4L10.2 8.6ZM8.6 10.2L14.4 16L8.6 21.8L2.8 16ZM23.4 10.2L29.2 16L23.4 21.8L17.6 16ZM16 17.6L21.8 23.4L16 29.2L10.2 23.4Z' fill='%23a798b3' stroke='rgba(76,64,128,0.45)' stroke-width='0.75' stroke-linejoin='round'/></svg>") 15 15, auto;
  --cursor-pointer: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 32 32'><path d='M16 2.8L21.8 8.6L16 14.4L10.2 8.6ZM8.6 10.2L14.4 16L8.6 21.8L2.8 16ZM23.4 10.2L29.2 16L23.4 21.8L17.6 16ZM16 17.6L21.8 23.4L16 29.2L10.2 23.4Z' fill='%23ada6b3' stroke='rgba(90,84,98,0.45)' stroke-width='0.75' stroke-linejoin='round'/></svg>") 15 15, pointer;
}

html,
body {
  background: var(--color-page);
}

html {
  cursor: var(--cursor-diamonds);
}

a,
button,
[role="button"] {
  cursor: var(--cursor-pointer);
}

/* Falling pixie-dust trail behind the cursor (drawn by cursor-trail.js). */
.cursor-trail {
  position: fixed;
  inset: 0;
  z-index: 2000;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

body {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  color: var(--color-page);
  font-family: system-ui, sans-serif;
  line-height: 1.5;
}


/* ========================================
   FULL VIEWPORT
======================================== */

.site-shell {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows:
    minmax(0, 413fr)
    minmax(0, 227fr)
    minmax(0, 200fr)
    minmax(0, 48fr);
  gap: var(--panel-gap);
  padding: var(--page-padding);
  padding-left: max(var(--page-padding), env(safe-area-inset-left));
  padding-right: max(var(--page-padding), env(safe-area-inset-right));
  padding-bottom: max(var(--page-padding), env(safe-area-inset-bottom));
  background: var(--color-page);
}


/* ========================================
   TOP STRIP
======================================== */

.top-strip {
  height: calc(var(--strip-height) + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  background: var(--color-strip);
}

.top-strip-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.top-strip-svg [role="button"],
.top-strip-svg [role="slider"] {
  cursor: var(--cursor-pointer);
  outline: none;
}

.top-strip-svg [role="button"]:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 4px;
}


/* COMMAS */

.comma {
  fill: var(--color-glyph);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 72px;
  font-weight: 700;
  user-select: none;
  transition: fill 0.2s;
}

.comma:hover {
  fill: var(--color-glyph-hover);
}

.comma-marker {
  fill: none;
  stroke: var(--color-marker);
  stroke-width: 3;
  transition: x 0.25s ease;
}


/* TARGET */

.target circle {
  transition: fill 0.3s;
}

.target:hover circle:first-child {
  filter: brightness(1.1);
}


/* MARKS */

.mark {
  fill: var(--color-glyph);
  stroke: var(--color-glyph);
  stroke-width: 0;
  stroke-linecap: round;
  transition: fill 0.2s, stroke-width 0.2s, transform 0.3s ease;
}

.toggle-outline:hover {
  fill: var(--color-glyph-hover);
  stroke: var(--color-glyph-hover);
}

.toggle-outline.is-outlined {
  fill: transparent;
  stroke-width: 3;
}

.rotates {
  transform-box: fill-box;
  transform-origin: center;
}

path.rotates {
  fill: none;
  stroke-width: 7;
}

.rotates:hover {
  fill: var(--color-glyph-hover);
  stroke: var(--color-glyph-hover);
}

path.rotates:hover {
  fill: none;
}

#brightness-dot:hover {
  filter: brightness(1.15);
}


/* SLIDER */

.slider {
  cursor: var(--cursor-pointer);
}

.slider-tick,
.slider-knob {
  fill: var(--color-glyph);
}

.slider-tick {
  transition: fill 0.2s;
}

.slider-tick:hover {
  fill: var(--color-glyph-hover);
}

.slider-track {
  stroke: var(--color-glyph);
  stroke-width: 4;
  stroke-linecap: round;
}

.slider-knob {
  transition: r 0.15s;
}

.slider:hover .slider-knob,
.slider.is-dragging .slider-knob {
  r: 10;
}

.slider.is-dragging {
  cursor: grabbing;
}


/* BARS BUTTON */

.bars-bg {
  fill: var(--color-glyph);
}

.bars-bar {
  fill: var(--color-strip);
}

.bars-bg,
.bars-bar {
  transition: fill 0.3s;
}

.bars:hover .bars-bg {
  fill: var(--color-glyph-hover);
}

.bars.is-swapped .bars-bg {
  fill: var(--color-strip);
  stroke: var(--color-glyph);
  stroke-width: 2;
}

.bars.is-swapped .bars-bar {
  fill: var(--color-glyph);
}

.bars.is-swapped:hover .bars-bg {
  stroke: var(--color-glyph-hover);
}

.bars.is-swapped:hover .bars-bar {
  fill: var(--color-glyph-hover);
}


/* ========================================
   ROWS
======================================== */

.row {
  display: grid;
  gap: var(--panel-gap);
  min-width: 0;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr);
}


/* FIRST 3-COLUMN ROW */

.row-1 {
  grid-template-columns:
    minmax(0, 686fr)
    minmax(0, 111fr)
    minmax(0, 152fr);

}


/* MIDDLE WIDE ROW */

.row-2 {
  grid-template-columns: minmax(0, 1fr);

}


/* LAST 3-COLUMN ROW */

.row-3 {
  grid-template-columns:
    minmax(0, 200fr)
    minmax(0, 539fr)
    minmax(0, 210fr);

}


/* ========================================
   PANELS
======================================== */

.panel {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background: var(--color-panel);
  border: 0;
  overflow-wrap: anywhere;
}

.panel-content {
  min-width: 0;
}


/* ========================================
   CONTENT INSIDE PANELS
======================================== */

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

.panel-layer img,
.panel-layer video,
.panel-layer canvas,
.panel-layer svg {
  height: 100%;
  object-fit: cover;
}


/* OPTIONAL */

.panel img.contain,
.panel video.contain {
  object-fit: contain;
}

.panel img.stretch,
.panel video.stretch {
  object-fit: fill;
}


/* ========================================
   TICKER DISPLAY
======================================== */

#ticker-display {
  overflow: hidden;
  background: #000;
}

.ticker {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.ticker-label {
  height: calc(var(--ticker-label-height) + var(--ticker-label-padding) * 2);
  padding: var(--ticker-label-padding) 0;
  background-image:
    url("../img/ipom-img-tickerdisplaylabel.svg"),
    linear-gradient(var(--color-ticker), var(--color-ticker));
  background-origin: content-box, border-box;
  background-clip: content-box, border-box;
  background-repeat: repeat-x, no-repeat;
  background-size:
    calc(var(--ticker-label-height) * 420 / 110) var(--ticker-label-height),
    auto;
  background-position: 0 0, 0 0;
  animation: ticker-marquee 6s linear infinite;
}

@keyframes ticker-marquee {
  to {
    background-position: calc(var(--ticker-label-height) * -420 / 110) 0, 0 0;
  }
}

#ticker-display .ticker-canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.ticker-foot {
  height: var(--ticker-foot-height);
  min-height: 10px;
  background: var(--color-ticker);
}

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


/* ========================================
   MAIN EVENT
======================================== */

#main-event {
  overflow: hidden;
}

.main-event {
  position: absolute;
  inset: 0;
  container-type: size;
  background: var(--color-main-event-outer);
}

.main-event-inner {
  position: absolute;
  left: 20%;
  right: 20%;
  top: 29.5%;
  bottom: 29.5%;
  background: var(--color-main-event-inner);
}

.main-event-stage {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 20% 10% 7% 26% 7% 10% 20%;
  grid-template-rows: 1fr;
  align-items: center;
}

.main-event-side {
  width: 70%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-self: center;
  gap: min(7.2cqh, 3.6cqw);
}

#main-event img.main-event-detail {
  width: auto;
  height: min(2.8cqh, 1.4cqw);
  max-width: 100%;
}

.main-event-dots {
  width: 100%;
  height: max(4px, min(1.6cqh, 0.8cqw));
}

#main-event .main-event-dots canvas {
  display: block;
  width: 100%;
  height: 100%;
}

#main-event img.main-event-features {
  flex: 0 0 auto;
  width: auto;
  height: min(20cqh, 10cqw);
  aspect-ratio: 1 / 1;
  transform: translateY(-3cqh);
}

/* Hang each blob cluster slightly off the inner box edge (offsets account
   for each SVG's own side padding: 10% in features1, 3% in features2). */
#main-event img.main-event-features[src$="features1.svg"] {
  justify-self: start;
  transform: translate(-18%, -3cqh);
}

#main-event img.main-event-features[src$="features2.svg"] {
  justify-self: end;
  transform: translate(11%, -3cqh);
}

#main-event img.main-event-headliner {
  flex: 0 0 auto;
  width: auto;
  height: min(68cqh, 34cqw);
  aspect-ratio: 221.32 / 1080;
  transform: translateY(-3cqh);
}

.main-event-center {
  position: relative;
  align-self: stretch;
}

#main-event .main-event-center canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#main-event img.main-event-title {
  position: absolute;
  left: 50%;
  bottom: 11%; /* centre of the band below the inner box (78% -> 100%) */
  transform: translate(-50%, 50%);
  width: min(40cqw, 90cqh);
  height: auto;
  filter:
    drop-shadow(0 0 0.3cqw var(--color-main-event-glow))
    drop-shadow(0 0 1cqw var(--color-main-event-glow));
  animation: main-event-glow 2.6s ease-in-out infinite alternate;
}

@keyframes main-event-glow {
  from {
    filter:
      drop-shadow(0 0 0.2cqw var(--color-main-event-glow))
      drop-shadow(0 0 0.6cqw var(--color-main-event-glow));
  }
  to {
    filter:
      drop-shadow(0 0 0.5cqw var(--color-main-event-glow))
      drop-shadow(0 0 1.8cqw var(--color-main-event-glow));
  }
}

@media (prefers-reduced-motion: reduce) {
  #main-event img.main-event-title {
    animation: none;
  }
}


/* ========================================
   BIOLOGY
======================================== */

#biology {
  overflow: hidden;
  container: biology / size;
}

.biology {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 41.5fr) minmax(0, 55fr);
  grid-template-rows: minmax(0, 1fr);
  column-gap: 1.5cqw;
  padding: 5cqh 1cqw 4cqh;
  background: url("../img/ipom-website-biology-bg.png") center / cover;
}

.biology-media,
.biology-feature {
  position: relative;
  min-height: 0;
  overflow: hidden;
}

/* Left column: looping background video (cover-cropped) under the overlay glyphs. */
.biology-media {
  background: var(--color-biology-media) center / cover no-repeat;
  display: grid;
  place-items: center;
}

#biology video.biology-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

#biology img.biology-overlay {
  position: relative;
  z-index: 1;
  width: 76%;
  height: auto;
  max-height: 70%;
  object-fit: contain;
  filter: drop-shadow(0 0.4cqh 0.8cqh rgba(0, 0, 0, 0.75));
}

.biology-column {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 75fr) minmax(0, 25fr);
  place-items: center;
}

.biology-feature {
  width: 100%;
  height: 100%;
  background: var(--color-biology-feature);
}

#biology img.biology-heading {
  position: absolute;
  top: 8%;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  height: 15%;
  max-width: 32%;
  object-fit: contain;
}

/* Right column: smoke canvas (biology-smoke.js), below the heading glyphs. */
.biology-specimen {
  position: absolute;
  inset: 27% 1% 6%;
}

#biology .biology-specimen canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* Soften the edges so smoke fades in/out instead of being cut off. */
  -webkit-mask-image:
    linear-gradient(to right, transparent, #000 6%, #000 94%, transparent),
    linear-gradient(transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent, #000 6%, #000 94%, transparent),
    linear-gradient(transparent, #000 12%, #000 88%, transparent);
  mask-composite: intersect;
}

#biology img.biology-footer {
  width: auto;
  height: 58%;
  max-width: 46%;
  object-fit: contain;
}

/* Square / narrow panels (<= 56rem): stack the columns. */
@container biology (aspect-ratio < 2) {
  .biology {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 42fr) minmax(0, 58fr);
    row-gap: 3cqh;
    padding: 4cqw;
  }
}


/* ========================================
   WELCOME SCREEN
======================================== */

/* Lock page scroll while the welcome layer is up (mobile layout scrolls). */
body.welcome-open {
  overflow: hidden;
}

.welcome {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr);
  justify-items: center;
  row-gap: 3vh;
  padding: 2vh 0;
  background: var(--color-welcome-bg);
  /* Keeps the site behind hinted at but not readable. */
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--color-welcome-ink);
  font-family: "velzyland", sans-serif;
  font-weight: 400;
  font-style: normal;
  line-height: 1;
  overflow: hidden;
  transition: opacity 1.2s ease;
}

.welcome.is-leaving {
  opacity: 0;
  pointer-events: none;
}

.welcome[hidden] {
  display: none;
}

.welcome-dots {
  width: 6px;
  height: 100%;
  background: radial-gradient(circle, var(--color-welcome-dots) 1.4px, transparent 2px) center top / 6px 15px repeat-y;
}

.welcome-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.6vh;
  width: 100%;
  text-align: center;
}

.welcome-title {
  margin: 0;
  font: inherit;
  font-size: 3.7vw;
  white-space: nowrap;
  cursor: var(--cursor-pointer);
  user-select: none;
}

.welcome-credit {
  margin: 0;
  font-size: 1.8vw;
  letter-spacing: 0.78em;
  margin-right: -0.78em; /* cancel trailing letter-spacing so it centres */
  white-space: nowrap;
  cursor: var(--cursor-pointer);
  user-select: none;
}

.welcome-credit span {
  display: inline-block;
  transition: transform 0.35s ease;
}

.welcome-credit span.is-flipped {
  transform: scaleY(-1);
}

.welcome-actions {
  display: flex;
  align-items: center;
  gap: 1.8vw;
  margin-top: 0.6vh;
}

.welcome-enter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.1em 0.4em;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 2.55vw;
  line-height: 1;
  cursor: var(--cursor-pointer);
}

/* Velzyland's ink sits off-centre in its line box, by a different amount per browser.
   welcome.js measures the real glyph bounds and sets --enter-nudge (in em). */
.welcome-enter > span {
  display: inline-block;
  transform: translateY(var(--enter-nudge, 0em));
}

.welcome-social {
  display: flex;
  align-items: center;
  gap: 1.35vw;
  font-size: 2.4vw;
}

.welcome-social a {
  color: inherit;
  text-decoration: none;
}

/* Everything clickable cycles through the three purples (one colour per second) on hover. */
@keyframes welcome-cycle {
  0% { color: var(--color-welcome-cycle-a); }
  33.333% { color: var(--color-welcome-cycle-b); }
  66.667% { color: var(--color-welcome-cycle-c); }
}

@keyframes welcome-cycle-fill {
  0% { background-color: var(--color-welcome-cycle-a); border-color: var(--color-welcome-cycle-a); }
  33.333% { background-color: var(--color-welcome-cycle-b); border-color: var(--color-welcome-cycle-b); }
  66.667% { background-color: var(--color-welcome-cycle-c); border-color: var(--color-welcome-cycle-c); }
}

.welcome-title:hover,
.welcome-credit:hover,
.welcome-social a:hover {
  animation: welcome-cycle 3s step-end infinite;
}

/* Button: stroke -> fill on hover. */
.welcome-enter:hover {
  color: #acdefb;
  animation: welcome-cycle-fill 3s step-end infinite;
}

.welcome :focus-visible {
  outline: 2px solid var(--color-welcome-cycle-a);
  outline-offset: 3px;
}

@media (max-width: 36rem) {
  .welcome-title {
    font-size: 8.5vw;
    white-space: normal;
    padding: 0 4vw;
  }

  .welcome-credit {
    font-size: 3vw;
    letter-spacing: 0.34em;
    margin-right: -0.34em;
    white-space: nowrap;
  }

  .welcome-actions {
    flex-direction: column;
    gap: 2.5vh;
  }

  .welcome-enter {
    font-size: 5.25vw;
  }

  .welcome-social {
    gap: 3.75vw;
    font-size: 5.25vw;
  }
}

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

  .welcome-credit span {
    transition: none;
  }
}


/* ========================================
   WARPED LINES
======================================== */

#warped-lines {
  overflow: hidden;
  container: warped / size;
}

.warped {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  row-gap: 3cqh;
  padding: 2cqh 1.8cqw 3cqh;
  background: var(--color-warped-bg);
}

/* Top: three warped-line SVGs stretched to fill, 3s hold / 3s crossfade (18s cycle). */
.warped-slider {
  position: relative;
  min-height: 0;
}

#warped-lines .warped-slider svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  opacity: 0;
  will-change: opacity;
  animation: warped-cycle 18s linear infinite;
}

#warped-lines .warped-slider svg:nth-of-type(2) {
  animation-delay: -12s;
}

#warped-lines .warped-slider svg:nth-of-type(3) {
  animation-delay: -6s;
}

@keyframes warped-cycle {
  0%,
  16.667% { opacity: 1; }
  33.333%,
  83.333% { opacity: 0; }
  100% { opacity: 1; }
}

/* Bottom: one calibration strip, or two side by side when the panel is wide. */
.warped-calibration {
  display: flex;
}

#warped-lines .warped-calibration img {
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
  height: auto;
}

#warped-lines .warped-calibration img:nth-child(2) {
  display: none;
}

@container warped (aspect-ratio >= 2) {
  #warped-lines .warped-calibration img:nth-child(2) {
    display: block;
  }
}

@media (prefers-reduced-motion: reduce) {
  #warped-lines .warped-slider svg {
    animation: none;
  }

  #warped-lines .warped-slider svg:first-of-type {
    opacity: 1;
  }
}


/* ========================================
   OTHERWORLDLY ENTITIES
======================================== */

#otherworldly-entities {
  overflow: hidden;
}

.entities {
  position: absolute;
  inset: 0;
  background: url("../img/ipom-website-img-entity.gif") center / cover no-repeat;
}


/* ========================================
   INFORMATICS MENU
======================================== */

@font-face {
  font-family: "Portal Galactico";
  src: url("../fonts/portal-galactico.otf") format("opentype");
  font-display: block;
}

#informatics-menu {
  overflow: hidden;
  background: #000;
}

.informatics {
  position: absolute;
  inset: 0;
  padding: 4%;
  container-type: size;
}

.informatics-frame {
  height: 100%;
  border: 1px solid var(--color-informatics-border);
  border-radius: 8px;
  padding: 6% 8%;
  overflow: hidden;
  font-family: "Portal Galactico", monospace;
  font-size: clamp(0.61rem, 5.4cqw, 1.15rem);
  line-height: 1.5;
  color: var(--color-informatics-ink);
}

.informatics-title {
  color: var(--color-informatics-ink);
  letter-spacing: 0.1em;
  margin: 0 0 0.9em;
}

.informatics-heading {
  margin: 0.9em 0 0.35em;
}

.informatics-stream {
  white-space: nowrap;
  transition: opacity 0.6s ease;
}

.informatics-stream.is-fading {
  opacity: 0;
}

.informatics-stream ul {
  margin: 0 0 0.6em;
  padding-left: 0;
  list-style: none;
}

.informatics-stream li {
  margin: 0;
  padding: 0;
  color: #fff;
}

.informatics-stream li::before {
  content: "\2022\00A0\00A0";
  font-family: Helvetica, Arial, sans-serif;
  color: var(--color-informatics-marker);
}


/* ========================================
   GLYPH DETERIORATION
======================================== */

@font-face {
  font-family: "Portal Glyph";
  src:
    url("../fonts/portal-glyph.woff2") format("woff2"),
    url("../fonts/portal-glyph.woff") format("woff"),
    url("../fonts/portal-glyph.ttf") format("truetype");
  font-display: block;
}

#glyph-deterioration {
  overflow: hidden;
  background: repeating-linear-gradient(
    45deg,
    var(--color-deterioration-stripe-a) 0 3px,
    var(--color-deterioration-stripe-b) 3px 6px
  );
}

.deterioration {
  position: absolute;
  inset: 0;
  container-type: size;
  /* Stepped, chewed rectangle with diagonal cuts; edit here to reshape the plate. */
  --plate-shape: polygon(
    0% 6%, 4% 6%, 4% 0%, 20% 0%, 23% 3%, 38% 3%, 38% 0%, 62% 0%, 62% 4%,
    78% 4%, 78% 0%, 93% 0%, 93% 5%, 100% 5%,
    100% 32%, 97% 32%, 97% 48%, 100% 48%, 100% 63%, 96% 66%, 96% 80%, 100% 83%,
    100% 100%, 85% 100%, 85% 96%, 70% 96%, 70% 100%, 42% 100%, 42% 97%,
    30% 97%, 27% 100%, 11% 100%, 11% 96%, 6% 96%, 6% 100%, 0% 100%,
    0% 72%, 3% 72%, 3% 55%, 0% 52%, 0% 30%, 3% 27%, 3% 14%, 0% 11%
  );
}

#glyph-deterioration .deterioration-canvas {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.deterioration-plate {
  position: absolute;
  inset: 7%;
  z-index: 1;
  background: var(--color-deterioration-plate);
  clip-path: var(--plate-shape);
}

.deterioration-body {
  position: absolute;
  inset: 7%;
  z-index: 2;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  row-gap: 8%;
  place-items: center;
  padding: 8% 10% 10%;
}

.deterioration-glyph {
  width: auto;
  height: 100%;
  max-width: 100%;
  min-height: 0;
  aspect-ratio: 1041.38 / 1080;
  background-color: var(--color-glyph);
  -webkit-mask: url("../img/ipom-img-balezeglyph.svg") center / contain no-repeat;
  mask: url("../img/ipom-img-balezeglyph.svg") center / contain no-repeat;
  transition: background-color 1.8s ease;
}

.deterioration-glyph:hover {
  background-color: var(--color-deterioration-glyph-hover);
}

.deterioration-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.05em;
  max-width: 100%;
  color: var(--color-glyph);
  font-family: "Portal Glyph", monospace;
  font-size: clamp(0.4rem, min(2.7cqw, 6cqh), 1.1rem);
  line-height: 1;
  letter-spacing: 0;
  word-spacing: 0.4em;
  white-space: nowrap;
}

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


/* ========================================
   FOOTER FINE PRINT
======================================== */

#footer-fine-print {
  overflow: hidden;
  background: transparent;
  border-top: 1px solid var(--color-fine-print);
  border-bottom: 1px solid var(--color-fine-print);
}

.fine-print {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 2vw, 2rem);
  animation: fine-print-blur 5s ease-in-out infinite alternate;
}

@keyframes fine-print-blur {
  from { filter: blur(0.25px); }
  to   { filter: blur(0.7px); }
}

.fine-print-side {
  flex: 1 1 0;
  align-self: stretch;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#footer-fine-print img {
  display: block;
  width: auto;
  flex: none;
}

/* --fine-print-scale is set by footer-fine-print.js on very narrow screens. */
#footer-fine-print .fine-print-center {
  height: calc(55% * var(--fine-print-scale, 1));
  max-height: calc(2rem * var(--fine-print-scale, 1));
}

#footer-fine-print .fine-print-glyph {
  height: calc(55% * var(--fine-print-scale, 1));
  max-height: calc(1.75rem * var(--fine-print-scale, 1));
  aspect-ratio: 1 / 1;
}

@media (prefers-reduced-motion: reduce) {
  .fine-print {
    animation: none;
    filter: blur(0.4px);
  }
}


/* ========================================
   ABSOLUTE CONTENT LAYERS
======================================== */

.panel-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

@media (max-width: 56rem) {
  :root {
    --strip-height: max(1.875rem, 100vw * 90 / 2048);
  }

  body {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .site-shell,
  .row {
    grid-template-rows: auto;
  }

  .site-shell {
    grid-auto-rows: auto;
  }

  .row .panel {
    aspect-ratio: 1 / 1;
  }

  .panel-bottom {
    min-height: 3rem;
  }

  .row-1 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto auto;
  }

  .row-1 > .panel:first-child {
    grid-column: 1 / -1;
  }

  .row-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 36rem) {
  :root {
    --strip-height: max(1.875rem, 100vw * 90 / 1288);
  }

  .row-1,
  .row-3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .row-1,
  .row-3 {
    grid-template-rows: auto;
    grid-auto-rows: auto;
  }
}
