/* PROJECT // OVERALL — holding page
   Colours, type and rules from Brand Book 02. No framework, no build step. */

@font-face {
  font-family: "Cabinet Grotesk";
  src: url("../fonts/CabinetGrotesk-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: block;
}

@font-face {
  font-family: "Satoshi";
  src: url("../fonts/Satoshi-Variable.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
}

/* Backup faces, resized to Cabinet Grotesk's and Satoshi's measurements. If the brand fonts
   can't load (a slow connection, or the page opened straight from a folder), Arial stands in
   without making the giant type wider and pushing things into each other. */
@font-face {
  font-family: "Cabinet Grotesk Fallback";
  src: local("Arial Black"), local("Arial-Black");
  font-weight: 100 900;
  size-adjust: 83%;
  ascent-override: 104.8%;
  descent-override: 33.7%;
  line-gap-override: 0%;
}

/* Devices without Arial Black (some phones) get Arial Bold, resized the same way. */
@font-face {
  font-family: "Cabinet Grotesk Fallback Bold";
  src: local("Arial Bold"), local("Arial-BoldMT");
  font-weight: 100 900;
  size-adjust: 92.2%;
  ascent-override: 94.4%;
  descent-override: 30.4%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Satoshi Fallback";
  src: local("Arial"), local("ArialMT");
  font-weight: 100 600;
  size-adjust: 101%;
  ascent-override: 100%;
  descent-override: 23.8%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Satoshi Fallback";
  src: local("Arial Bold"), local("Arial-BoldMT");
  font-weight: 700 900;
  size-adjust: 99%;
  ascent-override: 102%;
  descent-override: 24.2%;
  line-gap-override: 0%;
}

:root {
  --canvas: #f4f1ea;
  --slate: #3c4048;
  --denim: #7b9fb6;
  --saffron: #f4c430;

  --display: "Cabinet Grotesk", "Cabinet Grotesk Fallback", "Cabinet Grotesk Fallback Bold", Arial, sans-serif;
  --text: "Satoshi", "Satoshi Fallback", Arial, sans-serif;

  --gutter: clamp(16px, 4.4vw, 64px);
  --col-gap: clamp(12px, 1.7vw, 24px);
  --bar-h: 64px;
  /* Height of the phone browser's toolbar. Content in full-screen stages sits above it. */
  --toolbar: calc(100lvh - 100svh);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
}

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

html {
  background: var(--canvas);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: var(--bar-h);
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--slate);
  font-family: var(--text);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.7;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

h1,
h2,
p,
figure {
  margin: 0;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

b {
  font-weight: inherit;
}

::selection {
  background: var(--saffron);
  color: var(--slate);
}

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

/* ---------- Type ---------- */

.label {
  font-family: var(--text);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.display {
  font-family: var(--display);
  font-weight: 800;
  line-height: 0.84;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.wide-only {
  display: none;
}

@media (min-width: 640px) {
  .wide-only {
    display: inline;
  }
}

@media (min-width: 1024px) {
  .label {
    font-size: 11.5px;
  }

  body {
    font-size: 14.5px;
  }
}

.skip {
  position: fixed;
  top: 12px;
  left: var(--gutter);
  z-index: 200;
  padding: 12px 16px;
  background: var(--slate);
  color: var(--canvas);
  transform: translateY(-200%);
  transition: transform 0.3s var(--ease);
}

.skip:focus {
  transform: none;
}

/* ---------- Film grain (brand book: "a subtle, film-like grain") ---------- */

.grain {
  position: fixed;
  inset: -20%;
  z-index: 90;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='d'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' seed='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .13 0 0 0 0 .12 0 0 0 0 .11 1.5 0 0 0 -.62'/%3E%3C/filter%3E%3Cfilter id='l'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' seed='11' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .98 0 0 0 0 .94 1.5 0 0 0 -.66'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23d)'/%3E%3Crect width='100%25' height='100%25' filter='url(%23l)'/%3E%3C/svg%3E");
  background-size: 220px 220px;
  opacity: 0.36;
  animation: grain 0.9s steps(6) infinite;
}

@keyframes grain {
  0%,
  100% {
    transform: translate(0, 0);
  }
  17% {
    transform: translate(-3%, -5%);
  }
  33% {
    transform: translate(-7%, 3%);
  }
  50% {
    transform: translate(4%, -8%);
  }
  67% {
    transform: translate(-2%, 7%);
  }
  83% {
    transform: translate(6%, 1%);
  }
}

/* Photo grade (brand book: clean, slightly desaturated, warm, gentle vignette).
   Applied in CSS so any photo dropped in later matches. */
.hero__media img,
.window__frame img {
  filter: saturate(0.84) sepia(0.1) contrast(1.03) brightness(0.97);
}

.hero__media::after,
.window__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(120% 95% at 50% 45%, transparent 55%, rgb(24 22 20 / 0.34) 100%);
}

/* ---------- Bar ---------- */

.bar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 6px var(--gutter);
  color: var(--slate);
  background: rgb(244 241 234 / 0);
  pointer-events: none;
  transition: color 0.5s var(--ease), background-color 0.5s var(--ease);
}

.bar[data-theme="light"] {
  background: var(--canvas);
}

.bar[data-theme="dark"] {
  color: var(--canvas);
  background: var(--slate);
}

.bar[data-theme="over"] {
  color: var(--canvas);
}

.bar > * {
  pointer-events: auto;
}

.bar__mark {
  padding: 10px 0;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
}

.bar__link {
  position: relative;
  margin-left: clamp(12px, 7vw, 112px);
  padding: 12px 0;
  white-space: nowrap;
}

.bar__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0.2em;
  bottom: 9px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.6s var(--ease);
}

.bar__link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.bar__clock {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- [001] Hero ---------- */

.hero {
  position: relative;
  height: 250lvh;
}

.hero__stage {
  /* Starting slit, as insets from each edge of the screen. JS opens it on scroll. */
  --t0: 12%;
  --r0: 36%;
  --b0: 43%;
  --l0: 54.5%;
  --open: 0;
  /* "PROJECT //" measures 5.22em of ink: fit it between the gutters, capped on short screens */
  --wm: min(calc((100vw - 2 * var(--gutter)) / 5.22), 31lvh);

  position: sticky;
  top: 0;
  height: 100lvh;
  overflow: hidden;
}

.hero__layer {
  position: absolute;
  inset: 0;
}

.hero__layer--inverse {
  color: var(--canvas);
}

.hero__aperture {
  position: absolute;
  inset: 0;
  clip-path: inset(var(--t0) var(--r0) var(--b0) var(--l0));
  will-change: clip-path;
}

.hero__media {
  position: absolute;
  inset: 0;
}

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 18% 30%;
  transform: scale(calc(1.18 - 0.18 * var(--open)));
  transform-origin: 58% 24%;
  will-change: transform;
}

/* Darkens the photo under the wordmark (bottom) and under the bar (top) once it is open. */
.hero__scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgb(26 24 22 / 0.5) 0, rgb(26 24 22 / 0) 120px),
    linear-gradient(to top, rgb(26 24 22 / 0.6) 0%, rgb(26 24 22 / 0.22) 38%, rgb(26 24 22 / 0) 62%),
    linear-gradient(to right, rgb(26 24 22 / 0.28) 0%, rgb(26 24 22 / 0) 55%);
  opacity: var(--open);
}

