/*
Theme Name: Codevwork
Theme URI: https://codevwork.com
Author: Codevwork
Description: The codevwork.com block theme: the "engineered studio" design (Geist, the drafting grid, the commit graphs and the ink-tile cw monogram) as theme.json tokens, parts, templates and patterns.
Requires at least: 6.7
Tested up to: 7.1
Requires PHP: 8.1
Version: 1.0.0
License: Proprietary
Text Domain: codevwork
*/

/* Codevwork site styles: "engineered studio". Ported from the plain-PHP site's
 * public/assets/css/site.css; the component rules below the tokens are that file's, unchanged, and
 * the WordPress adaptations are all at the end ("WordPress").
 *
 * Light paper with a faint drafting grid, one typeface (Geist, self-hosted, SIL OFL 1.1, see
 * assets/fonts/OFL.txt, loaded through theme.json fontFace), small monospace labels in the system
 * mono stack, and one signature motif: the commit graph (static SVGs from bin/mosaic.php, shown by the
 * graph-* patterns). Everything else stays quiet so the graphs and the app colours carry the personality.
 *
 * Tokens: theme.json is the source of every light value (palette, font sizes, custom). The short names
 * below alias them. Dark mode is automatic (prefers-color-scheme) and swaps the preset values
 * themselves, so a palette colour picked in the editor follows the scheme too. theme.json has no
 * dark mode, which is why the dark values live here.
 */

:root {
  color-scheme: light dark;

  /* Colour */
  --paper: var(--wp--preset--color--paper);
  --surface: var(--wp--preset--color--surface);
  --ink: var(--wp--preset--color--ink);
  --ink-2: var(--wp--preset--color--ink-2);
  --ink-3: var(--wp--preset--color--ink-3);
  --line: var(--wp--preset--color--line);
  --line-strong: var(--wp--preset--color--line-strong);  /* form control borders: 3:1 or more on --paper and --surface */
  --grid: var(--wp--preset--color--grid);
  --focus: var(--wp--preset--color--focus);
  --danger: var(--wp--preset--color--danger);
  --danger-soft: var(--wp--preset--color--danger-soft);

  --perawise: var(--wp--preset--color--perawise);
  --lendey: var(--wp--preset--color--lendey);
  --anoto: var(--wp--preset--color--anoto);
  --mark-accent: var(--wp--preset--color--mark-accent);  /* the rust pixel on the ink logo tile */

  --tint-perawise: var(--wp--preset--color--tint-perawise);
  --tint-lendey: var(--wp--preset--color--tint-lendey);
  --tint-anoto: var(--wp--preset--color--tint-anoto);

  --apple: var(--wp--preset--color--apple);
  --apple-ink: var(--wp--preset--color--apple-ink);
  --android: var(--wp--preset--color--android);
  --android-ink: var(--wp--preset--color--android-ink);

  --button: var(--wp--preset--color--button);
  --button-ink: var(--wp--preset--color--button-ink);

  --raise: var(--wp--preset--color--raise);  /* fact cards lift off a tinted panel by mixing this in */
  --raise-mix: var(--wp--custom--raise-mix);

  /* Type */
  --sans: var(--wp--preset--font-family--sans);
  --mono: var(--wp--preset--font-family--mono);

  --t-label: var(--wp--preset--font-size--label);           /* 11px mono caps */
  --t-small: var(--wp--preset--font-size--small);           /* 14 */
  --t-body: var(--wp--preset--font-size--body);             /* 17 */
  --t-lead: var(--wp--preset--font-size--lead);             /* 19 to 22 */
  --t-h3: var(--wp--preset--font-size--title);              /* 19 */
  --t-h2: var(--wp--preset--font-size--heading);            /* 28 to 44 */
  --t-pov: var(--wp--preset--font-size--pov);               /* 23 to 34 */
  --t-h1: var(--wp--preset--font-size--page-title);         /* 36 to 68 */
  --t-display: var(--wp--preset--font-size--display);       /* 42 to 100 */

  /* Space and shape */
  --cell: var(--wp--custom--cell);                  /* the drafting grid */
  --gutter: var(--wp--custom--gutter);
  --wrap: var(--wp--custom--wrap);
  --measure: var(--wp--custom--measure);
  --section: var(--wp--custom--section);
  --notch: var(--wp--custom--notch);                /* stepped corners on buttons and badges */
  --radius-panel: var(--wp--custom--radius-panel);
  --radius-card: var(--wp--custom--radius-card);
}

