/* phaseworks site. Tokens and pw-* components follow docs/design system (Paper, and Night in dark mode),
   except the typeface: the site is set in Inter, with Google Sans Code for the ASCII wave and mono glyphs (see AGENTS.md). */

/* Inter comes as two files under one family. The browser reads the rules last to first for each
   character: inter.woff2 (Latin and extended Latin, made by tools/subset-inter.py) covers the site,
   and InterVariable.woff2 (the full upstream font) is fetched only for a character outside that range. */
@font-face {
  font-family: Inter;
  src: url("fonts/InterVariable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: Inter;
  src: url("fonts/inter.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-024F, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+1E00-1E9F,
    U+2000-206F, U+20A0-20C0, U+2122, U+2190-2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Google Sans Code";
  src: url("fonts/google-sans-code.woff2") format("woff2");
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
}

/* Tokens, copied from tokens.css, except --font-sans, which names Inter where the design system has Geist,
   and --font-wordmark and --font-control, which exist only on the website. Paper is the default theme. */
:root {
  --ground: #f4f8f8;
  --ink: #17252c;
  --ink-faint: #5f7178;
  --rule: #d3dfdf;
  --field: #2c7676;
  --trace: #a85428;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;
  --measure: 42rem;
  --hairline: 1px;
  --focus: 2px;
  --font-sans: Inter, system-ui, sans-serif;
  --font-mono: "Google Sans Code", ui-monospace, SFMono-Regular, Menlo, monospace;
  /* Website-only tokens: which of the two faces a part of the page uses. Change the value to switch. */
  --font-wordmark: var(--font-sans);  /* the name in the masthead; its weight and letter-spacing are tuned for Inter */
  --font-control: var(--font-sans);   /* navigation, button, footer; var(--font-mono) sets them in Google Sans Code */

  color-scheme: light dark;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Night: the design system's dark theme, when the browser asks for it. */
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #15262b;
    --ink: #f4f8f8;
    --ink-faint: #8fa6aa;
    --rule: #2d3e42;
    --field: #75d1cc;
    --trace: #f08d83;
  }
}

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

/* The page: one centred column at measure. */
body {
  box-sizing: content-box;
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(var(--space-6), 6vw, var(--space-16)) clamp(var(--space-6), 5vw, var(--space-12)) var(--space-12);
  background: var(--ground);
  color: var(--ink);
  font: 400 16px/1.75 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
main { margin-top: var(--space-8); }

p, ul { margin: 0 0 var(--space-4); }
p, li { text-wrap: pretty; }
ul { padding-left: 1.25rem; }
li + li { margin-top: var(--space-3); }
strong { font-weight: 600; }

a:focus-visible { outline: var(--focus) solid var(--ink); outline-offset: 3px; }

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

/* Wordmark: the name in Inter Medium, always lowercase (the company name is "phaseworks"). 40px in the masthead, scaling down to 24px on narrow screens. */
.pw-wordmark {
  margin: 0;
  font: 500 clamp(1.5rem, 11vw, 2.5rem)/1.1 var(--font-wordmark);
  letter-spacing: -.05em;
  color: var(--ink);
}

/* Wave: a small ASCII wave field beside the wordmark. wave.js animates it and opens it over the viewport. */
.pw-wave, .pw-wave-full pre {
  font: 400 9px/9px var(--font-mono);
  letter-spacing: 0;
  white-space: pre;
  color: var(--field);
  -webkit-user-select: none;
  user-select: none;
}
.pw-wave {
  display: inline-block;
  margin-right: var(--space-3);
  vertical-align: middle;
}
.pw-wave[role="button"] { cursor: pointer; }
.pw-wave:focus-visible { outline: var(--focus) solid var(--ink); outline-offset: 3px; }
.pw-wave-full {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  background: var(--ground);
  cursor: pointer;
  visibility: hidden;
  transition: clip-path .7s cubic-bezier(.3, 0, .2, 1), visibility 0s .7s;
}
.pw-wave-full.is-open { visibility: visible; transition-delay: 0s; }
.pw-wave-full pre { position: absolute; margin: 0; }
@media (prefers-reduced-motion: reduce) {
  .pw-wave-full { transition: none; }
}

/* Masthead: wordmark left, nav right, hairline under. Nav wraps beneath on narrow screens. */
.pw-masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2) var(--space-8);
  padding-bottom: var(--space-4);
  border-bottom: var(--hairline) solid var(--rule);
}
.pw-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-6);
  font: 400 14px/1.5 var(--font-control);
}
.pw-nav a {
  padding-block: var(--space-1);
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .24em;
}
.pw-nav a:hover { text-decoration-thickness: 2px; }
.pw-nav a[aria-current] { text-decoration: none; }
/* The current-item marker is a glyph from the mono face, like all iconography; the link text stays in Inter. */
.pw-nav a[aria-current]::before { content: "> "; font-family: var(--font-mono); color: var(--trace); }

/* Action: the one primary button. */
.pw-btn {
  display: inline-flex;
  align-items: center;
  height: 40px;
  margin-top: var(--space-4);
  padding: 0 var(--space-4);
  border: var(--hairline) solid var(--ink);
  background: var(--ink);
  color: var(--ground);
  font: 500 14px/1 var(--font-control);
  text-decoration: none;
}
.pw-btn:hover { background: var(--ground); color: var(--ink); }

.pw-footer {
  margin-top: var(--space-8);
  padding-top: var(--space-4);
  border-top: var(--hairline) solid var(--rule);
  font: 400 13px/1.5 var(--font-control);
  color: var(--ink-faint);
}
