/* site/flitmate.com/assets/site.css: the FlitMate website, direction B of
   Design/FLITMATE.md (the galley cart and its seals). Flat colours sampled
   from the cart; no gradients, no glass, no glow. Light follows the cart's
   aluminium; dark follows the bumper, and the label cards stay cream in both,
   as a real label does at night. Spacing keeps the brief's 8 px rhythm, with
   4 px half steps only inside label holders. */

/* The fonts come from this site (assets/fonts/, each family beside its
   licence), so a visit sends nothing to another host. Saira is Google's Latin
   cut of the 2020 family, which reserves no name; Saira Condensed Bold and
   IBM Plex Mono are their makers' own files, unmodified, as their reserved
   names require. */
@font-face { font-family: 'Saira Condensed'; src: url(fonts/saira/SairaCondensed-Bold.woff2) format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Saira'; src: url(fonts/saira/Saira-latin.woff2) format('woff2'); font-weight: 400 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url(fonts/ibm-plex-mono/IBMPlexMono-Regular-Latin1.woff2) format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url(fonts/ibm-plex-mono/IBMPlexMono-Medium-Latin1.woff2) format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }

:root {
  --aluminium: #C9CCCF;
  --aluminium-lit: #D7DADC;
  --rim: #8E9398;
  --seam: #5F6469;
  --bumper: #222428;
  --ink: #2E3136;
  --card: #F7F5EF;
  --seal-green: #2E9E5B;
  --seal-yellow: #F2C230;
  --seal-red: #D23A2E;
  --seal-red-deep: #B83228;

  --ground: var(--aluminium-lit);
  --panel: var(--aluminium);
  --cart: #B3B7BB;
  --text: var(--bumper);
  --text-body: var(--ink);
  --edge: var(--seam);
  --band: var(--bumper);

  --display: 'Saira Condensed', 'Saira', sans-serif;
  --body: 'Saira', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #222428;
    --panel: #33363B;
    --cart: #33363B;
    --text: #E7E8EA;
    --text-body: #B3B7BB;
    --edge: var(--rim);
    --band: #1A1B1E;
  }
}

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

html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--edge) var(--ground); }

/* A column as tall as the screen, so the footer sits at the bottom of a short page. */
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--ground);
  color: var(--text);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.55;
}
main { flex: 1 0 auto; }

::selection { background: var(--seal-yellow); color: var(--bumper); }

a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--seal-green); }

/* The focus ring: dark on the light ground and the cream card, yellow over the
   dark band, the footer and the dark ground. Yellow on aluminium is 1.19:1. */
:focus-visible { outline: 3px solid var(--focus, var(--bumper)); outline-offset: 3px; border-radius: 3px; }
.skip, .band, .foot { --focus: var(--seal-yellow); }
@media (prefers-color-scheme: dark) {
  main { --focus: var(--seal-yellow); }
  .doc { --focus: var(--bumper); }
}

/* Hidden by its own height, so a larger text size never brings it into view. */
.skip {
  position: absolute; left: 16px; top: 0; z-index: 10; transform: translateY(-110%);
  background: var(--card); color: var(--bumper);
  padding: 8px 16px; border-radius: 6px; font-weight: 600;
}
.skip:focus { top: 16px; transform: none; }

.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }

/* The top band: the cart's bumper. */
.band { background: var(--band); color: var(--card); border-bottom: 1px solid transparent; }
@media (prefers-color-scheme: dark) { .band { border-bottom-color: #3A3D42; } }
.band .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; padding-block: 8px; row-gap: 0; }
.band nav { display: flex; gap: 24px; font-size: 0.95rem; font-weight: 500; }
.band nav a { text-decoration: none; padding: 8px 2px; }
.band nav a:hover, .band nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--seal-green); }

.wordmark { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: inherit; }
.wordmark-text { font-family: var(--display); font-weight: 700; font-size: 1.75rem; line-height: 1; letter-spacing: 0.01em; text-transform: uppercase; }