/* :root:root outranks the :root block WordPress prints the presets in, whatever the stylesheet order. */
@media (prefers-color-scheme: dark) {
  :root:root {
    --wp--preset--color--paper: #0e1011;
    --wp--preset--color--surface: #171a1b;
    --wp--preset--color--ink: #e8eae5;
    --wp--preset--color--ink-2: #b3b8b1;
    --wp--preset--color--ink-3: #9a9f99;
    --wp--preset--color--line: #2a2e2d;
    --wp--preset--color--line-strong: #727871;
    --wp--preset--color--grid: rgb(232 234 229 / 0.028);
    --wp--preset--color--focus: #86d2a6;
    --wp--preset--color--danger: #ff8f80;
    --wp--preset--color--danger-soft: #2b1714;

    --wp--preset--color--perawise: #6fb88b;
    --wp--preset--color--lendey: #86d2a6;
    --wp--preset--color--anoto: #e8805a;
    --wp--preset--color--mark-accent: #a9472a;

    --wp--preset--color--tint-perawise: #171d16;
    --wp--preset--color--tint-lendey: #0f211e;
    --wp--preset--color--tint-anoto: #24170f;

    --wp--preset--color--apple: #e8805a;
    --wp--preset--color--apple-ink: #0e1011;
    --wp--preset--color--android: #86d2a6;
    --wp--preset--color--android-ink: #0e1011;

    --wp--preset--color--button: #e8eae5;
    --wp--preset--color--button-ink: #0e1011;

    --wp--preset--color--raise: #ffffff;
    --wp--custom--raise-mix: 7%;
  }
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: var(--cell) var(--cell);
  background-position: -1px -1px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--t-body);
  line-height: 1.6;
  font-feature-settings: "ss01" off;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}

main {
  flex: 1 0 auto;
}

main:focus {
  outline: none;
}

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

h2 {
  font-size: var(--t-h2);
}

h3 {
  font-size: var(--t-h3);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

p,
ul,
ol,
dl,
dd {
  margin: 0;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

picture {
  display: block;
}

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
}

a:hover {
  text-decoration-color: currentColor;
  text-decoration-thickness: 2px;
}

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

::selection {
  background: var(--ink);
  color: var(--paper);
}

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

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

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--button);
  color: var(--button-ink);
  font-weight: 500;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* ---------- Type helpers ---------- */

/* Tiny monospace caps: the eyebrow under a section heading, and list labels. */
.eyebrow,
.label {
  font-family: var(--mono);
  font-size: var(--t-label);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.eyebrow {
  margin-top: 1rem;
}

.lead {
  font-size: var(--t-lead);
  line-height: 1.5;
  letter-spacing: -0.01em;
  max-width: var(--measure);
}

.prose {
  max-width: var(--measure);
  color: var(--ink-2);
}

.prose > * + * {
  margin-top: 1.1em;
}

.prose ul {
  padding-left: 1.2rem;
}

.prose li + li {
  margin-top: 0.35em;
}

.prose li::marker {
  color: var(--ink-3);
}

.prose a {
  color: var(--ink);
}

.prose__aside {
  font-size: var(--t-small);
}

/* The short point-of-view paragraph that opens a page's content. */
.pov {
  max-width: 46rem;
  font-size: var(--t-pov);
  line-height: 1.3;
  letter-spacing: -0.02em;
  text-wrap: pretty;
}

.pov--small {
  font-size: var(--t-lead);
  line-height: 1.45;
  max-width: 44rem;
}

/* A square number badge with stepped corners: 01, 02 ... */
.num {
  display: inline-grid;
  place-items: center;
  flex: none;
  min-width: 1.75rem;
  height: 1.75rem;
  padding-inline: 0.25rem;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1;
  clip-path: polygon(0 3px, 3px 3px, 3px 0, calc(100% - 3px) 0, calc(100% - 3px) 3px, 100% 3px, 100% calc(100% - 3px), calc(100% - 3px) calc(100% - 3px), calc(100% - 3px) 100%, 3px 100%, 3px calc(100% - 3px), 0 calc(100% - 3px));
}

.num--large {
  min-width: 2.5rem;
  height: 2.5rem;
  font-size: 0.8125rem;
  margin-bottom: 1.25rem;
}

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.8rem 1.6rem;
  border: 0;
  background: var(--button);
  color: var(--button-ink);
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  clip-path: polygon(0 var(--notch), var(--notch) var(--notch), var(--notch) 0, calc(100% - var(--notch)) 0, calc(100% - var(--notch)) var(--notch), 100% var(--notch), 100% calc(100% - var(--notch)), calc(100% - var(--notch)) calc(100% - var(--notch)), calc(100% - var(--notch)) 100%, var(--notch) 100%, var(--notch) calc(100% - var(--notch)), 0 calc(100% - var(--notch)));
}

