/* ARITHMONOIA site v1.
   Colours come from the approved mark (arithmocene-crest/block-v5/angle-66) and the brand-v1 lockups.
   Geometry rule from the mark: decorative edges are horizontal or slanted at 66.04° (tan = 9/4).
   A vertical edge becomes 66.04° with skewX(-23.96deg), because tan(23.96°) = 4/9.
   No rounded corners and no curves in decorative shapes. */

@font-face { font-family: "Sora"; font-weight: 100 800; font-style: normal; font-display: swap;
  src: url("../fonts/Sora-Variable.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 100 800; font-style: normal; font-display: swap;
  src: url("../fonts/JetBrainsMono-Variable.woff2") format("woff2"); }

:root {
  color-scheme: light dark;
  /* brand colours */
  --navy: #141B2D;   /* mark front, light mode ink */
  --slate: #5A6478;  /* mark depth, light mode */
  --steel: #8C95A8;  /* mark depth, dark mode */
  --paper: #F4F5F7;  /* lockup ground, light mode */
  --rule: #C9CDD3;   /* small-icon outline */

  --bg: var(--paper);
  --ink: var(--navy);
  --ink-2: var(--slate);
  --line: var(--rule);
  --band: color-mix(in srgb, var(--slate) 9%, var(--paper));
  --mark-front: var(--navy);
  --mark-depth: var(--slate);
  --accent: var(--navy);
  --accent-ink: var(--paper);

  --skew: -23.96deg;
  --wrap: 1120px;
  --gutter: clamp(16px, 5vw, 40px);
  --sans: "Sora", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--navy);
    --ink: var(--paper);
    --ink-2: var(--steel);
    --line: color-mix(in srgb, var(--slate) 60%, var(--navy));
    --band: color-mix(in srgb, var(--slate) 16%, var(--navy));
    --mark-front: var(--paper);
    --mark-depth: var(--steel);
    --accent: var(--paper);
    --accent-ink: var(--navy);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--sans);
  font-feature-settings: "ss01";
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
::selection { background: var(--ink); color: var(--bg); }

h1, h2, h3 { font-weight: 600; letter-spacing: -.02em; line-height: 1.15; margin: 0; }
h1 { font-size: clamp(2.2rem, 6vw, 4rem); letter-spacing: -.035em; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); }
h3 { font-size: 1.125rem; letter-spacing: -.01em; }
p { margin: 0; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: var(--gutter); top: -4rem; background: var(--ink); color: var(--bg); padding: .5rem 1rem; z-index: 10; }
.skip:focus { top: .5rem; }

/* Mark (inline SVG copied from glyph-parts.svg; only the fills come from CSS) */
.mark .front { fill: var(--mark-front); }
.mark .depth { fill: var(--mark-depth); }

/* Wordmark: one file, assets/brand/wordmark.svg. The <img> sets the size and the alt text.
   A mask of the same file paints it in the current text colour, so it works in light and dark mode. */
.wordmark { display: inline-block; position: relative; color: var(--ink); line-height: 0; }
.wordmark img { height: 100%; width: auto; }
@supports ((mask-image: url("x.svg")) or (-webkit-mask-image: url("x.svg"))) {
  .wordmark::after {
    content: ""; position: absolute; inset: 0; background: currentColor;
    -webkit-mask: url("../brand/wordmark.svg") left center / contain no-repeat;
    mask: url("../brand/wordmark.svg") left center / contain no-repeat;
  }
  .wordmark img { opacity: 0; }
}

/* Header */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; padding-block: 1rem; }
.brand { display: flex; align-items: center; gap: .9rem; text-decoration: none; }
.brand .mark { height: 34px; width: auto; }
.brand .wordmark { height: 21px; }
.site-nav ul { display: flex; flex-wrap: wrap; gap: .25rem 1.6rem; list-style: none; margin: 0; padding: 0; }
.site-nav a { font-size: .9375rem; text-decoration: none; color: var(--ink-2); }
.site-nav a:hover { color: var(--ink); text-decoration: underline; }

