/* S Cult — the site is one concrete building.
   Three materials: CAST (words pressed into the wall), CUT (photographs as openings in the wall),
   PAINT (the pale-blue mark, the only colour the site owns, never used for text or controls).
   Palette: beton (wall), joint (formwork lines), ink (everything that must be read), paint (the mark). */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("/fonts/archivo-latin-wdth-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("/fonts/archivo-vietnamese-wdth-normal.woff2") format("woff2-variations");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

:root {
  --beton: #8f908a;
  --joint-dark: rgba(0, 0, 0, .3);
  --joint-light: rgba(255, 255, 255, .16);
  --ink: #000;
  --paint: #cfe0ff;
  --pad: clamp(20px, 5.2vw, 64px);
  --bar: 52px;
  --face: "Archivo", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", "Noto Sans CJK JP", system-ui, sans-serif;
  /* four sizes, no more: cast words (set per word), statement, text, small */
  --say: clamp(1.25rem, 4.9vw, 1.625rem);
  --text: 1.0625rem;
  --small: .8125rem;
  --wall: url("/img/grain.svg"), url("/img/mottle.svg");
  --ease: cubic-bezier(.2, .7, .2, 1);
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: var(--bar); }
html.is-menu { overflow: hidden; }

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--beton);
  background-image: var(--wall);
  background-size: 240px 240px, 900px 900px;
  background-blend-mode: soft-light, soft-light;
  font-family: var(--face);
  font-size: var(--text);
  line-height: 1.5;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: clip;
}

/* Japanese sets a little smaller and looser than Latin; Vietnamese needs room for stacked accents. */
:lang(ja) { --text: .9688rem; --say: clamp(1.125rem, 4.5vw, 1.5rem); line-break: strict; word-break: auto-phrase; }
html:lang(ja) body { line-height: 1.75; }
html:lang(vi) body { line-height: 1.6; }

h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
h2, .lede { text-wrap: balance; }
p { text-wrap: pretty; }
img, svg { display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }

h2 { font-size: var(--text); font-weight: 800; font-stretch: 112%; line-height: 1.3; }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
::selection { background: var(--paint); color: var(--ink); }

