/* Caldair Creative. One typeface (Inter), a 12-column grid, black hairline rules.
   Colour comes only from the products' own brands. */

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #0a0a0a;
  --mute: #6b6b6b;
  --line: #0a0a0a;
  --hair: #dcdcdc;
  --bg: #ffffff;
  --panel: #f3f3f1;
  --max: 88rem;
  --pad: clamp(1rem, 3.2vw, 2.5rem);
  --gap: clamp(1rem, 2vw, 1.5rem);
  /* Two sizes only: heading and body. Two weights: 400 and 500. Two colours: --ink and --mute. */
  --h: clamp(2.25rem, 4.6vw, 4.5rem);
  --b: 1rem;
  --s: var(--b);
  --m: var(--b);
  --l: var(--h);
  --xl: var(--h);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #ededed;
    --mute: #9a9a9a;
    --line: #ededed;
    --hair: #2e2e2e;
    --bg: #0e0e0e;
    --panel: #1a1a1a;
  }
  .logo img { filter: invert(1); }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; color-scheme: light dark; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
h1, h2, h3, .display, .title { text-wrap: balance; }
p, li, dd, figcaption, summary { text-wrap: pretty; }
[id] { scroll-margin-top: 1.5rem; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--b)/1.5 "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-feature-settings: "cv11", "ss03";
  -webkit-font-smoothing: antialiased;
}
strong, b, th { font-weight: 500; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--bg); padding: 0.5rem 1rem; z-index: 10; }
.skip:focus { left: var(--pad); }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); }

/* Header and footer */
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 1.5rem; padding-bottom: 1.5rem; }
.logo img { height: 26px; width: auto; }
.site-header nav { display: flex; gap: clamp(1rem, 2.5vw, 2rem); font-size: var(--s); font-weight: 500; }
.site-header nav a { text-decoration: none; }
.site-header nav a:hover, .site-header nav a[aria-current] { text-decoration: underline; }

