/* The site wears the app's "Bright" look (BlueprintDaily/src/theme/palettes.ts): white ground,
   #3C3C3C ink, Blueprint Blue for the one main action, and the Blueprint canvas as the one dark
   object. The page is built as colour chapters: every section is one flat field ([data-field]),
   and the sticky header takes the colour of the chapter under it (js/header.js). */

@font-face {
  font-family: "Nunito";
  src: url("../assets/fonts/Nunito_600SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Nunito";
  src: url("../assets/fonts/Nunito_800ExtraBold.ttf") format("truetype");
  font-weight: 800;
  font-display: swap;
}

@font-face {
  font-family: "Nunito";
  src: url("../assets/fonts/Nunito_900Black.ttf") format("truetype");
  font-weight: 900;
  font-display: swap;
}

:root {
  --blue: #1e6fd9;
  --blue-lip: #1859ae;
  --blue-ink: #0b2547;
  --sky: #49c0f8;
  --ink: #3c3c3c;
  --muted: #6b6b6b;
  --paper: #ffffff;
  --raised: #f2f4f6;
  --night: #131f24;
  --night-raised: #202f36;
  --night-ink: #f1f7fb;
  --night-muted: #8fa1ab;
  --canvas: #1e252b;
  --canvas-bar: #151c22;
  --gold: #ffc800;
  --amber: #ffb020;
  --orange: #c2410c;
  --flame: #ff9600;
  --green: #218838;
  --lime: #58cc02;

  --radius: 16px;
  --margin: clamp(16px, 3.2vw, 48px);
  --gap: clamp(16px, 2vw, 24px);
  --chapter-pad: clamp(88px, 11vw, 168px);
  --header-h: 72px;

  --t-display: clamp(64px, 11vw, 168px);
  --t-h2: clamp(40px, 5.2vw, 80px);
  --t-h3: clamp(23px, 2.4vw, 36px);
  --t-body: 18px;
  --t-small: 15px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 8px);
  -webkit-text-size-adjust: 100%;
  scrollbar-color: #b9c2cc var(--paper);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-weight: 600;
  font-size: var(--t-body);
  line-height: 1.55;
  overflow-x: clip;
}

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

img,
svg,
video {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

a {
  color: inherit;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
}

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

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

h3 {
  font-size: var(--t-h3);
  line-height: 1.12;
}

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

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

.icon {
  width: 1em;
  height: 1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-solid {
  fill: currentColor;
  stroke: none;
}

/* ---------- Fields: each chapter is one flat colour with its own inks ---------- */

[data-field="blue"] {
  --field: var(--blue);
  --text: #ffffff;
  --soft: #dbe8fa;
  --focus: #ffffff;
  background: var(--blue);
  color: #ffffff;
}

[data-field="white"] {
  --field: var(--paper);
  --text: var(--ink);
  --soft: var(--muted);
  --focus: var(--blue);
  background: var(--paper);
  color: var(--ink);
}

[data-field="night"] {
  --field: var(--night);
  --text: var(--night-ink);
  --soft: var(--night-muted);
  --focus: var(--sky);
  background: var(--night);
  color: var(--night-ink);
}

[data-field="gold"] {
  --field: var(--gold);
  --text: var(--ink);
  --soft: #4d4430;
  --focus: var(--ink);
  background: var(--gold);
  color: var(--ink);
}

:focus-visible {
  outline: 3px solid var(--focus, var(--blue));
  outline-offset: 3px;
}

.chapter {
  padding-block: var(--chapter-pad);
}

.lead {
  max-width: 34em;
  margin-top: 28px;
  font-size: 20px;
  line-height: 1.5;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #ffffff;
  font-weight: 900;
}

.skip-link:focus {
  top: 12px;
}

/* ---------- Buttons: the app's key with a solid lip (Button.tsx) ---------- */

.button {
  --face: var(--blue);
  --lip: var(--blue-lip);
  --label: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  margin-bottom: 5px;
  /* The end padding gives back the trailing letter-spacing, so the label sits optically centred. */
  padding-block: 0;
  padding-inline: 26px calc(26px - 0.06em);
  border: 0;
  border-radius: var(--radius);
  background: var(--face);
  color: var(--label);
  font: inherit;
  font-weight: 900;
  font-size: 16px;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--lip); /* taste-skill-ignore: the app's lipped button is the brand's control */
  transition: transform 90ms ease-out, box-shadow 90ms ease-out, filter 160ms;
}

.button:hover {
  filter: brightness(1.07);
}

.button:active {
  transform: translateY(5px);
  box-shadow: 0 0 0 var(--lip); /* taste-skill-ignore: pressed state of the lipped button */
}

.button .icon {
  width: 20px;
  height: 20px;
}

.button-sm {
  min-height: 44px;
  margin-bottom: 4px;
  padding-inline: 18px calc(18px - 0.06em);
  font-size: var(--t-small);
  box-shadow: 0 4px 0 var(--lip); /* taste-skill-ignore: the app's lipped button */
}

.button-sm:active {
  transform: translateY(4px);
}

/* On a blue field the main action turns white so it still reads as the button. */
[data-field="blue"] .button {
  --face: #ffffff;
  --lip: #b8cdea;
  --label: var(--blue);
}

.text-link {
  font-weight: 900;
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  transition: text-decoration-color 160ms;
}

.text-link:hover {
  text-decoration-color: currentColor;
}

/* ---------- Header: takes the colour of the chapter beneath it ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--field);
  color: var(--text);
  transition: background-color 300ms ease-out, color 300ms ease-out;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  font-weight: 900;
  font-size: 20px;
  line-height: 1;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

/* The mark is a blue square: a light rim keeps it the same size on the blue header and the white footer. */
.site-header[data-field="blue"] .brand img {
  outline: 2px solid rgb(255 255 255 / 0.45);
  outline-offset: -2px;
}

.site-footer .brand img {
  outline: 2px solid color-mix(in srgb, var(--ink) 15%, transparent);
  outline-offset: -2px;
}

.site-nav {
  display: none;
}

.nav-links {
  display: flex;
  gap: clamp(16px, 2.4vw, 32px);
}

.nav-links a,
.page-links a {
  color: inherit;
  font-weight: 800;
  font-size: 16px;
  line-height: 1;
  text-decoration: none;
  padding-block: 12px;
  background: linear-gradient(currentColor, currentColor) 0 calc(100% - 4px) / 0 3px no-repeat; /* taste-skill-ignore: a 3px underline that grows on hover, not a gradient fill */
  transition: background-size 220ms var(--ease-out);
}

.nav-links a:hover,
.page-links a:hover,
.page-links a[aria-current="page"] {
  background-size: 100% 3px;
}

.page-links {
  display: flex;
  gap: 20px;
}

/* Wide screens: brand left, links centred in the space between, the one action right. */
@media (min-width: 960px) {
  .site-nav {
    display: flex;
    flex: 1;
    justify-content: center;
  }
}

/* Trim the line box to the caps so flex centring lines up the letters, not the font's ascent. */
@supports (text-box: trim-both cap alphabetic) {
  .brand,
  .nav-links a,
  .page-links a,
  .button {
    text-box: trim-both cap alphabetic;
  }
}

.site-header .button {
  margin-bottom: 0;
  transition: transform 90ms ease-out, box-shadow 90ms ease-out, filter 160ms, background-color 300ms, color 300ms;
}

@media (max-width: 400px) {
  .head-cta {
    padding-inline: 14px calc(14px - 0.04em);
    font-size: 14px;
    letter-spacing: 0.04em;
  }
}
