/* Taflor product page. Self-hosted fonts only (SIL OFL 1.1, see fonts/). */

@font-face {
  font-family: "Familjen Grotesk";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/familjen-grotesk.woff2") format("woff2");
}

@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("fonts/source-serif-4.woff2") format("woff2");
}

@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url("fonts/source-serif-4-italic.woff2") format("woff2");
}

:root {
  /* palette: a game board at night */
  --fjord: #173a4a;      /* the board: hero and footer */
  --fjord-line: #4d7586; /* grid lines on the board */
  --birch: #e6e9e3;      /* page */
  --birch-lit: #f2f4ef;  /* raised areas on the page */
  --iron: #232c30;       /* text */
  --iron-soft: #4a575d;  /* secondary text */
  --lichen: #8fa86e;     /* base plugins */
  --lichen-deep: #4f6a33;/* lichen as text or marks on birch */
  --amber: #e3a72f;      /* the core, focus on dark */

  --sans: "Familjen Grotesk", "Helvetica Neue", Arial, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;

  --step--1: 0.875rem;
  --step-0: 1.125rem;
  --step-1: 1.375rem;
  --step-2: 1.75rem;
  --step-3: clamp(1.9rem, 1.4rem + 2vw, 2.6rem);
  --step-4: clamp(2.5rem, 1.2rem + 5vw, 4.6rem);

  --gutter: clamp(1.25rem, 4vw, 3rem);
  --wide: 74rem;
  --measure: 36em;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--birch);
  color: var(--iron);
  font-family: var(--serif);
  font-size: var(--step-0);
  line-height: 1.65;
  font-optical-sizing: auto;
}

h1,
h2,
h3,
dt,
.wordmark,
.site-nav,
.button,
.state {
  font-family: var(--sans);
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.1;
  font-weight: 650;
  text-wrap: balance;
}

p {
  margin: 0 0 1em;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--fjord);
  outline-offset: 3px;
  border-radius: 2px;
}

.on-board :focus-visible {
  outline-color: var(--amber);
}

.wrap {
  max-width: var(--wide);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 10;
  padding: 0.5rem 0.9rem;
  background: var(--amber);
  color: var(--iron);
  font-family: var(--sans);
  font-weight: 600;
}

.skip-link:focus {
  top: 0.75rem;
}

/* header and hero share the board colour */

.on-board {
  background: var(--fjord);
  color: var(--birch);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-block: 1.25rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: var(--step-1);
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.wordmark svg {
  width: 1.6rem;
  height: 1.6rem;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 1rem;
}

.site-nav a {
  text-decoration: none;
  padding-block: 0.25rem;
  border-bottom: 1px solid transparent;
}

.site-nav a:hover {
  border-bottom-color: currentColor;
}

.site-nav .lang {
  color: var(--amber);
}

.hero .wrap {
  display: grid;
  gap: 2.5rem;
  padding-block: clamp(2rem, 6vw, 5rem) clamp(3rem, 8vw, 6.5rem);
}

@media (min-width: 60rem) {
  .hero .wrap {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    align-items: center;
    gap: 4rem;
  }
}

.hero h1 {
  font-size: var(--step-4);
  line-height: 1.02;
  letter-spacing: -0.025em;
  max-width: 13ch;
}

.hero .lead {
  margin-top: 1.75rem;
  max-width: 34em;
  font-size: 1.2rem;
  line-height: 1.55;
}

@media (min-width: 40rem) {
  .hero .lead {
    font-size: var(--step-1);
  }
}

.status-note {
  max-width: 34em;
  margin: 1.75rem 0 2rem;
  padding-left: 1rem;
  border-left: 3px solid var(--amber);
}

.status-note p {
  margin: 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}

.button {
  display: inline-block;
  padding: 0.7rem 1.2rem;
  border: 2px solid var(--birch);
  font-size: 1.05rem;
  font-weight: 600;
  text-decoration: none;
  line-height: 1.2;
}

.button.primary {
  background: var(--birch);
  color: var(--fjord);
}

.button:hover {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--iron);
}

/* the board */

.board-figure {
  margin: 0;
}

.board {
  display: block;
  width: 100%;
  max-width: 30rem;
  height: auto;
  margin-inline: auto;
}

.board-bg {
  fill: #1d4558;
}

.board-grid {
  fill: none;
  stroke: var(--fjord-line);
  stroke-width: 0.4;
}

.board-mark {
  fill: #24536a;
}

.piece-open {
  fill: none;
  stroke: var(--birch);
  stroke-opacity: 0.55;
  stroke-width: 0.6;
  stroke-dasharray: 1.2 1.2;
}

.piece-base {
  fill: var(--lichen);
}

.piece-core {
  fill: var(--amber);
}

.piece-core-ring {
  fill: none;
  stroke: var(--fjord);
  stroke-width: 0.8;
}

.board-figure figcaption {
  max-width: 30rem;
  margin: 1.25rem auto 0;
  font-size: 1rem;
  line-height: 1.55;
  color: #c9d3d3;
}

.legend {
  margin: 0;
  padding: 0;
  list-style: none;
}

.legend li {
  display: grid;
  grid-template-columns: 1.4rem minmax(0, 1fr);
  align-items: baseline;
}

.legend li + li {
  margin-top: 0.4rem;
}

.key {
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  border-radius: 50%;
}

.key-core {
  background: var(--amber);
}

.key-base {
  background: var(--lichen);
}

.key-open {
  border: 1px dashed var(--birch);
}

/* the one moment of motion: the pieces are set up on load */