.skip { position: absolute; left: -200vw; top: 0; z-index: 50; padding: 12px 16px; background: var(--ink); color: #fff; }
.skip:focus { left: 0; }
.say { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.lede { font-size: var(--say); line-height: 1.25; font-weight: 650; max-width: 22em; }
html:lang(ja) .lede { line-height: 1.5; }
html:lang(vi) .lede { line-height: 1.35; }
.note { max-width: 32em; }
.kicker { font-size: var(--small); font-weight: 650; line-height: 1.4; }

.link { font-weight: 650; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .22em; }
.link:active { text-underline-offset: .12em; }

/* a plain button, cut square. Pressed, it sinks one pixel. */
.tool {
  appearance: none;
  min-height: 44px;
  padding: 9px 16px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: none;
  font-size: var(--small);
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}
.tool:active { background: rgba(0, 0, 0, .08); }
.tool--quiet { border-color: transparent; text-decoration: underline; text-underline-offset: .22em; padding-inline: 0; font-weight: 600; justify-self: start; }
.tool[hidden] { display: none; }

/* ---------- CAST: words pressed into the wall. An image, not text to read: each has an ink twin nearby. ---------- */

.cast {
  display: block;
  font-family: "Archivo", sans-serif;
  font-weight: 900;
  font-stretch: 125%;
  text-transform: uppercase;
  letter-spacing: -.015em;
  line-height: .84;
  color: rgba(0, 0, 0, .2);
  text-shadow: 0 -1px 0 rgba(0, 0, 0, .34), 0 2px 0 rgba(255, 255, 255, .2);
  white-space: nowrap;
  margin-left: -.035em;
}
.cast--name { font-size: clamp(3.6rem, 19.4vw, 21rem); }

/* The four chapter words share one size and one measure: each fills the width of its slab exactly.
   The width of the letters absorbs the difference (MIND is the narrowest word, so it gets the widest letters).
   .289 = 1 / 3.453, the width of MIND in ems at full width; the other three numbers were measured the same way. */
.cast--chapter, .cast--door { font-size: 24vw; }
.cast--mind { font-stretch: 125%; }
.cast--soul { font-stretch: 118.8%; }
.cast--mask { font-stretch: 107.4%; }
.cast--flesh { font-stretch: 97.6%; }
.chapter, .door, .next, .hero { container-type: inline-size; }
@supports (font-size: 1cqi) {
  /* 100cqi is the width inside the slab's padding */
  .cast--chapter, .cast--door { font-size: calc(100cqi * .2885); }
  .cast--name { font-size: calc(100cqi * .2205); }
}

/* ---------- CUT: a photograph is an opening in the wall ---------- */

.cut {
  position: relative;
  overflow: hidden;
  background: var(--tone, #5d6068) var(--ph, none) center / cover no-repeat;
  isolation: isolate;
}
.cut picture, .cut img { display: block; width: 100%; height: 100%; }
.cut img { object-fit: cover; object-position: var(--pos, 50% 50%); }
/* the depth of the opening: dark where the wall overhangs, a thin light edge where it catches the sky */
.cut::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 9px 16px -6px rgba(0, 0, 0, .6), inset 7px 0 12px -8px rgba(0, 0, 0, .4), inset 0 -2px 0 rgba(255, 255, 255, .2);
}

/* ---------- PAINT: the mark ---------- */

.mark {
  appearance: none;
  position: absolute;
  width: var(--size, 68px);
  height: var(--size, 68px);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--paint);
  cursor: pointer;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .3));
  touch-action: manipulation;
}
.mark[hidden] { display: none; }
.mark svg, .stamp svg, .face__under svg, .one__slot svg, .place__mark svg, .own__mark svg { width: 100%; height: 100%; overflow: visible; }
.mark:focus-visible { outline-offset: 8px; }
/* a mark painted onto a photograph */
.mark--on { left: var(--mx, 62%); top: var(--my, 58%); z-index: 2; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .45)); }

/* ---------- top bar ---------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  height: var(--bar);
  padding: 0 var(--pad);
  background-color: var(--beton);
  background-image: var(--wall);
  background-size: 240px 240px, 900px 900px;
  background-blend-mode: soft-light, soft-light;
  border-bottom: 2px solid var(--joint-dark);
  box-shadow: 0 2px 0 var(--joint-light);
  transition: transform .32s var(--ease);
}
.bar.is-away { transform: translateY(calc(-100% - 4px)); }

.bar__name { font-weight: 800; font-stretch: 125%; letter-spacing: -.01em; text-decoration: none; white-space: nowrap; padding: 12px 0; }
.bar__links, .bar__langs { display: none; }
.bar__side { display: flex; align-items: center; gap: 6px; }

.bar__menu {
  appearance: none;
  min-width: 44px;
  min-height: 44px;
  padding: 0 0 0 10px;
  border: 0;
  background: none;
  font-size: .9375rem;
  font-weight: 650;
  cursor: pointer;
}

/* the row of holes: one fills with paint for every mark found. Found ones also get an ink ring, so colour is never the only sign. */
.holes { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 8px; text-decoration: none; }
.holes i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .44);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .22), inset 0 1px 1px rgba(0, 0, 0, .5);
}
.holes i.is-found { background: var(--paint); box-shadow: 0 0 0 1.5px var(--ink); }
.holes i.is-fresh { animation: fill .7s var(--ease) both; }
@keyframes fill { from { transform: scale(2.4); opacity: 0; } }

/* ---------- menu: a full wall of doors ---------- */

.menu {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--ink);
  background-color: var(--beton);
  background-image: var(--wall);
  background-size: 240px 240px, 900px 900px;
  background-blend-mode: soft-light, soft-light;
  opacity: 0;
  translate: 0 -12px;
  transition: opacity .22s ease-out, translate .3s var(--ease), overlay .3s allow-discrete, display .3s allow-discrete;
}
.menu[open] { display: grid; grid-template-rows: auto 1fr auto; opacity: 1; translate: 0 0; }
@starting-style { .menu[open] { opacity: 0; translate: 0 -12px; } }
.menu::backdrop { background: none; }