.button:hover {
  background: color-mix(in srgb, var(--button) 82%, var(--paper));
  color: var(--button-ink);
}

/* clip-path would clip the focus ring, so a focused button drops its notches. */
.button:focus-visible {
  clip-path: none;
  border-radius: 0;
}

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

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

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1;
  text-decoration: none;
}

.wordmark:hover .wordmark__text {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

.wordmark__glyph {
  width: 2.0625rem;
  height: 1.125rem;
  flex: none;
}

.wordmark__tile { fill: var(--ink); }
.wordmark__letters { fill: var(--paper); }
.wordmark__accent { fill: var(--mark-accent); }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.75rem;
  font-size: 0.9375rem;
  font-weight: 450;
  text-decoration: none;
}

.site-nav a:hover {
  text-decoration: underline;
  text-underline-offset: 0.3em;
}

/* The current page gets one pixel. */
.site-nav a[aria-current="page"]::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  background: var(--anoto);
}

/* ---------- Masthead: statement left, descriptor right ---------- */

.masthead {
  border-bottom: 1px solid var(--line);
}

.masthead__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.masthead__title {
  padding-block: clamp(2.5rem, 1.5rem + 4vw, 5rem) clamp(2rem, 1rem + 3vw, 3.5rem);
  font-size: var(--t-h1);
  font-weight: 450;
  line-height: 1.02;
  letter-spacing: -0.04em;
  max-width: 18ch;
}

.masthead__title--display {
  font-size: var(--t-display);
  line-height: 0.96;
  letter-spacing: -0.045em;
  max-width: none;
}

.masthead__title .line {
  display: block;
}

.masthead__aside {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 1.5rem 2rem;
  border-top: 1px solid var(--line);
}

/* Small caps statement, set like a drafting title block. */
.descriptor {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.45;
  text-transform: uppercase;
  text-wrap: balance;
  max-width: 16rem;
}

.masthead__note {
  font-size: var(--t-small);
  color: var(--ink-2);
  max-width: 22rem;
}

@media (min-width: 52rem) {
  .masthead__inner {
    grid-template-columns: minmax(0, 1fr) minmax(15rem, 20rem);
  }

  .masthead__aside {
    border-top: 0;
    border-left: 1px solid var(--line);
    padding: clamp(2.5rem, 1.5rem + 4vw, 5rem) 0 2rem clamp(1.5rem, 3vw, 2.5rem);
  }

  .masthead__title {
    padding-right: 2rem;
  }

  .masthead__note {
    text-align: right;
    align-self: flex-end;
  }
}

/* ---------- The commit graphs (class names keep "mosaic") ---------- */

.mosaic img {
  width: 100%;
}

/* Full-bleed hero band: a year of commits, 53 weeks by 7 days. At its natural ratio it is 13.2vw tall;
   narrow screens keep a usable height and crop to the latest weeks, where the monogram sits. */
.mosaic--hero {
  margin-top: clamp(1.5rem, 4vw, 3rem);
}

.mosaic--hero img {
  height: clamp(6.5rem, 13.2vw, 15rem);
  object-fit: cover;
  object-position: 100% 50%;
}

.mosaic--divider {
  margin-block: 2.5rem 2.75rem;
}

.mosaic--divider img {
  height: auto;
  /* On a phone the natural height leaves 5px cells: keep it taller and crop to the busy middle. */
  min-height: 4.5rem;
  object-fit: cover;
}

.mosaic--footer img {
  height: clamp(3rem, 4.375vw, 4.5rem);
  object-fit: cover;
  object-position: 100% 100%;
}

.mosaic--404 {
  width: min(100%, 26rem);
  margin-bottom: 2.5rem;
}

/* ---------- Sections ---------- */

.section {
  padding-block: var(--section) 0;
}

.section--first {
  padding-top: clamp(2.5rem, 1.5rem + 4vw, 4.5rem);
}

main > :last-child {
  padding-bottom: var(--section);
}

/* Long-form two columns: statement and eyebrow left, prose right. */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.75rem;
}

.split__head h2 {
  max-width: 14ch;
}

@media (min-width: 52rem) {
  .split {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    column-gap: clamp(2rem, 6vw, 6rem);
  }

  .split--stack {
    grid-template-columns: minmax(0, 1fr);
  }

  .split__body {
    padding-top: 0.5rem;
  }
}

.split__body.prose {
  font-size: var(--t-body);
}

