/* Vicious Triangles - the site. The build (site/build.js) fills every value in
   double braces from brand.json: do not write a brand value in this file. */

@font-face {
  font-family: "Sans Guilt MB";
  src: url("/assets/SansGuiltMB.d0f6dc03fd.otf") format("opentype");
  font-display: block;
}

:root {
  --paper: #f1ead9;
  --ink: #231f1c;
  --red: #b3372b;
  --track-heading: 0.3em;
  --track-corner: 0.2em;
  --quiet: 0.6; /* low contrast: page controls */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}
body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Sans Guilt MB", sans-serif;
  font-weight: 400;
  font-synthesis: none;
  font-size: 16px;
  line-height: 1.5;
}
a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}
a:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 4px;
}
ul {
  list-style: none;
}

/* Capitals with wide spacing: the heading style. The padding balances the
   space after the last letter, so the words are truly centred. */
.heading-style {
  text-transform: uppercase;
  letter-spacing: var(--track-heading);
  padding-left: var(--track-heading);
  font-weight: 400;
}

.spaced {
  text-transform: uppercase;
  letter-spacing: var(--track-heading);
}
.spaced .last {
  letter-spacing: 0;
}

/* ---- The triangle page: first screen ---------------------------------- */

.screen {
  height: 100vh;
  height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.stage {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  touch-action: pan-y;
}
#tri {
  position: absolute;
  inset: 0;
}
#tri h1,
#tri p {
  font-size: inherit;
  font-weight: 400;
}

/* Without JavaScript: the words in a plain column. */
#tri {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  text-align: center;
}
#tri svg {
  display: none;
}
/* The element that holds the corners and the caption (data-nosnippet) makes no box. */
#tri .punch {
  display: contents;
}
#tri .caps {
  text-transform: uppercase;
  letter-spacing: var(--track-corner);
}

/* With JavaScript: every text is placed by its baseline (as in the Reel).
   Each line has zero line-height and a strut on the baseline, so the bottom
   of a line is its baseline, whatever the metrics of the font. */
.js #tri {
  display: block;
}
.js #tri svg {
  display: block;
  position: absolute;
  left: 0;
  top: 0;
  overflow: visible;
}
.js #tri .text {
  position: absolute;
  width: max-content;
  text-align: center;
  white-space: nowrap;
  transform: translateX(-50%);
  opacity: 0;
}
.js #tri .line {
  display: block;
  line-height: 0;
}
.js #tri .strut {
  display: inline-block;
  width: 0;
  height: var(--pitch);
}
.js #tri .caps .line {
  padding-left: var(--track);
}
#tri-heading {
  --track: var(--track-heading);
  letter-spacing: var(--track) !important;
}
#tri .corner {
  --track: var(--track-corner);
}

.controls {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  gap: 2.2em;
  padding: 0 16px calc(14px + env(safe-area-inset-bottom, 0px));
  font-size: 0.875rem;
  letter-spacing: 0.08em;
  line-height: 2;
}
.controls a {
  opacity: var(--quiet);
}
.controls a:hover,
.controls a:focus-visible {
  opacity: 1;
}

/* ---- Below the first screen ------------------------------------------- */

.below {
  text-align: center;
  padding: 0 16px;
}
.see-also {
  padding: 4.5rem 0 4rem;
}
.label {
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  opacity: var(--quiet);
  margin-bottom: 1.4rem;
}
.see-also li {
  font-size: 1rem;
  line-height: 1.5;
  margin: 0.9rem 0;
}

/* ---- The foot --------------------------------------------------------- */

.foot {
  text-align: center;
  font-size: 0.8125rem;
  line-height: 1.6;
  letter-spacing: 0.02em;
  word-spacing: 0.1em;
  padding: 3rem 16px calc(3rem + env(safe-area-inset-bottom, 0px));
}
.foot .links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5em 1.8em;
}
.foot .name {
  margin-top: 1.4rem;
  opacity: var(--quiet);
}

/* ---- The index -------------------------------------------------------- */

.index {
  max-width: 1180px;
  margin: 0 auto;
  padding: 3.5rem 20px 3rem;
}
.index h1 {
  text-align: center;
  font-size: 1.5rem;
  line-height: 1.2;
}
.index .order {
  display: flex;
  justify-content: center;
  gap: 1.8em;
  font-size: 0.875rem;
  letter-spacing: 0.08em;
  margin: 1.3rem 0 3rem;
}
.index .order a[aria-current="true"] {
  text-decoration: none;
}
.index .order a:not([aria-current="true"]) {
  opacity: var(--quiet);
}
.index .list {
  columns: 1;
  column-gap: 3rem;
}
.index .list li {
  break-inside: avoid;
  font-size: 0.9375rem;
  line-height: 1.5;
  padding: 0.45rem 0;
}
.index .group {
  break-inside: avoid;
  padding-bottom: 2rem;
}
.index .group h2 {
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 0.4rem;
}
.index [hidden] {
  display: none;
}
@media (min-width: 720px) {
  .index .list {
    columns: 2;
  }
}
@media (min-width: 1100px) {
  .index .list {
    columns: 3;
  }
}
