/* old mate studio: landing page. Tokens live in tokens.css. */

@font-face {
  font-family: "Libre Franklin";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/LibreFranklin-SemiBold-latin.woff2") format("woff2");
  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: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/Inter-Regular-latin.woff2") format("woff2");
  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;
}

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

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 15px;
  line-height: 22px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

img, video { display: block; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: var(--space-5);
  top: var(--space-2);
  z-index: 20;
  padding: var(--space-2) var(--space-3);
  background: var(--ground);
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* wordmark: below 20px set solid, 20px and above tightened */
.wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0;
  white-space: nowrap; /* one line, always */
}

/* top bar */
/* top bar: on the column grid. Wordmark on column 1, the links each on a column line:
   phones (4 columns) 3 and 4, tablets 9 and 11, desktops 11 and 12. */
.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--bar-height);
  padding: 0 var(--space-5);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--space-4);
  align-items: center;
  background: var(--ground);
}
.bar .wordmark { grid-column: 1 / span 2; justify-self: start; }
.bar nav { grid-column: 3 / span 2; }
.bar ul {
  display: grid;
  grid-template-columns: repeat(var(--nav-cols, 2), minmax(0, 1fr)); /* equal columns: a word may overhang, never stretch one */
  column-gap: var(--space-4);
  margin: 0; padding: 0; list-style: none;
}
.bar li { justify-self: start; white-space: nowrap; }
@media (min-width: 700px) {
  .bar { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .bar .wordmark { grid-column: 1 / span 4; }
  .bar nav { grid-column: 9 / span 4; --nav-cols: 4; }
  .bar li:last-child { grid-column: 3; }
}
@media (min-width: 1100px) {
  .bar nav { grid-column: 11 / span 2; --nav-cols: 2; }
  .bar li:last-child { grid-column: 2; }
}
.bar a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* work panels */
.panel {
  position: relative;
  height: calc(100svh - var(--bar-height));
  min-height: 400px;
  overflow: hidden;
  background: var(--ground);
}
/* the home banner stops four lines (88px) short of the screen, so the next section's label
   and hairline show beneath it on first load: the signal that the page goes on */
.panel--peek { height: calc(100svh - var(--bar-height) - 88px); min-height: 312px; }
.panel__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* Fill */
}
.panel[data-fit="contain"] .panel__media { object-fit: contain; } /* Fit */

/* narrow screens: landscape work defaults to Fit, unless data-mobile="cover" */
@media (max-width: 699.98px) {
  .panel[data-orientation="landscape"]:not([data-mobile="cover"]) .panel__media {
    object-fit: contain;
  }
  /* Fill with a portrait phone cut: line the landscape poster up with the cut's first frame */
  .panel[data-mobile="cover"] .poster-shim { object-position: var(--poster-x, 50%) 50%; }
}

/* a panel that links through: the whole panel is the link */
.panel__link { position: absolute; inset: 0; display: block; }
.panel__link:focus-visible { outline-offset: -4px; }
/* the panel is a link: its two texts take a Riso Blue box, text staying white, on rollover or focus.
   Padding is always there (transparent) and the position is pulled back by the same amount,
   so the text does not move when the box appears. */
.panel__link .panel__label,
.panel__cta {
  padding: 2px 6px;
  text-shadow: none;
  text-decoration: none;
}
.panel__link .panel__label { left: calc(var(--space-5) - 6px); bottom: calc(var(--space-4) - 2px); }
.panel__cta {
  position: absolute;
  right: calc(var(--space-5) - 6px);
  bottom: calc(var(--space-4) - 2px);
  margin: 0;
  font-size: 15px;
  line-height: 22px;
  color: var(--ink);
}
.panel__link:hover .panel__label,
.panel__link:hover .panel__cta,
.panel__link:focus-visible .panel__label,
.panel__link:focus-visible .panel__cta {
  background: var(--riso-blue);
  color: var(--ink);
}

.panel__label {
  position: absolute;
  left: var(--space-5);
  bottom: var(--space-4);
  margin: 0;
  font-size: 15px;
  line-height: 22px;
  color: var(--ink);
  text-shadow: 0 0 14px var(--ground);
}

/* sections */
/* sections: on the 22px baseline grid. The heading is one line, its rule half a line below
   (8.5 + 1.5 + the 1px rule + 11 = 22); the 1.5px drops 12px type onto the 15px baseline. */
.section {
  padding: 44px var(--space-5) 0;
}
.section__heading {
  margin: 0 0 11px;
  padding: 1.5px 0 8.5px;
  border-bottom: 1px solid var(--rule);
  font-size: 12px;
  line-height: 22px;
  font-weight: 400;
  color: var(--ink-muted);
}

/* about */
/* About: whole lines between paragraphs; the measure is whole columns (same steps as the
   project text): 6 on tablets, 4 on desktops, 3 on wide screens. */
.about p { margin: 0 0 22px; }
.about p:last-child { margin-bottom: 0; }
.about__label { display: block; color: var(--ink-muted); }
@media (min-width: 700px) {
  .about { --cols: 6; width: calc((100% - 11 * var(--space-4)) / 12 * var(--cols) + (var(--cols) - 1) * var(--space-4)); }
}
@media (min-width: 1100px) { .about { --cols: 4; } }
@media (min-width: 1600px) { .about { --cols: 3; } }

/* footer: one row on the 12-column grid, the wordmark at bar size */
.footer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px var(--space-4);
  margin-top: 88px;
  padding: 21px var(--space-5) 44px; /* 21 + the 1px rule: a whole line */
  border-top: 1px solid var(--rule);
}
.footer__wordmark {
  grid-column: 1 / -1;
  justify-self: start;
  white-space: nowrap;
  font-family: var(--font-display);
  font-weight: 600;
}
.footer__links { margin: 0; padding: 0; list-style: none; }
.footer__links a:hover,
.about a { text-decoration: underline; text-underline-offset: 4px; }