/* The lockup: PROJECT // over OVERALL, anchored bottom-left, the tag tucked under the slashes. */
/* Natural spacing, as in the logo: tighter tracking makes the C and T collide. */
.lockup {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: calc(var(--toolbar) + var(--gutter));
  display: grid;
  grid-template-columns: max-content max-content minmax(0, 1fr);
  grid-template-areas:
    "p s ."
    "o t t";
  column-gap: 0.19em;
  font-family: var(--display);
  font-size: var(--wm);
  font-weight: 800;
  line-height: 0.84;
  letter-spacing: 0;
  text-transform: uppercase;
}

.wm {
  display: block;
  overflow: hidden;
  margin: -0.06em 0 -0.02em -0.045em;
  padding: 0.06em 0 0.02em 0.045em;
  white-space: nowrap;
}

.wm > span {
  display: block;
}

.wm--p {
  grid-area: p;
}

.wm--s {
  grid-area: s;
}

.wm--o {
  grid-area: o;
}

/* Kept no wider than the slashes above it, so it wraps instead of running off the page. */
.lockup__tag {
  grid-area: t;
  align-self: start;
  max-width: calc(var(--wm) * 0.8);
  padding-top: 0.15em;
  font-size: 10.5px;
  line-height: 1.6;
  letter-spacing: 0.2em;
}

