@font-face {
  font-family: Italiana;
  src: url('/assets/italiana-regular.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Inter Tight';
  src: url('/assets/inter-tight-regular.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Inter Tight';
  src: url('/assets/inter-tight-medium.ttf') format('truetype');
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

:root {
  color-scheme: light;
  font-family: 'Inter Tight', Arial, sans-serif;
  color: #090a08;
  background: #e8e8e5;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  width: 100%;
  height: 100vh;
  height: 100svh;
  padding: 0;
  overflow: hidden;
}

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

a:focus-visible, button:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 6px;
}

.canvas {
  --page-gutter: clamp(14px, 6.5cqw, 120px);
  --header-top: clamp(12px, 2.7cqh, 34px);
  --header-height: clamp(38px, 6.3cqh, 58px);
  --gallery-gap: clamp(6px, 1.05cqw, 16px);
  --gallery-top: calc(var(--header-top) + var(--header-height) + clamp(10px, 2.2cqh, 22px));
  --gallery-bottom: clamp(38px, 6.8cqh, 68px);
  --gallery-columns: 3;
  --gallery-rows: 2;
  --home-video-width: min(clamp(164px, 25cqw, 382px), 44cqh);
  position: relative;
  isolation: isolate;
  container-type: size;
  width: 100%;
  height: 100%;
  background: #e8e8e5;
  overflow: hidden;
}

.header {
  position: absolute;
  z-index: 6;
  inset: var(--header-top) var(--page-gutter) auto;
  height: var(--header-height);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
}

.wordmark {
  font-size: clamp(15px, 1.65cqw, 23px);
  font-weight: 500;
  letter-spacing: -.065em;
}

.navigation {
  display: grid;
  grid-column: 2 / -1;
  grid-template-columns: subgrid;
  height: 100%;
  align-items: center;
}

.nav-center {
  display: flex;
  gap: clamp(12px, 3.1cqw, 44px);
  align-items: center;
  height: 100%;
}

.nav-link, .nav-memes {
  position: relative;
  display: grid;
  place-items: center;
  height: 100%;
  color: inherit;
  font: inherit;
  font-size: clamp(11px, 1.15cqw, 16px);
  line-height: 1;
}

.nav-dex { cursor: default; }
.nav-memes { padding: 0; border: 0; background: transparent; cursor: pointer; }

.nav-link::after, .nav-memes::after {
  content: '';
  position: absolute;
  bottom: calc(50% - .85em);
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .2s ease;
}

.nav-link:hover::after, .nav-link:focus-visible::after,
.nav-memes:hover::after, .nav-memes[aria-pressed="true"]::after { transform: scaleX(1); }
.nav-link:focus-visible, .nav-memes:focus-visible { outline-offset: 3px; }

.nav-buy {
  justify-self: end;
  display: grid;
  place-items: center;
  height: 100%;
  padding: 0 clamp(12px, 2.9cqw, 46px);
  background: #030402;
  color: #f3f3ef;
  font-size: clamp(11px, 1.07cqw, 16px);
  transition: background .2s ease;
}

.nav-buy:hover { background: #34362f; }
.nav-buy:focus-visible { outline-color: #090a08; }

.coming-soon {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  width: max-content;
  transform: translate(-50%, -3px);
  background: #090a08;
  color: #e8e8e5;
  padding: 8px 11px;
  font-size: 11px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .18s, transform .18s, visibility .18s;
}

.nav-dex:hover .coming-soon, .nav-dex:focus .coming-soon, .nav-dex.is-active .coming-soon { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

.hero {
  position: absolute;
  inset: 0;
  transition: opacity .34s ease, translate .38s ease, visibility .38s;
}

.canvas[data-show-memes] .hero {
  opacity: 0;
  translate: 0 -8px;
  visibility: hidden;
}

.title { margin: 0; font: 400 1em/1 Italiana, 'Bodoni MT', Didot, serif; letter-spacing: -.065em; }
.title-stoic, .title-cat { position: absolute; left: 50%; transform: translateX(-50%); white-space: nowrap; z-index: 1; font-weight: 400; }
.title-stoic { top: 9.3%; font-size: min(21.2cqw, 29.4cqh); line-height: .95; }
.title-cat { bottom: 2.2%; font-size: min(30cqw, 38.2cqh); line-height: .86; }

.portrait {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 24.3%;
  transform: translateX(-50%);
  width: 34%;
  height: 59.2%;
  margin: 0;
  pointer-events: none;
}

.portrait img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: center bottom; filter: grayscale(1) contrast(.94); }

.connectors { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.connector-paths { stroke: #6e6f67; stroke-width: .9; stroke-dasharray: 1.3 4.4; stroke-linecap: round; }
.connector-dots { fill: #080907; }

.callout { position: absolute; z-index: 4; width: 15.7%; }
.callout h2 { margin: 0 0 .4em; font-size: min(2.17cqw, 3.04cqh); font-weight: 500; letter-spacing: -.055em; line-height: 1.02; }
.callout p { margin: 0; max-width: 95%; font-size: min(1.15cqw, 1.61cqh); line-height: 1.28; letter-spacing: -.017em; text-wrap: pretty; }
.callout-one { left: 6.5%; top: 18.7%; }
.callout-two { left: 79.4%; top: 25.1%; width: 15.2%; }
.callout-three { left: 7%; top: 54.4%; width: 14.8%; }
.callout-four { left: 77.5%; top: 53.3%; width: 17%; }
.copy-short { display: none; }

.footer { position: absolute; left: 6.8%; bottom: 2.6%; z-index: 4; font-size: min(2.25cqw, 3.05cqh); letter-spacing: -.07em; font-weight: 500; }
.video-dock {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 5;
  width: var(--home-video-width);
  height: calc(var(--home-video-width) * 464 / 848);
  transition: width .38s ease, height .38s ease, right .38s ease, bottom .38s ease;
}

.canvas[data-show-memes] .video-dock {
  right: var(--page-gutter);
  bottom: var(--gallery-bottom);
  width: calc((100cqw - 2 * var(--page-gutter) - (var(--gallery-columns) - 1) * var(--gallery-gap)) / var(--gallery-columns));
  height: calc((100cqh - var(--gallery-top) - var(--gallery-bottom) - (var(--gallery-rows) - 1) * var(--gallery-gap)) / var(--gallery-rows));
}

.video-card {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #090a08;
}

.video-card video { display: block; width: 100%; height: 100%; object-fit: contain; }
.video-controls {
  position: absolute;
  right: 4px;
  bottom: 4px;
  display: flex;
  gap: 1px;
  background: rgb(8 8 7 / .88);
  color: #f3f3ef;
}

.video-controls button {
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.video-controls button:hover { background: #34362f; }
.video-controls button:focus-visible { outline-offset: -2px; }
.video-controls svg { width: 16px; height: 16px; }
.video-card:not([data-playing]) .icon-pause,
.video-card[data-playing] .icon-play,
.video-sound[aria-pressed="false"] .icon-sound-on,
.video-sound[aria-pressed="true"] .icon-sound-off { display: none; }

.memes-gallery {
  position: absolute;
  inset: var(--gallery-top) var(--page-gutter) var(--gallery-bottom);
  display: grid;
  grid-template-columns: repeat(var(--gallery-columns), minmax(0, 1fr));
  grid-template-rows: repeat(var(--gallery-rows), minmax(0, 1fr));
  gap: var(--gallery-gap);
  opacity: 0;
  translate: 0 10px;
  visibility: hidden;
  transition: opacity .34s ease, translate .38s ease, visibility .38s;
}

.canvas[data-show-memes] .memes-gallery {
  opacity: 1;
  translate: 0;
  visibility: visible;
}

.meme-tile {
  position: relative;
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: #11110e;
  color: #f3f3ef;
  cursor: zoom-in;
}

.meme-tile:focus-visible { outline-offset: -3px; }
.meme-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }

.meme-viewer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 58px 12px 16px;
  border: 0;
  background: #11110e;
  color: #f3f3ef;
}

.meme-viewer::backdrop { background: #11110e; }
.meme-viewer[open] { display: grid; place-items: center; }
.meme-viewer img { display: block; max-width: 100%; max-height: 100%; min-height: 0; object-fit: contain; }

.viewer-close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 1;
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid #77776c;
  background: #171713;
  color: inherit;
  cursor: pointer;
}

.viewer-close:hover { background: #303029; }
.viewer-close:focus-visible { outline-offset: 3px; }
.viewer-close svg { width: 19px; height: 19px; }

@media (max-width: 640px) {
  .canvas { --page-gutter: clamp(12px, 4cqw, 24px); }
}

@media (prefers-reduced-motion: no-preference) {
  .canvas { animation: appear .8s ease both; }
  .portrait { animation: portrait-appear 1.1s cubic-bezier(.2,.65,.3,1) both; }
  @keyframes appear { from { opacity: 0; } to { opacity: 1; } }
  @keyframes portrait-appear { from { opacity: 0; translate: 0 10px; } to { opacity: 1; translate: 0 0; } }
}

@media (max-width: 640px) and (max-aspect-ratio: 4/5) {
  body { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  .canvas {
    --gallery-columns: 2;
    --gallery-rows: 3;
    --home-video-width: min(clamp(142px, 48cqw, 245px), 36cqh);
  }
  .title-stoic { top: 19%; font-size: min(30cqw, 18cqh); }
  .title-cat { top: calc(30cqh + min(53.2cqw, 33cqh) - 4cqh); bottom: auto; font-size: min(30cqw, 24cqh); }
  .portrait { top: 30%; width: auto; height: min(53.2cqw, 33cqh); aspect-ratio: 993 / 1200; }
  .connectors { display: none; }
  .callout { width: 25%; }
  .callout-one, .callout-three { left: 3%; }
  .callout-two, .callout-four { left: 72%; }
  .callout-one { top: 31%; }
  .callout-two { top: 37%; }
  .callout-three, .callout-four { top: 57%; }
  .callout h2 { font-size: clamp(11px, 3.15cqw, 14px); margin-bottom: .5em; }
  .callout h2 br { display: none; }
  .callout p { width: 100%; max-width: 100%; font-size: clamp(10px, 2.65cqw, 12px); line-height: 1.4; text-wrap: wrap; }
  .copy-full { display: none; }
  .callout .copy-short { display: block; }
  .footer { left: 7%; bottom: 2.4%; font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
