/* ============================================================
   DashCode — Dash Flow, the site's page system (DESIGN.md).
   Shared by every page that has moved to it (the landing page and /docs):
   the self-hosted fonts, the page tokens (light + dark), the base, the
   pill (the one control shape), the header and the footer slab.
   Page files add their own layout after this; the app's own look (the
   demo window, the /docs mocks) lives in css/app-ui.css.
   ============================================================ */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/inter-latin.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/assets/fonts/jetbrains-mono-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("/assets/fonts/source-serif-4-latin.woff2") format("woff2");
}

:root {
  /* surfaces: white page, warm paper for fills */
  --surface:       #ffffff;
  --paper:         #f2f1ed;
  --paper-hover:   #f7f6f5;
  --paper-strong:  #dbd7cd;

  /* text is black at an alpha, so it takes the warmth of what's under it */
  --text:          #000000;
  --text-2:        rgba(0, 0, 0, .55);
  --text-3:        rgba(0, 0, 0, .4);
  --rule:          rgba(0, 0, 0, .1);
  --ring-hover:    #2a2420;
  --link-hover:    #50473e;

  /* the one action shape: a black pill */
  --btn:           #000000;
  --btn-hover:     #2a2420;
  --btn-ink:       #ffffff;

  --ok:            #3a8f5d;
  --danger:        #c2412a;

  /* the grainy mesh behind the demo: amber and cornflower on cream */
  --mesh-base:     #f3ecdf;
  --mesh-amber:    #f2be74;
  --mesh-amber-2:  #e19a34;
  --mesh-blue:     #6fadff;
  --mesh-blue-2:   #3991ff;
  --mesh-alpha:    1;
  --grain-alpha:   .13;
  /* film grain: fractal noise as a tile */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  --window-shadow: 0 1px 2px rgba(2, 6, 23, .05), 0 30px 60px -20px rgba(70, 45, 10, .28);

  --serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --sans:  "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --ease:     cubic-bezier(.4, 0, .2, 1);
  --ease-out: cubic-bezier(.22, 1, .36, 1);

  --gutter: 32px;
  --max:    1448px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface:       #0f0e0c;
    --paper:         #1b1a17;
    --paper-hover:   #23211d;
    --paper-strong:  #36322b;

    --text:          #f5f3ee;
    --text-2:        rgba(245, 243, 238, .62);
    --text-3:        rgba(245, 243, 238, .42);
    --rule:          rgba(245, 243, 238, .12);
    --ring-hover:    #c9bfb2;
    --link-hover:    #c9bfb2;

    --btn:           #f5f3ee;
    --btn-hover:     #dcd8cf;
    --btn-ink:       #000000;

    --ok:            #78c091;
    --danger:        #f08a6f;

    --mesh-base:     #1d1813;
    --mesh-alpha:    .5;
    --grain-alpha:   .2;
    --window-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 30px 70px -20px rgba(0, 0, 0, .7);
  }
}

* { box-sizing: border-box; }
/* sections the script focuses after an in-page link take the reading position, not a focus ring */
[tabindex="-1"]:focus { outline: none; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--surface);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 20px;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: color-mix(in srgb, var(--mesh-amber) 55%, transparent); color: var(--text); }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* the logomark as drawn, not set in type. Width follows the cropped viewBox (413.6 × 48.4). */
.logomark { display: block; flex: none; width: auto; aspect-ratio: 413.6 / 48.4; }

/* ============================== PILLS ============================== */
/* Everything you can press is a pill. Border stays transparent so variants line up. */
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: 400 14px/20px var(--sans);
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 150ms var(--ease), color 150ms var(--ease);
}
.pill svg { width: 16px; height: 16px; flex: none; }
.pill--primary { background: var(--btn); color: var(--btn-ink); }
.pill--primary:hover { background: var(--btn-hover); }
.pill--primary:active { background: var(--btn); }
.pill--secondary { background: var(--paper); color: var(--text); }
.pill--secondary:hover { background: var(--paper-hover); }
.pill--secondary:active { background: var(--paper-strong); }
.pill--ghost { background: transparent; color: var(--text); transition-duration: 100ms; }
.pill--ghost:hover { background: var(--paper); }

/* ============================== HEADER ============================== */
.top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  width: min(100% - 2 * var(--gutter), var(--max));
  height: 72px;
  margin: 0 auto;
}
.top__brand { display: inline-flex; align-items: center; height: 40px; color: var(--text); justify-self: start; }
.top__brand .logomark { height: 20px; }
.top__nav, .top__actions { display: flex; align-items: center; gap: 4px; }
.top__actions { justify-self: end; }

/* ============================== FOOTER ============================== */
.foot {
  margin-top: 160px;
  border-radius: 32px 32px 0 0;
  background: var(--paper);
}
.foot__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
  width: min(100% - 2 * var(--gutter), var(--max));
  margin: 0 auto;
  padding: 72px 0 64px;
}
.foot__lead .logomark { height: 18px; color: var(--text); }
.foot__lead p { margin: 18px 0 0; max-width: 30em; color: var(--text-2); }
.foot__col h2 {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-weight: 200;
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text-2);
}
.foot__col ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }

.foot__base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(100% - 2 * var(--gutter), var(--max));
  margin: 0 auto;
  padding: 20px 0 32px;
  border-top: 1px solid var(--rule);
  font-size: 12px;
  line-height: 16px;
  color: var(--text-2);
}
.foot__base .sig { display: inline-flex; align-items: center; gap: 7px; }
.foot__base a { color: var(--text); text-decoration: none; transition: color 150ms var(--ease); }
.foot__base a:hover { color: var(--link-hover); }

/* ============================== responsive ============================== */
@media (max-width: 1080px) {
  .foot__inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .foot__lead { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .top { height: 64px; grid-template-columns: auto 1fr auto; gap: 4px; }
  .top__nav { justify-self: end; }
  .top__brand .logomark { height: 17px; }
  .top__hide-sm { display: none; }
  .foot { margin-top: 112px; border-radius: 24px 24px 0 0; }
  .foot__inner { grid-template-columns: minmax(0, 1fr); gap: 40px; padding: 56px 0 48px; }
  .foot__base { padding-bottom: 28px; }
}
@media (max-width: 360px) {
  .top__brand .logomark { height: 15px; }
  .top .pill { padding: 0 10px; }
}

/* footer columns may hold links (/docs) */
.foot__col a { text-decoration: none; transition: color 150ms var(--ease); }
.foot__col a:hover { color: var(--link-hover); }