@media (prefers-reduced-motion: no-preference) {
  .piece-core,
  .piece-base,
  .piece-open {
    transform-box: fill-box;
    transform-origin: center;
    animation: set-piece 420ms cubic-bezier(0.2, 0.9, 0.3, 1.25) both;
  }

  .piece-core {
    animation-delay: 150ms;
  }

  .piece-base.d1 {
    animation-delay: 450ms;
  }

  .piece-base.d2 {
    animation-delay: 650ms;
  }

  .piece-open {
    animation-name: show-open;
    animation-duration: 600ms;
    animation-timing-function: ease-out;
    animation-delay: 1050ms;
  }
}

@keyframes set-piece {
  from {
    opacity: 0;
    transform: scale(0.2);
  }
}

@keyframes show-open {
  from {
    opacity: 0;
  }
}

/* page sections */

main > section {
  padding-block: clamp(3rem, 7vw, 5.5rem);
}

main > section + section {
  border-top: 1px solid rgb(35 44 48 / 0.14);
}

.section-head {
  margin-bottom: 2rem;
}

.section-head h2 {
  font-size: var(--step-3);
  letter-spacing: -0.015em;
}

.section-head p {
  max-width: var(--measure);
  margin-top: 1rem;
  color: var(--iron-soft);
}

.prose {
  max-width: var(--measure);
}

.split {
  display: grid;
  gap: 1.5rem 4rem;
}

@media (min-width: 60rem) {
  .split {
    grid-template-columns: 17rem minmax(0, 1fr);
  }

  .split > .section-head {
    position: sticky;
    top: 2rem;
    align-self: start;
  }
}

/* modes */

.modes {
  display: grid;
  gap: 1.5rem 3rem;
  margin-top: 2.5rem;
}

@media (min-width: 48rem) {
  .modes {
    grid-template-columns: 1fr 1fr;
  }
}

.modes h3 {
  font-size: var(--step-1);
  margin-bottom: 0.5rem;
}

.modes p {
  margin: 0;
}

/* ideas */

.ideas {
  display: grid;
  gap: 2.25rem 3rem;
  margin: 0;
}

@media (min-width: 48rem) {
  .ideas {
    grid-template-columns: 1fr 1fr;
  }
}

.ideas div {
  max-width: 32em;
}

.ideas dt {
  font-size: var(--step-1);
  font-weight: 650;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.ideas dd {
  margin: 0;
}

.ideas .first {
  grid-column: 1 / -1;
  max-width: 44em;
  padding: 1.5rem 1.75rem;
  background: var(--birch-lit);
  border-left: 4px solid var(--lichen-deep);
}

.ideas .first dt {
  font-size: var(--step-2);
}

/* status: a row of squares, like a line on the board */

.track {
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: 46rem;
}

.track li {
  position: relative;
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  column-gap: 1rem;
  padding-bottom: 1.75rem;
}

.track li::before {
  content: "";
  grid-row: 1 / span 3;
  justify-self: center;
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.35rem;
  border: 2px solid var(--iron-soft);
  background: var(--birch);
  z-index: 1;
}

.track li::after {
  content: "";
  position: absolute;
  left: calc(1.25rem - 1px);
  top: 1.6rem;
  bottom: 0;
  width: 2px;
  background: rgb(35 44 48 / 0.2);
}

.track li:last-child::after {
  display: none;
}

.track .done::before {
  background: var(--lichen-deep);
  border-color: var(--lichen-deep);
}

.track .now::before {
  background: var(--amber);
  border-color: var(--iron);
  border-radius: 50%;
}

.track h3 {
  font-size: var(--step-1);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
}

.state {
  font-size: var(--step--1);
  font-weight: 600;
  padding: 0.1rem 0.5rem;
  border: 1px solid currentColor;
  color: var(--iron-soft);
}

.done .state {
  color: var(--lichen-deep);
}

.now .state {
  color: var(--iron);
  background: var(--amber);
  border-color: var(--amber);
}

.track p {
  margin: 0.35rem 0 0;
}

.track-note {
  max-width: var(--measure);
  margin-top: 1rem;
  color: var(--iron-soft);
}

/* limits */

.limits {
  display: grid;
  gap: 1rem 3rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 48rem) {
  .limits {
    grid-template-columns: 1fr 1fr;
  }
}

.limits li {
  max-width: 32em;
  padding-left: 1.4rem;
  position: relative;
}

.limits li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.7rem;
  height: 2px;
  background: var(--iron-soft);
}

/* footer */

.site-footer .wrap {
  display: grid;
  gap: 2rem 4rem;
  padding-block: 3rem;
  font-size: 1rem;
  line-height: 1.6;
}

@media (min-width: 48rem) {
  .site-footer .wrap {
    grid-template-columns: 1.2fr 1fr;
  }
}

.site-footer h2 {
  font-size: var(--step-1);
  margin-bottom: 0.5rem;
}

.site-footer p {
  max-width: 34em;
  color: #d5dcdb;
}

.site-footer a {
  color: var(--birch);
}

.legal-links {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgb(230 233 227 / 0.2);
  font-family: var(--sans);
}

/* legal pages */

.legal .wrap {
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
}

.legal h1 {
  font-size: var(--step-3);
  margin-bottom: 1rem;
}

.legal h2 {
  font-size: var(--step-1);
  margin: 2.25rem 0 0.6rem;
}

/* placeholder pages (docs/demo before W2/W3) */

.placeholder .wrap {
  min-height: 60vh;
  padding-block: clamp(3rem, 8vw, 6rem);
}

.placeholder h1 {
  font-size: var(--step-3);
  margin-bottom: 1.25rem;
}

@media print {
  .on-board {
    background: none;
    color: var(--iron);
  }

  .board-figure,
  .site-nav,
  .actions {
    display: none;
  }
}
