@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces-latin.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Space Mono";
  src: url("fonts/space-mono-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* the Chinese characters: an open-licensed serif CJK cut down to the handful
   of glyphs this page uses, in a single bold weight (5 kB). The cut also
   carries the character each halftone plate sets in its top right corner */
@font-face {
  font-family: "Noto Serif SC";
  src: url("fonts/noto-serif-sc-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+5200, U+521d, U+5236, U+534f, U+547d, U+57ce, U+5bb6, U+5c71, U+5f00,
    U+63db, U+652f, U+65b0, U+65e0, U+661f, U+6708, U+6728, U+6ce2, U+7403, U+773c, U+7fa4,
    U+8bbe, U+95ee;
}

@font-face {
  font-family: "JetBrainsMono Nerd Font";
  src: url("fonts/JetBrainsMonoNerdFont-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  /* paper, ink and one seal red */
  --paper: #14130f;
  --paper-light: #e9e1d2;
  --ink: #e8dfcf;
  --ink-soft: #c4b29e;
  --ink-dim: #9b8c7a;
  --ink-bright: #fffdf7;
  --ink-on-light: #17150f;
  /* kept for the inner pages: the accent is the ink itself, the seal is the
     only colour on the site */
  --accent-primary: #e8dfcf;
  --accent-secondary: #e8dfcf;
  --accent-hover: #e8dfcf;
  --seal: #cf4630;
  /* the hairlines that give the page its printed structure: a rule strong
     enough to see, faint enough to stay behind the words */
  --line: rgba(232, 223, 207, 0.14);
  --line-soft: rgba(232, 223, 207, 0.08);
  --line-light: rgba(23, 21, 15, 0.16);

  /* the page grain */
  --grain: url("assets/grain.webp");

  --f-serif: "Fraunces", Georgia, serif;
  --f-mono: "Space Mono", "JetBrainsMono Nerd Font", ui-monospace, monospace;
  --f-cjk: "Noto Serif SC", "Yu Mincho", "Hiragino Mincho ProN", "Songti SC", SimSun, serif;

  --gutter: clamp(1.15rem, 4vw, 3rem);
  --max: 1240px;
  --ease-join: cubic-bezier(0.66, 0, 0.34, 1);
  --fade: 0.9s;
  --plate-w: 232px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  background-color: var(--paper);
  scroll-padding-top: 4rem;
}

:root {
  --bg: #0d0c09;
  --fg: var(--ink);
  --card: var(--ink-dim);
  --border: var(--line-soft);
  --primary: var(--accent-primary);
  --accent: var(--accent-primary);
  --radius: 0;
}

/* the page: black with a fine grey grain, so it never reads as a flat void */
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--paper);
  background-image:
    url("assets/grain.webp");
  background-size: 200px 200px;
  background-repeat: repeat;
  background-position: center;
  color: var(--ink);
  font-family: var(--f-mono);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

::selection {
  background: var(--seal);
  color: #f6efe2;
}

:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 4px;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 30;
  padding: 0.5rem 0.8rem;
  background: var(--ink);
  color: var(--paper);
}

/* the reading progress: a hairline that fills as the page scrolls */
.progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 30;
  height: 2px;
  pointer-events: none;
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--seal);
  box-shadow: none;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Chinese characters: the accent that carries the motifs (换 家 协 …) */
.cjk {
  font-family: var(--f-cjk);
  font-weight: 700;
  font-synthesis: none;
  color: var(--accent-primary);
  line-height: 1;
  text-shadow: none;
}

/* ------------------------------------------------------- the only navbar */

.hdr {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: #100f0c;
  background-image: var(--grain);
  border-bottom: 1px solid var(--line-soft);
}

.hdr__in {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-block: 0.9rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--f-serif);
  font-size: 1rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.logo__cjk {
  display: inline-grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  border: 1px solid var(--line);
  font-family: var(--f-cjk);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  color: var(--ink-bright);
  transition: color 240ms ease, border-color 240ms ease, box-shadow 240ms ease;
}

