/* Driggsby 2.0: foundation.
 * Black ground, the system face, and dark liquid-glass surfaces that
 * refract an ambient bloom. */

:root {
  color-scheme: dark;

  /* Ground and ink. #ededed for display ink cuts glare on pure black;
     #a1a1a1 is the 7.9:1 body gray; #8f8f8f the 6.4:1 tertiary. */
  --bg: #000;
  --ink: #ededed;
  --ink-hi: #fafafa;
  --ink-2: #a1a1a1;
  --ink-3: #8f8f8f;
  --ink-4: #6b6b6b;

  /* Lines: the frame rail, a card edge, and a hover edge. */
  --rail: #1f1f1f;
  --line: #262626;
  --line-2: #333;
  --cross: #4d4d4d;

  /* Raised fills on the ladder: 4% / 7% / 10% white. */
  --fill-1: rgb(255 255 255 / 0.04);
  --fill-2: rgb(255 255 255 / 0.07);
  --fill-3: rgb(255 255 255 / 0.1);
  --panel: #0a0a0a;
  --panel-2: #111;

  /* The identity pair (the app's workspace mark): cloud cyan to road blue. */
  --cyan: oklch(0.78 0.13 205);
  --blue: oklch(0.66 0.16 258);
  --accent-grad: linear-gradient(90deg, var(--cyan), var(--blue));
  --pos: oklch(0.78 0.14 160);
  --neg: oklch(0.74 0.15 25);

  /* Data hues, from the app's category wheel. */
  --cat-food: oklch(0.75 0.16 55);
  --cat-shop: oklch(0.8 0.14 85);
  --cat-transport: oklch(0.65 0.15 258);
  --cat-home: oklch(0.78 0.15 115);
  --cat-utilities: oklch(0.72 0.14 148);
  --cat-fun: oklch(0.7 0.19 345);
  --cat-travel: oklch(0.68 0.14 300);
  --cat-saas: oklch(0.73 0.14 200);
  --cat-gold: oklch(0.8 0.14 85);
  --cat-coral: oklch(0.72 0.16 25);

  /* Glass. A 55% smoke over a blur that saturates what is behind it,
     a 10% ring, and a lit top edge. */
  --glass-bg: linear-gradient(180deg, rgb(255 255 255 / 0.055), rgb(255 255 255 / 0.015) 42%), rgb(18 18 18 / 0.58);
  --glass-filter: blur(24px) saturate(165%);
  --glass-ring: rgb(255 255 255 / 0.1);
  --glass-shadow:
    0 0 0 1px var(--glass-ring),
    inset 0 1px 0 rgb(255 255 255 / 0.09),
    0 1px 2px rgb(0 0 0 / 0.4),
    0 24px 64px -12px rgb(0 0 0 / 0.65);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  /* Layout. The frame is 1200 wide; 48px inside it puts content on 1104. */
  --frame: 1200px;
  --pad: 48px;
  --nav-h: 64px;
  /* The footer's height; main.js keeps it exact as the footer reflows. */
  --foot-h: calc(74px + env(safe-area-inset-bottom, 0px));
  --capsule: 820px;
  --sec-y: 112px;

  /* Motion: Apple's sheet spring for anything that travels, a softer
     standard curve for color and opacity. */
  --spring: cubic-bezier(0.32, 0.72, 0, 1);
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --out: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 8px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  font-feature-settings: "ss01" off;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg { display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
code, pre, kbd { font-family: var(--mono); }
h1, h2, h3, p { margin: 0; }
ol, ul { margin: 0; padding: 0; list-style: none; }
::selection { background: color-mix(in oklch, var(--blue) 45%, transparent); color: var(--ink-hi); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
/* Controls inside a clipping track ring inward so the ring is never cut. */
.seg-tab:focus-visible, .idea:focus-visible, .code-tab:focus-visible, .code-body:focus-visible { outline-offset: -2px; }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 16px; top: -48px; z-index: 100; padding: 8px 14px; border-radius: 8px; background: var(--ink); color: #000; font-size: 14px; font-weight: 500; transition: top 200ms var(--ease); }
.skip:focus { top: 12px; }

/* ---------- Icons ---------- */
.ico { flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.ico-12 { width: 12px; height: 12px; stroke-width: 2; }
.ico-14 { width: 14px; height: 14px; }
.ico-16 { width: 16px; height: 16px; }
.ico-18 { width: 18px; height: 18px; stroke-width: 1.6; }
.brand-glyph { fill: currentColor; stroke: none; }

/* ---------- Type ---------- */
.display {
  font-size: 72px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-wrap: balance;
}
.h2 {
  font-size: 48px;
  line-height: 1.0833;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--ink);
  text-wrap: balance;
}
.lead {
  font-size: 18px;
  line-height: 28px;
  letter-spacing: -0.011em;
  color: var(--ink-2);
  text-wrap: pretty;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  letter-spacing: -0.006em;
  color: var(--ink-2);
}
.eyebrow .ico { color: var(--ink-3); }
.ic {
  font-size: 0.9em;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--fill-2);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.06);
  color: var(--ink);
  white-space: nowrap;
}

/* ---------- Frame: the content column; sections part by space alone ---------- */
.frame {
  position: relative;
  width: min(var(--frame), calc(100% - 48px));
  margin: 0 auto;
}
.sec {
  position: relative;
  padding: var(--sec-y) var(--pad);
}

.sec-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
  gap: 48px;
  /* Bottoms aligned, which sets the intro's last line on the title's
     baseline. */
  align-items: end;
  margin-bottom: 64px;
}
.sec-head .h2 { max-width: 600px; }
/* Beside its intro, a title's size follows its column, so the longest first
   phrase (487px at 48px in the widest fallback face) keeps to one line. */
