@import url("brand/tokens.css");
@import url("display-room.css");

:root {
  --ground: var(--ground-intro);
  --stage-size: min(57vw, 82svh, 950px);
  font-family: var(--body);
  color: var(--ink);
  background: var(--ground);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

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

button {
  font: inherit;
  color: inherit;
}

::selection {
  background: var(--ink);
  color: var(--paper);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 5px;
}

.skip {
  position: fixed;
  z-index: 20;
  left: 14px;
  top: -100px;
  background: var(--paper);
  padding: 14px;
}

.skip:focus {
  top: 14px;
}

.topbar, .chapter-nav {
  position: fixed;
  z-index: 6;
  left: var(--edge);
  right: var(--edge);
  display: flex;
  align-items: center;
}

.topbar {
  top: 0;
  justify-content: space-between;
  height: 88px;
  border-bottom: 1px solid var(--rule);
}

.lockup {
  display: inline-flex;
  align-items: center;
  gap: .45em;
  text-decoration: none;
  font: 650 clamp(22px, 2.1vw, 38px)/1 var(--display);
  letter-spacing: -.035em;
}

.lockup img {
  width: 1.3em;
  height: 1.3em;
  object-fit: contain;
}

.topbar nav {
  display: flex;
  gap: 2.2rem;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
}

.topbar nav a {
  text-decoration: none;
}

.topbar nav a:hover {
  text-decoration: underline;
}

.story {
  position: relative;
  isolation: isolate;
  overflow: clip;
}

.story::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background: radial-gradient(ellipse at var(--glow-x, 75%) 33%, rgb(255 251 185 / .17), transparent 62%), linear-gradient(160deg, transparent 58%, rgb(30 38 48 / .085));
}

.chapter {
  min-height: max(100svh, 690px);
  display: flex;
  align-items: center;
  position: relative;
  padding: 110px var(--edge);
  pointer-events: none;
}

.chapter a {
  pointer-events: auto;
}

.chapter-copy {
  width: 48%;
  position: relative;
  z-index: 2;
}

.chapter-copy p {
  font: 450 clamp(16px, 1.25vw, 21px)/1.52 var(--body);
  max-width: 33ch;
  margin: 25px 0;
}

.chapter-copy h1, .chapter-copy h2 {
  font-family: var(--display);
  font-weight: 510;
  letter-spacing: -.065em;
  line-height: .89;
  margin: 0;
  text-wrap: balance;
  overflow-wrap: break-word;
}

.chapter-copy h1 {
  font-size: clamp(98px, min(11.6vw, 20vh), 210px);
}

.chapter-copy h2 {
  font-size: clamp(60px, 7.3vw, 138px);
}

.chapter-copy em {
  font-style: italic;
  font-weight: 430;
  color: var(--ink-emphasis);
}

.opposite {
  justify-content: flex-end;
}

.opposite .chapter-copy {
  width: 43%;
}

.action-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 30px;
}

.action-row>span {
  font: 12px/1.5 var(--body);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 30px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-size: 15px;
  font-weight: 650;
  transition: transform .2s ease, background .2s;
}

.button:hover {
  transform: translateY(-2px);
  background: #263d31;
}

#pot-stage {
  position: fixed;
  z-index: 1;
  left: var(--pot-x, 73%);
  top: var(--pot-y, 50%);
  width: var(--stage-size);
  height: var(--stage-size);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

#pot-stage::before {
  content: "";
  position: absolute;
  width: 54%;
  height: 7%;
  left: 23%;
  bottom: 7%;
  background: #213228;
  opacity: .24;
  border-radius: 50%;
  filter: blur(clamp(9px, 1.3vw, 22px));
  pointer-events: none;
}

#pot-canvas, #pot-fallback {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#pot-fallback {
  object-fit: contain;
  padding: 5% 4%;
  pointer-events: none;
}

#pot-canvas {
  opacity: 0;
  pointer-events: auto;
  touch-action: pan-y;
}

#pot-stage[data-ready="true"] #pot-canvas {
  opacity: 1;
}

#pot-stage[data-ready="true"] #pot-fallback {
  visibility: hidden;
}


.chapter-nav {
  bottom: 0;
  height: 64px;
  justify-content: space-between;
  gap: 0;
  background: var(--ground);
  border-top: 1px solid var(--rule);
}

.chapter-nav a {
  position: relative;
  display: grid;
  place-content: center;
  flex: 1;
  align-self: stretch;
  font: 600 13px/1 var(--body);
  text-decoration: none;
}

.chapter-nav a::before {
  content: "";
  height: 3px;
  position: absolute;
  left: 0;
  right: 0;
  top: -2px;
  background: currentColor;
  transform: scaleX(0);
  transition: transform .25s ease;
}

.chapter-nav a[aria-current]:before, .chapter-nav a:hover:before {
  transform: scaleX(1);
}

.slip-field {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: url("media/clay-slip.webp") 8% 57% / min(80vw, 1050px) auto no-repeat;
  opacity: calc(var(--slip-opacity, 0) * .57);
  mask-image: linear-gradient(90deg, transparent 1%, black 10%, black 36%, transparent 57%);
}

.pattern-field {
  position: fixed;
  inset: -8% -16%;
  z-index: -1;
  pointer-events: none;
  transform: rotate(-11deg);
  opacity: var(--pattern-opacity, 0);
}