.lockup__tag > span {
  display: block;
}

.hero__meta {
  position: absolute;
  opacity: clamp(0, calc(1 - var(--open) * 2.6), 1);
}

.hero__status {
  top: calc(var(--bar-h) + 3.5vh);
  left: var(--gutter);
}

/* Viewfinder marks around the slit: the f-stop above it, coordinates running up its right edge. */
.hero__fstop {
  top: calc(var(--t0) - 28px);
  left: var(--l0);
  font-variant-numeric: tabular-nums;
}

.hero__fstop b {
  text-transform: none;
}

.hero__coords {
  top: var(--t0);
  left: calc(100% - var(--r0) + 10px);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
}

@media (max-height: 620px) {
  .hero__coords {
    display: none;
  }
}

.hero__cue {
  right: var(--gutter);
  bottom: calc(var(--toolbar) + var(--gutter));
}

@media (min-width: 1024px) {
  .lockup__tag {
    font-size: 11.5px;
    padding-top: 0.2em;
  }
}

/* Portrait screens (phones, upright tablets): PROJECT / // + tag / OVERALL */
@media (max-aspect-ratio: 1/1) {
  .hero {
    height: 230lvh;
  }

  .hero__stage {
    --t0: 13%;
    --r0: 12%;
    --b0: 33%;
    --l0: 56%;
    /* "PROJECT" is 4.36em wide */
    --wm: calc((100vw - 2 * var(--gutter)) / 4.36);
  }

  .hero__media img {
    object-position: 36% 0;
    transform-origin: 64% 18%;
  }

  .lockup {
    grid-template-columns: max-content minmax(0, 1fr);
    grid-template-areas:
      "p p"
      "s t"
      "o o";
    column-gap: 0.2em;
  }

  .lockup__tag {
    align-self: center;
    max-width: none;
    padding-top: 0.05em;
  }

  .hero__cue {
    display: none;
  }

  /* Two lines, so it stays clear of the f-stop label above the slit */
  .hero__status span span {
    display: block;
  }
}

/* Upright tablets: the photo barely crops sideways, so move the slit over her face instead. */
@media (max-aspect-ratio: 1/1) and (min-width: 600px) {
  .hero__stage {
    --l0: 45%;
    --r0: 23%;
  }
}

/* ---------- Sections ---------- */

.section {
  position: relative;
  padding: clamp(104px, 17vh, 220px) var(--gutter) clamp(80px, 13vh, 180px);
}

.section__label {
  margin-bottom: clamp(24px, 4.5vh, 48px);
}

/* ---------- Windows (images that open like an aperture) ---------- */

.window {
  --open: 1;
  position: relative;
}

.window__frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background: rgb(60 64 72 / 0.08);
  clip-path: inset(0 calc(49.6% * (1 - var(--open))) 0 calc(49.6% * (1 - var(--open))));
}

.window__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(calc(1.24 - 0.24 * var(--open)));
}

.window figcaption {
  margin-top: 14px;
  opacity: clamp(0, calc(var(--open) * 2.5 - 1.5), 1);
}

/* ---------- [002] Manifesto ---------- */

.manifesto__title {
  font-size: min(12.4vw, 152px);
}

.line {
  display: block;
  overflow: hidden;
  margin-top: -0.08em;
  padding-top: 0.08em;
}

.line > span {
  display: block;
}

.manifesto__body {
  max-width: 36ch;
  margin-top: clamp(40px, 8vh, 88px);
}

.manifesto__body p + p {
  margin-top: 1.2em;
}

.manifesto__end {
  font-weight: 700;
}

.window--market {
  width: 74%;
  margin-top: clamp(56px, 10vh, 120px);
}