/* ---------- Work cards (Home) ---------- */

.cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3rem 1.5rem;
  margin-top: clamp(3rem, 6vw, 5rem);
  padding: 0;
  list-style: none;
}

@media (min-width: 44rem) {
  .cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .card__media {
    aspect-ratio: 4 / 3;
  }
}

.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.card__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  text-decoration: none;
}

.card__link:focus-visible {
  outline-offset: 6px;
}

.card__media {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-card);
  background: var(--tint);
}

.card--perawise { --tint: var(--tint-perawise); }
.card--lendey { --tint: var(--tint-lendey); }
.card--anoto { --tint: var(--tint-anoto); }

.card__media .app-icon {
  width: clamp(5.5rem, 9vw, 7.5rem);
}

.card__title {
  margin-top: 1.5rem;
  font-size: clamp(1.375rem, 1.1rem + 0.8vw, 1.75rem);
  font-weight: 450;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.card__link:hover .card__title {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
}

.card__text {
  margin-top: 0.6rem;
  max-width: 21rem;
  font-size: var(--t-small);
  line-height: 1.55;
  color: var(--ink-2);
}

.app-icon {
  border-radius: 22.5%;
  box-shadow: 0 1px 2px rgb(18 20 28 / 0.12), 0 10px 24px -10px rgb(18 20 28 / 0.35);
}

/* ---------- Tag pills ---------- */

.tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.375rem;
  margin-top: 1rem;
  padding: 0;
  list-style: none;
}

.tag {
  padding: 0.3rem 0.55rem 0.25rem;
  font-family: var(--mono);
  font-size: var(--t-label);
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
  clip-path: polygon(0 2px, 2px 2px, 2px 0, calc(100% - 2px) 0, calc(100% - 2px) 2px, 100% 2px, 100% calc(100% - 2px), calc(100% - 2px) calc(100% - 2px), calc(100% - 2px) 100%, 2px 100%, 2px calc(100% - 2px), 0 calc(100% - 2px));
}

.tag--apple {
  background: var(--apple);
  color: var(--apple-ink);
}

.tag--android {
  background: var(--android);
  color: var(--android-ink);
}

