/* merged. brand tokens + base reset
   Copy into the site (e.g. /css/tokens.css) and load it before any other stylesheet.
   Source: Design Guide New.pdf. Values marked "web extension" are not in the PDF. */

/* Mona Sans, self-hosted (SIL OFL, see fonts/OFL.txt). Only the two brand styles. */
@font-face {
  font-family: "Mona Sans";
  src: url("fonts/MonaSans-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Mona Sans";
  src: url("fonts/MonaSans-ExtraBoldItalic.woff2") format("woff2");
  font-weight: 800;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: dark;

  /* ---- Color: the only three brand colors (+ shadow black) ---- */
  --c-black: #141414;
  --c-white: #ffffff;
  --c-orange: #ff6c0a;
  --c-shadow: #000000;

  /* Muted text = white at reduced opacity, never a new gray (web extension) */
  --c-white-muted: rgb(255 255 255 / 0.7);
  --c-white-faint: rgb(255 255 255 / 0.6); /* lowest allowed for text */

  /* ---- Type ---- */
  --font: "Mona Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fw-text: 400;
  --fw-title: 800; /* always with font-style: italic */

  /* Base size: 1rem mobile, 1.125rem >= 48rem (web extension) */
  --fs-text: 1rem;

  /* Brand scale, ratio 1.25 */
  --fs-sub2: calc(var(--fs-text) * 1.25);     /* 125%    */
  --fs-sub1: calc(var(--fs-text) * 1.5625);   /* 156.25% */
  --fs-title: calc(var(--fs-text) * 1.953);   /* 195.3%  */

  /* Display sizes continue the 1.25 scale, fluid (web extension) */
  --fs-display-1: clamp(var(--fs-title), 4.5vw, calc(var(--fs-text) * 2.441));
  --fs-display-2: clamp(calc(var(--fs-text) * 2.441), 6vw, calc(var(--fs-text) * 3.052));
  --fs-display-3: clamp(calc(var(--fs-text) * 2.441), 8vw, calc(var(--fs-text) * 4.768));
  --fs-display-4: clamp(calc(var(--fs-text) * 3.052), 10.5vw, calc(var(--fs-text) * 7.451));

  /* Line heights (brand) */
  --lh-text: 1.45;
  --lh-sub2: 1.3;
  --lh-sub1: 1.2;
  --lh-title: 1.1;
  --lh-display: 1.05; /* web extension */

  /* Gap between stacked text blocks = line height of the SMALLER block (brand rule) */
  --gap-text: calc(var(--fs-text) * var(--lh-text));
  --gap-sub2: calc(var(--fs-sub2) * var(--lh-sub2));
  --gap-sub1: calc(var(--fs-sub1) * var(--lh-sub1));
  --gap-title: calc(var(--fs-title) * var(--lh-title));

  /* ---- Lines & geometry ---- */
  --line: 1px;                           /* the ONLY line weight */
  --line-color: var(--c-white);
  --rule: var(--line) solid var(--line-color);
  --overshoot: clamp(0.75rem, 2.5vw, 2rem); /* how far sketch lines run past a corner (web extension) */
  --accent-square: clamp(0.75rem, 1.6vw, 1.25rem);

  /* ---- Layout (web extension) ---- */
  --gutter: 1.25rem;                        /* side padding on mobile */
  --col-gap: clamp(1rem, 2.5vw, 2rem);
  --max-width: 90rem;
  --section-pad: clamp(4rem, 9vw, 8rem);  /* distance between two sections */
  --space-block: clamp(1.5rem, 3.5vw, 3rem); /* distance between blocks inside a section */
  --title-rule-width: min(33%, 20rem);   /* short underline below big titles */

  /* ---- Depth ---- */
  --shadow-media: 0 1.5rem 3rem -0.75rem rgb(0 0 0 / 0.65);  /* fading black, pictures/renders only */
  --fade-bottom: linear-gradient(to bottom, rgb(0 0 0 / 0) 0%, rgb(0 0 0 / 0.75) 100%);

  /* ---- Motion (web extension) ---- */
  --t-fast: 120ms;
  --t-base: 180ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

@media (min-width: 768px) {
  :root {
    --fs-text: 1.125rem; /* 1.125rem */
    --gutter: clamp(1.5rem, 4vw, 4rem);
  }
}

/* ---- Base reset ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
  border-radius: 0 !important; /* brand: no rounded corners, ever */
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Big screens: the whole site (all sizes are in rem) grows with the
     screen from 1440×900 up, by width or height, whichever is smaller, so
     text and pictures keep the proportions of a 1440×900 screen up to 4K.
     Below that it's the normal 100%. */
  font-size: max(100%, min(1.1111vw, 1.7778vh));
}

body {
  margin: 0;
  background: var(--c-black);
  color: var(--c-white);
  font-family: var(--font);
  font-weight: var(--fw-text);
  font-size: var(--fs-text);
  line-height: var(--lh-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Brand: never divide words with dashes */
body,
h1, h2, h3, h4, h5, h6, p, li, a, button, label {
  hyphens: none;
  -webkit-hyphens: none;
  overflow-wrap: normal;
  word-break: normal;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: var(--fw-title);
  font-style: italic;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

/* Type roles */
.t-display-3 { font-size: var(--fs-display-3); line-height: var(--lh-display); }
.t-display-2 { font-size: var(--fs-display-2); line-height: var(--lh-display); }
.t-display-1 { font-size: var(--fs-display-1); line-height: var(--lh-display); }
.t-title     { font-size: var(--fs-title);     line-height: var(--lh-title); }
.t-sub1      { font-size: var(--fs-sub1);      line-height: var(--lh-sub1); }
.t-sub2      { font-size: var(--fs-sub2);      line-height: var(--lh-sub2); }
.t-text      { font-size: var(--fs-text);      line-height: var(--lh-text); font-weight: var(--fw-text); font-style: normal; }

.t-display-3, .t-display-2, .t-display-1, .t-title, .t-sub1, .t-sub2 {
  font-weight: var(--fw-title);
  font-style: italic;
}

/* Block gaps: the following block's gap = line height of the smaller block.
   Body text is always the smallest, so anything followed by / following text uses --gap-text. */
.stack > * + * { margin-top: var(--gap-text); }
.stack > .t-sub2 + .t-sub2 { margin-top: var(--gap-sub2); }
.stack > .t-sub1 + .t-sub2,
.stack > .t-sub2 + .t-sub1 { margin-top: var(--gap-sub2); }
.stack > .t-title + .t-sub1,
.stack > .t-sub1 + .t-title { margin-top: var(--gap-sub1); }
.stack > .t-title + .t-sub2,
.stack > .t-sub2 + .t-title { margin-top: var(--gap-sub2); }

/* The orange dot in "merged." */
.dot { color: var(--c-orange); }

a {
  color: inherit;
  text-decoration-thickness: var(--line);
  text-underline-offset: 0.2em;
}

img,
video,
picture,
svg {
  display: block;
  max-width: 100%;
  height: auto;
  border: 0;       /* brand: media is never framed */
  outline: 0;
}

/* Form controls: kill native rounding/styling (iOS rounds inputs) */
input,
button,
select,
textarea {
  font: inherit;
  color: inherit;
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: 0;
  margin: 0;
}

:focus-visible {
  outline: var(--line) solid var(--c-orange);
  outline-offset: 0.25rem;
}

::selection {
  background: var(--c-orange);
  color: var(--c-black);
}

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