:root {
  --paper: #f2f1ed;
  --ink: #141414;
  --ink-soft: rgba(20, 20, 20, 0.55);
  --red: #cd1e3c;
  --gutter: clamp(16px, 2.2vw, 32px);
  --seal: clamp(52px, 9vh, 96px);
  --type: 'Anybody', system-ui, sans-serif;
  --type-small: 'Geist', system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--type);
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
  height: 100dvh;
}

/* ---- the seal ---------------------------------------------------------- */

.top {
  flex: none;
  display: flex;
  justify-content: center;
  padding: calc(var(--gutter) * 0.9) var(--gutter) calc(var(--gutter) * 0.6);
}
.seal {
  margin: 0;
  line-height: 0;
}
.seal img {
  width: var(--seal);
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

/* ---- the three worlds ---------------------------------------------------- */

/* the space between the seal and the footer… */
.stage {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 0 var(--gutter);
  container-type: size;
}

/* …holds the words in a square, as big as fits, centred */
.worlds {
  position: relative;
  width: min(100cqw, 100cqh);
  height: min(100cqw, 100cqh);
}

/* rows are sized and placed by main.js; this is the no-script fallback */
.world {
  position: absolute;
  left: 0;
  right: 0;
  display: block;
  color: var(--ink);
  text-decoration: none;
  overflow: visible;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  touch-action: none;
  outline: none;
}
.world:nth-child(1) { top: 0; height: 33.33%; }
.world:nth-child(2) { top: 33.33%; height: 33.33%; }
.world:nth-child(3) { top: 66.66%; height: 33.34%; }

.world span {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  white-space: nowrap;
  text-transform: uppercase;
  line-height: 1;
  font-size: 18vh; /* fallback before main.js measures */
  font-variation-settings: 'wdth' 100, 'wght' 500;
  transform-origin: 0 0;
  will-change: transform;
}
.world:focus-visible span {
  color: var(--red);
}

/* with script on, hide the words until the font is measured, so they don't jump */
.js .worlds {
  opacity: 0;
  transition: opacity 0.6s ease;
}
.js.ready .worlds {
  opacity: 1;
}

/* ---- footer (same as art.ancrenoire.com) -------------------------------- */

.foot {
  position: relative;
  flex: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px 24px;
  padding: calc(var(--gutter) * 0.7) var(--gutter) calc(var(--gutter) * 0.8 + env(safe-area-inset-bottom));
  font-family: var(--type-small);
  font-size: 13px;
  font-weight: 420;
  letter-spacing: 0.01em;
}

.credits {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 18px;
  color: var(--ink-soft);
}

.links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.links a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.links a:hover,
.links a:focus-visible {
  border-color: currentColor;
  outline: none;
}

.links .icon {
  display: block;
  width: 18px;
  height: 18px;
  border: 0;
  color: var(--ink-soft);
  transition: color 0.2s ease;
}
.links .icon:hover,
.links .icon:focus-visible {
  color: var(--ink);
}
.links .icon:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 4px;
  border-radius: 3px;
}
.links .icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.links .icon .dot {
  fill: currentColor;
}

@media (max-width: 560px) {
  .foot {
    flex-direction: column-reverse;
    align-items: flex-start;
  }
}