/* The key that says what the pill colours mean. */
.tags-key {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.5rem;
  margin-top: 3rem;
  font-family: var(--mono);
  font-size: var(--t-label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.tags-key__item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.tags-key__item::before {
  content: "";
  width: 0.625rem;
  height: 0.625rem;
}

.tags-key__item--apple::before { background: var(--apple); }
.tags-key__item--android::before { background: var(--android); }

/* ---------- Numbered items (services on Home, steps on About) ---------- */

.caps {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem 1.5rem;
  padding: 0;
  list-style: none;
}

@media (min-width: 36rem) {
  .caps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 60rem) {
  .caps {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .caps--four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .caps--three,
  .caps--six {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.caps--four,
.caps--three {
  margin-top: 3rem;
}

/* A lead paragraph between a section's heading and its numbered items. */
.section__intro {
  margin-top: 2rem;
  max-width: 44rem;
}

.caps__item > a,
.caps__item > h3 {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.25;
  text-decoration: none;
}

.caps__item > a:hover .caps__name {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

.caps__item p {
  margin-top: 0.75rem;
  font-size: var(--t-small);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 18rem;
}

/* ---------- Contact block ---------- */

.contact-block__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.contact-block h2 {
  max-width: 18ch;
}

.contact-block p {
  max-width: 30rem;
  color: var(--ink-2);
}

.contact-block h2 + p {
  margin-top: 1rem;
}

.contact-block .button {
  margin-top: 2rem;
}

.contact-block__email {
  margin-top: 1.25rem;
  font-size: var(--t-small);
}

.contact-block__email a {
  color: var(--ink);
}

/* ---------- Work page: tinted app panels ---------- */

.apps {
  display: grid;
  gap: clamp(1.25rem, 3vw, 2rem);
  padding-top: clamp(2rem, 1rem + 3vw, 3.5rem);
}

.app-panel {
  --tint: var(--tint-perawise);
  padding: clamp(1.5rem, 1rem + 3.5vw, 4rem);
  border-radius: var(--radius-panel);
  background: var(--tint);
  scroll-margin-top: 1.5rem;
}

.app-panel--lendey { --tint: var(--tint-lendey); }
.app-panel--anoto { --tint: var(--tint-anoto); }

.app-panel__head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 1rem 1.25rem;
}

.app-panel__head .app-icon {
  width: clamp(3.5rem, 3rem + 2vw, 4.5rem);
}

.app-panel__head h2 {
  font-size: var(--t-h2);
}

.app-panel__tagline {
  margin-top: 0.4rem;
  color: var(--ink-2);
}

.app-panel__tags {
  grid-column: 1 / -1;
  justify-content: flex-start;
  margin-top: 0;
}

@media (min-width: 60rem) {
  .app-panel__head {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .app-panel__tags {
    grid-column: auto;
    justify-content: flex-end;
    max-width: 24rem;
  }
}

.app-panel__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  margin-top: clamp(2rem, 4vw, 3rem);
}

@media (min-width: 56rem) {
  .app-panel__body {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: clamp(2rem, 5vw, 4rem);
  }
}

.app-panel .prose {
  color: var(--ink);
}

/* Facts as small cards. */
.facts {
  display: grid;
  gap: 0.625rem;
  align-content: start;
}

.fact {
  padding: 0.9rem 1rem 1rem;
  border-radius: 0.875rem;
  background: color-mix(in srgb, var(--raise) var(--raise-mix), var(--tint));
}

.fact dt {
  font-family: var(--mono);
  font-size: var(--t-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.fact dd {
  margin-top: 0.3rem;
  font-size: var(--t-small);
  line-height: 1.5;
}

/* Phone screenshots in a plain CSS device frame. */
.screens {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.625rem, 3vw, 2.5rem);
  max-width: 54rem;
  margin: clamp(2.5rem, 5vw, 4rem) auto 0;
  padding: 0;
  list-style: none;
}

.device {
  position: relative;
  padding: 3.2%;
  border-radius: 15% / 7%;
  background: #12141c;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.06) inset, 0 24px 48px -24px rgb(18 20 28 / 0.45);
}

/* The camera island, over the gap in the screenshot's status bar. */
.device::before {
  content: "";
  position: absolute;
  top: 4.4%;
  left: 50%;
  width: 26%;
  height: 2.6%;
  border-radius: 999px;
  background: #000;
  transform: translateX(-50%);
}

.device img {
  width: 100%;
  border-radius: 12% / 5.6%;
}

/* ---------- Services page ---------- */

.toc {
  padding-top: clamp(2rem, 4vw, 3rem);
}

.toc__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.75rem;
  padding: 0;
  list-style: none;
}

.toc__list a {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.75rem;
  font-weight: 500;
  text-decoration: none;
}

.toc__list a:hover {
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.services {
  padding-top: clamp(1.5rem, 3vw, 2.5rem);
}

.service {
  padding-block: clamp(2.5rem, 1.5rem + 4vw, 5rem);
  border-top: 1px solid var(--line);
  scroll-margin-top: 1rem;
}

.service:first-child {
  border-top: 0;
}

.service .split__head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.service__lists {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  margin-top: 2.25rem;
}

@media (min-width: 40rem) {
  .service__lists {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.squares {
  margin-top: 0.875rem;
  padding: 0;
  list-style: none;
  font-size: var(--t-small);
  line-height: 1.5;
  color: var(--ink-2);
}

.squares li {
  position: relative;
  padding-left: 1.1rem;
}

.squares li + li {
  margin-top: 0.6rem;
}

.squares li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.375rem;
  height: 0.375rem;
  background: var(--ink-3);
}

/* ---------- About ---------- */

.principles {
  padding: 0;
  list-style: none;
}

.principles li {
  padding-block: 1.25rem;
  border-top: 1px solid var(--line);
}

.principles li:first-child {
  padding-top: 0;
  border-top: 0;
}

.principles p {
  margin-top: 0.5rem;
  color: var(--ink-2);
  max-width: var(--measure);
}

/* ---------- Privacy ---------- */

.policy {
  padding-top: clamp(2.5rem, 5vw, 4rem);
}

.policy__section {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem 2rem;
  padding-block: 2rem;
  border-top: 1px solid var(--line);
}

.policy__section h2 {
  font-size: var(--t-h3);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

@media (min-width: 52rem) {
  .policy__section {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    column-gap: clamp(2rem, 6vw, 6rem);
  }
}

/* ---------- Contact page ---------- */

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3rem;
}

@media (min-width: 56rem) {
  .contact-layout {
    grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
    gap: clamp(3rem, 7vw, 6rem);
  }
}

.contact-main {
  max-width: 38rem;
}

.contact-form {
  display: grid;
  gap: 1.75rem;
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field label {
  font-weight: 500;
  font-size: 1rem;
}

.field__optional {
  font-weight: 400;
  color: var(--ink-3);
}

.field__hint {
  font-size: var(--t-small);
  color: var(--ink-2);
}

.field__error {
  font-size: var(--t-small);
  font-weight: 500;
  color: var(--danger);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.25rem;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  line-height: 1.4;
}

.field textarea {
  min-height: 11rem;
  resize: vertical;
}

.field select {
  appearance: none;
  padding-right: 2.5rem;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink) 50%),
    linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 1.15rem) 52%, calc(100% - 0.8rem) 52%;
  background-size: 0.35rem 0.35rem;
  background-repeat: no-repeat;
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
  border-color: var(--ink);
}

.field--invalid input,
.field--invalid select,
.field--invalid textarea {
  border-color: var(--danger);
  border-width: 2px;
  padding: calc(0.7rem - 1px) calc(0.85rem - 1px);
}

.contact-form__submit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  padding-top: 0.25rem;
}

.contact-form__note {
  font-size: var(--t-small);
  color: var(--ink-2);
  max-width: 22rem;
}

.form-alert,
.form-success {
  margin-bottom: 2.5rem;
  padding: 1.25rem 1.4rem 1.4rem;
  border-left: 4px solid var(--danger);
  background: var(--danger-soft);
}

.form-success {
  margin-bottom: 0;
  border-left-color: var(--lendey);
  background: var(--tint-lendey);
}

.form-alert:focus,
.form-success:focus {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.form-alert h2,
.form-success h2 {
  font-size: var(--t-h3);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.form-alert p,
.form-alert ul,
.form-success p {
  margin-top: 0.6rem;
}

.form-alert ul {
  padding-left: 1.2rem;
}

.form-alert a {
  color: var(--danger);
  font-weight: 500;
}

.contact-aside {
  display: grid;
  align-content: start;
  gap: 2rem;
}

.contact-aside__block {
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.contact-aside h2 {
  font-size: var(--t-h3);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.contact-aside p {
  margin-top: 0.5rem;
  font-size: var(--t-small);
  color: var(--ink-2);
}

.contact-aside a {
  color: var(--ink);
}

/* ---------- 404 ---------- */

.not-found__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: clamp(3rem, 2rem + 5vw, 6rem);
  text-align: center;
}

.not-found h1 {
  font-size: var(--t-h1);
  letter-spacing: -0.04em;
  line-height: 1.02;
  max-width: 16ch;
}

.not-found .lead {
  margin-top: 1.25rem;
  color: var(--ink-2);
}

.not-found .button {
  margin-top: 2rem;
}

.not-found__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1.5rem;
  margin-top: 1rem;
  padding: 0;
  list-style: none;
}

.not-found__links a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
}

/* ---------- Footer ---------- */

.site-footer {
  flex: none;
}

.site-footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem 2rem;
  padding-block: 1.5rem 2rem;
  font-size: var(--t-small);
  color: var(--ink-2);
}

.site-footer__brand {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
}

.site-footer__name {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.site-footer__nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5rem;
  padding: 0;
  list-style: none;
}

.site-footer__nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--ink);
}

.site-footer__legal {
  font-family: var(--mono);
  font-size: var(--t-label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

@media (min-width: 52rem) {
  .site-footer__inner {
    grid-template-columns: auto 1fr auto;
    align-items: center;
  }

  .site-footer__nav ul {
    justify-content: center;
  }
}

/* The footer's commit strip stands directly on the footer rule, edge to edge. */
.site-footer .mosaic {
  border-bottom: 1px solid var(--line);
}

/* ---------- Motion and print ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

@media print {
  body {
    background: none;
  }

  .site-nav,
  .mosaic,
  .skip-link {
    display: none;
  }
}

/* =====================================================================================
 * WordPress
 *
 * Everything above is the plain-PHP site's stylesheet. What follows only maps WordPress's own
 * markup onto it: the block template wrapper, core's skip link, core/navigation, and Contact
 * Form 7. Global styles set blockGap to 0 (theme.json), so the layout margins core prints are
 * zero and the component margins above stay the only ones.
 * ===================================================================================== */

/* The template wrapper sits between <body> and header/main/footer: it takes over the body's column. */
.wp-site-blocks {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.wp-site-blocks > main {
  flex: 1 0 auto;
}

/* Core inserts the skip link (server side, no script) and hides it with .screen-reader-text;
   on focus it takes the design's skip-link look instead of core's grey box. */
body .skip-link.screen-reader-text:focus {
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100000;
  padding: 0.6rem 1rem;
  background: var(--button);
  color: var(--button-ink);
  font-size: var(--t-body);
  font-weight: 500;
  line-height: 1.6;
  text-decoration: none;
}

/* ---------- Primary navigation: core/navigation, "overlayMenu":"never" ---------- */

.wp-block-navigation.site-nav,
.wp-block-navigation.site-nav .wp-block-navigation__container {
  gap: 0.25rem 1.5rem;
}

.wp-block-navigation.site-nav .wp-block-navigation-item__content {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.75rem;
  padding: 0;
  color: inherit;
  font-size: 0.9375rem;
  font-weight: 450;
  line-height: 1.6;
  text-decoration: none;
}

.wp-block-navigation.site-nav .wp-block-navigation-item__content:hover {
  text-decoration-line: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: currentColor;
  text-underline-offset: 0.3em;
}

/* The current page gets one pixel (core/navigation-link prints aria-current="page"). */
.wp-block-navigation.site-nav .wp-block-navigation-item__content[aria-current="page"]::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  background: var(--anoto);
}

/* ---------- Contact Form 7: a styling contract ----------
 *
 * CF7 owns the form's markup; the theme only styles it. Every selector here is strictly more
 * specific than the CF7 6.1.6 rule it competes with (includes/css/styles.css), never equal, so the
 * look does not depend on stylesheet order:
 *   .wpcf7 form .wpcf7-response-output              (0,2,1)  <  div.wpcf7 form .wpcf7-response-output         (0,2,2)
 *   .wpcf7 form.sent|failed|invalid|... .wpcf7-...  (0,3,1)  <  div.wpcf7 form.sent ... .wpcf7-response-output  (0,3,2)
 *   .wpcf7-not-valid-tip (0,1,0), .use-floating-validation-tip .wpcf7-not-valid-tip (0,2,0)
 *                                                            <  div.wpcf7 form .wpcf7-not-valid-tip            (0,2,2)
 *   .wpcf7-spinner (0,1,0), form.submitting .wpcf7-spinner (0,1,1)
 *                                                            <  div.wpcf7 form .wpcf7-spinner                  (0,2,2)
 * The spinner keeps CF7's own visibility toggle and geometry (its keyframes are calibrated to them);
 * only its colours change. The response line keeps CF7's display toggles (init/submitting hide it).
 *
 * The form's own markup (bin/seed/10-contact-form.php) wraps each field in p.cw-field with a
 * span.cw-field__hint, the Send button in p.cw-submit and the privacy line in p.cw-form-note;
 * those classes carry templates/contact-form.php's look. */

/* The form is a wrapping flex column: every row full width, except the Send row and the note
   beside it, which share a line when there is room (as .contact-form__submit did). The 1.75rem
   between fields is a 1rem row gap plus 0.75rem under each field, so a note that wraps under the
   button sits 1rem below it. */
div.wpcf7 form.wpcf7-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}

div.wpcf7 form.wpcf7-form > * {
  flex: 1 1 100%;
  min-width: 0;
  margin: 0;
}

div.wpcf7 form.wpcf7-form > .cw-field {
  margin-bottom: 0.75rem;
}

/* CF7's autop puts a <br> after each label and hint; the field is a column with its own gap. */
div.wpcf7 form .cw-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

div.wpcf7 form .cw-field > br {
  display: none;
}

div.wpcf7 form label {
  font-size: 1rem;
  font-weight: 500;
}

div.wpcf7 form .cw-field__optional {
  font-weight: 400;
  color: var(--ink-3);
}

div.wpcf7 form .cw-field__hint {
  font-size: var(--t-small);
  color: var(--ink-2);
}

div.wpcf7 form.wpcf7-form > .cw-submit {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  padding-top: 0.25rem;
}

div.wpcf7 form.wpcf7-form > .cw-form-note {
  flex: 1 1 14rem;
  max-width: 22rem;
  font-size: var(--t-small);
  color: var(--ink-2);
}

div.wpcf7 form .cw-form-note a {
  color: inherit;
}

/* The validation tip follows the control in CF7's markup; the design shows the error above it. */
div.wpcf7 form .wpcf7-form-control-wrap {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.4rem;
}

/* :where() keeps this at (0,1,2), so the focus and invalid rules below (0,2,3) and (0,3,3) win. */
div.wpcf7 form .wpcf7-form-control:where(input:not([type="submit"], [type="checkbox"], [type="radio"], [type="hidden"]), select, textarea) {
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.25rem;
  background-color: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.4;
}

div.wpcf7 form textarea.wpcf7-form-control {
  min-height: 11rem;
  resize: vertical;
}

div.wpcf7 form select.wpcf7-form-control {
  appearance: none;
  padding-right: 2.5rem;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink) 50%),
    linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 1.15rem) 52%, calc(100% - 0.8rem) 52%;
  background-size: 0.35rem 0.35rem;
  background-repeat: no-repeat;
}

