/* Tokyo Cashmere. Two colors, one typeface in one weight, hard cuts.
   Values come from the 2020 brand kit and the Tokyo Cashmere design system.
   Sizes are stage units: 1u = stage width / 1920 (landscape) or / 1180 (portrait). */

/* Suisse Int'l is licensed to Tokyo Cashmere by Swiss Typefaces. Self-hosted, @font-face only,
   original files, and only served on tokyo-cashmere.com (see vercel.json). */
@font-face {
  font-family: "Suisse Intl";
  src: local("Suisse Int'l Semi Bold"), local("SuisseIntl-SemiBold"), url("/fonts/SuisseIntl-SemiBold.otf") format("opentype");
  font-weight: 600; font-style: normal; font-display: swap;
}

:root {
  --deep-black: #000000;
  --pure-white: #ffffff;
  --ashes: #434343;
  --ground: var(--pure-white);
  --ink: var(--deep-black);
  --font-sans: "Suisse Intl", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --w: 1920;
  --u: min(calc(100vw / 1920), calc(100vh / 1000));
  --u: min(calc(100vw / 1920), calc(100dvh / 1000));

  --fs-statement: calc(154 * var(--u));  --lh-statement: calc(185 * var(--u));
  --fs-headline: calc(101 * var(--u));   --lh-headline: calc(121 * var(--u));
  --fs-say: calc(97 * var(--u));         --lh-say: calc(116 * var(--u));
  --fs-nav: max(11px, calc(20 * var(--u)));
  --fs-body: max(15px, calc(23 * var(--u)));
  --page-x: calc(36 * var(--u));
  --page-y: calc(40 * var(--u));
  --wide: calc(120 * var(--u));
  --logo-w: calc(337 * var(--u));
}
@media (max-aspect-ratio: 1/1) {
  :root {
    --w: 1180;
    --u: min(calc(100vw / 1180), calc(100vh / 1700));
    --u: min(calc(100vw / 1180), calc(100dvh / 1700));
    --fs-statement: calc(132 * var(--u)); --lh-statement: calc(158 * var(--u));
    --fs-nav: max(11px, calc(34 * var(--u)));
    --fs-body: max(15px, calc(44 * var(--u)));
    --page-x: calc(48 * var(--u));
    --page-y: calc(56 * var(--u));
    --wide: calc(60 * var(--u));
    --logo-w: calc(500 * var(--u));
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--ground); color: var(--ink); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font-family: var(--font-sans); font-weight: 600; font-synthesis: none;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, p { margin: 0; font-weight: 600; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; border-radius: 0; cursor: pointer; text-transform: inherit; letter-spacing: 0; -webkit-appearance: none; appearance: none; }
::selection { background: var(--ink); color: var(--ground); }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.only-p { display: none; }
@media (max-aspect-ratio: 1/1) { .only-p { display: inline; } .only-l { display: none; } }

/* Negative: black ground, white marks. Once in the run, for rhythm. */
.tc-neg, body.is-neg { --ground: var(--deep-black); --ink: var(--pure-white); }
body.is-neg, .tc-neg { background: var(--ground); color: var(--ink); }

/* ---- Marks: brand kit SVGs, unmodified, used as masks so they take the ink ---- */
.tc-logotype, .tc-icon, .tc-symbol {
  display: block; background: currentColor;
  -webkit-mask: var(--tc-mark) center / contain no-repeat; mask: var(--tc-mark) center / contain no-repeat;
}
.tc-logotype { width: var(--logo-w); aspect-ratio: 10 / 1; }
.tc-logotype--primary { --tc-mark: url("/assets/marks/TC_logotype_primary.svg"); }
.tc-logotype--secondary1 { --tc-mark: url("/assets/marks/TC_logotype_secondary1.svg"); }
.tc-logotype--secondary2 { --tc-mark: url("/assets/marks/TC_logotype_secondary2.svg"); }
.tc-logotype--secondary3 { --tc-mark: url("/assets/marks/TC_logotype_secondary3.svg"); }
.tc-logotype--secondary4 { --tc-mark: url("/assets/marks/TC_logotype_secondary4.svg"); }
.tc-icon { --tc-mark: url("/assets/marks/TC_icon_black_no_BG.svg"); aspect-ratio: 1; }
.tc-symbol { aspect-ratio: 1; }

/* ---- Site header: two words and the logotype. No bar, no rule. ---- */
.tc-header {
  position: fixed; left: 0; right: 0; top: 0; z-index: 10;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: var(--page-y) var(--page-x) 0;
  padding-top: max(var(--page-y), env(safe-area-inset-top));
  color: var(--ink);
}
/* The logotype is the 2020 animation itself: six frames, 0.4s each, hard cuts. It is black on white,
   so the header multiplies onto whatever is behind it, and inverts and screens on the negative frame. */
.tc-header { mix-blend-mode: multiply; }
body.is-neg .tc-header { mix-blend-mode: screen; }
.tc-logo { display: block; width: var(--logo-w); }
.tc-logo img { display: block; width: 100%; height: auto; }
body.is-neg .tc-logo img { filter: invert(1); }
.tc-header a, .tc-foot button { font-size: var(--fs-nav); line-height: 1.2; text-transform: uppercase; }
.tc-header a:first-child { justify-self: start; }
.tc-header a:last-child { justify-self: end; }
.tc-header a[aria-current], .tc-header a:not(.tc-logo):hover, .tc-foot button:hover {
  text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: 0.09em;
}
a:focus-visible, button:focus-visible { outline: max(2px, calc(3 * var(--u))) solid currentColor; outline-offset: calc(6 * var(--u)); }

/* Back and Next. Words, not arrows. */
.tc-foot {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: space-between;
  padding: 0 var(--page-x) var(--page-y);
  padding-bottom: max(var(--page-y), env(safe-area-inset-bottom));
  color: var(--ink); pointer-events: none;
}
.tc-foot button { pointer-events: auto; }
.tc-foot.is-swapped { flex-direction: row-reverse; }
.no-js .tc-foot { display: none; }

/* ---- Type devices. Caps, Semi Bold, tracking 0, leading 1.2. ---- */
.tc-statement, .tc-stack { text-transform: uppercase; font-weight: 600; letter-spacing: 0; }
.as-set { text-transform: none; }
.tc-statement { white-space: pre-line; text-align: center; font-size: var(--fs-statement); line-height: var(--lh-statement); }
.tc-stack { white-space: nowrap; font-size: var(--fs-headline); line-height: var(--lh-headline); text-align: left; }
.tc-stack--statement { font-size: var(--fs-statement); line-height: var(--lh-statement); }
.tc-stack--say { font-size: var(--fs-say); line-height: var(--lh-say); }
.tc-stack--right { text-align: right; }
.tc-stack > span { display: block; }
.tc-body { font-size: var(--fs-body); line-height: 1.2; text-align: justify; hyphens: none; }
.tc-body a { text-transform: uppercase; }
.tc-body a:hover, .dev-works a:hover, .dev-works button:hover { text-decoration: underline; text-decoration-thickness: 0.06em; text-underline-offset: 0.1em; }
.tc-words { display: flex; gap: 1.6em; margin-top: 1.2em; }
.tc-legal { display: block; margin-top: 1.2em; }
.tc-photo { position: absolute; display: block; object-fit: cover; border-radius: 0; }
.w { display: inline-block; white-space: pre; }

/* ---- Frames. Without script: a plain scrolling page, every device on its last frame. ---- */
.frame { position: relative; min-height: 100vh; min-height: 100dvh; overflow: hidden; background: var(--ground); color: var(--ink); }
.canvas { position: relative; width: calc(var(--w) * var(--u)); height: 100vh; height: 100dvh; margin: 0 auto; }

/* With script: one frame at a time, cut hard. Nothing scrolls. Scrolling sets type. */
.js, .js body { height: 100%; overflow: hidden; overscroll-behavior: none; }
.js body { touch-action: none; }
.js .frame { position: fixed; inset: 0; display: none; }
.js .frame.is-on { display: block; }

/* ---- Devices, placed by eye on the 1920 stage ---- */
.dev-center { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); }
.dev-note {
  position: absolute; right: var(--wide); bottom: calc(118 * var(--u));
  width: calc(480 * var(--u)); min-width: 17em; max-width: calc(100% - 2 * var(--wide));
}

