/* Wannapat — portfolio, built from Figma "D3-Homepage" (2413:171),
   "D3-All Work Page-1" (2745:158) and "D3-Single Work-…", 1440px desktop
   frames.
   Every Figma px value is written as N * var(--u): 1px at >= 1440px wide,
   scaling down in proportion below that. --vw is the page's width without
   the scrollbar (script.js), so nothing runs under a scrollbar and gets cut
   off at the right. */

:root {
  --u: min(1px, calc(var(--vw, 100vw) / 1440));
  --nav-h: calc(103 * var(--u));

  /* ITC Avant Garde Gothic: the copy installed on the Mac (Chrome), else the
     one in assets/fonts (Safari won't use installed fonts). League Spartan
     comes from Google Fonts. --font-nav is where the design used TT Firs
     Neue Medium: Avant Garde Medium sized to match it (see "Avant Garde
     Nav" below). */
  --font-nav: "Avant Garde Nav", "League Spartan", sans-serif;
  --font-sub: "Avant Garde", "League Spartan", sans-serif;
  --font-body: "League Spartan", sans-serif;
}

/* Avant Garde Medium standing in for TT Firs Neue Medium. Its strokes are
   already as thick (118 vs 115 units); it's drawn 5.7% bigger (cap height
   740 vs 700), so it's scaled to 94.6% to stand as tall at the same
   font-size. Its line spacing is set to Firs Neue's (ascent 950, descent
   340, no line gap; divided by the 94.6%, which applies on top), so
   line-height: normal and every baseline stay where they were. */
@font-face {
  font-family: "Avant Garde Nav";
  font-weight: 500;
  src: local("ITC Avant Garde Gothic Std Medium"), url("assets/fonts/ITCAvantGardeStd-Md.otf") format("opentype");
  size-adjust: 94.6%;
  ascent-override: 100.4%;
  descent-override: 35.9%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Avant Garde";
  font-weight: 300;
  src: local("ITC Avant Garde Gothic Std Book"), url("assets/fonts/ITCAvantGardeStd-Bk.otf") format("opentype");
}

@font-face {
  font-family: "Avant Garde";
  font-weight: 500;
  src: local("ITC Avant Garde Gothic Std Medium"), url("assets/fonts/ITCAvantGardeStd-Md.otf") format("opentype");
}

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

html {
  scroll-behavior: smooth;
  /* Phones keep the sizes set here (no automatic text enlarging). */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: #fff;
  color: #000;
  font-family: var(--font-body);
}

p,
h1,
h2,
h3 { margin: 0; font: inherit; }
img, video { display: block; }
a { color: inherit; text-decoration: none; }

/* Underline for the page you're on / the link or filter just clicked
   (Work in the nav and All Work on the All Work page set the size and gap). */
.is-current {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

/* ---------- Nav bar ----------
   Fixed along the top, with no background. Its text and logo are drawn white
   with a "difference" blend, so they show as the opposite of whatever is
   under them: black on the white page, and a readable contrasting colour over
   a picture or video. On the homepage it starts plain white over the landing
   picture and only blends once that has scrolled away (script.js sets
   .is-dark). */

.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10;
  height: var(--nav-h);
  color: #fff;
  mix-blend-mode: difference;
  font-family: var(--font-nav);
  font-size: calc(15 * var(--u));
  font-weight: 500;
  line-height: normal;
}

.nav--over-landing:not(.is-dark) { mix-blend-mode: normal; }