.menu__top { display: flex; align-items: center; justify-content: space-between; height: var(--bar); padding: 0 var(--pad); border-bottom: 2px solid var(--joint-dark); box-shadow: 0 2px 0 var(--joint-light); }
.menu__list { display: grid; align-content: center; gap: 2px; padding: 12px var(--pad); overflow: auto; }
.menu__chapter {
  font-family: "Archivo", sans-serif;
  font-weight: 900;
  font-stretch: 125%;
  font-size: clamp(3rem, 17.5vw, 7.5rem);
  line-height: .95;
  letter-spacing: -.02em;
  text-transform: uppercase;
  text-decoration: none;
  margin-left: -.03em;
}
.menu__chapter[aria-current="page"] { color: rgba(0, 0, 0, .2); text-shadow: 0 -1px 0 rgba(0, 0, 0, .34), 0 2px 0 rgba(255, 255, 255, .2); }
.menu__chapter:active { translate: 0 1px; }
.menu__foot { display: grid; gap: 14px; padding: 18px var(--pad) calc(22px + env(safe-area-inset-bottom)); border-top: 2px solid var(--joint-dark); box-shadow: inset 0 2px 0 var(--joint-light); }
.menu__more, .menu__langs { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.menu__more a { font-weight: 750; font-stretch: 112%; text-decoration: none; padding: 8px 0; }
.menu__more a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .25em; }
.menu__lang, .foot__lang, .bar__lang { font-size: .9375rem; text-decoration: none; padding: 8px 0; border-bottom: 2px solid transparent; font-family: system-ui, "Hiragino Sans", "Noto Sans JP", sans-serif; }
.menu__lang[aria-current], .foot__lang[aria-current], .bar__lang[aria-current] { border-bottom-color: var(--ink); font-weight: 650; }

/* ---------- slabs: a formwork joint along the top edge, tie holes in the corners ---------- */

.slab {
  position: relative;
  padding: calc(var(--pad) + 30px) var(--pad) calc(var(--pad) + 26px);
  border-top: 2px solid var(--joint-dark);
  box-shadow: inset 0 2px 0 var(--joint-light);
  background-image:
    radial-gradient(circle at 26px 26px, rgba(0, 0, 0, .46) 0 5px, rgba(255, 255, 255, .2) 5.6px 6.8px, transparent 7.4px),
    radial-gradient(circle at calc(100% - 26px) 26px, rgba(0, 0, 0, .46) 0 5px, rgba(255, 255, 255, .2) 5.6px 6.8px, transparent 7.4px);
}
.slab > h2 + p, .story__text h2 + p, .lead h2 + p, .one__text h2 + p { margin-top: 10px; }

.lead { padding: clamp(56px, 14vw, 128px) var(--pad) clamp(22px, 5vw, 40px); max-width: 44rem; }

/* ---------- front wall ---------- */

.hero {
  display: grid;
  grid-template-rows: 1fr auto auto;
  min-height: calc(84svh - var(--bar));
  padding: 0 var(--pad) clamp(18px, 4vw, 36px);
}
.hero__wall { position: relative; min-height: 30svh; }
.hero__text { display: grid; gap: 12px; margin-top: clamp(18px, 4vw, 36px); }
.hero__tease {
  position: absolute;
  left: 0;
  bottom: 10px;
  font-size: var(--small);
  font-weight: 650;
  opacity: 0;
}
.hero__tease.is-on { animation: tease 2.6s ease-out both; }
@keyframes tease { 0% { opacity: 0; translate: 0 6px; } 12%, 70% { opacity: 1; translate: 0 0; } 100% { opacity: 0; } }

.hero--lost { min-height: calc(100svh - var(--bar)); }
.hero__text--lost { gap: 6px; }
.hero__text--lost .lede { margin-top: 14px; }
.lost__lang { font-size: var(--small); opacity: .7; margin-left: 8px; }

/* ---------- the scroll story: an opening that starts as a slit and widens as the page moves ----------
   What is written here is the END of the story. The @keyframes below are driven by the scroll position
   (css/motion.css: .m-scrub is the tall track, .m-pin stays on screen, .m-key follows the track), so they run
   off the main thread where the browser can do that, and through js/motion/scroll.js where it cannot. */

