/* XN Software. The rules behind every value here are in DESIGN.md. */

@font-face {
  font-family: "Newsreader";
  src: url("assets/fonts/newsreader/newsreader.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("assets/fonts/newsreader/newsreader-italic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
/* XN One, the face of the XN logo: for the small parts only (labels,
   navigation, buttons). It has no middle dot or symbols; those fall
   back to Newsreader, glyph by glyph. */
@font-face {
  font-family: "XN One";
  src: url("assets/fonts/xn-one/XNOne-Light.woff2") format("woff2");
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: "XN One";
  src: url("assets/fonts/xn-one/XNOne-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "XN One";
  src: url("assets/fonts/xn-one/XNOne-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --paper: #F4F1EA;
  --paper-2: #ECE8DE;
  --ink: #1E1D1A;
  --ink-2: #5E5A52;
  --ink-3: #6C675D;
  --rule: #D9D3C6;
  --clay: #A4502F;

  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --xn: "XN One", "Newsreader", sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);

  --width: 1120px;
  --gutter: 24px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1B1A17;
    --paper-2: #232220;
    --ink: #ECE8DF;
    --ink-2: #A9A397;
    --ink-3: #8C867A;
    --rule: #36342F;
    --clay: #DB7B57;
    color-scheme: dark;
  }
}

@media (min-width: 720px) {
  :root { --gutter: 48px; }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.6;
  font-optical-sizing: auto;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
@media (min-width: 720px) { body { font-size: 18px; } }

.wrap {
  width: 100%;
  max-width: calc(var(--width) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

h1, h2, h3 { font-weight: 400; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
em { font-style: italic; }

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

.skip {
  position: absolute; left: -9999px; top: 8px;
  background: var(--ink); color: var(--paper); padding: 8px 16px; border-radius: 999px; text-decoration: none;
}
.skip:focus { left: 16px; z-index: 10; }

.label {
  font-family: var(--xn);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: .06em;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.label .num { color: var(--clay); margin-right: 8px; }
.label .dot { margin: 0 4px; }

.lead {
  font-size: 19px;
  line-height: 1.45;
  color: var(--ink-2);
  max-width: 34em;
}
@media (min-width: 720px) { .lead { font-size: 22px; } }

/* Links and buttons */

.quiet {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-color: var(--ink-3);
  transition: text-decoration-color 160ms var(--ease);
}
.quiet:hover { text-decoration-color: var(--clay); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  font: 400 15px/1 var(--xn);
  letter-spacing: .02em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms var(--ease);
}
.btn svg { width: 14px; height: 14px; fill: currentColor; }
.btn:hover { background: var(--clay); }
/* the other systems' downloads, and how to open the one you got */
.get { margin: 12px 0 0; font-size: 15px; line-height: 1.5; color: var(--ink-2); max-width: 34em; }
.btn[aria-disabled="true"] { opacity: .5; cursor: default; pointer-events: none; }

/* Header */

.top { border-bottom: 1px solid var(--rule); }
.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  text-decoration: none;
  white-space: nowrap;
}
.lockup { height: 19px; width: auto; display: block; fill: var(--ink); }
.mark { height: 14px; width: auto; flex: none; fill: var(--ink); }
.tagline { font-family: var(--xn); font-size: 14px; letter-spacing: .03em; color: var(--ink-2); }

nav { display: flex; gap: 24px; }
nav a {
  font-family: var(--xn);
  font-size: 14px;
  letter-spacing: .03em;
  color: var(--ink-2);
  text-decoration: none;
  transition: color 160ms var(--ease);
}
nav a:hover { color: var(--ink); }
@media (max-width: 560px) { nav { display: none; } }

/* Hero */

.hero { padding-top: 96px; padding-bottom: 96px; }
.hero h1 {
  font-size: 44px;
  line-height: 1.02;
  letter-spacing: -.02em;
  margin: 24px 0 32px;
  max-width: 12em;
}
.hero .label .dot { margin: 0 6px; }
.hero h1 em { color: var(--clay); }
/* Typed in by main.js: the ghost keeps the words' space, the typed copy
   sits over it, and the cursor blinks while it types, then goes. */
.hero h1 em.typing { position: relative; display: inline-block; }
.hero h1 em.typing .ghost { visibility: hidden; }
.hero h1 em.typing .typed { position: absolute; left: 0; top: 0; white-space: nowrap; }
.hero h1 em .stop, .hero h1 em.typing .ghost { font-style: normal; }
.hero h1 em .stop { color: var(--ink); }
.hero h1 em .caret {
  display: inline-block;
  width: .06em;
  height: .82em;
  margin-left: .04em;
  vertical-align: -.06em;
  background: var(--clay);
  animation: caret 1s steps(1) infinite;
  transition: opacity 240ms var(--ease);
}
.hero h1 em .caret.done { opacity: 0; animation: none; }
@keyframes caret { 50% { opacity: 0; } }
.hero .lead { max-width: 30em; }
.hero-links { margin-top: 32px; }
@media (min-width: 720px) {
  .hero { padding-top: 144px; padding-bottom: 144px; }
  .hero h1 { font-size: 76px; }
}

/* Products */

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

.product {
  display: grid;
  gap: 32px;
  padding-top: 64px;
  padding-bottom: 64px;
  position: relative;
}
.product + .product::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--gutter);
  right: var(--gutter);
  border-top: 1px solid var(--rule);
}
.product .plate { order: -1; }

.words { display: flex; flex-direction: column; gap: 16px; max-width: 34em; }
.words h2 { font-size: 36px; line-height: 1.08; letter-spacing: -.01em; margin-top: 8px; }
.words ul { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.words li { position: relative; padding-left: 24px; color: var(--ink-2); }
.words li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .8em;
  width: 10px;
  border-top: 1px solid var(--ink-3);
}
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin-top: 16px; }

.plate {
  margin: 0;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 4px;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  color: var(--ink);
}
.plate svg { width: 100%; height: 100%; }
.plate svg * {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.plate svg .accent-fill { fill: var(--clay); stroke: var(--clay); }
.plate svg .accent-line { stroke: var(--clay); }
.plate svg title { display: none; }

@media (min-width: 900px) {
  .product {
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 64px;
    padding-top: 96px;
    padding-bottom: 96px;
  }
  .product .plate { order: 0; }
  .product.flip .plate { order: -1; }
  .words h2 { font-size: 52px; }
}

/* Together */

.together, .principles {
  border-top: 1px solid var(--rule);
  padding-top: 96px;
  padding-bottom: 96px;
}
.together h2, .principles h2 {
  font-size: 26px;
  line-height: 1.15;
  margin: 16px 0 48px;
}
@media (min-width: 720px) {
  .together h2, .principles h2 { font-size: 32px; }
}

.flow {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
  counter-reset: step;
}
.flow li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 16px;
  align-items: baseline;
  padding: 20px 0;
  border-top: 1px solid var(--rule);
  font-size: 21px;
  line-height: 1.4;
  color: var(--ink-2);
}
.flow li:last-child { border-bottom: 1px solid var(--rule); }
.flow li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--xn);
  font-size: 13px;
  letter-spacing: .06em;
  color: var(--ink-3);
}
.flow .who { color: var(--ink); font-style: italic; }
@media (min-width: 720px) {
  .flow li { font-size: 26px; grid-template-columns: 96px 1fr; }
}

/* Principles */

.principles .grid { display: grid; gap: 40px; }
.principles h3 { font-size: 22px; line-height: 1.25; margin-bottom: 10px; }
.principles p { color: var(--ink-2); max-width: 26em; }
@media (min-width: 900px) {
  .principles .grid { grid-template-columns: repeat(3, 1fr); gap: 48px; }
}

/* Footer */

.foot { border-top: 1px solid var(--rule); }
.foot-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  padding-top: 32px;
  padding-bottom: 48px;
}
.brand.small { gap: 12px; }
.fine { color: var(--ink-3); font-family: var(--xn); font-size: 13px; letter-spacing: .04em; }