/* Small label above headings, led by a slanted bar like the mark's top bar */
.eyebrow { display: flex; align-items: flex-start; gap: .75rem; font: 500 .8125rem/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 1.1rem; }
.eyebrow::before { content: ""; flex: none; margin-top: .45em; width: 1.75rem; height: .5rem; background: var(--mark-depth); transform: skewX(var(--skew)); }

/* Hero */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: center; gap: 2rem 4rem; padding-block: clamp(3.5rem, 9vw, 7.5rem); position: relative; }
.hero h1 { max-width: 17ch; }
.lede { margin-top: 1.5rem; font-size: clamp(1.0625rem, 1.6vw, 1.25rem); line-height: 1.6; color: var(--ink-2); max-width: 36rem; }
.lede strong { color: var(--ink); font-weight: 600; }
.hero-mark { justify-self: end; width: min(100%, 360px); }
.hero-mark .mark { width: 100%; height: auto; }
.hero-note { margin-top: 1.75rem; font-size: .9375rem; color: var(--ink-2); }
.hero-bands { position: absolute; inset: 0; pointer-events: none; }
.hero-bands span { position: absolute; top: 0; bottom: 0; background: var(--band); transform: skewX(var(--skew)); transform-origin: bottom left; }
.hero-bands span:nth-child(1) { left: 58%; width: 9%; }
.hero-bands span:nth-child(2) { left: 70%; width: 3%; }
.hero-bands span:nth-child(3) { left: 76%; width: 30%; }

/* Buttons: text stays upright, the background is a slanted parallelogram */
.actions { display: flex; flex-wrap: wrap; gap: .9rem 1.6rem; margin-top: 2.25rem; }
.btn { position: relative; isolation: isolate; display: inline-flex; align-items: center; min-height: 48px; padding: .7rem 1.6rem; font-weight: 600; font-size: 1rem; text-decoration: none; color: var(--ink); }
.btn::before { content: ""; position: absolute; inset: 0; z-index: -1; transform: skewX(var(--skew)); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.btn--solid { color: var(--accent-ink); }
.btn--solid::before { background: var(--accent); border-color: var(--accent); }
.btn:hover::before { border-width: 2px; }
.btn--plain::before { border-top-color: transparent; }

/* Sections */
section { padding-block: clamp(3.5rem, 8vw, 6rem); }
section + section { border-top: 1px solid var(--line); }
.section-head { display: grid; gap: 1rem; max-width: 46rem; margin-bottom: clamp(2rem, 5vw, 3.25rem); }
.section-head p { color: var(--ink-2); font-size: 1.0625rem; }

/* Services */
.groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3rem clamp(2rem, 5vw, 4.5rem); }
.group-title { display: flex; align-items: baseline; gap: 1rem; padding-bottom: 1rem; border-bottom: 2px solid var(--ink); margin-bottom: .5rem; }
.group-title .num { font: 500 .875rem/1 var(--mono); color: var(--ink-2); }
.group-title h3 { font-size: 1.375rem; }
.service { padding-block: 1.25rem; border-bottom: 1px solid var(--line); }
.service h4 { margin: 0 0 .4rem; font-size: 1.0625rem; font-weight: 600; }
.service p { color: var(--ink-2); }
.not-taken { margin-top: 2.5rem; max-width: 52rem; color: var(--ink-2); font-size: .9688rem; }
.not-taken strong { color: var(--ink); font-weight: 600; }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem; list-style: none; margin: 0; padding: 0; }
.steps li { padding-top: 1.25rem; border-top: 1px solid var(--line); }
.steps li::before { content: ""; display: block; width: 2.5rem; height: .5rem; margin: 0 0 1.1rem .15rem; background: var(--accent); transform: skewX(var(--skew)); }
.steps h3 { margin-bottom: .5rem; display: flex; gap: .6rem; align-items: baseline; }
.steps .num { font: 500 .8125rem/1 var(--mono); color: var(--ink-2); }
.steps p { color: var(--ink-2); font-size: .9688rem; }