.logo:hover .logo__cjk {
  color: var(--seal);
  border-color: var(--seal);
}

.nav {
  display: flex;
  gap: 1.3rem;
  margin-left: auto;
}

.nav a {
  position: relative;
  padding-block: 0.2rem;
  color: var(--ink-dim);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-decoration: none;
  text-transform: lowercase;
  white-space: nowrap;
  transition: color 240ms ease;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--seal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 420ms var(--ease-join);
}

.nav a:hover,
.nav a[aria-current="true"],
.nav a[aria-current="page"] {
  color: var(--accent-hover);
}

.nav a:hover::after,
.nav a[aria-current="true"]::after,
.nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

/* the menu toggle: hidden while the bar can show every link */
.menu-btn {
  display: none;
  align-items: center;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  cursor: pointer;
  transition: color 240ms ease, border-color 240ms ease;
}

.menu-btn:hover {
  color: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--line);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-decoration: none;
  text-transform: lowercase;
  white-space: nowrap;
  transition: all 240ms cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn span {
  transition: transform 300ms var(--ease-join);
}

.btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #14120f;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.btn:hover span {
  transform: translateX(3px);
}

/* the language switch: two plain letters, the active one underlined in seal */
.lang {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  margin-left: 0.1rem;
}

.lang__btn {
  padding: 0.35rem 0.28rem;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--ink-dim);
  font-family: var(--f-mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 240ms ease, border-color 240ms ease;
}

.lang__btn:hover {
  color: var(--ink-bright);
}

.lang__btn:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 2px;
}

.lang__btn.is-active {
  color: var(--ink-bright);
  border-bottom-color: var(--seal);
}

/* ------------------------------------------------------------------- hero */

/* the cover: the title sits on the bottom edge, one character stands in the
   right margin, and the rest is paper */
.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: min(92svh, 820px);
  padding-block: clamp(3rem, 8vh, 5rem);
  overflow: hidden;
  background-color: #000;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.35)),
    url("imagebg1.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* the section's character, printed into the right margin */
.hero__cjk {
  position: absolute;
  top: 50%;
  right: var(--gutter);
  translate: 0 -50%;
  writing-mode: vertical-rl;
  font-family: var(--f-cjk);
  font-size: clamp(7rem, 17vw, 15rem);
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
  opacity: 0.1;
  pointer-events: none;
  user-select: none;
}

.hero__in {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-bottom: clamp(1.6rem, 5vh, 3rem);
}

.aside {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  color: var(--ink-dim);
  font-size: 0.625rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* a short rule before each label, so the eye finds the section index fast */
.aside::before {
  content: "";
  flex: none;
  width: 1.5rem;
  height: 1px;
  background: var(--accent-primary);
}

.aside .cjk {
  font-size: 1.6rem;
  letter-spacing: 0;
  text-transform: none;
  line-height: 0.8;
}

.aside--big .cjk {
  font-size: 2.2rem;
}

.title {
  margin: 0;
  font-family: var(--f-serif);
  font-size: clamp(3.4rem, 11.5vw, 9.5rem);
  font-weight: 600;
  font-variation-settings: "opsz" 144, "WONK" 1;
  line-height: 0.84;
  letter-spacing: -0.05em;
  max-width: 11ch;
  color: var(--accent-primary);
}

.title__w {
  display: inline-block;
}

@keyframes title-in {
  from {
    opacity: 0;
    transform: translateY(0.35em);
    clip-path: inset(0 0 100% 0);
  }
  to {
    opacity: 1;
    transform: none;
    clip-path: inset(0 0 0 0);
  }
}

.js-fade .hero__in.is-in .title__w {
  animation: title-in 700ms var(--ease-join) both;
}

.js-fade .hero__in.is-in .title__w + .title__w {
  animation-delay: 60ms;
}

.lead {
  margin: clamp(1.8rem, 4.2vh, 2.8rem) 0 0;
  max-width: 40ch;
  color: var(--ink-soft);
  font-size: clamp(0.85rem, 1.05vw, 0.95rem);
}

.links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin: clamp(1.2rem, 2.6vh, 1.8rem) 0 0;
  padding: 0;
  list-style: none;
}

.links a {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.72rem 1.05rem;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--ink) 3%, transparent);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  transition: background-color 240ms ease, border-color 240ms ease,
    color 240ms ease, transform 240ms var(--ease-join), box-shadow 240ms ease;
}