.scrub { --m-len: 270svh; }
.scrub--long { --m-len: 400svh; }
.scrub__pin { display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.scrub__frame { position: relative; min-height: 0; }
.scrub__cut { position: absolute; inset: 0; }
.scrub__cut::after { display: none; }
.scrub__cut img { transform-origin: var(--origin, 50% 20%); will-change: transform; }
.scrub__rim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  box-shadow: inset 0 9px 16px -6px rgba(0, 0, 0, .6), inset 7px 0 12px -8px rgba(0, 0, 0, .4), inset 0 -2px 0 rgba(255, 255, 255, .2);
}
.scrub__lines {
  position: relative;
  display: grid;
  align-items: start;
  min-height: 8.6rem;
  padding: 18px var(--pad) calc(20px + env(safe-area-inset-bottom));
  border-top: 2px solid var(--joint-dark);
}
.scrub__line { grid-area: 1 / 1; font-size: var(--say); font-weight: 650; line-height: 1.25; max-width: 21em; }
.scrub__line .link { display: inline-block; margin-top: 10px; font-size: var(--text); }
html:lang(ja) .scrub__line { line-height: 1.5; }

/* the slit: its height, how far the picture is pushed up behind it and how much it is enlarged (set per photograph) */
@keyframes scrub-open {
  0% { clip-path: inset(0 var(--pad) var(--slit, 76%) var(--pad)); }
  42%, 100% { clip-path: inset(0 0 0 0); }
}
@keyframes scrub-rim {
  0% { inset: 0 var(--pad) var(--slit, 76%) var(--pad); }
  42%, 100% { inset: 0; }
}
@keyframes scrub-zoom {
  0% { transform: translateY(var(--lift, -22%)) scale(var(--zoom, 1.3)); }
  42%, 100% { transform: none; }
}
/* the sentences take turns: three of them on the front wall, four on the jacket's page */
@keyframes line-1of3 {
  0%, 3% { opacity: 0; transform: translateY(12px); visibility: hidden; }
  9%, 30% { opacity: 1; transform: none; visibility: visible; }
  36%, 100% { opacity: 0; transform: none; visibility: hidden; }
}
@keyframes line-2of3 {
  0%, 34% { opacity: 0; transform: translateY(12px); visibility: hidden; }
  40%, 62% { opacity: 1; transform: none; visibility: visible; }
  68%, 100% { opacity: 0; transform: none; visibility: hidden; }
}
@keyframes line-3of3 {
  0%, 66% { opacity: 0; transform: translateY(12px); visibility: hidden; }
  72%, 100% { opacity: 1; transform: none; visibility: visible; }
}
@keyframes line-1of4 {
  0%, 2% { opacity: 0; transform: translateY(12px); visibility: hidden; }
  7%, 22% { opacity: 1; transform: none; visibility: visible; }
  27%, 100% { opacity: 0; transform: none; visibility: hidden; }
}
@keyframes line-2of4 {
  0%, 25% { opacity: 0; transform: translateY(12px); visibility: hidden; }
  30%, 47% { opacity: 1; transform: none; visibility: visible; }
  52%, 100% { opacity: 0; transform: none; visibility: hidden; }
}
@keyframes line-3of4 {
  0%, 50% { opacity: 0; transform: translateY(12px); visibility: hidden; }
  55%, 72% { opacity: 1; transform: none; visibility: visible; }
  77%, 100% { opacity: 0; transform: none; visibility: hidden; }
}
@keyframes line-4of4 {
  0%, 75% { opacity: 0; transform: translateY(12px); visibility: hidden; }
  80%, 100% { opacity: 1; transform: none; visibility: visible; }
}
/* the mark painted on the jacket at the end of its story */
.mark--take { --size: clamp(44px, 13vw, 76px); }
@keyframes mark-on {
  0%, 77% { opacity: 0; visibility: hidden; }
  82%, 100% { opacity: 1; visibility: visible; }
}

