:root {
  --paper: #FEFEFD;
  --ink: #33176a;
  --purple: #6335b5;
  --line: #dcd5e2;
  --lavender: #eee7f4;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  /* Size tiers, stepped by the media queries at the end of the file (base values fit 1920×1080).
     --logo-size steps on its own; --type-scale multiplies text sizes, spacing and the content column. */
  --logo-size: 320px;
  --type-scale: 1;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-columns: 42% minmax(0, 1fr);
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
}

a { color: inherit; }
a:focus-visible { outline: 2px solid var(--purple); outline-offset: 5px; }

.skip {
  position: fixed;
  left: 20px;
  top: -90px;
  z-index: 3;
  padding: 12px;
  background: var(--ink);
  color: white;
}
.skip:focus { top: 12px; }

.brand-panel {
  position: relative;
  min-height: 0;
  overflow: hidden;
  padding: calc(32px * var(--type-scale)) calc(40px * var(--type-scale));
  border-right: 1px solid var(--line);
  background: var(--lavender);
}

.brand {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  mix-blend-mode: multiply;
}
.brand-name { font-size: calc(21.5px * var(--type-scale)); letter-spacing: .3em; }
.mobile-mark { display: none; }

.large-mark {
  position: absolute;
  width: min(var(--logo-size), 68%);
  aspect-ratio: 1;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
}
.large-mark img {
  /* logo.png is the lettermark on a white disc; at 140% with this offset the mark spans the box width. */
  position: absolute;
  width: 140%;
  height: auto;
  left: -20%;
  top: -26%;
  /* Trace the logo and its separate center triangle, leaving the white pixels outside the clip.
     Inset by 0.1% of the image so the anti-aliased white edge pixels fall outside the clip too. */
  clip-path: polygon(evenodd,
    43.338% 20.930%, 56.572% 20.930%, 85.494% 70.830%, 80.912% 78.780%,
    62.646% 78.780%, 53.145% 63.156%, 55.461% 58.720%, 64.087% 58.720%,
    49.950% 32.368%, 35.913% 58.720%, 44.449% 58.720%, 46.765% 63.156%,
    37.254% 78.780%, 18.898% 78.780%, 14.365% 70.830%, 43.338% 20.930%,
    49.949% 43.255%, 55.895% 54.630%, 43.916% 54.630%, 49.949% 43.255%,
    43.338% 20.930%
  );
}

.panel-wave {
  /* Centered on the panel like the logo: the trailing translate puts the midpoint between the
     ribbon's two pinch points (36% and 79% along the canvas) on the panel center. The size keeps
     both pinch points inside the panel while both ends of the ribbon run off it; the mask only
     softens the last few percent as a safety margin for the animation wobble. */
  position: absolute;
  width: max(140%, 140vh);
  aspect-ratio: 884 / 570;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(-60deg) translate(-8.1%, -1.1%);
  opacity: .9;
  pointer-events: none;
  mix-blend-mode: multiply;
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.panel-wave canvas { display: block; width: 100%; height: 100%; }

.panel-caption {
  position: absolute;
  right: calc(40px * var(--type-scale));
  bottom: calc(32px * var(--type-scale));
  font-size: calc(13px * var(--type-scale));
  color: var(--ink);
}

.content-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  /* Centre the copy against the full page height, without the former navigation's offset. */
  padding: 0 clamp(24px, 3.5vw, 112px);
}

main {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: calc(24px * var(--type-scale)) 0;
  scrollbar-width: thin;
}
main:focus { outline: none; }
main section { max-width: calc(760px * var(--type-scale)); flex-shrink: 0; margin-block: auto; }
main section:not([hidden]) + section { margin-top: calc(32px * var(--type-scale)); }
main p { margin: 0 0 calc(20px * var(--type-scale)); font-size: calc(16px * var(--type-scale)); line-height: 1.65; color: var(--ink); }
main .lead { color: var(--ink); font: calc(26.5px * var(--type-scale))/1.55 var(--sans); text-wrap: balance; }
main .contact-text { color: var(--ink); margin: calc(50px * var(--type-scale)) 0 0; }

/* Logo sizes are capped at 68% of the narrower brand panel at every tier. */
@media (max-width: 1200px) {
  :root { --logo-size: 240px; }
}

@media (max-width: 1000px) {
  .brand-panel { padding-inline: 24px; }
  .panel-caption { right: 24px; }
}

@media (max-width: 700px), (max-width: 1100px) and (max-height: 500px) and (pointer: coarse) {
  body { grid-template-columns: minmax(0, 1fr); grid-template-rows: calc(76px + env(safe-area-inset-top, 0px)) minmax(0, 1fr); }
  .brand-panel {
    display: flex;
    align-items: center;
    padding: env(safe-area-inset-top, 0px) max(6vw, env(safe-area-inset-right, 0px)) 0 max(6vw, env(safe-area-inset-left, 0px));
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand { gap: 10px; min-height: 44px; }
  .brand-name { font-size: 18px; line-height: 1; letter-spacing: .24em; }
  .mobile-mark { display: block; width: 36px; height: 36px; flex-shrink: 0; object-fit: contain; }
  .large-mark, .panel-caption { display: none; }
  .panel-wave { width: 390px; left: auto; right: -90px; top: -80px; transform: rotate(-35deg); opacity: .65; }
  .content-panel { padding: 0 max(6vw, env(safe-area-inset-right, 0px)) 0 max(6vw, env(safe-area-inset-left, 0px)); }
  main .lead { font-size: 22px; }
  main section { margin-block: 0; } /* start at the top instead of centring in the leftover height */
  main { padding-bottom: max(24px, env(safe-area-inset-bottom, 0px)); scrollbar-width: none; }
  main::-webkit-scrollbar { display: none; width: 0; height: 0; }
}

@media (min-width: 2200px) {
  :root { --logo-size: 450px; --type-scale: 1.35; }
}

@media (min-width: 3200px) {
  :root { --logo-size: 640px; --type-scale: 1.8; }
}

.desc-text {
  font-size: calc(0.85 * 16px * var(--type-scale)); /* 85% of the body text, following the size tiers */
  padding-top: calc(14px * var(--type-scale));
  border-top: 1px solid var(--line);
}

#mission p:not(.contact-text) {
  text-align: left;
  hyphens: none;
  text-wrap: pretty;
}

#mission .lead { text-wrap: balance; }
