/* ---------------------------------------------------------------
   Formwork Studios
   Light, paper-like. Warm ground, one typeface, no JavaScript.
   --------------------------------------------------------------- */

@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/archivo-latin-var.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F, U+2122, U+2212, U+FEFF, U+FFFD;
}

:root {
  --paper:      #f2efe9;   /* warm off-white ground */
  --panel:      #ece8e0;   /* one step deeper, for blocks */
  --ink:        #141210;   /* near-black, slightly warm */
  --muted:      #6f685d;   /* secondary type */
  --rule:       rgba(20, 18, 16, 0.13);
  --rule-soft:  rgba(20, 18, 16, 0.07);

  --gutter:  clamp(1.25rem, 5vw, 2.5rem);
  --section: clamp(3.5rem, 9vw, 6.5rem);
  --measure: 36rem;

  --font: "Archivo", ui-sans-serif, -apple-system, BlinkMacSystemFont,
          "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;

  font-family: var(--font);
  font-weight: 400;
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--paper);

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ---- skeleton -------------------------------------------------- */

.container {
  width: 100%;
  max-width: 68rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

main { flex: 1 0 auto; }

.section { padding-block: var(--section); }
.section + .section { padding-top: 0; }
.section--ruled { border-top: 1px solid var(--rule-soft); padding-top: var(--section); }

/* Parked off-canvas with a transform rather than a negative offset, so it
   never contributes to the page's scrollable width on small screens. */
.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  border-radius: 0 0 4px 0;
  transform: translateY(-130%);
  transition: transform 180ms var(--ease);
}
.skip-link:focus { transform: none; }

@media (prefers-reduced-motion: reduce) {
  .skip-link { transition: none; }
}

/* ---- the mark -------------------------------------------------- */

/* The icon is a CSS mask, so assets/mark.svg stays the single source of
   truth: swap that one file and the logo changes everywhere. The mask
   takes its colour from currentColor, so it recolours on hover. */
.glyph {
  display: block;
  flex: none;
  aspect-ratio: 1 / 1;
  background-color: currentColor;
  -webkit-mask: url("/assets/mark.svg") center / contain no-repeat;
          mask: url("/assets/mark.svg") center / contain no-repeat;
}

/* ---- header ---------------------------------------------------- */

.site-header {
  border-bottom: 1px solid var(--rule-soft);
  background-color: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-block: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
  transition: color 280ms var(--ease);
}
.brand:hover, .brand:focus-visible { color: var(--muted); }

.brand .glyph { width: 1.75rem; }

.brand__name {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(0.85rem, 2.4vw, 1.75rem);
}

.nav a {
  color: var(--muted);
  font-size: 0.9375rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  padding-block: 0.25rem;
  border-bottom: 1px solid transparent;
  transition: color 240ms var(--ease), border-color 240ms var(--ease);
}
.nav a:hover, .nav a:focus-visible { color: var(--ink); border-bottom-color: var(--rule); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }

/* ---- type ------------------------------------------------------ */

h1, h2, h3 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.12;
  text-wrap: balance;
}

h1 { font-size: clamp(2rem, 1.35rem + 2.7vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 1.25rem + 1.1vw, 2.125rem); }
h3 { font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem); letter-spacing: -0.015em; }

p { margin: 0; }

a { color: inherit; }

a[href^="mailto:"] { overflow-wrap: break-word; }