/* a cast word sets as it comes onto the screen; a photograph drifts a little inside its opening */
@keyframes cast-set {
  0% { opacity: 0; transform: translateY(.09em) scale(.985); }
  14%, 100% { opacity: 1; transform: none; }
}
@keyframes cut-drift {
  from { transform: translateY(-3.5%) scale(1.08); }
  to { transform: translateY(3.5%) scale(1.08); }
}

/* ---------- four doors ---------- */

.slabs { display: grid; grid-template-columns: 1fr; }

.door {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 24px;
  min-height: 70svh;
  text-decoration: none;
  background-color: var(--beton);
  background-image:
    radial-gradient(circle at 26px 26px, rgba(0, 0, 0, .46) 0 5px, rgba(255, 255, 255, .2) 5.6px 6.8px, transparent 7.4px),
    radial-gradient(circle at calc(100% - 26px) 26px, rgba(0, 0, 0, .46) 0 5px, rgba(255, 255, 255, .2) 5.6px 6.8px, transparent 7.4px),
    var(--wall);
  background-size: auto, auto, 240px 240px, 900px 900px;
  background-blend-mode: normal, normal, soft-light, soft-light;
  box-shadow: inset 0 2px 0 var(--joint-light), 0 -16px 28px -18px rgba(0, 0, 0, .5);
}
.door .cast { align-self: start; }
.door__text { align-self: end; max-width: 26em; }
.door__text b { display: block; font-size: var(--small); font-weight: 650; margin-bottom: 2px; }
.door:active .cast { translate: 0 1px; }

/* ---------- a closing line ---------- */

.closing { display: grid; gap: 10px; padding-top: clamp(64px, 16vw, 140px); padding-bottom: clamp(64px, 16vw, 140px); }
.closing h2 { font-size: var(--say); font-weight: 650; font-stretch: 100%; line-height: 1.25; max-width: 20em; }
html:lang(ja) .closing h2 { line-height: 1.5; }
.closing p { max-width: 30em; }

/* ---------- the door at the end of a page ---------- */

.next {
  position: relative;
  display: grid;
  gap: 14px;
  padding: clamp(40px, 10vw, 96px) var(--pad) clamp(36px, 9vw, 80px);
  border-top: 2px solid var(--joint-dark);
  box-shadow: inset 0 2px 0 var(--joint-light);
  text-decoration: none;
  overflow: clip;
}
.next__label { font-size: var(--small); font-weight: 650; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .25em; justify-self: start; }
.next__name { font-weight: 900; font-stretch: 125%; font-size: clamp(2rem, 10.5vw, 4.5rem); line-height: 1.02; letter-spacing: -.02em; justify-self: start; }
.next--plain .next__label { text-decoration: none; }
.next--plain .next__name { text-decoration: underline; text-decoration-thickness: .06em; text-underline-offset: .12em; }
html:lang(vi) .next__name { line-height: 1.2; }
.next:active .cast, .next:active .next__name { translate: 0 1px; }

/* ---------- top of a chapter ---------- */

.chapter {
  display: grid;
  align-content: end;
  gap: 14px;
  min-height: calc(70svh - var(--bar));
  padding: clamp(28px, 8vw, 72px) var(--pad) clamp(30px, 8vw, 64px);
}
.chapter .lede { margin-top: 8px; }

/* top of the other pages: an ink title */
.top { display: grid; gap: 12px; padding: clamp(56px, 15vw, 132px) var(--pad) clamp(30px, 8vw, 64px); }
.title { font-weight: 900; font-stretch: 125%; font-size: clamp(2.25rem, 11.5vw, 5rem); line-height: 1; letter-spacing: -.02em; margin-left: -.03em; justify-self: start; }
html:lang(vi) .title { line-height: 1.18; }
html:lang(ja) .title { line-height: 1.2; letter-spacing: 0; }
.count { font-size: var(--small); font-weight: 650; }
.count b { font-size: var(--say); font-weight: 900; font-stretch: 125%; margin-right: 4px; }

/* ---------- the gesture of each chapter ---------- */

.play { display: grid; gap: 22px; }
.play__line { font-size: var(--say); font-weight: 650; line-height: 1.25; max-width: 20em; }
html:lang(ja) .play__line { line-height: 1.5; }