.window--room {
  width: 60%;
  margin: clamp(48px, 8vh, 96px) 0 0 auto;
}

@media (min-width: 768px) {
  .window--market {
    width: 46%;
  }

  .window--room {
    width: 38%;
    margin-top: -12vh;
  }
}

@media (min-width: 1024px) {
  .manifesto {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--col-gap);
    align-items: start;
  }

  .manifesto .section__label {
    grid-column: 1 / 7;
    grid-row: 1;
  }

  .manifesto__title {
    grid-column: 1 / 10;
    grid-row: 2;
    min-width: 0;
    font-size: 8.9vw;
  }

  .manifesto__body {
    grid-column: 1 / 5;
    grid-row: 3;
  }

  .window--market,
  .window--room {
    width: auto;
    margin: 0;
  }

  .window--room {
    grid-column: 10 / 13;
    grid-row: 1 / 3;
    align-self: end;
  }

  .window--market {
    grid-column: 6 / 9;
    grid-row: 3;
    margin-top: clamp(80px, 16vh, 200px);
  }
}

/* ---------- [003] Statement ---------- */

.statement {
  position: relative;
  height: 220lvh;
  background: var(--slate);
  color: var(--canvas);
}

.statement__stage {
  position: sticky;
  top: 0;
  height: 100lvh;
  overflow: hidden;
}

.statement__label {
  position: absolute;
  top: calc(var(--bar-h) + 3.5vh);
  left: var(--gutter);
}

.statement__title {
  position: absolute;
  left: var(--gutter);
  bottom: calc(var(--toolbar) + var(--gutter) + 72px);
  font-size: min(calc((100vw - var(--gutter) + 1vw) / 4.48), calc((100svh - 300px) / 1.68));
  white-space: nowrap;
}

.word {
  display: inline-block;
  margin-left: -0.04em;
}

.word--last {
  display: block;
}

.statement__note {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: calc(var(--toolbar) + var(--gutter));
  max-width: 44ch;
}

@media (max-aspect-ratio: 1/1) {
  .statement {
    height: 200lvh;
  }

  .statement__title {
    font-size: calc((100vw - var(--gutter) + 1.6vw) / 4.48);
  }

  .word {
    display: block;
  }
}

/* ---------- [004] Join + contact ---------- */

.join__title {
  font-size: min(15.6vw, 120px);
}

.tag {
  max-width: 560px;
  margin-top: clamp(40px, 7vh, 72px);
  border: 1px solid var(--slate);
}

.tag__head,
.tag__foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
}

.tag__head {
  border-bottom: 1px solid var(--slate);
}

.tag__foot {
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0 0.6em;
  border-top: 1px solid var(--slate);
}

.tag__foot > span {
  white-space: nowrap;
}

.tag__foot.is-error {
  color: #9d2a18;
}

.tag__row {
  display: flex;
  align-items: stretch;
}

.tag__input {
  flex: 1;
  min-width: 0;
  height: 64px;
  padding: 0 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--slate);
  font: 500 16px/1 var(--text);
  letter-spacing: 0.02em;
  -webkit-appearance: none;
  appearance: none;
}

.tag__input::placeholder {
  color: rgb(60 64 72 / 0.55);
}

.tag__input:focus-visible {
  outline: 2px solid var(--slate);
  outline-offset: -6px;
}

.tag__btn {
  flex: none;
  min-width: 132px;
  padding: 0 20px;
  border: 0;
  border-left: 1px solid var(--slate);
  border-radius: 0;
  background: var(--saffron);
  color: var(--slate);
  text-align: left;
  cursor: pointer;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
}

.tag__btn:hover {
  background: var(--slate);
  color: var(--saffron);
}

.tag__btn:focus-visible {
  outline: 2px solid var(--slate);
  outline-offset: 3px;
}

.tag__btn[disabled] {
  cursor: progress;
}

.tag__hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.tag__done {
  padding: 22px 16px 26px;
  outline: none;
}