/* The seal: a ring and a numbered flag. Colour carries meaning. */
.seal { display: inline-flex; align-items: center; color: var(--seal-green); }
.seal-ring { width: 20px; height: 20px; border: 5px solid currentColor; border-radius: 50%; }
.seal-flag {
  margin-left: -3px; min-width: 46px; padding: 2px 8px; border-radius: 3px;
  background: currentColor; text-align: center;
}
.seal-flag span { font-family: var(--mono); font-size: 0.72rem; font-weight: 500; color: var(--bumper); font-variant-numeric: tabular-nums; }
.seal--yellow { color: var(--seal-yellow); }
.seal--red { color: var(--seal-red-deep); }
.seal--red .seal-flag span { color: var(--card); }

/* The label holder: a cream card behind a rim. */
.holder {
  display: inline-block; background: var(--card); color: var(--bumper);
  border: 4px solid var(--rim); border-radius: 5px; padding: 4px 12px 2px;
  font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.01em;
}

/* Home: the first screen. */
.hero { padding: 56px 0 64px; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 56px; align-items: center; }
.hero h1 {
  margin: 0 0 24px; font-family: var(--display); font-weight: 700; text-transform: uppercase;
  font-size: clamp(2.6rem, 2rem + 3vw, 4.4rem); line-height: 0.98; letter-spacing: 0; text-wrap: balance;
  overflow-wrap: anywhere;
}
.lead { margin: 0 0 24px; font-size: 1.2rem; color: var(--text-body); max-width: 34ch; }

.stores { display: flex; flex-wrap: wrap; gap: 16px; margin: 0 0 24px; }
.store {
  display: inline-flex; flex-direction: column; gap: 0; padding: 8px 16px;
  background: var(--card); color: var(--bumper); border: 4px solid var(--rim); border-radius: 6px;
}
.store-when { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em; }
/* "App Store" keeps Apple's capitals: never set it all in capitals. */
.store-name { font-family: var(--display); font-weight: 700; font-size: 1.35rem; line-height: 1.1; }

.today { margin: 0; font-family: var(--mono); font-size: 0.85rem; color: var(--text-body); max-width: 52ch; }
.today + .today { margin-top: 8px; }