@media (min-width: 1025px) {
  .sec-head { container-type: inline-size; }
  .sec-head .h2 { font-size: clamp(36px, calc((100cqw - 488px) * 48 / 487), 48px); }
}
/* Every section title breaks at its phrase, so all of them read as the
   same two-line block instead of wrapping wherever a few pixels fall
   (a phone lets them wrap on their own, below). */
.h2-ln { display: block; }

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  font-weight: 500;
  letter-spacing: -0.011em;
  border-radius: 999px;
  transition: background-color 160ms var(--ease), box-shadow 160ms var(--ease), color 160ms var(--ease), transform 160ms var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn-xs { height: 28px; padding: 0 10px; font-size: 13px; gap: 6px; }
.btn-sm { height: 32px; padding: 0 14px; font-size: 14px; }
.btn-md { height: 36px; padding: 0 16px; font-size: 14px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 15px; }
.btn-primary { background: var(--ink); color: #0a0a0a; }
.btn-primary:hover { background: #fff; }
.btn-ghost { background: rgb(255 255 255 / 0.03); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn-ghost:hover { background: var(--fill-2); box-shadow: inset 0 0 0 1px #3d3d3d; }
.btn-lg .btn-arrow { margin-right: -2px; transition: transform 240ms var(--spring); }
.btn:hover .btn-arrow { transform: translateX(2px); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  color: var(--ink-3);
  transition: background-color 160ms var(--ease), color 160ms var(--ease);
}
.icon-btn:hover { background: var(--fill-2); color: var(--ink); }

/* Copy glyph: the copy icon gives way to a check, each scaling through
   the same point so the swap reads as one glyph changing. */
.copy-glyph { position: relative; display: inline-grid; width: 14px; height: 14px; flex: none; }
.copy-glyph .ico { grid-area: 1 / 1; transition: opacity 180ms var(--ease), transform 280ms var(--spring); }
.copy-glyph .g-check { opacity: 0; transform: scale(0.5); color: var(--pos); stroke-width: 2.25; }
.is-copied .copy-glyph .g-copy { opacity: 0; transform: scale(0.5); }
.is-copied .copy-glyph .g-check { opacity: 1; transform: scale(1); }

/* ---------- Glass ---------- */
.glass {
  position: relative;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
  box-shadow: var(--glass-shadow);
}
/* The lit rim: a gradient border, brightest at the top-left where the
   light falls, masked to a 1px ring. */
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(160deg, rgb(255 255 255 / 0.24), rgb(255 255 255 / 0.04) 28%, rgb(255 255 255 / 0) 55%, rgb(255 255 255 / 0.06));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}

/* ---------- Nav ---------- */
/* A flat bar on the frame at the top; once the page moves, it gathers
   into a floating glass capsule: the app's glass pane (a 40% smoke over a
   20px blur), its 20% ring and lit top edge, and on Chromium the app's
   own lens bending the rim (js/lens.js). It moves on the sheet spring;
   the nav keeps its height, so nothing under it shifts. */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: flex-start;
  pointer-events: none;
}
.nav-inner {
  --lens-bezel: 14; --lens-scale: 28; --lens-blur: 20; --lens-saturate: 170;
  pointer-events: auto;
  width: min(var(--frame), calc(100% - 48px));
  height: var(--nav-h);
  margin: 0 auto;
  padding: 0 var(--pad);
  display: flex;
  align-items: center;
  gap: 40px;
  border-radius: 0;
  box-shadow: 0 0 0 1px transparent, inset 0 1px 0 transparent, 0 8px 24px transparent;
  transition: width 0.8s var(--spring), height 0.8s var(--spring), margin-top 0.8s var(--spring), padding 0.8s var(--spring), gap 0.8s var(--spring), border-radius 0.8s var(--spring), background-color 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
/* At the top the bar is clear: no pane, and no lens. */
.nav:not(.is-scrolled) .nav-inner { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
.nav.is-scrolled .nav-inner {
  width: min(var(--capsule), calc(100% - 24px));
  height: 52px;
  margin-top: 12px;
  padding: 0 10px 0 22px;
  gap: 28px;
  border-radius: 26px;
  background-color: oklch(0.145 0 0 / 0.4);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  backdrop-filter: blur(20px) saturate(170%);
  box-shadow: 0 0 0 1px oklch(1 0 0 / 0.2), inset 0 1px 0 oklch(1 0 0 / 0.12), 0 8px 24px oklch(0 0 0 / 0.3);
}
.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.brand-d { width: 17px; height: 18px; fill: var(--ink); }
.brand-word { font-size: 18px; line-height: 1; font-weight: 600; letter-spacing: -0.035em; color: var(--ink); }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: -0.006em;
  color: var(--ink-2);
  transition: color 160ms var(--ease), background-color 160ms var(--ease);
}
.nav-links a:hover { color: var(--ink); background: var(--fill-1); }
.nav-actions { margin-left: auto; display: flex; gap: 8px; }

/* ---------- Cells (caption rows under a visual) ---------- */
.cells {
  display: grid;
  margin-top: 48px;
  border-top: 1px solid var(--rail);
}
.cells-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cells-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cell { padding: 28px 28px 0 0; }
.cell + .cell { padding-left: 28px; border-left: 1px solid var(--rail); }
.cell p { font-size: 15px; line-height: 24px; letter-spacing: -0.009em; color: var(--ink-3); text-wrap: pretty; }
.cell strong { font-weight: 500; color: var(--ink); }
.cell-ico { color: var(--ink-2); margin-bottom: 14px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--rail); }
/* One line under the rule: the company left, its terms right, 32 from
   the rule to the capitals and from the baseline to the page's end. */
.footer-inner {
  width: min(var(--frame), calc(100% - 48px));
  margin: 0 auto;
  padding: 26px var(--pad) calc(27px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  font-size: 13px;
  line-height: 20px;
  color: var(--ink-3);
}
.footer-docs { display: flex; gap: 24px; }
.footer-docs a { color: var(--ink-3); transition: color 160ms var(--ease); }
.footer-docs a:hover { color: var(--ink); }

/* ---------- Reveal ---------- */
/* Blocks rise into place; words also come into focus. A blur on a whole
   window would cost a phone its frame rate for no visible gain, so only
   text takes one. */
.js [data-reveal], .js [data-reveal-group] > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 640ms var(--out), transform 900ms var(--spring), filter 640ms var(--out);
  transition-delay: var(--d, 0ms);
}
.js :is(h1, h2, p, .eyebrow)[data-reveal] { filter: blur(4px); }
.js .is-in[data-reveal], .js [data-reveal-group].is-in > * { opacity: 1; transform: none; filter: none; }
/* The hero enters on its own as the page first paints, so the first
   screen never waits on a script to appear. */
.js [data-reveal][data-hero-in] { opacity: 1; transform: none; filter: none; transition: none; animation: hero-in 900ms var(--spring) both; animation-delay: calc(var(--hi, 0) * 70ms + 60ms); }
.js :is(h1, p)[data-reveal][data-hero-in] { animation-name: hero-in-text; }
@keyframes hero-in { from { opacity: 0; transform: translateY(16px); } }
@keyframes hero-in-text { from { opacity: 0; transform: translateY(16px); filter: blur(4px); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .js [data-reveal], .js [data-reveal-group] > * { opacity: 1; transform: none; filter: none; }
  .mq-track { animation: none !important; }
}

/* The review build's version tag: shown everywhere but driggsby.com, so a
   screenshot names its build. Over the footer it fades out, so it never
   covers a link. */
.lab-version { display: none; }
.show-version .lab-version { display: block; position: fixed; left: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); z-index: 70; padding: 3px 8px; border-radius: 96px; background: oklch(0.2 0 0 / 0.8); box-shadow: inset 0 0 0 1px oklch(1 0 0 / 0.12); font: 500 11px/14px -apple-system, BlinkMacSystemFont, sans-serif; color: oklch(0.8 0 0); font-variant-numeric: tabular-nums; pointer-events: none; transition: opacity 160ms var(--ease); }
.show-version .lab-version.is-away { opacity: 0; }