.eyebrow {
  margin: 0 0 1.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.lede {
  max-width: var(--measure);
  font-size: clamp(1.0625rem, 1rem + 0.45vw, 1.3125rem);
  line-height: 1.5;
  color: var(--muted);
  text-wrap: pretty;
}

.stack     > * + * { margin-top: 1.125rem; }
.stack-lg  > * + * { margin-top: 2rem; }
.stack-xl  > * + * { margin-top: clamp(2.5rem, 5vw, 3.5rem); }

.measure { max-width: var(--measure); }

/* ---- hero ------------------------------------------------------ */

.hero { padding-block: clamp(3.5rem, 10vw, 7.5rem) var(--section); }

.hero h1 + .lede { margin-top: clamp(1.25rem, 2.5vw, 1.75rem); }
.hero .lede + p  { margin-top: clamp(1.75rem, 3.5vw, 2.5rem); }

.hero .glyph {
  width: clamp(56px, 10vw, 76px);
  color: var(--ink);
  margin-bottom: clamp(1.75rem, 4vw, 2.5rem);
}

.hero h1 { max-width: 20ch; }

/* ---- links ----------------------------------------------------- */

.link {
  --line: rgba(20, 18, 16, 0.38);
  color: var(--ink);
  text-decoration: none;
  background-image: linear-gradient(var(--line), var(--line));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 1px;
  padding-bottom: 0.15em;
  transition: background-size 300ms var(--ease), color 240ms var(--ease);
}
.link:hover, .link:focus-visible { --line: currentColor; }

.link--quiet { color: var(--muted); }
.link--quiet:hover, .link--quiet:focus-visible { color: var(--ink); }

.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.375rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: color 240ms var(--ease), background-color 240ms var(--ease);
}
.cta:hover, .cta:focus-visible { background-color: var(--ink); color: var(--paper); }
.cta::after { content: "\2192"; transition: transform 240ms var(--ease); }
.cta:hover::after { transform: translateX(3px); }

/* ---- grids ----------------------------------------------------- */

/* min() on the track floor so a column can never be wider than the
   container it sits in — otherwise the grid pushes the page sideways on
   very narrow screens. */
.grid {
  display: grid;
  gap: clamp(1.5rem, 3.5vw, 2.5rem);
  grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr));
}

.grid--halves { grid-template-columns: repeat(auto-fit, minmax(min(20rem, 100%), 1fr)); }

/* Four items: pair them 2x2 rather than leaving one stranded on its own row. */
.grid--2up { grid-template-columns: repeat(auto-fit, minmax(min(24rem, 100%), 1fr)); }

.tile {
  padding-top: 1.5rem;
  border-top: 2px solid var(--ink);
}
.tile h3 { margin-bottom: 0.625rem; }
.tile p  { color: var(--muted); text-wrap: pretty; }

.panel {
  padding: clamp(1.75rem, 4vw, 2.75rem);
  background-color: var(--panel);
  border: 1px solid var(--rule-soft);
  border-radius: 6px;
}

/* ---- definition rows ------------------------------------------- */

.rows { border-top: 1px solid var(--rule); }

.row {
  display: grid;
  grid-template-columns: minmax(8rem, 14rem) 1fr;
  gap: 0.5rem clamp(1.5rem, 4vw, 3rem);
  padding-block: 1.5rem;
  border-bottom: 1px solid var(--rule);
}
@media (max-width: 40rem) {
  .row { grid-template-columns: 1fr; }
}

.row dt { font-weight: 600; letter-spacing: -0.01em; }
.row dd { margin: 0; color: var(--muted); text-wrap: pretty; }

dl.rows { margin: 0; }

/* ---- status note ----------------------------------------------- */

.note {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.9375rem;
  text-wrap: pretty;
}
.note::before {
  content: "";
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  margin-top: 0.5rem;
  border-radius: 999px;
  background-color: var(--ink);
}

/* ---- prose (legal + notes) ------------------------------------- */

.prose { max-width: 40rem; }

.prose h2 {
  margin-top: clamp(2.5rem, 5vw, 3.25rem);
  margin-bottom: 0.875rem;
  font-size: clamp(1.1875rem, 1.1rem + 0.5vw, 1.4375rem);
}