div.wpcf7 form .wpcf7-form-control:is(input, select, textarea):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
  border-color: var(--ink);
}

div.wpcf7 form .wpcf7-form-control.wpcf7-not-valid:is(input, select, textarea) {
  border-color: var(--danger);
  border-width: 2px;
  padding: calc(0.7rem - 1px) calc(0.85rem - 1px);
}

div.wpcf7 form .wpcf7-not-valid-tip {
  position: static;
  width: auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--danger);
  font-size: var(--t-small);
  font-weight: 500;
  line-height: 1.6;
}

/* Send: the design's .button. */
div.wpcf7 form .wpcf7-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.8rem 1.6rem;
  border: 0;
  border-radius: 0;
  background: var(--button);
  color: var(--button-ink);
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  line-height: 1.2;
  cursor: pointer;
  clip-path: polygon(0 var(--notch), var(--notch) var(--notch), var(--notch) 0, calc(100% - var(--notch)) 0, calc(100% - var(--notch)) var(--notch), 100% var(--notch), 100% calc(100% - var(--notch)), calc(100% - var(--notch)) calc(100% - var(--notch)), calc(100% - var(--notch)) 100%, var(--notch) 100%, var(--notch) calc(100% - var(--notch)), 0 calc(100% - var(--notch)));
}

