/* Candidate page story (canvas intro that lands in the form). Loaded after style.css. */

  /* ---------- the story: a sticky canvas that ends on the About block ---------- */
  /* Without html.cs-ready (no JS, the story failed, reduced motion) the page is simply the form: no canvas, no long scroll. */
  #c, .p6-caps { display: none; }
  .cs-ready #c { display: block; }
  .cs-ready .p6-caps { display: block; }
  .cs-ready .p6-story { position: relative; height: 540vh; height: 540svh; }
  .cs-ready .p6-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: visible; background: var(--bg); }
  .cs-ready #c { position: absolute; inset: 0; width: 100%; height: 100%; display: block; clip-path: inset(0); }

  /* captions: the live site's caption type (500, tight), words rise from masks like on the live site */
  /* the letter: written line under line at the top (right column on desktop), in the heading family, and kept on screen */
  .p6-caps { position: absolute; left: var(--edge); right: var(--edge-r); transform-origin: 0 0; top: calc(env(safe-area-inset-top, 0px) + 78px); z-index: 2; pointer-events: none; color: var(--fg, #171717); }
  .p6-caps::before { content: ""; position: absolute; left: -50vw; right: -50vw; top: -200px; height: calc(270px + var(--washh, 0px)); background: linear-gradient(to bottom, var(--wash, rgba(245,245,242,.92)) 0, var(--wash, rgba(245,245,242,.92)) calc(100% - 70px), rgba(0,0,0,0) 100%); z-index: -1; opacity: var(--washa, 1); }
  .p6-cap { position: relative; margin: 0; visibility: hidden; font-family: "Wise Display Var", var(--font); font-size: clamp(28px, min(10.6vw, 6svh), 64px); font-weight: 700; line-height: .98; letter-spacing: .005em; text-transform: uppercase; transform-origin: 0 0; }
  .p6-cap .cl { display: block; white-space: nowrap; }   /* one line each; JS sets every line's size so it runs exactly edge to edge */
  .p6-cap { letter-spacing: 0; }
  .p6-cap .cw { line-height: .98; vertical-align: var(--bl, 0); }   /* small and big words share one baseline */
  .p6-cap .cw + .cw { margin-left: var(--spw, .15em); }   /* the word gap in each word's own size */
  .p6-hello { position: absolute; left: 0; right: 0; top: 0; }   /* the greeting: shown first, then it leaves (not part of the letter) */
  .p6-caps .cw { transform-origin: 0 0; }
  @media (min-width: 900px) {
    .p6-caps { left: auto; right: var(--edge-r); width: clamp(340px, 27vw, 440px); transform-origin: 100% 0; top: 104px; }
    .p6-cap { font-size: clamp(36px, 3.2vw, 56px); }
    .p6-caps::before { left: -200px; right: -220px; top: -260px; height: calc(480px + var(--washh, 0px)); background: radial-gradient(closest-side, var(--wash, rgba(245,245,242,.92)) 62%, rgba(0,0,0,0) 100%); }   /* a soft oval, no box edges */
  }

  /* the form the story lands on: the live form section, over the stage from the start, invisible; it stays put when the story ends */
  .p6-form { --fa: 1; --bd: 1; --eb: 1; --dot: 1;
    padding: calc(env(safe-area-inset-top, 0px) + max(104px, 14svh)) 0 clamp(64px, 9vw, 120px); }
  .cs-ready .p6-form { position: absolute; top: 0; left: 0; right: 0; z-index: 3; visibility: hidden; pointer-events: none; --fa: 0; --bd: 0; --eb: 0; --dot: 0; }
  .p6-form .apply-intro { position: static; }
  .p6-form:not(.is-live) [data-w] { opacity: 0; }
  .p6-form .eyebrow span { color: rgba(23, 23, 23, var(--eb)); }
  .p6-form .eyebrow span::before { opacity: var(--dot, 0); }
  /* About, its own section under the form, like on the live site; 1K+ "placed since 2021" takes the right column */
  .p6-about { border-top: 1px solid var(--line) !important; padding-top: clamp(72px, 9vw, 136px) !important; }
  .p6-count { display: grid; gap: 10px; align-content: start; }
  .p6-num { font-family: var(--font); font-weight: 700; font-size: clamp(72px, 8vw, 136px); line-height: .9; letter-spacing: -0.035em; }
  .p6-num-sub { font-size: clamp(15px, 1.25vw, 18px); }
  @media (max-width: 640px) { .p6-form { padding-top: calc(env(safe-area-inset-top, 0px) + 92px); } .p6-about { padding-top: 64px !important; } }
  /* while the lines are landing, the form's own lines and words wait for them */
  .p6-form:not(.is-live) .file > *:not(input), .p6-form:not(.is-live) .form-submit { opacity: var(--fa); }
  .p6-form:not(.is-live) .field input:not([type="file"]) { border-bottom-color: rgba(23, 23, 23, calc(0.32 * var(--bd))); }
  .p6-form:not(.is-live) .file { border-color: rgba(23, 23, 23, calc(0.32 * var(--bd))); }

  /* the header turns light while the story is at night */
  .topbar .topbar-link { transition: color 0.35s ease, background-size 0.3s var(--ease); }
  .topbar .btn { transition: background-color 0.35s ease, color 0.35s ease, transform 0.2s var(--ease); }
  .topbar.is-night .topbar-link { color: rgba(242, 242, 239, 0.66); }
  .topbar.is-night .btn { background: #F2F2EF; color: #171717; }
  .topbar::before { content: ""; position: absolute; inset: 0 0 -20px; z-index: -1; pointer-events: none; opacity: 0; transition: opacity .3s ease;
    background: linear-gradient(var(--bg) 64%, rgba(245, 245, 242, 0)); }
  .topbar.is-over::before { opacity: 1; }

  /* probe controls: only while the story is on screen */
  .hud { position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); display: flex; gap: 8px; align-items: center; padding: 7px 10px; border-radius: 999px; background: rgba(23,23,23,.84); color: #F2F2EF; font: 12px/1 ui-monospace, "SF Mono", Menlo, monospace; z-index: 30; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: opacity .3s ease, transform .3s ease; }
  .hud.is-off { opacity: 0; transform: translateY(12px); pointer-events: none; }
  .hud button { all: unset; cursor: pointer; padding: 7px 11px; border-radius: 999px; background: var(--accent); color: #171717; font-weight: 600; }
  .hud button.ghost { background: transparent; color: #F2F2EF; box-shadow: inset 0 0 0 1px rgba(242,242,239,.35); }
  .hud input { flex: 1; accent-color: var(--accent); min-width: 0; }
  .hud .num { font-variant-numeric: tabular-nums; opacity: .75; white-space: nowrap; }
  @media (min-width: 760px) { .hud { left: auto; width: 460px; } }
  .p6-note { font-size: 13px; color: var(--muted); }
  /* phone: a compact form that fits about one screen. Each label sits inside its field (small, at the top of the line once
     there is a value; at the input's size while empty). The rhythm follows the screen's height, within limits. */
  @media (max-width: 640px) {
    .p6-form { --fh: clamp(40px, 5.7svh, 52px); --fg: clamp(2px, .6svh, 8px);
      padding-top: calc(env(safe-area-inset-top, 0px) + clamp(70px, 10svh, 96px)); padding-bottom: clamp(32px, 6svh, 64px); }
    .p6-form .apply-grid { gap: clamp(10px, 2svh, 22px); }
    .p6-form .apply-intro .eyebrow { margin-bottom: clamp(8px, 1.5svh, 16px); }
    .p6-form .apply-intro .apply-note { margin-top: clamp(4px, 1svh, 10px); font-size: 15px; }
    .p6-form .form { gap: var(--fg); }
    .p6-form .form-row, .p6-form .form-row-names { gap: var(--fg) 14px; }
    .p6-form .field { position: relative; gap: 0; }
    .p6-form .field:not(.field-file) > label { position: absolute; left: 0; top: 5px; font-size: 12px; line-height: 1; white-space: nowrap; }
    .p6-form .field input:not([type="file"]) { height: var(--fh); padding-top: calc(var(--fh) * .32); font-size: 16px; }
    .p6-form .field-error { padding-top: 2px; padding-bottom: 4px; }
    .p6-form .field-file { margin-top: clamp(8px, 1.6svh, 16px); gap: 6px; }
    .p6-form .field .label { font-size: 12px; }
    .p6-form .file { min-height: clamp(52px, 7svh, 64px); padding: 9px 10px 9px 14px; }
    .p6-form .form-submit { margin-top: clamp(8px, 1.6svh, 16px); gap: 10px; }
  }
  /* v30: the form speaks in a small mono, set apart from the display type of the story; what you type stays in the site face
     at 16px (smaller makes the iPhone zoom in on focus) */
  @media (max-width: 640px) {
    .p6-form .field label, .p6-form .field .label, .p6-form .apply-note, .p6-form .file-name, .p6-form .file-meta, .p6-form .file-action,
    .p6-form .consent, .p6-form .field-error, .p6-form .form-error, .p6-form .btn { font-family: var(--mono); }
    .p6-form .field:not(.field-file) > label, .p6-form .field .label { font-size: 10.5px; font-weight: 400; text-transform: uppercase; letter-spacing: .07em; }
    .p6-form .field:not(.field-file) > label { top: 6px; }
    .p6-form .apply-intro .apply-note { font-size: 12px; letter-spacing: 0; max-width: none; }
    .p6-form .file-name { font-size: 13px; }
    .p6-form .file-meta { font-size: 10.5px; letter-spacing: .02em; }
    .p6-form .file-action { font-size: 10.5px; font-weight: 500; text-transform: uppercase; letter-spacing: .07em; padding: 8px 12px; }
    .p6-form .btn-large { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .1em; padding: 17px 24px; }
    .p6-form .consent { font-size: 10.5px; line-height: 1.5; letter-spacing: 0; }
    .p6-form .field-error { font-size: 11px; }
  }
  /* v32: the hints and what you type in the same mono; the form narrower than the screen, and about 15% taller: more room between fields */
  @media (max-width: 640px) {
    .p6-form .wrap { padding-left: max(clamp(28px, 8.5vw, 44px), env(safe-area-inset-left, 0px)); padding-right: max(clamp(28px, 8.5vw, 44px), env(safe-area-inset-right, 0px)); }
    .p6-form { --fh: clamp(48px, 7svh, 62px); --fg: clamp(5px, 1.3svh, 13px); }
    .p6-form .field input:not([type="file"]) { font-family: var(--mono); letter-spacing: -.01em; }
    .p6-form .field input::placeholder { font-family: var(--mono); font-size: 13px; letter-spacing: .01em; }
    .p6-form .apply-grid { gap: clamp(12px, 2.4svh, 26px); }
    .p6-form .field-file { margin-top: clamp(10px, 2svh, 20px); }
    .p6-form .file { min-height: clamp(58px, 7.8svh, 72px); }
    .p6-form .form-submit { margin-top: clamp(10px, 2svh, 20px); }
  }
  @supports selector(:has(*)) { @media (max-width: 640px) {
    .p6-form .field:has(> input:placeholder-shown:not(:focus)) > label,
    .p6-form .field:has(> .combo > input:placeholder-shown:not(:focus)) > label { transform: translateY(calc(var(--fh) * .66 - 11px)) scale(1.24); }
  } }
  /* what was typed leaves with the form when you scroll back up, and comes back with it */
  .p6-form:not(.is-live) .field input { color: rgba(23,23,23,var(--fa)); -webkit-text-fill-color: rgba(23,23,23,var(--fa)); }
  .p6-form:not(.is-live) .apply-note { opacity: var(--fa); }

  /* no probe controls on the real page */
  .hud { display: none !important; }



/* Facts under About, type only: no boxes, no accent marks, no counting up. One hairline system; numbers in the site font
   with proportional figures and normal tracking (tabular figures left a gap after the "1" of 1000+). On phones each
   number and its caption sit on one row, so every caption gets the same single line. */
.cs-facts { margin-top: clamp(40px, 5vw, 72px); }
.cs-nums { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cs-fact { display: grid; gap: 14px; align-content: start; padding: clamp(24px, 2.6vw, 36px) clamp(18px, 2vw, 28px) clamp(26px, 2.8vw, 40px); border-left: 1px solid var(--line); }
.cs-fact:first-child { border-left: 0; padding-left: 0; }
.cs-num { margin: 0; font-family: var(--font); font-weight: 600; font-size: clamp(48px, 4.8vw, 76px); line-height: 1; letter-spacing: -0.02em; font-variant-numeric: lining-nums proportional-nums; color: var(--ink); }
.cs-fact dd { margin: 0; font-size: 15px; line-height: 1.35; color: var(--muted); }
@media (max-width: 760px) {
  /* phones: two by two, number over its caption, like the desktop row folded in half */
  .cs-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); border-bottom: 0; }
  .cs-fact, .cs-fact:first-child { grid-template-columns: none; gap: 8px; padding: 22px 0 24px 18px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .cs-fact:nth-child(odd) { border-left: 0; padding-left: 0; padding-right: 18px; }   /* both cells keep 18px off the divider, so the two columns are the same */
  .cs-num { font-size: 44px; }
  .cs-fact dd { font-size: 14px; }
}


/* Block 02: where we work, as one line of text going slowly round, next to the numbers. Plain type on a circle. */
.cs-orbit { justify-self: end; align-self: end; width: clamp(176px, 19vw, 272px); aspect-ratio: 1; }
.cs-orbit svg { display: block; width: 100%; height: 100%; overflow: visible; }
.cs-orbit { position: relative; }
.cs-globe { position: absolute; left: 21%; top: 21%; width: 58%; height: 58%; pointer-events: none; }   /* inside the ring of text; it turns by itself */
.cs-orbit text { font-family: "Wise Display Var", var(--font); font-weight: 600; font-size: 20.2px; letter-spacing: .12em; fill: var(--ink); }
.cs-orbit .cs-orbit-muted { fill: var(--muted); }
@media (prefers-reduced-motion: no-preference) { .cs-orbit svg { animation: cs-orbit 60s linear infinite; } }
@keyframes cs-orbit { to { transform: rotate(360deg); } }
@media (max-width: 900px) { .cs-orbit { justify-self: center; width: min(68vw, 280px); margin-top: 16px; } }   /* one column: the circle sits in the middle */


/* Footer, candidate page: inverted (ink ground, paper type), with room above. The two links one under the other (their arrows
   slide on hover), the small print on one line, and right under it the name in caps, edge to edge, its bottom cut off by the page. */
.footer-big { padding-bottom: 0; overflow: hidden; background: var(--ink); color: var(--bg); margin-top: clamp(48px, 8vw, 120px); }
.footer-row { display: flex; flex-direction: column; gap: clamp(56px, 9vw, 120px); padding-top: clamp(72px, 11vw, 160px); }
.footer-social { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }   /* one under the other */
.footer-a { display: inline-flex; align-items: center; gap: .18em; font-size: clamp(30px, 3vw, 44px); font-weight: 500; line-height: 1.1; letter-spacing: -0.03em; color: var(--bg); text-decoration: none; }
.arr { position: relative; display: inline-block; width: .62em; height: .62em; overflow: hidden; flex: none; }
.arr svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: square; transition: transform .45s var(--ease); }
.arr svg + svg { transform: translate(-110%, 110%); }
@media (hover: hover) {
  .footer-a:hover .arr svg:first-child, .footer-a:focus-visible .arr svg:first-child { transform: translate(110%, -110%); }
  .footer-a:hover .arr svg + svg, .footer-a:focus-visible .arr svg + svg { transform: none; }
}
.footer-small { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 20px; }   /* one line: the copyright left, the two links right, one size and colour */
.footer-small .copyright, .footer-small .footer-links a { font-size: clamp(12px, 3.2vw, 14px); line-height: 1.3; color: rgba(245, 245, 242, .6); white-space: nowrap; }
.footer-small .copyright { margin: 0; width: auto; }
.footer-small .footer-links { margin: 0; gap: 6px clamp(14px, 4vw, 28px); flex-wrap: nowrap; }
@media (max-width: 640px) { .footer-small .lg { display: none; } }   /* phones: short link names keep the small print on one line */
.footer-word { display: block; width: 100%; height: auto; aspect-ratio: 660.4 / 67; margin-top: 12px; overflow: visible; fill: var(--bg); }   /* glued to the small print; the page cuts its bottom */
/* during the pull the footer box rides up with the page: its ink runs on below it (a shadow, which never adds scroll), and the name's bottom may hang out of the box */
html.cs-pull .footer-big { overflow: visible; box-shadow: 0 160px 0 0 var(--ink); }
html.cs-end { overscroll-behavior-y: none; }   /* at the end of the page the pull goes into the stems, not the bounce */

/* until the story is ready, the form waits instead of flashing up first (and shows anyway after 4 s if the story never comes) */
.cs-pending:not(.cs-ready) .p6-form { visibility: hidden; animation: cs-show 0s 4s forwards; }
@keyframes cs-show { to { visibility: visible; } }

/* One paper grain over the whole page, on light and on dark (the intro's own grain is this one): black and white specks,
   very low alpha, static. It is the texture of the CV paper, kept from the first frame to the footer. */
body::after { content: ""; position: fixed; inset: 0; z-index: 2147483000; pointer-events: none; opacity: .5; transition: opacity .3s; background: url("assets/img/grain.png") 0 0 / 128px 128px repeat; }
.cs-dark body::after { opacity: 0; }

/* the form title speaks in the letter's voice, so the letter lands in it */
:root { --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, "Roboto Mono", "Cascadia Mono", Consolas, monospace; }
.p6-form .section-title { font-family: "Wise Display Var", var(--font); font-weight: 700; text-transform: uppercase; letter-spacing: .005em; line-height: .98; font-size: clamp(30px, 8.2vw, 52px); }
@media (min-width: 900px) { .p6-form .section-title { font-size: clamp(40px, 3.4vw, 58px); } }