.prose h3 {
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.prose p,
.prose ul,
.prose ol { margin-top: 1rem; color: var(--muted); text-wrap: pretty; }

.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li + li { margin-top: 0.5rem; }

.prose strong { color: var(--ink); font-weight: 600; }

.prose a { color: var(--ink); text-underline-offset: 0.2em; }

.meta {
  margin-top: 1.25rem;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}

/* ---- notes index ----------------------------------------------- */

.entries { border-top: 1px solid var(--rule); }

.entry {
  display: block;
  padding-block: clamp(1.5rem, 3vw, 2rem);
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  color: inherit;
}
.entry:hover h3, .entry:focus-visible h3 { color: var(--muted); }
.entry h3 { transition: color 240ms var(--ease); }
.entry p { margin-top: 0.5rem; color: var(--muted); max-width: var(--measure); }
.entry time {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---- footer ---------------------------------------------------- */

.site-footer {
  flex: none;
  border-top: 1px solid var(--rule);
  padding-block: clamp(2.5rem, 6vw, 4rem) 2rem;
  font-size: 0.9375rem;
}

.site-footer__inner {
  display: grid;
  gap: clamp(2rem, 5vw, 3rem);
  grid-template-columns: minmax(16rem, 1.4fr) 2fr;
}
@media (max-width: 46rem) {
  .site-footer__inner { grid-template-columns: 1fr; }
}

.site-footer__about .glyph { width: 1.5rem; color: var(--ink); margin-bottom: 0.875rem; }
.site-footer__about p { color: var(--muted); max-width: 26rem; }
.site-footer__about .legal-name { color: var(--ink); font-weight: 600; }

.site-footer__nav {
  display: grid;
  gap: 1.5rem 2rem;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
}

.site-footer__nav h2 {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.875rem;
}

.site-footer__nav ul { list-style: none; margin: 0; padding: 0; }
.site-footer__nav li + li { margin-top: 0.5rem; }
.site-footer__nav a { color: var(--muted); text-decoration: none; }
.site-footer__nav a:hover, .site-footer__nav a:focus-visible {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule-soft);
  font-size: 0.875rem;
  color: var(--muted);
}

/* The email address is one unbreakable word; space-between would otherwise
   push it past the right edge before the row agrees to wrap. */
.site-footer__legal > * { min-width: 0; }

@media (max-width: 34rem) {
  .site-footer__legal { display: block; }
  .site-footer__legal > * + * { margin-top: 0.5rem; }
}

/* ---- focus ----------------------------------------------------- */

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

/* ---- entrance -------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  .hero > * { animation: rise 720ms var(--ease) backwards; }
  .hero > *:nth-child(1) { animation-delay:  40ms; }
  .hero > *:nth-child(2) { animation-delay: 140ms; }
  .hero > *:nth-child(3) { animation-delay: 240ms; }
  .hero > *:nth-child(4) { animation-delay: 340ms; }

  @keyframes rise {
    from { opacity: 0; transform: translateY(0.6rem); }
    to   { opacity: 1; transform: none; }
  }
}

/* ---- print ----------------------------------------------------- */

@media print {
  .site-header, .site-footer__nav, .skip-link { display: none; }
  body { background: #fff; color: #000; }
}

/* ---- inline code ----------------------------------------------- */

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
               "Liberation Mono", monospace;
  font-size: 0.875em;
  padding: 0.1em 0.35em;
  background-color: var(--panel);
  border: 1px solid var(--rule-soft);
  border-radius: 3px;
  overflow-wrap: break-word;
}

.prose p > code:only-child {
  display: block;
  padding: 1rem 1.125rem;
  line-height: 1.7;
}

/* ---- postal address -------------------------------------------- */

/* <address> is italic by default in every browser; this is a postal
   address, not an aside, so it reads as plain text. */
address {
  font-style: normal;
  line-height: 1.55;
}

.site-footer__about address {
  margin-top: 0.875rem;
  color: var(--muted);
}

.prose address {
  margin-top: 1rem;
  color: var(--muted);
}

.stack > h3 + address { margin-top: 0.625rem; }

.muted-note {
  color: var(--muted);
  font-size: 0.9375rem;
  text-wrap: pretty;
}