.links a:hover {
  color: var(--ink-bright);
  border-color: color-mix(in srgb, var(--ink) 55%, transparent);
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  transform: translateY(-2px);
}

.links a.links__main {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #14120f;
  font-weight: 700;
}

.links a.links__main:hover {
  background: transparent;
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.55);
}

.links a span {
  transition: transform 300ms var(--ease-join);
}

.links a:hover span {
  transform: translateX(4px);
}

/* the cue under the words: the page continues, and it says so */
.hero__cue {
  position: absolute;
  bottom: clamp(1rem, 3vh, 1.7rem);
  right: max(var(--gutter), calc(50% - var(--max) / 2 + var(--gutter)));
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink-dim);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-decoration: none;
  text-transform: lowercase;
  transition: color 240ms ease;
}

.hero__cue:hover {
  color: var(--ink-bright);
}

.hero__cue-line {
  position: relative;
  display: block;
  width: 1px;
  height: 2.3rem;
  background: var(--line);
  overflow: hidden;
}

.hero__cue-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent-hover);
  transform: translateY(-100%);
  animation: cue 2.6s ease-in-out infinite;
}

/* --------------------------------------------------------------- sections */

.sec {
  position: relative;
  border-top: 1px solid var(--line-soft);
}

.sec[data-glyph] {
  overflow: hidden;
}

/* the section's character, printed oversize into the ground of the page */
.sec::after {
  content: attr(data-glyph);
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 0;
  translate: -50% -50%;
  color: var(--ink);
  font-family: var(--f-cjk);
  font-size: clamp(12rem, 32vw, 30rem);
  font-weight: 700;
  line-height: 1;
  opacity: 0.09;
  pointer-events: none;
  user-select: none;
}

/* each folio lands somewhere different, like a stamped page */
#focus::after {
  top: 46%;
  left: 50%;
}

#community::after {
  top: 34%;
  left: 62%;
}

#faq::after {
  top: 50%;
  left: 68%;
}

.sec > .wrap {
  position: relative;
  z-index: 1;
}

/* Each section is a wrap: words and one plate on the first row (left or right,
   alternating), then its details full width — so no column is left empty. */
.sec__in {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--plate-w);
  grid-template-areas: "head plate" "body body";
  column-gap: clamp(1.4rem, 4vw, 3.4rem);
  row-gap: clamp(1.2rem, 3vw, 2.2rem);
  align-items: start;
  padding-block: clamp(4rem, 10vh, 8rem);
}

.sec__head {
  grid-area: head;
  align-self: center;
  max-width: 46ch;
}

.sec__head > .plate-wrap,
.sec__head h2 {
  margin: 0.75rem 0 0;
}

.sec__head h2 {
  font-family: var(--f-serif);
  font-size: clamp(2rem, 4.4vw, 3.6rem);
  font-weight: 550;
  line-height: 0.95;
  letter-spacing: -0.03em;
  text-wrap: balance;
  color: #efe4d6;
}

.note {
  margin: 0.9rem 0 0;
  max-width: 42ch;
  color: var(--ink-dim);
  font-size: 0.78rem;
}

/* the mirror: plate on the left, words on the right */
.sec__in--flip {
  grid-template-columns: var(--plate-w) minmax(0, 1fr);
  grid-template-areas: "plate head" "body body";
}