/* The video player */

.player {
  width: min(960px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  overflow: hidden;
}
.player.tall { width: min(420px, calc(100vw - 32px)); }
.player::backdrop { background: color-mix(in srgb, var(--paper) 92%, transparent); }
.player[open] { animation: open 240ms var(--ease); }
.player-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 10px 10px 20px;
  border-bottom: 1px solid var(--rule);
}
.player-title { font-family: var(--xn); font-size: 15px; letter-spacing: .03em; margin-right: auto; }
.on-youtube { font-size: 14px; color: var(--ink-2); margin-right: 8px; text-decoration: none; transition: color 160ms var(--ease); }
.on-youtube:hover { color: var(--ink); }
.close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: background-color 160ms var(--ease), color 160ms var(--ease);
}
.close:hover { background: var(--paper-2); color: var(--ink); }
.close svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; fill: none; }
.frame { aspect-ratio: 16 / 9; background: #000; }
.player.tall .frame { aspect-ratio: 9 / 16; max-height: calc(100vh - 100px); margin: 0 auto; }
.frame iframe { width: 100%; height: 100%; border: 0; display: block; }

@keyframes open {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

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

/* The font and brand kit pages */

.kit-hero { padding-bottom: 64px; }
.kit-hero .actions { margin-top: 32px; }
nav a[aria-current="page"] { color: var(--ink); }
.kit { padding-top: 48px; padding-bottom: 48px; border-top: 1px solid var(--rule); }
.kit-h { font-size: 26px; line-height: 1.15; margin-bottom: 24px; }
@media (min-width: 720px) { .kit-h { font-size: 32px; } }
.kit-p { max-width: 38em; color: var(--ink-2); margin-bottom: 24px; }
.kit-list { margin: 0; padding-left: 1.1em; max-width: 38em; }
.kit-list li + li { margin-top: 8px; }
.kit .plate { aspect-ratio: auto; }

/* specimen */
.specimen-plate { padding: 32px; display: grid; gap: 24px; }
.xn-big { font: 400 clamp(120px, 26vw, 280px)/.9 var(--xn); color: var(--ink); }
.xn-set { font: 400 clamp(18px, 2.6vw, 30px)/1.4 var(--xn); letter-spacing: .02em; color: var(--ink); overflow-wrap: anywhere; }
@media (min-width: 900px) { .specimen-plate { grid-template-columns: auto 1fr; align-items: center; gap: 48px; padding: 48px; } }
.weights { list-style: none; margin: 0; padding: 0; }
.weights li { display: grid; gap: 8px; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.weights li:first-child { padding-top: 0; }
.xn-line { font: 400 clamp(30px, 6vw, 64px)/1.1 var(--xn); color: var(--ink); overflow-wrap: anywhere; }

/* tester */
.tester { padding: 24px; }
.tester-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--rule); }
.tester-bar label { display: inline-flex; align-items: center; gap: 12px; }
.tester-bar input[type="range"] { accent-color: var(--clay); width: min(220px, 50vw); }
.tester-bar output { min-width: 3ch; font-variant-numeric: tabular-nums; }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 999px; padding: 3px; }
.seg button { font: 400 14px/1 var(--xn); letter-spacing: .03em; color: var(--ink-2); background: none; border: 0; border-radius: 999px; padding: 8px 14px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.tester-text { font: 400 72px/1.1 var(--xn); color: var(--ink); padding-top: 24px; outline: none; overflow-wrap: anywhere; min-height: 1.2em; }

/* in use */
.uses { display: grid; gap: 24px; }
@media (min-width: 900px) { .uses { grid-template-columns: 1fr 1fr; } }
.use { margin: 0; padding: 24px; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; min-height: 300px; }
.use figcaption { margin: 0; }
.use-card { background: var(--paper); border: 1px solid var(--rule); border-radius: 4px; padding: 24px; }
.use-h { font-size: 36px; line-height: 1.08; margin: 8px 0; }
.use-p { color: var(--ink-2); margin-bottom: 16px; }
.use-card .btn { pointer-events: none; }
.use-poster { background: var(--ink); color: var(--paper); border-radius: 4px; padding: 32px; flex: 1; display: flex; align-items: flex-end; }
.xn-poster { font: 700 clamp(30px, 5vw, 44px)/1.08 var(--xn); letter-spacing: -.01em; }
.use-app { background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; font-family: var(--xn); overflow: hidden; }
.app-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--rule); font-size: 15px; }
.app-tabs { display: inline-flex; gap: 16px; font-size: 13px; color: var(--ink-2); }
.app-tabs b { font-weight: 400; color: var(--ink); box-shadow: inset 0 -2px var(--clay); padding-bottom: 4px; }
.app-rows { display: grid; grid-template-columns: 1fr auto; gap: 12px 16px; padding: 16px; font-size: 14px; font-weight: 300; }
.app-rows .mono { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.use-sign { flex: 1; display: grid; place-content: center; text-align: center; gap: 8px; border: 1.5px solid var(--ink); border-radius: 4px; padding: 32px 16px; }
.xn-sign { font: 300 clamp(34px, 6vw, 52px)/1 var(--xn); letter-spacing: .02em; }
.xn-sign-sub { font: 300 15px/1.3 var(--xn); letter-spacing: .06em; color: var(--ink-2); }

/* brand kit */
.assets { display: grid; gap: 32px 24px; }
@media (min-width: 720px) { .assets { grid-template-columns: 1fr 1fr; } }
.asset { margin: 0; }
.asset-art { display: flex; align-items: center; justify-content: center; gap: 24px; padding: 48px 24px; min-height: 200px; }
.asset-art.dark { background: #1B1A17; border-color: #1B1A17; }
.asset-art svg { width: auto; max-width: 100%; display: block; }
.asset-art .lockup { height: 40px; fill: var(--ink); }
.asset-art.dark .lockup, .asset-art.dark .mark { fill: #FFFFFF; }
.asset-art .mark { height: 56px; }
.icon-art { width: 96px; height: 96px; border-radius: 22px; }
.icon-art + .icon-art { box-shadow: 0 0 0 1px var(--rule); }
.asset figcaption { display: grid; gap: 4px; margin-top: 12px; }
.asset-name { display: block; font-size: 20px; }
.files { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 4px; font-family: var(--xn); font-size: 14px; letter-spacing: .03em; }
.rules { display: grid; gap: 32px; align-items: center; }
@media (min-width: 900px) { .rules { grid-template-columns: 1fr 1fr; } }
.rule-art { margin: 0; padding: 32px; display: grid; gap: 16px; justify-items: center; }
.space { padding: 28px; outline: 1px dashed var(--clay); outline-offset: -1px; }
.space .mark { height: 56px; display: block; }
.swatches { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.swatches li { display: grid; gap: 4px; }
.chip { display: block; height: 72px; border-radius: 4px; border: 1px solid var(--rule); margin-bottom: 8px; }
.sw-name { font-size: 18px; }
.type-pair { display: grid; gap: 24px; }
@media (min-width: 900px) { .type-pair { grid-template-columns: 1fr 1fr; } }
.type-card { padding: 32px; display: grid; gap: 12px; align-content: start; }
.type-sample { font-size: clamp(30px, 4.5vw, 44px); line-height: 1.1; margin-bottom: 8px; }
.type-sample.serif em { color: var(--clay); }
.type-sample.xn { font-family: var(--xn); letter-spacing: .02em; }
.our-line { font-size: clamp(30px, 5vw, 48px); line-height: 1.1; margin-bottom: 24px; max-width: 16em; }
/* the plates' line-drawing style is for the product drawings, not for the logo or the type */
.kit .plate svg path, .kit .plate svg * { fill: inherit; stroke: none; }
.kit .tester, .kit .type-card { text-align: left; place-items: stretch; justify-items: stretch; }
.kit .type-card { justify-content: stretch; align-items: start; }
.tester-text { overflow-wrap: break-word; }
@media (max-width: 560px) { .tester-text { font-size: 44px; } }
.asset-art.dark { border-color: var(--rule); }