/* 1. Seek discomfort. The stack moves up a line a beat; the line in the middle is the one you made. */
.dev-seek {
  position: absolute; left: 50%; top: 50%; width: max-content;
  height: calc(3 * var(--lh-statement));
  display: flex; flex-direction: column; justify-content: flex-end;
  transform: translate(-50%, calc(var(--lh-statement) * -2.5));
}
.no-js .dev-seek { height: auto; transform: translate(-50%, -50%); }

/* 3. Right is on the right. Then it is not. */
.dev-why-r { position: absolute; right: var(--wide); top: 50%; transform: translateY(-50%); }
.dev-why-l { position: absolute; left: var(--wide); top: 50%; transform: translateY(-50%); }

/* 4. High is low, low is high. */
.dev-highlow { position: absolute; inset: 0; }
.dev-highlow span { position: absolute; left: 0; right: 0; }
.dev-highlow .lo { top: calc(150 * var(--u)); }
.dev-highlow .sl { top: 50%; transform: translateY(-50%); }
.dev-highlow .hi { bottom: calc(150 * var(--u)); }

/* 5. The icon: enormous or nothing. */
.dev-tsu { position: absolute; left: 50%; top: 50%; width: calc(2700 * var(--u)); transform: translate(-50%, -50%); }

/* 7. Say cheese */
.dev-cheese { position: absolute; display: block; right: calc(127 * var(--u)); top: 50%; transform: translateY(-50%); height: calc(6 * var(--lh-say)); }
.dev-cheese:hover span:not(.turn), .dev-cheese:focus-visible span:not(.turn) { text-decoration: underline; text-decoration-thickness: 0.06em; text-underline-offset: 0.1em; }
.dev-cheese:focus-visible { outline-offset: calc(16 * var(--u)); }
.dev-cheese-photo { left: calc(50% - 50vw); top: 0; width: calc(50vw - 50% + 1045 * var(--u)); height: 100%; }
#cheese .dev-note { right: auto; left: var(--wide); width: calc(560 * var(--u)); }
#cheese.has-photo .dev-note { display: none; }