.tag__done-text {
  font-family: var(--display);
  font-size: clamp(22px, 2.2vw, 30px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.window--detail {
  width: 56%;
  margin: clamp(56px, 10vh, 112px) 0 0 auto;
}

.contact {
  min-width: 0;
  margin-top: clamp(64px, 12vh, 140px);
  container-type: inline-size;
}

.contact__mail {
  display: inline-block;
  margin: 12px 0 14px;
  padding-bottom: 6px;
  font-family: var(--display);
  font-size: min(calc(100cqi / 13.8), 64px);
  overflow-wrap: anywhere;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat;
  transition: background-size 0.7s var(--ease);
}

.contact__mail:hover,
.contact__mail:focus-visible {
  background-size: 100% 2px;
}

@media (min-width: 1024px) {
  .join {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--col-gap);
    align-items: start;
  }

  .join__label {
    grid-column: 1 / 7;
    grid-row: 1;
  }

  .join__title {
    grid-column: 1 / 8;
    grid-row: 2;
    font-size: 6.6vw;
  }

  .tag {
    grid-column: 1 / 7;
    grid-row: 3;
  }

  .contact {
    grid-column: 1 / 9;
    grid-row: 4;
  }

  .window--detail {
    grid-column: 9 / 12;
    grid-row: 2 / 5;
    align-self: center;
    width: auto;
    margin: 0;
  }
}

/* ---------- Footer ---------- */

.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  padding: 24px var(--gutter) calc(24px + env(safe-area-inset-bottom));
  border-top: 1px solid rgb(60 64 72 / 0.22);
}

.foot__clock {
  font-variant-numeric: tabular-nums;
}

@media (min-width: 768px) {
  .foot__clock {
    margin-left: auto;
  }
}

/* ---------- Motion (only when JS runs) ---------- */

.js .wm > span {
  transform: translateY(108%);
}

.is-ready .wm > span {
  transform: none;
  transition: transform 1.3s var(--ease) 0.15s;
}

.is-ready .wm--s > span {
  transition-delay: 0.25s;
}

.is-ready .wm--o > span {
  transition-delay: 0.32s;
}

.js .hero__meta > span,
.js .lockup__tag > span {
  display: inline-block;
  opacity: 0;
}

.js .lockup__tag > span {
  display: block;
}

.is-ready .hero__meta > span,
.is-ready .lockup__tag > span {
  opacity: 1;
  transition: opacity 1.2s var(--ease) 0.9s;
}

.js [data-reveal] .line > span {
  transform: translateY(105%);
}

.js [data-reveal].is-in .line > span {
  transform: none;
  transition: transform 1.2s var(--ease);
  transition-delay: calc(var(--i, 0) * 90ms);
}

.js .fade {
  opacity: 0;
  transform: translateY(16px);
}

.js .fade.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 1.1s var(--ease) 0.15s, transform 1.3s var(--ease) 0.15s;
}

.js .window {
  --open: 0;
}

.js .word {
  opacity: 0;
  transform: translateY(0.05em) scale(1.035);
  transition: opacity 0.45s var(--ease), transform 0.8s var(--ease);
}

.js .word.is-on {
  opacity: 1;
  transform: none;
}

.js .statement__note {
  opacity: 0;
  transition: opacity 0.9s var(--ease);
}

.js .statement__note.is-on {
  opacity: 1;
}

@media (hover: hover) {
  .window__frame img {
    transition: scale 1.4s var(--ease);
  }

  .window:hover .window__frame img {
    scale: 1.03;
  }
}

@media (prefers-reduced-motion: reduce) {
  .grain {
    animation: none;
  }

  .hero {
    height: 100lvh;
  }

  .statement {
    height: 100lvh;
  }

  .js .wm > span,
  .js [data-reveal] .line > span,
  .js .fade,
  .js .word {
    transform: none;
    opacity: 1;
    transition: none;
  }

  .js .hero__meta > span,
  .js .lockup__tag > span,
  .js .statement__note {
    opacity: 1;
    transition: none;
  }

  .js .window {
    --open: 1;
  }
}

/* ---------- 404 ---------- */

.lost {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100svh;
  padding: calc(var(--bar-h) + 4vh) var(--gutter) var(--gutter);
}

.lost__title {
  font-size: min(calc((100vw - var(--gutter)) / 4.65), 34svh);
}

.lost__back {
  margin-top: 24px;
  display: inline-block;
}