/* ------------------------------------------------------------ the plates */

.plate {
  position: relative;
  margin: 0;
  border: 1px solid var(--line);
  background: #0e0e0d;
  overflow: hidden;
  transition: border-color 500ms ease, box-shadow 500ms ease;
}

.plate--right {
  grid-area: plate;
  justify-self: end;
}

.plate--left {
  grid-area: plate;
  justify-self: start;
}

.plate:hover {
  border-color: color-mix(in srgb, var(--ink) 45%, transparent);
  box-shadow: 0 22px 46px -24px rgba(0, 0, 0, 0.85);
}

/* a soft vignette, so each plate sits in its own frame */
.plate::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 48px rgba(0, 0, 0, 0.32);
  pointer-events: none;
}

.plate img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 1.2s var(--ease-join);
}

.plate img::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 48px rgba(0, 0, 0, 0.32);
  pointer-events: none;
}

.plate:hover img {
  transform: scale(1.02);
}

/* the small printed caption under each plate */
.plate figcaption {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.42rem 0.55rem 0.46rem;
  border-top: 1px solid var(--line-soft);
  color: var(--ink-dim);
  font-size: 0.53rem;
  letter-spacing: 0.14em;
  line-height: 1.4;
  text-transform: lowercase;
}

.plate figcaption b {
  font-weight: 400;
  color: color-mix(in srgb, var(--ink) 72%, transparent);
}

/* ----------------------------------------------------------------- focus */

/* focus takes its own shape: the statement runs the full width of the
   section, with the note set beside it, and the three tracks become an
   indexed ledger that the plate sits next to — not a row of cards */
.sec--focus .sec__in {
  grid-template-columns: minmax(0, 1fr) var(--plate-w);
  grid-template-areas: "head head" "body plate";
}

.sec--focus .sec__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
  align-items: end;
  column-gap: clamp(1.4rem, 4vw, 3.4rem);
  max-width: none;
}

.sec--focus .aside,
.sec--focus h2 {
  grid-column: 1;
}

.sec--focus h2 {
  max-width: 18ch;
  font-size: clamp(2rem, 4.2vw, 3.3rem);
}

.sec--focus .note {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: end;
  margin-top: 0;
  max-width: 40ch;
}

/* the plate lines up with the top of the ledger and closes the column */
.sec--focus .plate {
  align-self: start;
  width: 100%;
}

/* the ledger: one row per track, rules between them, index in the margin */
.ledger {
  grid-area: body;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.ledger li {
  position: relative;
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 0.9fr) minmax(0, 1.25fr);
  align-items: baseline;
  column-gap: clamp(1rem, 3vw, 2.4rem);
  padding: 1.05rem 0 1.15rem;
  border-bottom: 1px solid var(--line-soft);
  transition: padding-left 360ms var(--ease-join), border-color 320ms ease;
}

.ledger li::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: var(--accent-hover);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 460ms var(--ease-join);
}

.ledger li:hover {
  padding-left: 0.6rem;
  border-bottom-color: transparent;
}

.ledger li:hover::after {
  transform: scaleX(1);
}

.ledger__n {
  color: var(--ink-dim);
  font-family: var(--f-serif);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  transition: color 300ms ease;
}

.ledger__tag {
  display: block;
  margin-top: 0.25rem;
  color: var(--ink-dim);
  font-family: var(--f-mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  opacity: 0.75;
}

.ledger li:hover .ledger__n {
  color: var(--accent-hover);
}

.ledger h3 {
  margin: 0;
  font-family: var(--f-serif);
  font-size: 1.16rem;
  font-weight: 500;
  color: #eadfd0;
  transition: color 300ms ease;
}

.ledger li:hover h3 {
  color: var(--ink-bright);
}

.ledger p {
  margin: 0;
  color: var(--ink-dim);
  font-size: 0.76rem;
}

/* ------------------------------------------------------------ status band */

/* a thin band under focus: the project status stated plainly, set like a
   colophon rule — label, statement, note, one quiet link */
.band {
  position: relative;
  border-top: 1px solid var(--line-soft);
}

.band::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 1px;
  background: var(--accent-secondary);
  opacity: 0.5;
}