/* 8. Selected works. The list is the page. */
.dev-works {
  position: absolute; left: 0; right: 0; top: calc(241 * var(--u)); white-space: normal;
}
.dev-works a, .dev-works button { display: block; width: max-content; max-width: none; margin: 0 auto; white-space: nowrap; text-align: center; }
.dev-works [data-fx="heart"].is-fx { min-width: 3.3em; text-align: right; }
.dev-note--works { right: auto; left: var(--page-x); bottom: calc(118 * var(--u)); width: calc(330 * var(--u)); }
.terrazzo { position: absolute; left: calc(50% - 50vw); width: 100vw; top: 0; height: 100%; pointer-events: none; }
.terrazzo .tc-symbol { position: absolute; width: calc(100 * var(--u)); }

/* 9. Teenies */
.dev-teenies { position: absolute; left: var(--wide); top: 50%; height: calc(4 * var(--lh-headline)); transform: translateY(-50%); }
.dev-teenies-logo { position: absolute; right: calc(150 * var(--u)); top: calc(190 * var(--u)); width: calc(620 * var(--u)); height: auto; }

/* ---- Portrait: keep the composition, let the stage scale, re-break by hand ---- */
@media (max-aspect-ratio: 1/1) {
  .dev-note { right: var(--wide); left: var(--wide); width: auto; min-width: 0; max-width: none; bottom: calc(190 * var(--u)); }
  .dev-seek { font-size: calc(108 * var(--u)); line-height: calc(130 * var(--u)); height: calc(3 * 130 * var(--u)); transform: translate(-50%, calc(130 * var(--u) * -2.5)); }
  .dev-why-r, .dev-why-l { font-size: calc(150 * var(--u)); line-height: calc(180 * var(--u)); }
  .dev-tsu { width: calc(3000 * var(--u)); }
  .dev-highlow .lo { top: calc(260 * var(--u)); }
  .dev-highlow .hi { bottom: calc(420 * var(--u)); }
  .dev-cheese { right: var(--wide); top: auto; bottom: calc(480 * var(--u)); transform: none; font-size: calc(132 * var(--u)); line-height: calc(158 * var(--u)); height: calc(6 * 158 * var(--u)); }
  .dev-cheese-photo { left: calc(50% - 50vw); width: 100vw; top: 0; height: 38%; }
  #cheese .dev-note { left: var(--wide); right: var(--wide); width: auto; bottom: calc(190 * var(--u)); }
  .dev-works { top: calc(300 * var(--u)); }
  .dev-note--works { left: var(--wide); right: var(--wide); width: auto; }
  .dev-teenies { font-size: calc(132 * var(--u)); line-height: calc(158 * var(--u)); height: calc(4 * 158 * var(--u)); top: 54%; }
  .dev-teenies-logo { right: auto; left: var(--wide); top: calc(250 * var(--u)); width: calc(560 * var(--u)); }
}

/* ---- Without script the page simply scrolls, every device on its last frame ---- */
.no-js .tc-header { position: absolute; }
.no-js .dev-seek { font-size: var(--fs-headline); line-height: var(--lh-headline); }
.no-js #principles .canvas, .no-js #works .canvas { height: auto; }
.no-js .pr { position: relative; height: 100vh; }
.no-js .dev-works { position: relative; top: 0; padding: calc(241 * var(--u)) 0 calc(420 * var(--u)); }

@media print { .tc-foot { display: none; } }