div.wpcf7 form .wpcf7-submit:hover {
  background: color-mix(in srgb, var(--button) 82%, var(--paper));
}

div.wpcf7 form .wpcf7-submit:focus-visible {
  clip-path: none;
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

div.wpcf7 form .wpcf7-submit:disabled {
  opacity: 0.6;
}

/* The spinner: CF7's size, shape, motion and visibility toggle, the design's colours. CF7's script
   inserts it after the button, in flow with 24px margins, which would push the privacy note 72px
   right of where the design has it; it sits out of flow beside the button instead, and the note
   steps aside while the form is sending. */
div.wpcf7 form .cw-submit {
  position: relative;
}

div.wpcf7 form .wpcf7-spinner {
  position: absolute;
  top: 50%;
  left: calc(100% + 1.5rem);
  margin: -12px 0 0;
  background-color: var(--ink);
  opacity: 0.75;
}

div.wpcf7 form.submitting .cw-form-note {
  visibility: hidden;
}

div.wpcf7 form .wpcf7-spinner::before {
  background-color: var(--paper);
}

/* The response line moves above the fields (as the plain-PHP form's alert sat) and takes the
   alert look: danger for every failure state, Lendey green once sent. */
div.wpcf7 form .wpcf7-response-output {
  order: -1;
  margin: 0 0 1.5rem;
  padding: 1.25rem 1.4rem 1.4rem;
  border: 0;
  border-left: 4px solid var(--danger);
  background: var(--danger-soft);
  color: var(--ink);
  font-weight: 500;
}

div.wpcf7 form.invalid .wpcf7-response-output,
div.wpcf7 form.unaccepted .wpcf7-response-output,
div.wpcf7 form.payment-required .wpcf7-response-output,
div.wpcf7 form.failed .wpcf7-response-output,
div.wpcf7 form.aborted .wpcf7-response-output,
div.wpcf7 form.spam .wpcf7-response-output {
  border-color: var(--danger);
  background: var(--danger-soft);
}

div.wpcf7 form.sent .wpcf7-response-output {
  border-color: var(--lendey);
  background: var(--tint-lendey);
}

/* Where the form goes before CF7 is set up. */
.contact-form-placeholder {
  padding: 1.25rem 1.4rem 1.4rem;
  border-left: 4px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-2);
}

.contact-form-placeholder a {
  color: var(--ink);
}

/* Home: the link under the selected-work cards. */
.section__more {
  margin-top: 2.5rem;
  text-align: center;
  font-size: var(--t-small);
}

/* Home hero: the two calls to action under the note. */
.masthead__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin: 0;
}

@media (min-width: 52rem) {
  .masthead__aside:has(.masthead__actions) {
    justify-content: flex-start;
  }

  /* One step up from the inner pages' note: beside the display headline, 14px reads as too small. */
  .masthead__aside:has(.masthead__actions) .masthead__note {
    margin-top: auto;
    font-size: 0.9375rem;
  }

  .masthead__actions {
    justify-content: flex-end;
    align-self: flex-end;
  }
}