/* Public work */
.work { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 0 clamp(2rem, 5vw, 4rem); }
.work li { padding-block: 1.25rem; border-bottom: 1px solid var(--line); }
.work li > a { font-weight: 600; text-decoration: none; display: inline-flex; gap: .5rem; align-items: baseline; }
.work li > a:hover { text-decoration: underline; }
.work li > a::after { content: "→"; font-weight: 400; color: var(--ink-2); }
.work p { color: var(--ink-2); font-size: .9688rem; margin-top: .35rem; }

/* About */
.about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 2rem clamp(2rem, 6vw, 5rem); align-items: start; }
.prose { display: grid; gap: 1.1rem; max-width: 40rem; }
.prose p { color: var(--ink-2); }
.prose strong { color: var(--ink); font-weight: 600; }
.facts { margin: 0; display: grid; gap: 0; border-top: 2px solid var(--ink); }
.facts div { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 1rem; padding-block: .9rem; border-bottom: 1px solid var(--line); }
.facts dt { font: 500 .8125rem/1.6 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); }
.facts dd { margin: 0; }

/* Contact */
.contact { background: var(--band); }
.contact .email { display: inline-block; margin-top: 1.25rem; font-size: clamp(1.35rem, 4.2vw, 2.4rem); font-weight: 600; letter-spacing: -.02em; overflow-wrap: anywhere; text-decoration-thickness: 2px; }
.contact .prose { margin-top: 1.5rem; }
.profiles { margin-top: 2.5rem; }
.profiles h3 { font: 500 .8125rem/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); margin-bottom: .75rem; }
.profiles ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.75rem; }
/* TODO handles: a profile link whose address still contains "TODO" is hidden, so no broken link is shown. */
.profiles li:has(a[href*="TODO"]) { display: none; }
.profiles:not(:has(a:not([href*="TODO"]))) { display: none; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding-block: 2rem 2.5rem; font-size: .875rem; color: var(--ink-2); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; list-style: none; margin: 0; padding: 0; }
.footer-bar { height: 6px; background: var(--ink); clip-path: polygon(2.67px 0, 100% 0, calc(100% - 2.67px) 100%, 0 100%); margin-bottom: 1.5rem; width: 96px; }

/* Legal pages */
.legal { padding-block: clamp(3rem, 7vw, 5rem); }
.legal .wrap { max-width: 46rem; }
.legal h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: .75rem; }
.legal .updated { color: var(--ink-2); font-size: .9375rem; margin-bottom: 2.5rem; }
.legal h2 { font-size: 1.25rem; margin: 2.25rem 0 .6rem; }
.legal p, .legal li { color: var(--ink-2); }
.legal p + p { margin-top: .9rem; }
.legal ul { padding-left: 1.2rem; margin: .6rem 0 0; }
.legal li + li { margin-top: .4rem; }
.legal strong { color: var(--ink); font-weight: 600; }

/* Phones and small tablets */
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-mark { grid-row: 1; justify-self: start; width: min(42%, 160px); }
  .hero-bands span:nth-child(1) { left: 62%; width: 14%; }
  .hero-bands span:nth-child(2) { left: 80%; width: 4%; }
  .hero-bands span:nth-child(3) { left: 88%; width: 40%; }
  .groups { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  body { font-size: 1rem; }
  .brand .mark { height: 30px; }
  .brand .wordmark { height: 18px; }
  .site-nav ul { gap: .25rem 1.1rem; }
  .steps { grid-template-columns: 1fr; }
  .facts div { grid-template-columns: 1fr; gap: .15rem; }
}

@media print {
  .hero-bands, .site-nav, .skip { display: none; }
  .contact { background: none; }
}