/* The cart illustration. */
.cart {
  background: var(--cart); border: 2px solid var(--edge); border-radius: 10px;
  padding: 16px 16px 0; display: flex; flex-direction: column; gap: 8px; overflow: hidden;
  max-width: 440px; width: 100%; justify-self: end;
}
.cart-drawer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--panel); border: 2px solid var(--edge); border-radius: 6px;
  padding: 16px;
}
@media (prefers-color-scheme: dark) { .cart-drawer { background: #2A2C30; } }
.cart-drawer .holder { font-size: 1.4rem; min-width: 9ch; text-align: center; }
.cart-bumper { height: 44px; margin: 8px -16px 0; background: var(--bumper); }
@media (prefers-color-scheme: dark) { .cart-bumper { background: #121315; } }

@keyframes seal-snap {
  from { transform: translateY(-7px) rotate(-10deg); }
  to { transform: none; }
}
.cart .seal { transform-origin: 10px 50%; animation: seal-snap 360ms cubic-bezier(0.16, 1, 0.3, 1) both; }
.cart .cart-drawer:nth-child(2) .seal { animation-delay: 120ms; }
.cart .cart-drawer:nth-child(3) .seal { animation-delay: 240ms; }
@media (prefers-reduced-motion: reduce) { .cart .seal { animation: none; } }

/* Home: the drawers, stacked as the drawer fronts of a cart, the label holder
   on the left and its sentence beside it once there is room. */
.section { padding: 64px 0; border-top: 2px solid var(--edge); }
.section h2 {
  margin: 0 0 24px; font-family: var(--display); font-weight: 700; text-transform: uppercase;
  font-size: clamp(2rem, 1.6rem + 1.6vw, 2.8rem); line-height: 1; text-wrap: balance;
}
.drawers { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; max-width: 860px; }
.drawer {
  background: var(--panel); border: 2px solid var(--edge); border-radius: 6px;
  padding: 16px; display: flex; flex-direction: column; gap: 16px;
}
.drawer h3 { margin: 0; font-size: 1.3rem; }
.drawer h3 .holder { display: block; text-align: center; }
.drawer p { margin: 0; color: var(--text-body); font-size: 1rem; }
@media (min-width: 640px) {
  .drawer { flex-direction: row; align-items: center; gap: 24px; }
  .drawer h3 { flex: 0 0 13ch; }
}

.sealed { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px; align-items: start; max-width: 860px; }
.sealed .seal { margin-top: 8px; }
.sealed .seal-ring { width: 34px; height: 34px; border-width: 7px; }
.sealed .seal-flag { min-width: 72px; padding: 4px 8px; }
.sealed .seal-flag span { font-size: 0.95rem; }
.sealed h2 { margin-bottom: 16px; }
.sealed p { margin: 0; color: var(--text-body); max-width: 58ch; }

.close { padding: 72px 0 80px; border-top: 2px solid var(--edge); }
.close h2 { margin: 0 0 16px; font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: clamp(2rem, 1.6rem + 1.6vw, 2.8rem); line-height: 1; }
.close p { margin: 0; color: var(--text-body); }

/* The plain pages: the label card is the page. */
.doc-page { padding: 40px 0 72px; }
.doc {
  background: var(--card); color: var(--bumper);
  border: 2px solid var(--edge); border-radius: 10px;
  padding: clamp(24px, 4vw, 56px); max-width: 860px; margin-inline: auto;
}
.doc h1 {
  display: inline-block; margin: 0 0 16px; background: var(--card);
  border: 4px solid var(--rim); border-radius: 5px; padding: 4px 16px 2px;
  font-family: var(--display); font-weight: 700; text-transform: uppercase;
  font-size: clamp(2rem, 1.6rem + 1.8vw, 3rem); line-height: 1.05;
}
.doc .stamp { margin: 0 0 24px; font-family: var(--mono); font-size: 0.85rem; color: var(--ink); }
.doc h2 {
  margin: 40px 0 8px; font-family: var(--display); font-weight: 700; text-transform: uppercase;
  font-size: 1.5rem; line-height: 1.1; scroll-margin-top: 24px;
}
.doc h3 {
  margin: 24px 0 8px; font-family: var(--display); font-weight: 700; text-transform: uppercase;
  font-size: 1.15rem; line-height: 1.15;
}
/* 34em keeps a line near 70 characters; 68ch in Saira is 776 px and never bites. */
.doc p, .doc li { color: var(--ink); max-width: 34em; overflow-wrap: anywhere; }
.doc p { margin: 0 0 16px; }
.doc ul, .doc ol { margin: 0 0 16px; padding-inline-start: 1.3em; }
.doc li { margin: 0 0 8px; }
.doc a { color: var(--bumper); }
.draft { font-family: var(--mono); font-size: 0.85rem; background: #FFF6D6; border: 2px dashed var(--seal-yellow); border-radius: 6px; padding: 8px 16px; }

/* The site footer: chrome, never part of a document. */
.foot { background: var(--band); color: var(--card); padding: 24px 0 40px; }
.foot .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; }
.foot-links { display: flex; gap: 24px; font-size: 0.95rem; }
.foot-links a { text-decoration: none; padding: 8px 2px; }
.foot-links a:hover { text-decoration: underline; text-decoration-color: var(--seal-green); }
.foot-line { flex-basis: 100%; font-family: var(--mono); font-size: 0.8rem; color: #C5C8CB; }

@media (max-width: 860px) {
  .hero { padding: 40px 0 48px; }
  .hero .wrap { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .cart { justify-self: stretch; max-width: none; }
  .sealed { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}
@media (max-width: 420px) {
  .band nav { gap: 16px; }
  .wordmark-text { font-size: 1.5rem; }
  .cart-drawer .holder { font-size: 1.2rem; }
}
/* After the 420 px rule, whose gap would reset the row gap: link rows wrap
   rather than run off a narrow phone at a large text size. */
.band nav, .foot-links { flex-wrap: wrap; row-gap: 0; }