/* MIND: tap the wall */
.play--stamp { min-height: 86svh; align-content: space-between; cursor: crosshair; overflow: hidden; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.play__ask h2 { font-size: var(--say); font-weight: 650; font-stretch: 100%; line-height: 1.25; }
.play__ask p { margin-top: 8px; max-width: 24em; }
.play__tools { display: flex; flex-wrap: wrap; gap: 10px; position: relative; z-index: 3; }
.tool--after { visibility: hidden; }
.is-used .tool--after { visibility: visible; }
.stamp { position: absolute; z-index: 1; color: var(--paint); pointer-events: none; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .3)); }
.stamp.is-kept { z-index: 2; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .3)) drop-shadow(0 0 0 #000); outline: 2px solid var(--ink); outline-offset: 6px; }

/* SOUL: do nothing */
.wait { position: relative; width: min(100%, 34rem); }
.wait__veil {
  position: absolute;
  inset: -1px;
  z-index: 3;
  background-color: var(--beton);
  background-image: var(--wall);
  background-size: 240px 240px, 900px 900px;
  background-blend-mode: soft-light, soft-light;
  will-change: opacity;
}
.wait.is-open .wait__veil { opacity: 0; transition: opacity .8s ease-out; pointer-events: none; }
.wait .mark--on { --mx: 68%; --my: 70%; }

/* MASK: the straight face */
.face {
  appearance: none;
  position: relative;
  display: block;
  width: min(76vw, 26rem);
  aspect-ratio: 1;
  margin: clamp(8px, 4vw, 40px) auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  cursor: pointer;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.face__mask {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: rgba(0, 0, 0, .24);
  stroke-width: 5.5;
  stroke-linecap: round;
  filter: drop-shadow(0 -1px 0 rgba(0, 0, 0, .34)) drop-shadow(0 2px 0 rgba(255, 255, 255, .22));
  transition: opacity .3s ease-out, transform .5s var(--ease);
}
.face__mask path:first-of-type { stroke-width: 9; }
.face.is-lifted .face__mask { opacity: .1; transform: translateY(-9%) scale(1.04); }
.face__under { position: absolute; inset: 9%; color: var(--paint); filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .3)); opacity: 0; transition: opacity .25s; }
.face.is-lifted .face__under { opacity: 1; transition-duration: 0s; }

/* FLESH: a shutter over a photograph. --shown runs 0 to 1. */
.slide { position: relative; width: min(100%, 34rem); touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: ew-resize; }
.slide__cover {
  position: absolute;
  inset: -1px;
  z-index: 3;
  display: grid;
  place-items: center end;
  padding-right: 7%;
  clip-path: inset(0 0 0 calc(var(--shown) * 100%));
  background-color: var(--beton);
  background-image: var(--wall);
  background-size: 240px 240px, 900px 900px;
  background-blend-mode: soft-light, soft-light;
}
.slide__word { font-weight: 900; font-stretch: 125%; font-size: clamp(1.125rem, 5.2vw, 2.25rem); color: rgba(0, 0, 0, .2); text-shadow: 0 -1px 0 rgba(0, 0, 0, .34), 0 2px 0 rgba(255, 255, 255, .2); white-space: nowrap; }
.slide__edge {
  position: absolute;
  top: -8px;
  bottom: -8px;
  left: calc(var(--shown) * 100%);
  z-index: 4;
  width: 4px;
  margin-left: -2px;
  background: var(--ink);
}
.slide__edge::after { content: ""; position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; margin: -22px; border: 2px solid var(--ink); border-radius: 50%; background: var(--beton); }
.slide__range { position: absolute; left: 0; right: 0; bottom: -34px; width: 100%; height: 24px; margin: 0; opacity: 0; }
.slide__range:focus-visible { opacity: 1; }
.slide .mark--on { --mx: 72%; --my: 14%; z-index: 2; }
.play--slide { padding-bottom: calc(var(--pad) + 56px); }

/* ---------- words beside a photograph ---------- */