.band__in {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem clamp(1rem, 3vw, 2rem);
  padding-block: clamp(0.95rem, 2.2vw, 1.35rem);
}

.band__k {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  color: var(--ink-dim);
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: lowercase;
}

.band__k .cjk {
  font-size: 1.35rem;
  letter-spacing: 0;
  line-height: 0.8;
  text-transform: none;
}

.band__t {
  margin: 0;
  font-family: var(--f-serif);
  font-size: clamp(1.15rem, 2.1vw, 1.5rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: #efe4d6;
}

.band__d {
  margin: 0;
  color: var(--ink-dim);
  font-size: 0.74rem;
}

.band__a {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  margin-left: auto;
  padding-bottom: 0.15rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.76rem;
  text-decoration: none;
  transition: color 240ms ease, border-color 240ms ease;
}

.band__a:hover {
  color: var(--ink-bright);
  border-bottom-color: var(--ink);
}

.band__a span {
  transition: transform 300ms var(--ease-join);
}

.band__a:hover span {
  transform: translateX(3px);
}

/* -------------------------------------------------------------- community */

/* the moon is the only plate left, so it gets the room */
.sec--community {
  --plate-w: clamp(240px, 26vw, 330px);
}

/* community: the cards take the full-width row under the words */
.body {
  grid-area: body;
  display: flex;
  flex-direction: column;
  gap: clamp(1.2rem, 3vw, 2rem);
}

/* the character cards: thin rules between them, like print columns */
.cards {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-top: 1px solid var(--line);
}

.card {
  position: relative;
  flex: 1 1 220px;
  padding: 1.3rem 1.4rem 1.5rem 0;
  border-right: 1px solid var(--line-soft);
  transition: background-color 320ms ease;
}

.card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent-hover);
  transition: width 460ms var(--ease-join);
}

.card:hover {
  background: color-mix(in srgb, var(--ink) 4%, transparent);
}

.card:hover::before {
  width: 100%;
}

.card + .card {
  padding-left: 1.4rem;
}

.card:last-child {
  border-right: 0;
}

.card__cjk {
  display: block;
  margin-bottom: 0.9rem;
  font-size: 2.6rem;
  transition: color 320ms ease, transform 320ms var(--ease-join);
}

.card:hover .card__cjk {
  color: var(--accent-hover);
  transform: translateY(-2px);
}

.card h3 {
  margin: 0;
  font-family: var(--f-serif);
  font-size: 1.16rem;
  font-weight: 500;
  line-height: 1.2;
}

.card p {
  margin: 0.55rem 0 0;
  color: var(--ink-dim);
  font-size: 0.76rem;
}

/* -------------------------------------------------------------------- faq */

.faq__q {
  grid-area: body;
  border-top: 1px solid var(--line-soft);
}

.qa {
  border-bottom: 1px solid var(--line-soft);
  transition: background-color 300ms ease;
}

.qa:hover {
  background: color-mix(in srgb, var(--ink) 2.5%, transparent);
}

.qa[open] {
  background: color-mix(in srgb, var(--ink) 4%, transparent);
}

.qa summary {
  position: relative;
  padding: 0.95rem 2rem 0.95rem 0.8rem;
  color: var(--ink);
  font-size: 0.86rem;
  cursor: pointer;
  list-style: none;
  transition: padding-left 300ms var(--ease-join), color 300ms ease;
}

.qa summary::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.9rem;
  bottom: 0.9rem;
  width: 2px;
  background: var(--accent-hover);
  opacity: 0;
  transition: opacity 300ms ease;
}