.site-footer { margin-top: clamp(4rem, 10vw, 9rem); }
.site-footer .wrap { border-top: 1px solid var(--line); padding-top: 1.25rem; padding-bottom: 2.5rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem 2rem; font-size: var(--s); color: var(--mute); }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.site-footer a { color: var(--ink); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* Type */
.display { font-size: var(--xl); font-weight: 500; line-height: 0.98; letter-spacing: -0.045em; }
.title { font-size: var(--l); font-weight: 500; line-height: 1.05; letter-spacing: -0.035em; }
.lead { font-size: var(--b); }
.label { font-size: var(--s); font-weight: 500; }
.mute { color: var(--mute); }
.num { font-variant-numeric: tabular-nums; }

/* Hero */
.hero { padding-top: clamp(3rem, 9vw, 8rem); padding-bottom: clamp(3rem, 8vw, 7rem); }
.hero .display { grid-column: 1 / span 11; }
.hero .lead { grid-column: 6 / span 6; margin-top: clamp(2rem, 5vw, 4rem); }

/* Sections: a black rule, a label in the first three columns, content in the rest */
.section { padding-top: 1.25rem; padding-bottom: clamp(3.5rem, 8vw, 7rem); }
.section > .grid { border-top: 1px solid var(--line); padding-top: 1.25rem; }
.section .label { grid-column: 1 / span 3; }
.section .body { grid-column: 4 / span 9; }

/* Work */
.work { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2.5rem, 5vw, 4rem) var(--gap); }
.work li { position: relative; }
.tile { aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden; position: relative; }
.tile img { position: relative; }
.tile .bgimg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.t-ww { background: #0d1132; }
.t-ww img { width: 30%; border-radius: 22%; }
.t-nc { background: #5200e4; }
.t-nc img { width: 52%; }
.t-lb { background: #faf6ef; }
.t-lb img { width: 30%; }
.t-px { background: #1b1b1b; }
.t-px img.mark { width: 56%; }
.t-px .bgimg { opacity: 0.55; }
.work .meta { display: grid; grid-template-columns: 1fr auto; gap: 0.25rem 1rem; border-top: 1px solid var(--line); margin-top: 1rem; padding-top: 0.75rem; }
.work h3 { font-size: var(--m); font-weight: 500; line-height: 1.2; }
.work h3 a { text-decoration: none; }
.work h3 a::after { content: ""; position: absolute; inset: 0; }
.work li:hover h3 a { text-decoration: underline; }
.work .where { font-size: var(--s); color: var(--mute); text-align: right; align-self: center; }
.work p.desc { grid-column: 1 / -1; color: var(--mute); max-width: 34rem; }
.work p.plat { grid-column: 1 / -1; font-size: var(--s); }

/* Numbered points */
.points { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem var(--gap); counter-reset: n; }
.points li { counter-increment: n; }
.points li::before { content: counter(n, decimal-leading-zero); display: block; font-size: var(--s); color: var(--mute); margin-bottom: 1.5rem; font-variant-numeric: tabular-nums; }
.points h3 { font-size: var(--m); font-weight: 500; line-height: 1.25; margin-bottom: 0.5rem; }
.points p { color: var(--mute); max-width: 26rem; }

/* Contact */
.big-link { font-size: var(--m); font-weight: 500; line-height: 1.3; text-decoration: none; border-bottom: 1px solid currentColor; }
.big-link:hover { border-bottom-width: 2px; }
.body .lead + .big-link { display: inline-block; margin-top: 0.75rem; }

/* Documents: privacy, terms, support */
.doc main { max-width: var(--max); margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); padding-top: clamp(2.5rem, 7vw, 6rem); }
.doc main > * { grid-column: 4 / span 7; }
.doc main > h1 { grid-column: 1 / span 12; font-size: var(--l); font-weight: 500; letter-spacing: -0.035em; line-height: 1.05; margin-bottom: 1rem; }
.doc .updated { color: var(--mute); margin-bottom: 2.5rem; }
.doc h2 { font-size: var(--m); font-weight: 500; margin: 3rem 0 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--line); }
.doc h3 { font-size: var(--b); font-weight: 500; margin: 1.75rem 0 0.4rem; }
.doc p, .doc ul, .doc ol { margin-bottom: 1rem; max-width: 42rem; }
.doc main ul { list-style: disc; padding-left: 1.2rem; }
.doc main ol { list-style: decimal; padding-left: 1.4rem; }
.doc li { margin-bottom: 0.35rem; }
.doc .summary h2 { margin-top: 0; border-top: 0; padding-top: 0; }
.doc .summary { background: var(--panel); padding: 1.25rem 1.5rem; margin-bottom: 2rem; }
.doc .summary > :last-child { margin-bottom: 0; }
.doc .toc { font-size: var(--s); margin: 2rem 0 1rem; }
.doc .toc h2 { margin-top: 0; }
.doc .toc ul, .doc .toc ol { list-style: none; padding-left: 0; columns: 2; column-gap: var(--gap); }
.tablewrap { overflow-x: auto; margin-bottom: 1.5rem; }
.doc table { border-collapse: collapse; width: 100%; font-size: var(--s); }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 0.6rem 0.75rem 0.6rem 0; border-bottom: 1px solid var(--hair); }
.doc th { font-weight: 500; border-bottom-color: var(--line); }
.doc details { border-bottom: 1px solid var(--hair); }
.doc details:first-of-type { border-top: 1px solid var(--hair); }
.doc summary { cursor: pointer; font-weight: 500; padding: 1rem 0; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.doc summary::-webkit-details-marker { display: none; }
.doc summary::after { content: "+"; font-weight: 400; }
.doc details[open] summary::after { content: "\2212"; }
.doc details > :not(summary) { max-width: 42rem; }

/* 404 */
.plain main { max-width: var(--max); margin: 0 auto; padding: clamp(3rem, 9vw, 8rem) var(--pad) 0; }
.plain main p { font-size: var(--m); max-width: 40rem; }
.plain h1 { font-size: var(--xl); font-weight: 500; letter-spacing: -0.045em; line-height: 0.98; margin-bottom: 1.5rem; }

@media (max-width: 900px) {
  .hero .display { grid-column: 1 / -1; }
  .hero .lead { grid-column: 1 / -1; }
  .section .label, .section .body { grid-column: 1 / -1; }
  .section .label { margin-bottom: 1.5rem; }
  .points { grid-template-columns: 1fr; gap: 2rem; }
  .doc main > *, .doc main > h1 { grid-column: 1 / -1; }
  .doc .toc ul, .doc .toc ol { columns: 1; }
}
@media (max-width: 640px) {
  .work { grid-template-columns: 1fr; }
  .site-header .wrap { flex-direction: column; align-items: flex-start; }
}