.pattern-field i {
  --pitch: clamp(55px, 6.8vw, 118px);
  --feather: 3%;
  position: absolute;
  left: 0;
  right: 0;
  height: var(--pitch);
  opacity: .23;
  background-repeat: repeat-x;
  background-size: var(--pitch) 100%;
  mask-image: linear-gradient(to right, black calc(var(--applied, 0%) - var(--feather)), transparent var(--applied, 0%));
}

.pattern-field i:nth-child(1) {
  bottom: 15%;
  background-image: var(--motif-leaves);
}

.pattern-field i:nth-child(2) {
  top: 49%;
  background-image: var(--motif-diamonds);
  --pitch: clamp(45px, 5.2vw, 94px);
}

.pattern-field i:nth-child(3) {
  top: 19%;
  background-image: var(--motif-braid);
  --pitch: clamp(60px, 7.6vw, 133px);
}

.closing {
  padding-bottom: 210px;
}

.credits {
  position: absolute;
  bottom: 80px;
  left: var(--edge);
  right: var(--edge);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  z-index: 4;
  font: 12px/1.5 var(--body);
}

.studio-credit {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.studio-credit img {
  width: 120px;
  max-height: 55px;
  object-fit: contain;
  background: var(--paper);
  border-radius: 6px;
  padding: 6px;
}

.credits div a {
  margin-left: 15px;
}

dialog {
  width: min(90vw, 900px);
  border: 0;
  padding: 18px;
  border-radius: 16px;
  background: #17261e;
  color: #fffbef;
}

dialog::backdrop {
  background: #102119cd;
}

.film-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.film-head strong {
  font: 500 22px var(--display);
}

.film-head button {
  border: 1px solid #a9b4a9;
  border-radius: 24px;
  background: transparent;
  padding: 6px 13px;
  cursor: pointer;
}

.film-head button span {
  font-size: 22px;
  vertical-align: middle;
}

.film-screen, .film-screen iframe {
  width: 100%;
  aspect-ratio: 16/9;
  border: 0;
  display: block;
  background: #152019;
}

dialog>a {
  display: inline-block;
  margin-top: 12px;
  font-size: 14px;
}

.wrap {
  width: min(91%, 1400px);
  margin: auto;
}

.mast, .simple, .preview {
  padding-block: 32px;
}

.simple h1, .preview h1 {
  font: 500 clamp(44px, 8vw, 130px)/1 var(--display);
}

@media (max-width: 800px) {
  :root {
    --edge: 22px;
    --stage-size: min(87vw, 42svh);
    --pot-x: 50%;
    --pot-y: 28%;
  }

  .topbar {
    height: 58px;
    background: var(--ground);
  }

  .topbar nav {
    gap: 16px;
  }

  .topbar nav a[href="#shaping"] {
    display: none;
  }

  .story::after {
    content: "";
    position: fixed;
    inset: 0 0 auto;
    height: 50svh;
    background: linear-gradient(to bottom, var(--ground) 68%, transparent);
    opacity: var(--mobile-veil, 1);
    z-index: 2;
    pointer-events: none;
  }

  #pot-stage {
    z-index: 3;
  }

  .chapter {
    min-height: max(100svh, 640px);
    padding: 49svh var(--edge) 76px;
    align-items: center;
  }

  .chapter-copy, .opposite .chapter-copy {
    width: 100%;
    z-index: 1;
  }

  .chapter-copy h1, .chapter-copy h2 {
    font-size: clamp(48px, 11vw, 76px);
    line-height: .96;
  }

  .chapter-copy h1 br {
    display: none;
  }

  .chapter-copy h1 em::before {
    content: " ";
  }

  .chapter-copy p {
    margin: 14px 0 18px;
    max-width: 40ch;
    font-size: 16px;
    line-height: 1.42;
  }

  .action-row {
    margin-top: 17px;
  }


  .chapter-nav {
    height: 52px;
    left: 0;
    right: 0;
    padding: 0 10px;
  }

  .closing {
    padding-bottom: 195px;
    min-height: max(calc(100svh + 90px), 780px);
  }

  .credits {
    bottom: 70px;
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .credits div a:first-child {
    margin-left: 8px;
  }

  .studio-credit img {
    width: 95px;
    max-height: 42px;
  }

  .chapter-nav a {
    font-size: 12px;
  }

  .button {
    min-height: 43px;
  }

  .pattern-field {
    z-index: 0;
  }

  .slip-field {
    background-position: center 18%;
    background-size: auto 55svh;
    mask-image: linear-gradient(to bottom, transparent 6%, black 19%, black 37%, transparent 52%);
  }
}

@media (min-width: 801px) and (max-height: 690px) {
  .topbar {
    height: 64px;
    background: var(--ground);
  }

  .chapter-copy h1 {
    font-size: 100px;
  }

  .chapter-nav {
    height: 48px;
  }

  .chapter {
    min-height: max(100svh, 550px);
  }

  .closing {
    min-height: 680px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *:before, *:after {
    animation: none!important;
    transition: none!important;
  }
}


@media (max-width: 400px) {
  .topbar .lockup {
    font-size: 18px;
    white-space: nowrap;
  }

  .topbar nav {
    gap: 10px;
    font-size: 13px;
    white-space: nowrap;
  }

}