.qa[open] summary {
  color: var(--ink-bright);
}

.qa[open] summary::before {
  opacity: 1;
}

.qa summary::-webkit-details-marker {
  display: none;
}

.qa summary::after {
  content: "+";
  position: absolute;
  right: 0.2rem;
  top: 50%;
  translate: 0 -50%;
  color: var(--ink-dim);
  font-size: 0.9rem;
  transition: rotate 300ms var(--ease-join), color 300ms ease;
}

.qa[open] summary::after {
  rotate: 45deg;
  color: var(--ink);
}

.qa summary:hover {
  padding-left: 1.1rem;
}

.qa p {
  margin: 0;
  padding: 0 2rem 1rem 0.8rem;
  max-width: 70ch;
  color: var(--ink-dim);
  font-size: 0.78rem;
}

/* ------------------------------------------------------------------- join */

/* the only light page: a sheet of paper between the dark sections */
.sec--join {
  position: relative;
  overflow: hidden;
  background: var(--paper-light);
  color: var(--ink-on-light);
  border-top-color: var(--line-light);
}

.sec--join .aside {
  color: color-mix(in srgb, var(--ink-on-light) 60%, transparent);
}

.sec--join .aside::before {
  background: var(--ink-on-light);
}

.sec--join h2 {
  color: var(--ink-on-light);
}

.sec--join .note {
  color: color-mix(in srgb, var(--ink-on-light) 68%, transparent);
}

.btn--big {
  margin-top: 1.4rem;
  padding: 0.95rem 1.4rem;
  font-size: 0.76rem;
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #14120f;
  font-weight: 600;
  letter-spacing: 0.16em;
}

.btn--big:hover {
  background: transparent;
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  transform: translateY(-3px);
}

/* on paper the button flips: dark ink on cream */
.sec--join .btn--big {
  background: var(--ink-on-light);
  border-color: var(--ink-on-light);
  color: var(--paper-light);
}

.sec--join .btn--big:hover {
  background: transparent;
  color: var(--ink-on-light);
  border-color: var(--ink-on-light);
}

/* the seal: the one red mark on the page */
.seal {
  display: inline-grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  margin-top: 1.6rem;
  background: var(--seal);
  color: #f6efe2;
  font-family: var(--f-cjk);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
}

/* ----------------------------------------------------------------- footer */

.ftr {
  border-top: 1px solid var(--line);
  background-color: #100f0c;
  background-image: var(--grain);
  background-size: 200px 200px;
  background-position: center;
}

.ftr__in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1.4rem;
  padding-block: 1.1rem;
  color: var(--ink-dim);
  font-size: 0.68rem;
}

.ftr__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.ftr .logo__cjk {
  width: 1.4rem;
  height: 1.4rem;
  font-size: 0.78rem;
}

.ftr__c {
  color: var(--ink-dim);
}

.ftr__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
}

.ftr__nav a {
  color: var(--ink-dim);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 240ms ease, border-color 240ms ease;
}

.ftr__nav a:hover {
  color: var(--ink-bright);
  border-bottom-color: var(--seal);
}

/* ---------------------------------------------------------------- motion */

/* the small light that runs down the scroll cue */
@keyframes cue {
  0%   { transform: translateY(-100%); opacity: 0; }
  25%  { opacity: 1; }
  70%, 100% { transform: translateY(100%); opacity: 0; }
}

/* the fade: app.js reveals each block once, the first time it enters view.
   Without js-fade (no JS, or reduced motion) everything stays visible. */
.js-fade .hero__in,
.js-fade .sec__in,
.js-fade .band__in,
.js-fade .ftr__in {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity var(--fade) cubic-bezier(0.4, 0, 0.2, 1),
    transform var(--fade) cubic-bezier(0.4, 0, 0.2, 1);
}