@media (min-width: 700px) {
  .footer { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .footer__wordmark { grid-column: 1 / span 4; }
  .footer__links:nth-of-type(1) { grid-column: 5 / span 2; }
  .footer__links:nth-of-type(2) { grid-column: 7 / span 2; }
}

/* inset panel: the page gutter on the sides and below, flush under the bar (as the Klim banner) */
.panel--inset {
  margin: 0 var(--space-5) var(--space-5);
  height: calc(100svh - var(--bar-height) - var(--space-5));
}
/* inset and peeking (the project header): up by the title's padding and line (44 + 44) plus
   one more line, so the project title shows beneath it on first load with room to breathe */
.panel--inset.panel--peek { height: calc(100svh - var(--bar-height) - var(--space-5) - 110px); }

/* joined videos: the active clip shows, the other waits behind it (a hard cut, no fade) */
.panel[data-sequence] video:not([data-active]) { visibility: hidden; }

/* project page: every text edge on a column line, every line on a 22px baseline grid
   (the body leading). Vertical space is in whole or half lines; a 1px rule takes its
   pixel out of the padding beside it so the lines below stay on the grid. */
.project { padding: 44px var(--space-5) 0; }
.project__title {
  margin: 0 0 44px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 40px;
  line-height: 44px;
  letter-spacing: -0.02em;
  position: relative; top: 2.5px; /* drops its baseline onto the 22px grid (Libre Franklin 40px) */
}
.project__label {
  margin: 0 0 22px;
  font-size: 12px;
  line-height: 22px;
  font-weight: 400;
  color: var(--ink-muted);
  position: relative; top: 1.5px; /* 12px in a 22px line sits higher than 15px: share the body's baseline */
}
.project__body p { margin: 0 0 22px; }
.project__body p:last-child { margin-bottom: 0; }
.project__rows { margin-top: 44px; border-bottom: 1px solid var(--rule); }
.project__rows details { border-top: 1px solid var(--rule); }
.project__rows summary {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 21px 0 22px; /* a line above and below; 21 + the 1px rule keeps the text on the grid */
  list-style: none;
  cursor: pointer;
}
.project__rows summary::-webkit-details-marker { display: none; }
/* the arrow hangs in the gutter, so "Details" starts on the column line */
.project__rows summary::before {
  content: "";
  width: 0; height: 0;
  margin-left: calc(-6px - var(--space-2));
  border-left: 6px solid var(--ink);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
}
.project__rows details[open] summary::before {
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 6px solid var(--ink);
  border-bottom: 0;
  margin-left: calc(-8px - var(--space-2));
}
.project__rows summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.project__rows dl { margin: 0; padding: 0 0 21px; }
/* The rows are exactly --span page columns wide, so the same number of columns with the
   same gutter inside them falls on the page's column lines. Phones: 4 columns, term in one. */
.project__rows { --span: 4; --term: 1; }
.project__rows dl div { display: grid; grid-template-columns: repeat(var(--span), minmax(0, 1fr)); column-gap: var(--space-4); }
.project__rows dt { grid-column: 1 / span var(--term); color: var(--ink-muted); }
.project__rows dd { grid-column: calc(var(--term) + 1) / -1; margin: 0; }

/* wider: the 12-column page grid. Label in columns 1-2, text from column 3. Tablets: one
   6-column text column. Desktops: the text runs to the page edge in two 5-column text columns
   (3-7 and 8-12; the 16px column gap is the grid gutter, so both land on column lines), whole
   paragraphs only, with the Details under the first. Wide screens narrow each to 4 columns. */
@media (min-width: 700px) {
  .project__info {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--space-4);
  }
  .project__label { grid-column: 1 / span 2; margin: 0; }
  .project__body, .project__rows { grid-column: 3 / span 6; }
  .project__rows { --span: 6; --term: 2; }
}
@media (min-width: 1100px) {
  .project__body { grid-column: 3 / -1; columns: 2; column-gap: var(--space-4); }
  .project__body p { break-inside: avoid; }
  .project__rows { grid-column: 3 / span 5; --span: 5; --term: 1; }
}
/* wide screens: two 4-column text columns (3-6 and 7-10), so lines stay near 80 characters */
@media (min-width: 1600px) {
  .project__body { grid-column: 3 / span 8; }
  .project__rows { grid-column: 3 / span 4; --span: 4; }
}

.gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}
.gallery img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; }
@media (min-width: 700px) { .gallery { grid-template-columns: 1fr 1fr; } }

/* frames grid: across-the-page frames, videos in place of frames, empty places, room set on the list */
.gallery__wide { grid-column: 1 / -1; }
.gallery__wide img { aspect-ratio: var(--ratio, 3 / 2); }
.gallery__empty { display: none; }
.gallery video { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; }
.gallery__wide video { aspect-ratio: var(--ratio, 3 / 2); }
@media (min-width: 700px) {
  .gallery__empty { display: block; }
  .gallery {
    column-gap: var(--gallery-gap-x, var(--space-4));
    row-gap: var(--gallery-gap-y, var(--space-4));
    /* exactly N columns and their gutters of the page grid, so the edges land on column lines */
    width: calc((100% - 11 * var(--space-4)) / 12 * var(--gallery-columns, 12) + (var(--gallery-columns, 12) - 1) * var(--space-4));
    margin-inline: auto;
  }
}

/* poster held in place until the video is playing (see app.js) */
.poster-shim { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
video[data-live] + .poster-shim { display: none; }
.gallery li { position: relative; }