.story { display: grid; gap: 28px; }
.story__text { max-width: 30em; }
.story__cut { width: min(100%, 30rem); }
.story--flip .story__cut { justify-self: end; }

.alone { display: grid; gap: 26px; }
.alone__cut { width: min(86%, 26rem); justify-self: end; }
.alone__line { font-size: var(--say); font-weight: 650; line-height: 1.25; max-width: 18em; }
html:lang(ja) .alone__line { line-height: 1.5; }

.lives__link { display: grid; gap: 18px; text-decoration: none; }
.lives__link .cut { width: min(100%, 26rem); }
.lives__text { display: grid; gap: 6px; justify-items: start; }
.lives__text b { font-weight: 800; font-stretch: 112%; }

/* ---------- clothes ---------- */

.piece { display: grid; gap: 22px; scroll-margin-top: var(--bar); }
.piece__photo { display: block; width: min(100%, 30rem); }
.piece__text { display: grid; gap: 6px; justify-items: start; }
.piece__text h2 { font-size: var(--say); font-weight: 900; font-stretch: 125%; line-height: 1.1; letter-spacing: -.01em; }
html:lang(ja) .piece__text h2, html:lang(vi) .piece__text h2 { line-height: 1.3; }

/* ---------- denim jacket ---------- */

.plate dl { display: grid; max-width: 34rem; border-bottom: 2px solid var(--joint-dark); }
.plate dl > div { display: grid; grid-template-columns: 6.5em 1fr; gap: 14px; padding: 12px 0; border-top: 2px solid var(--joint-dark); }
.plate dt { font-size: var(--small); font-weight: 650; padding-top: .2em; }
.plate dd { font-weight: 750; font-stretch: 112%; }

.closer { display: grid; gap: 22px; }
.closer__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.one { display: grid; gap: 26px; min-height: 80svh; align-content: space-between; cursor: pointer; }
.one__text { display: grid; gap: 0; justify-items: start; max-width: 30em; }
.one__text .tool { margin-top: 18px; }
.one__slot { display: block; width: min(56vw, 17rem); aspect-ratio: 1; justify-self: center; color: var(--paint); filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .3)); }

.with { display: grid; gap: 12px; }
.with ul { display: grid; gap: 8px; justify-items: start; }

/* ---------- about ---------- */

.rules { display: grid; gap: 10px; }
.rules__how { font-size: var(--small); font-weight: 650; }
.rules__list { display: grid; gap: clamp(30px, 8vw, 56px); margin-top: 22px; counter-reset: rule; }
.rule { display: grid; gap: 10px; max-width: 32em; counter-increment: rule; }
.rule::before { content: counter(rule); font-size: var(--small); font-weight: 650; }
.refuse {
  appearance: none;
  justify-self: start;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  font-size: var(--say);
  font-weight: 650;
  line-height: 1.3;
  cursor: pointer;
}
/* the refusal is struck with paint, line by line, when tapped */
.refuse span {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 10' preserveAspectRatio='none'%3E%3Cpath d='M0 6 C12 3 22 8 36 5 S62 3 78 6 92 4 100 5' fill='none' stroke='%23cfe0ff' stroke-width='4.2' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0 58%;
  background-size: 0% .5em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  transition: background-size .5s var(--ease);
}
.refuse[aria-pressed="true"] span { background-size: 100% .5em; }

.egg {
  appearance: none;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 44px;
  margin: -12px -8px -12px -12px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 800;
  vertical-align: middle;
  cursor: pointer;
  position: static;
  color: inherit;
  filter: none;
}
.egg.is-found { color: var(--paint); filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .3)); animation: upright .6s var(--ease) both; }
.egg svg { width: 34px; height: 34px; overflow: visible; }
@keyframes upright { from { rotate: 90deg; } }

/* ---------- marks ---------- */

