/* Vyupex studio page. The edge between the two bands is the flat top of the mark: the V and every app's
   piece hang from it. Colours come from tokens.css (a copy from the brand kit); this file maps them to roles. */

@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/ibm-plex-sans-latin-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/ibm-plex-sans-latin-500.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/ibm-plex-sans-latin-700.woff2") format("woff2"); }

:root {
  color-scheme: light dark;
  --upper: var(--vyupex-background);
  --lower: var(--vyupex-surface);
  --text: var(--vyupex-text);
  --muted: var(--vyupex-muted-text);
  --link: var(--vyupex-accent-text);
  --mark: var(--vyupex-primary);
  --wedge: var(--vyupex-accent);
  --sendbill: var(--vyupex-slot-sendbill);
  --gutter: clamp(20px, 5vw, 64px);
  --font: var(--vyupex-font-wordmark);
}

/* Dark: the lower band is ink, where the brand kit has checked the mark and wedge colours. */
@media (prefers-color-scheme: dark) {
  :root {
    --upper: var(--vyupex-primary-hover);
    --lower: var(--vyupex-primary);
    --text: var(--vyupex-on-primary);
    --muted: var(--vyupex-primary-300);
    --link: var(--vyupex-accent-text-dark);
    --mark: var(--vyupex-on-primary);
    --sendbill: var(--vyupex-slot-sendbill-dark);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--lower);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
img, svg { display: block; }

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 2px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- upper band: the studio ---------- */
.upper { background: var(--upper); }

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: clamp(20px, 3vw, 32px); }
.brand { display: block; }
.brand img { height: 32px; width: auto; }
.top-mail { color: var(--text); font-size: 0.9375rem; }

.intro {
  display: grid;
  gap: clamp(20px, 2.4vw, 32px) clamp(32px, 5vw, 80px);
  padding-block: clamp(32px, 4.5vw, 56px) clamp(40px, 4.5vw, 60px);
}
h1 {
  font-size: clamp(2.125rem, 1.2rem + 3.9vw, 4rem);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.022em;
  max-width: 15ch;
  text-wrap: balance;
}
.lede {
  max-width: 34ch;
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.3125rem);
  line-height: 1.5;
  color: var(--muted);
}

/* ---------- lower band: what hangs from the edge ---------- */
.lower { flex: 1; display: flex; flex-direction: column; }

/* Narrow screens: the V floats right and the app's text follows its slanted edge. */
.bay { display: flow-root; }

.hung {
  float: right;
  width: clamp(128px, 36vw, 340px);
  height: auto;
  overflow: hidden;
  shape-outside: polygon(0 0, 100% 0, 50% 100%);
  shape-margin: 20px;
}
.mark-v { fill: var(--mark); }
.mark-wedge { fill: var(--wedge); transition: fill 180ms ease; }

.app { position: relative; }
.app-wedge { width: 48px; height: auto; overflow: hidden; }
.piece-small { fill: var(--sendbill); }
.app h3 { margin-top: 20px; font-size: 1.625rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
.app h3 a { color: var(--text); text-decoration: none; }
/* The whole entry is the link's target. */
.app h3 a::after { content: ""; position: absolute; inset: 0; }
.app h3 a:focus-visible { outline: none; }
.app:focus-within { outline: 2px solid var(--link); outline-offset: 6px; border-radius: 2px; }
.app p { margin-top: 6px; max-width: 40ch; color: var(--muted); }
.app-site { display: inline-block; margin-top: 10px; color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.app:hover .app-site { text-decoration-thickness: 2px; }

/* Pointing at Sendbill puts it in the mark: the wedge takes the app's colour, as the brand rule says. */
.lower:has(.app-sendbill:hover, .app-sendbill:focus-within) .mark-wedge { fill: var(--sendbill); }

.bay-note { clear: both; padding-top: clamp(28px, 4vw, 36px); max-width: 36ch; font-size: 0.9375rem; color: var(--muted); }

/* One moment on load: the pieces drop out of the edge and stop. */
@media (prefers-reduced-motion: no-preference) {
  .piece { transform-box: fill-box; animation: seat 650ms cubic-bezier(0.2, 0.9, 0.25, 1) 250ms backwards; }
  .piece-small { animation-delay: 400ms; }
  @keyframes seat { from { transform: translateY(-105%); } to { transform: none; } }
}

/* ---------- footer ---------- */
.foot {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 32px;
  padding-block: clamp(48px, 7vw, 72px) 36px;
  font-size: 0.9375rem;
  color: var(--muted);
}

/* ---------- message pages (404) ---------- */
.message { padding-block: clamp(40px, 7vw, 88px); }
.message .lede { margin-top: clamp(20px, 2.4vw, 32px); }

/* ---------- wide screens ---------- */
@media (min-width: 860px) {
  .intro { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: end; }
  .lede { padding-bottom: 0.3em; }

  .bay { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); column-gap: clamp(32px, 5vw, 80px); align-items: start; }
  .app-list { grid-column: 1; grid-row: 1; }
  .hung { grid-column: 2; grid-row: 1; width: min(100%, 340px); }
  .bay-note { grid-column: 2; grid-row: 2; }

  .app-wedge { width: 64px; }
  .app h3 { margin-top: 28px; font-size: 2rem; }
  .app p { font-size: 1.125rem; }
}