/* 45% white band behind the nav while work scrolls under it (script.js). */
.nav-band {
  position: fixed;
  inset: 0 0 auto;
  z-index: 9;
  height: var(--nav-h);
  background: rgb(255 255 255 / 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.nav-band.is-shown { opacity: 1; }

.nav__logo {
  position: absolute;
  left: calc(30 * var(--u));
  top: calc(41 * var(--u));
  width: calc(155 * var(--u));
  height: calc(22 * var(--u));
}

.nav__logo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* The white logo, blended like the text (the black one isn't needed now). */
.nav__logo-black { display: none; }

.nav__link,
.nav__clock {
  position: absolute;
  top: calc(45 * var(--u));
  white-space: pre;
}

.nav__link { transition: color 0.2s ease; }

/* Hover: grey (#757575 blends to #8a8a8a on the white page); white text over
   the landing picture goes black. */
.nav__link:hover { color: #757575; }
.nav--over-landing:not(.is-dark) .nav__link:hover { color: #000; }

.nav__link--home { left: calc(381 * var(--u)); }
.nav__link--work { left: calc(477 * var(--u)); }
.nav__link--about { left: calc(570 * var(--u)); }
.nav__clock { left: calc(1243 * var(--u)); font-variant-numeric: tabular-nums; }

/* ---------- Landing (homepage) ---------- */

.landing {
  position: relative;
  z-index: 2; /* over the fixed sidebar until it scrolls away */
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

.landing__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.landing__logo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(758 * var(--u));
  height: auto;
  translate: -50% -50%;
}

/* Easing on the landing (soft start and stop):
   - opening the page: the picture fades in settling from a slight zoom, then
     the logo fades in rising into place (both ease out);
   - scrolling down: script.js sets --p (0 at the top, 1 once the landing has
     gone) — the logo eases out, fading as it lags behind the page (so it
     never runs into the nav), and the picture moves a little slower too. */
.landing__title {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: calc(1 - var(--p-in, 0));
  transform: translateY(calc(var(--p, 0) * 220 * var(--u)));
  will-change: transform, opacity;
}

.landing__bg {
  transform: translateY(calc(var(--p, 0) * 30%));
  will-change: transform;
}

@media (prefers-reduced-motion: no-preference) {
  .landing__bg { animation: landing-bg 1.8s cubic-bezier(0.22, 1, 0.36, 1) both; }
  .landing__logo { animation: landing-logo 1.4s cubic-bezier(0.22, 1, 0.36, 1) 0.4s both; }
}

@keyframes landing-bg {
  from { opacity: 0; scale: 1.08; }
  to { opacity: 1; scale: 1; }
}

@keyframes landing-logo {
  from { opacity: 0; translate: -50% calc(-50% + 40 * var(--u)); }
  to { opacity: 1; translate: -50% -50%; }
}

/* ---------- Sidebar + work column ---------- */

.layout {
  display: grid;
  grid-template-columns: calc(360 * var(--u)) calc(1080 * var(--u));
}

.layout--work { padding-top: var(--nav-h); }

/* "Slide Bar": the about text at the top, contacts at the bottom. Fixed in
   place right under the nav (103 from the top, as on a project's page) while
   the page scrolls past. On the homepage the landing covers it, and it shows
   once the landing has scrolled away. */
.sidebar {
  position: fixed;
  left: 0;
  top: var(--nav-h);
  z-index: 1;
  width: calc(360 * var(--u));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: calc(100svh - var(--nav-h));
  padding: 0 calc(30 * var(--u)) calc(60 * var(--u));
  font-size: calc(15 * var(--u));
  font-weight: 300;
  line-height: normal;
}

/* The sidebar is out of the flow, so the page's content keeps to the second
   column. */
.layout > :not(.sidebar) { grid-column: 2; }

/* Body-2: ITC Avant Garde Gothic Medium 12, 134% line height, -2%. */
.sidebar__about {
  max-width: calc(296 * var(--u));
  font-family: var(--font-sub);
  font-size: calc(12 * var(--u));
  font-weight: 500;
  line-height: 1.34;
  letter-spacing: -0.02em;
}

.sidebar__contact {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: calc(18 * var(--u));
  row-gap: calc(4 * var(--u));
}

.sidebar__social { grid-column: 1 / -1; }
.sidebar__social--first { margin-top: calc(1lh + 4 * var(--u)); }
.sidebar a:hover { text-decoration: underline; }

.work {
  padding: 0 0 calc(80 * var(--u)) calc(20 * var(--u));
}

.layout--home .work { padding-top: calc(70 * var(--u)); }
.layout--home .work__more { margin-top: calc(81 * var(--u)); }

.work__heading,
.work__more {
  width: calc(1040 * var(--u));
  font-family: var(--font-nav);
  font-size: calc(15 * var(--u));
  font-weight: 500;
  text-align: center;
}

.work__heading { margin-bottom: calc(35 * var(--u)); }
/* Only the words are the link (hover / click), centred under the grid. */
.work__more {
  display: inline-block;
  width: auto;
  margin-top: calc(88 * var(--u));
  margin-left: calc(520 * var(--u));
  translate: -50% 0;
  transition: color 0.2s ease;
}

/* Filters (All Work page). */
.filters {
  display: flex;
  gap: calc(61 * var(--u));
  height: calc(18 * var(--u));
  margin-bottom: calc(41 * var(--u));
  font-family: var(--font-nav);
  font-size: calc(15 * var(--u));
  font-weight: 500;
  line-height: normal;
}

.filters button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.filters button { transition: color 0.2s ease; }

/* Hover turns these grey; only clicking underlines them. */
.filters button:hover,
.work__more:hover,
.to-top:hover { color: #8a8a8a; }

/* ---------- Project cards ----------
   Rows 1030 wide: each card is 418 tall and as wide as Figma has it (330,
   447, 505, 563 or 680, set by script.js); the picture frame is its top 348,
   then the name, the year on the right and the category under it. What's in
   the frame is placed in Figma px (script.js). Filtering just reflows them. */

.grid {
  display: flex;
  flex-wrap: wrap;
  width: calc(1030 * var(--u));
  column-gap: calc(20 * var(--u));
  row-gap: calc(21 * var(--u));
}

.card {
  position: relative;
  flex: none;
  width: calc(var(--cw) * var(--u));
  height: calc(418 * var(--u));
  overflow: hidden;
}

.card[hidden] { display: none; }

.card__media {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: calc(348 * var(--u));
  overflow: hidden;
}

.card__pic {
  position: absolute;
  max-width: none;
}

.card__name,
.card__year,
.card__type {
  position: absolute;
  line-height: normal;
  white-space: nowrap;
}

.card__name {
  left: 0;
  top: calc(366 * var(--u));
  font-family: var(--font-nav);
  font-size: calc(15 * var(--u));
  font-weight: 500;
}

.card__type,
.card__year {
  font-family: var(--font-sub);
  font-size: calc(11 * var(--u));
  font-weight: 500;
  letter-spacing: -0.02em;
}

.card__type { left: 0; top: calc(387 * var(--u)); }
.card__year { right: 0; top: calc(370 * var(--u)); }

/* Only the picture of a card opens its page. Hovering it zooms the picture
   8% inside its frame (the frame keeps its size), to show it can be clicked. */
a.card__media { cursor: pointer; }

.card__zoom {
  position: absolute;
  inset: 0;
  transition: scale 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

a.card__media:hover .card__zoom,
a.card__media:focus-visible .card__zoom { scale: 1.08; }
a.card__media:focus-visible { outline: 2px solid #000; outline-offset: 3px; }

/* ---------- A project's page (Figma "D3-Single Work-…") ----------
   project.js fills it from projects.js. The info stays on the left; the
   pictures sit where they do in Figma (Figma px from the top of the page). */

.project-info {
  position: fixed;
  left: 0;
  top: var(--nav-h);
  z-index: 1;
  width: calc(360 * var(--u));
  padding: 0 calc(30 * var(--u));
  display: flex;
  flex-direction: column;
  gap: calc(30 * var(--u));
}

.project-info__head {
  position: relative;
  width: calc(300 * var(--u));
  height: calc(38 * var(--u));
}

.project-info__name {
  position: absolute;
  left: 0;
  top: calc(-4 * var(--u));
  font-family: var(--font-nav);
  font-size: calc(20 * var(--u));
  font-weight: 500;
  line-height: normal;
  white-space: nowrap;
}

.project-info__year,
.project-info__type {
  position: absolute;
  font-family: var(--font-sub);
  font-size: calc(12 * var(--u));
  font-weight: 500;
  line-height: normal;
}

.project-info__year { right: 0; top: calc(5 * var(--u)); }
.project-info__type { left: 0; top: calc(24 * var(--u)); }

/* Body-2: ITC Avant Garde Gothic Medium 12, 134% line height, -2%. */
.project-info__body {
  width: calc(300 * var(--u));
  font-family: var(--font-sub);
  font-size: calc(12 * var(--u));
  font-weight: 500;
  line-height: 1.34;
  letter-spacing: -0.02em;
}

.project-info__body p + p { margin-top: 1lh; }

.project-info__team {
  font-family: var(--font-sub);
  font-size: calc(12 * var(--u));
  line-height: normal;
}

.project-info__team h3 { font-weight: 500; margin-bottom: calc(6 * var(--u)); }
.project-info__team li { line-height: normal; }
.project-info__team ul { margin: 0; padding: 0; list-style: none; font-weight: 300; }

.project {
  position: relative;
  height: calc((var(--page-h, 2000) + 0) * var(--u));
}

/* Back < Project name: "Back" at 0, the arrow at 42, the name at 59. */
.back {
  position: absolute;
  left: calc(380 * var(--u));
  top: calc(var(--back-top, 99) * var(--u));
  width: calc(700 * var(--u));
  height: calc(25 * var(--u));
}

.back__link {
  position: absolute;
  left: 0;
  top: calc(8 * var(--u));
  width: calc(47 * var(--u));
  height: calc(13 * var(--u));
  color: #838383;
  font-family: var(--font-sub);
  font-size: calc(11 * var(--u));
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: normal;
  transition: color 0.2s ease;
}

.back__link:hover,
.next:hover { color: #000; }
.back__link.is-clicked .back__label {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.back__arrow {
  position: absolute;
  left: calc(42 * var(--u));
  top: 0;
  width: calc(5 * var(--u));
  height: calc(10 * var(--u));
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

.back__title {
  position: absolute;
  left: calc(59 * var(--u));
  top: 0;
  font-family: var(--font-nav);
  font-size: calc(20 * var(--u));
  font-weight: 500;
  line-height: normal;
  white-space: nowrap;
}

/* Next >: "Next" at 1361, the arrow at 1403 (Figma), to the next project. */
.next {
  position: absolute;
  left: calc(1361 * var(--u));
  top: calc(109 * var(--u));
  width: calc(47 * var(--u));
  height: calc(13 * var(--u));
  color: #838383;
  font-family: var(--font-sub);
  font-size: calc(11 * var(--u));
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: normal;
  transition: color 0.2s ease;
}

.next__arrow {
  position: absolute;
  left: calc(42 * var(--u));
  top: calc(1 * var(--u));
  width: calc(5 * var(--u));
  height: calc(10 * var(--u));
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

/* Back to the top: centred under the pictures, 113 below the last one. */
.to-top {
  position: absolute;
  left: calc(895 * var(--u));
  top: calc(var(--to-top, 2000) * var(--u));
  translate: -50% 0;
  font-family: var(--font-nav);
  font-size: calc(15 * var(--u));
  font-weight: 500;
  line-height: normal;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.collage__block {
  position: absolute;
  left: calc(var(--x) * var(--u));
  top: calc(var(--y) * var(--u));
  width: calc(var(--w) * var(--u));
  height: calc(var(--h) * var(--u));
  overflow: hidden;
}

.collage__pic {
  position: absolute;
  max-width: none;
}

/* ---------- About (Figma "D3-About-2") ----------
   A 284 × 280 black frame with the portrait in it, centred over the two
   columns 113 below the nav; then Work Experience and Education side by side
   153 below it: each row a name, what it was under it, the date on the
   right. */

.about { padding: 0 0 calc(80 * var(--u)) calc(22 * var(--u)); }

.about__photo {
  position: relative;
  width: calc(284 * var(--u));
  height: calc(280 * var(--u));
  margin: calc(113 * var(--u)) 0 0 calc(331 * var(--u));
  background: #000;
  overflow: hidden;
}

.about__photo img {
  position: absolute;
  left: calc(40 * var(--u));
  top: calc(21 * var(--u));
  width: calc(203 * var(--u));
  height: calc(238 * var(--u));
  object-fit: cover;
}

.about__cv {
  display: grid;
  grid-template-columns: calc(331 * var(--u)) calc(331 * var(--u));
  column-gap: calc(194 * var(--u));
  margin-top: calc(153 * var(--u));
  line-height: normal;
}

/* Headings: TT Firs Neue Medium 20. Each entry's name and date: TT Firs Neue
   Medium 15. What it was, and the Skill / Software lists: ITC Avant Garde
   Gothic Book 12. */
.cv__heading {
  margin-bottom: calc(23 * var(--u));
  font-family: var(--font-nav);
  font-size: calc(20 * var(--u));
  font-weight: 500;
  letter-spacing: -0.02em;
}

.cv ul { margin: 0; padding: 0; list-style: none; }

/* Rows 56px apart; a long name wraps and pushes the rest down. */
.cv__row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  column-gap: calc(16 * var(--u));
  min-height: calc(56 * var(--u));
  padding-bottom: calc(14 * var(--u));
}

/* The last row ends with its text, like the Skill / Software lists, so every
   topic is the same 34 below the one above it. */
.cv__row:last-child { min-height: 0; padding-bottom: 0; }

/* A name that wraps gets a little air between its lines. */
.cv__name,
.cv__date { font-family: var(--font-nav); font-size: calc(15 * var(--u)); font-weight: 500; line-height: 1.3; }
.cv__date { text-align: right; }
.cv__name,
.cv__date { line-height: 1.5; } /* a little more air between the lines of a name that wraps */
.cv__what { grid-column: 1 / -1; font-family: var(--font-sub); font-size: calc(12 * var(--u)); font-weight: 300; }
.cv__date { white-space: nowrap; }
.cv__what { margin-top: calc(4 * var(--u)); }

.about__side { display: flex; flex-direction: column; gap: calc(34 * var(--u)); }

/* Skill / Software: plain lists in the description style. The negative
   margin takes off the extra space the 1.6 line height leaves under the last
   line, so the gap to the next topic is the same 34 as everywhere else. */
.cv .cv__list { margin-bottom: calc(-4.2 * var(--u)); }
.cv__list li {
  font-family: var(--font-sub);
  font-size: calc(12 * var(--u));
  font-weight: 300;
  line-height: 1.6;
}

/* ---------- Phones (Figma "D3-Homepage-Mobile" 2797:1526, 2797:1690,
   2797:1746: 393px wide frames) ----------
   Under 768px wide the pages turn into one 353-wide column with 20 either
   side. Figma's mobile px are written as N * var(--m) (1px on a 393-wide
   phone, scaling with the screen). Cards and project pictures keep their
   desktop layout inside, scaled down to the column (their --u is set to
   that scale). The about text and contacts move to the end of the page. */

@media (max-width: 767px) {
  :root {
    --m: calc(var(--vw, 100vw) / 393);
    --nav-h: calc(71 * var(--m));
  }

  body { overflow-x: clip; }

  /* Homepage and All Work: no about text or contacts on a phone (About
     keeps them at the end of the page). */
  .sidebar--desktop-only { display: none; }

  /* Nav: logo on the left, Home / Work / About on the right, no clock. */
  .nav { font-size: calc(13 * var(--m)); }
  .nav__logo {
    left: calc(20.7 * var(--m));
    top: calc(27.7 * var(--m));
    width: calc(119.6 * var(--m));
    height: calc(16.7 * var(--m));
  }
  .nav__link { top: calc(27 * var(--m)); }
  .nav__link--home { left: calc(198 * var(--m)); }
  .nav__link--work { left: calc(269 * var(--m)); }
  .nav__link--about { left: calc(335 * var(--m)); }
  .nav__clock { display: none; }

  .landing__logo { width: calc(283 * var(--m)); }
  .landing__title { transform: translateY(calc(var(--p, 0) * 120 * var(--m))); }

  /* One column; the about text and contacts come last. */
  .layout { display: flex; flex-direction: column; }
  .sidebar {
    position: static;
    order: 2;
    width: auto;
    height: auto;
    gap: calc(30 * var(--m));
    padding: calc(20 * var(--m)) calc(20 * var(--m)) calc(50 * var(--m));
    font-size: calc(10 * var(--m));
  }
  .sidebar__about { max-width: none; font-size: calc(10 * var(--m)); }
  .sidebar__contact { column-gap: calc(14 * var(--m)); row-gap: calc(3 * var(--m)); }
  .sidebar__social--first { margin-top: calc(1lh + 3 * var(--m)); }

  /* About: the portrait, the about text under it, then Work Experience and
     the rest; the contacts (12, a little bigger) stay at the bottom. */
  .sidebar--about,
  .layout:has(.sidebar--about) .about { display: contents; }
  .about__photo { order: 1; }
  .sidebar--about .sidebar__about {
    order: 2;
    padding: calc(30 * var(--m)) calc(20 * var(--m)) 0;
  }
  .about__cv { order: 3; padding: 0 calc(20 * var(--m)); }
  .sidebar--about .sidebar__contact {
    order: 4;
    padding: calc(30 * var(--m)) calc(20 * var(--m)) calc(50 * var(--m));
    font-size: calc(12 * var(--m));
    font-weight: 300;
  }

  .work { padding: 0 calc(20 * var(--m)) calc(40 * var(--m)); }
  .layout--home .work { padding-top: calc(53 * var(--m)); }
  .work__heading {
    width: auto;
    margin-bottom: calc(35 * var(--m));
    font-size: calc(15 * var(--m));
  }
  .work__more,
  .layout--home .work__more {
    margin-top: calc(40 * var(--m));
    margin-left: 50%;
    font-size: calc(13 * var(--m));
  }

  /* All Work filters: a list on the right half, 29 apart. */
  .filters {
    flex-direction: column;
    align-items: flex-start;
    gap: calc(13 * var(--m));
    height: auto;
    margin: calc(1 * var(--m)) 0 calc(42 * var(--m)) calc(179 * var(--m));
    font-size: calc(13 * var(--m));
  }
  /* Each on one line, left-aligned. */
  .filters button { text-align: left; white-space: nowrap; }

  /* Cards: full width, the picture scaled from the card's desktop width. */
  .grid {
    flex-direction: column;
    width: 100%;
    row-gap: calc(13 * var(--m));
  }
  .card {
    --mh: calc(var(--m) * 348 * 353 / var(--cw));
    width: 100%;
    height: calc(var(--mh) + 44 * var(--m));
  }
  .card__media {
    --u: calc(var(--m) * 353 / var(--cw));
    height: var(--mh);
  }
  .card__name { top: calc(var(--mh) + 11 * var(--m)); font-size: calc(10 * var(--m)); }
  .card__year { top: calc(var(--mh) + 13 * var(--m)); font-size: calc(10 * var(--m)); }
  .card__type { top: calc(var(--mh) + 25 * var(--m)); font-size: calc(8 * var(--m)); }

  /* A project's page: Back < name and Next > at the top, then the info,
     then the pictures (placed by project.js), then Back to the top. */
  .project-info {
    position: static;
    width: auto;
    margin-top: calc(134 * var(--m));
    padding: 0 calc(20 * var(--m));
    gap: calc(30 * var(--m));
  }
  .project-info__head { width: 100%; height: calc(35 * var(--m)); }
  .project-info__name { font-size: calc(20 * var(--m)); }
  .project-info__year,
  .project-info__type { font-size: calc(12 * var(--m)); }
  .project-info__year { top: calc(5 * var(--m)); }
  .project-info__type { top: calc(24 * var(--m)); }
  .project-info__body,
  .project-info__team { width: 100%; font-size: calc(10 * var(--m)); }
  .project-info__team h3 { margin-bottom: calc(4 * var(--m)); }

  .project { position: static; height: auto; padding-bottom: calc(80 * var(--m)); }
  .back {
    left: calc(20 * var(--m));
    top: calc(76 * var(--m));
    width: calc(200 * var(--m));
    height: calc(25 * var(--m));
  }
  .back__link,
  .next {
    width: calc(47 * var(--m));
    height: calc(13 * var(--m));
    font-size: calc(10 * var(--m));
  }
  .back__link { top: calc(8 * var(--m)); }
  .back__arrow,
  .next__arrow { width: calc(5 * var(--m)); height: calc(10 * var(--m)); }
  .back__arrow { left: calc(39 * var(--m)); }
  .next__arrow { left: calc(42 * var(--m)); top: 0; }
  .back__title { left: calc(59 * var(--m)); top: calc(3 * var(--m)); font-size: calc(15 * var(--m)); }
  .next { left: calc(324 * var(--m)); top: calc(83 * var(--m)); }

  .collage {
    position: relative;
    height: calc(var(--mh, 0) * var(--m));
    margin: calc(32 * var(--m)) calc(20 * var(--m)) 0;
  }
  .collage__block {
    --u: calc(var(--m) * 353 / 1030);
    left: calc(var(--mx) * var(--m));
    top: calc(var(--my) * var(--m));
  }
  .to-top {
    position: static;
    display: block;
    width: fit-content;
    margin: calc(42 * var(--m)) auto 0;
    translate: none;
    font-size: calc(10 * var(--m));
  }

  /* About: the portrait, then each topic one under another. */
  .about { padding: 0 calc(20 * var(--m)) calc(20 * var(--m)); }
  .about__photo {
    --u: var(--m);
    margin: calc(30 * var(--m)) auto 0;
  }
  .about__cv {
    grid-template-columns: 1fr;
    row-gap: calc(34 * var(--m));
    margin-top: calc(50 * var(--m));
  }
  .about__side { gap: calc(34 * var(--m)); }
  .cv__heading { margin-bottom: calc(16 * var(--m)); font-size: calc(15 * var(--m)); }
  .cv__row {
    column-gap: calc(12 * var(--m));
    min-height: calc(44 * var(--m));
    padding-bottom: calc(10 * var(--m));
  }
  .cv__row:last-child { min-height: 0; padding-bottom: 0; }
  .cv__name,
  .cv__date { font-size: calc(12 * var(--m)); }
  .cv__what { margin-top: calc(3 * var(--m)); font-size: calc(10 * var(--m)); }
  .cv__list li { font-size: calc(10 * var(--m)); }
  .cv .cv__list { margin-bottom: calc(-3.5 * var(--m)); }
}