.places__list { display: grid; max-width: 34rem; border-bottom: 2px solid var(--joint-dark); }
.place a { display: grid; grid-template-columns: 48px 1fr; grid-template-rows: auto auto; column-gap: 16px; align-items: center; padding: 12px 0; border-top: 2px solid var(--joint-dark); text-decoration: none; }
.place__mark {
  grid-row: 1 / 3;
  width: 48px;
  height: 48px;
  color: var(--paint);
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .3));
  background: radial-gradient(circle, rgba(0, 0, 0, .44) 0 5px, rgba(255, 255, 255, .2) 5.6px 6.8px, transparent 7.4px);
}
.place.is-found .place__mark { background: none; }
.place__name { font-weight: 800; font-stretch: 112%; align-self: end; }
.place__hint { font-size: var(--small); font-weight: 600; align-self: start; }
.place.is-found .place__hint { text-decoration: line-through; text-decoration-thickness: 1.5px; opacity: .6; }

.own { display: grid; gap: 26px; justify-items: start; }
.own[hidden], .locked[hidden] { display: none; }
.own__mark { display: block; width: min(64vw, 20rem); aspect-ratio: 1; color: var(--paint); filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .3)); }
.own__text { display: grid; justify-items: start; }
.own__text .tool { margin-top: 18px; }
.locked p { font-size: var(--say); font-weight: 650; }
.small { display: grid; gap: 6px; justify-items: start; font-size: var(--small); }

/* a line that slides up once every mark is found */
.toast {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 30rem;
  padding: 14px 16px;
  background: var(--ink);
  color: #fff;
  font-size: .9375rem;
  text-decoration: none;
  animation: rise .5s var(--ease) both;
}
.toast b { text-decoration: underline; text-underline-offset: .2em; white-space: nowrap; }
@keyframes rise { from { transform: translateY(140%); } }

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

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 20px;
  border-top: 2px solid var(--joint-dark);
  box-shadow: inset 0 2px 0 var(--joint-light);
  padding: 18px var(--pad) calc(18px + env(safe-area-inset-bottom));
  font-size: .9375rem;
}
.foot__langs { display: flex; gap: 6px 18px; flex-wrap: wrap; }

/* ---------- wider screens ---------- */

@media (min-width: 860px) {
  :root { --bar: 56px; }
  .bar__links { display: flex; gap: 22px; margin-right: auto; margin-left: 30px; }
  .bar__links a { font-size: .9375rem; font-weight: 600; text-decoration: none; padding: 8px 0; border-bottom: 2px solid transparent; }
  .bar__links a[aria-current="page"] { border-bottom-color: var(--ink); }
  .bar__langs { display: flex; gap: 16px; margin-left: 10px; }
  .bar__menu { display: none; }

  .hero__text { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 48px; align-items: start; }

  .scrub__pin { grid-template-rows: none; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .scrub__lines { border-top: 0; border-left: 2px solid var(--joint-dark); align-items: center; padding: var(--pad); }

  .slabs { grid-template-columns: 1fr 1fr; }
  .door { position: relative; min-height: 34rem; box-shadow: inset 0 2px 0 var(--joint-light); }
  .door:nth-child(even) { border-left: 2px solid var(--joint-dark); }

  .story, .alone, .piece, .lives__link, .one { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: center; }
  .story--flip .story__text { order: 2; }
  .story--flip .story__cut { justify-self: start; }
  .alone__cut { justify-self: start; width: min(100%, 30rem); }
  .play--wait, .play--slide { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 56px; align-items: center; }
  .play--wait .tool, .play--slide .slide { grid-column: 2; }
  .closer__grid { grid-template-columns: repeat(4, 1fr); }
  .rules__list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
}

/* ---------- page change: the wall stays, the old words sink into it, the new ones press out ----------
   (cross-document view transition, switched on in css/motion.css; the tapped door's word travels to become the title) */

@keyframes sink { to { opacity: 0; transform: translateY(10px); } }
@keyframes press { from { opacity: 0; transform: translateY(-10px); } }
::view-transition-old(root) { animation: sink .2s ease-in both; }
::view-transition-new(root) { animation: press .34s .08s var(--motion-ease, ease-out) both; }

/* ---------- less motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .scrub__frame { aspect-ratio: 4 / 5; }
  .scrub__lines { display: block; }
  .scrub__line { margin-bottom: 12px; }
  .door { position: relative; }
  .hero__tease.is-on { animation: none; opacity: 1; }
}