.js-fade .hero__in.is-in,
.js-fade .sec__in.is-in,
.js-fade .band__in.is-in,
.js-fade .ftr__in.is-in {
  opacity: 1;
  transform: none;
}

/* ------------------------------------------------------------------ layouts */

/* the bar drops its links into the menu as soon as they no longer fit:
   the French labels are a little longer, so this happens before 960px */
@media (max-width: 1040px) {
  .hdr__in {
    gap: 0.6rem;
  }

  .menu-btn {
    display: inline-flex;
    margin-left: auto;
  }

  /* the links drop below the bar as one panel, opened by the menu button */
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 0.3rem var(--gutter) 0.6rem;
    background-color: #100f0c;
    background-image: var(--grain);
    background-size: 200px 200px;
    background-position: center;
    border-bottom: 1px solid var(--line);
  }

  .nav.is-open {
    display: flex;
  }

  .nav a {
    padding-block: 0.8rem;
    border-bottom: 1px solid var(--line-soft);
    font-size: 0.8rem;
  }

  .nav a:last-child {
    border-bottom: 0;
  }

  .nav a::after {
    display: none;
  }

  .nav a:hover,
  .nav a[aria-current="true"],
  .nav a[aria-current="page"] {
    padding-left: 0.4rem;
  }
}

@media (max-width: 860px) {
  :root {
    --plate-w: 100%;
  }

  .sec--community {
    --plate-w: 100%;
  }

  .sec__in,
  .sec__in--flip {
    grid-template-columns: 1fr;
    grid-template-areas: "head" "plate" "body";
  }

  /* focus stacks too, but keeps its note under the statement */
  .sec--focus .sec__in {
    grid-template-columns: 1fr;
    grid-template-areas: "head" "plate" "body";
  }

  .sec--focus .sec__head {
    display: block;
  }

  .sec--focus .note {
    margin-top: 0.9rem;
    max-width: 42ch;
  }

  /* the band stacks its line: the link drops under the note, left-aligned */
  .band__a {
    margin-left: 0;
  }

  .ledger li {
    grid-template-columns: 2rem minmax(0, 1fr);
    row-gap: 0.35rem;
  }

  .ledger p {
    grid-column: 2;
  }

  /* the plate keeps the same mobile cap as every other section */
  .sec--focus .plate {
    width: min(100%, 240px);
  }

  .plate--right,
  .plate--left {
    justify-self: start;
    width: min(100%, 240px);
  }

  .card {
    flex-basis: 100%;
    padding-right: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .card + .card {
    padding-left: 0;
  }

  .hero {
    min-height: auto;
    padding-block: clamp(2.5rem, 7vh, 4rem);
  }

  .hero__cjk {
    font-size: clamp(5rem, 24vw, 9rem);
    opacity: 0.08;
  }
}

@media (max-width: 520px) {
  /* the hero keeps its own join call, so the bar stays calm on small phones */
  .hdr .btn {
    display: none;
  }

  .hdr__in {
    gap: 0.5rem;
  }

  .lang__btn {
    padding-inline: 0.22rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__cue-line::after {
    animation: none;
    transform: none;
    opacity: 0.7;
  }

  .title__w {
    animation: none;
  }

  .hero__in,
  .sec__in,
  .band__in,
  .ftr__in {
    opacity: 1 !important;
    transform: none !important;
    transition: none;
  }

  .nav a::after,
  .btn,
  .btn span,
  .links a,
  .links a span,
  .band__a,
  .band__a span,
  .plate,
  .plate img,
  .card,
  .card::before,
  .card__cjk,
  .ledger li,
  .ledger li::after,
  .ledger__n,
  .ledger h3,
  .qa,
  .qa summary,
  .qa summary::before,
  .qa summary::after {
    transition: none;
  }
}

/* sections whose plate was removed: the words take the whole width, with no
   empty plate track left behind */
.sec__in--no-plate,
.sec--focus .sec__in--no-plate {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "head" "body";
}
