/* ==========================================================
   VERYQUERY · design system
   Editorial cartography · warm paper · surveyor's amber

   Shared primitives: tokens, resets, base typography, reusable
   classes (.prose, .btn*, .eyebrow*, .field*). Loaded by the
   marketing site AND cross-origin by merchant.veryquery.com.

   Keep rules in their ORIGINAL source order relative to styles.css
   so the two files concatenated are cascade-equivalent to the
   pre-split file.
========================================================== */

:root {
  /* ---------- Paper & ink ---------- */
  --paper:        #EEE5CE;
  --paper-deep:   #E4D8B7;
  --paper-darker: #D6C69E;
  --ink:          #17140E;
  --ink-soft:     #2F2A20;
  --ink-mid:      #5E564A;
  --ink-ghost:    #948974;
  --rule:         #BBAA82;
  --rule-soft:    #D2C39A;
  --accent:       #B24718;
  --accent-deep:  #84310D;
  --accent-tint:  #E7D3B7;
  --forest:       #2A3328;

  /* ---------- Type ---------- */
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body:    "Instrument Sans", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --font-mono:    "Fragment Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --t-2xs: 0.6875rem;
  --t-xs:  0.75rem;
  --t-sm:  0.8125rem;
  --t-md:  0.9375rem;
  --t-base:1rem;
  --t-lg:  1.1875rem;
  --t-xl:  1.4375rem;
  --t-2xl: 1.875rem;
  --t-3xl: 2.625rem;
  --t-4xl: 3.75rem;
  --t-5xl: 5.375rem;
  --t-6xl: 7.5rem;

  /* ---------- Space ---------- */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4.5rem;
  --s-9: 6.5rem;
  --s-10: 9rem;
  --s-11: 12rem;

  /* ---------- Structure ---------- */
  --container: 1320px;
  --gutter:    clamp(1.25rem, 4vw, 3rem);
  --rule-w:    1px;

  /* ---------- Motion ---------- */
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-1: 240ms;
  --dur-2: 520ms;
  --dur-3: 900ms;
  --dur-4: 1400ms;
}

/* ==========================================================
   RESET
========================================================== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: var(--s-7); }
body {
  font-family: var(--font-body);
  font-size: var(--t-base);
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  position: relative;
}
/* Very faint paper grain */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='3'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.14 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.55;
  mix-blend-mode: multiply;
  z-index: 2;
}
/* Very faint coordinate grid */
body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(23,20,14,0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(23,20,14,0.04) 1px, transparent 1px);
  background-size: 64px 64px;
  z-index: 1;
}
main, header, footer, section { position: relative; z-index: 3; }

img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; background: none; border: 0; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
em { font-style: italic; }

/* ==========================================================
   TYPOGRAPHY BASE
========================================================== */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 420;
  font-variation-settings: "opsz" 144, "SOFT" 80;
  letter-spacing: -0.017em;
  line-height: 0.95;
  color: var(--ink);
}
h1 { font-size: clamp(3rem, 6.4vw, var(--t-5xl)); }
h2 { font-size: clamp(2.25rem, 5vw, var(--t-4xl)); }
h3 { font-size: clamp(1.375rem, 2.2vw, var(--t-xl)); }

p { color: var(--ink-soft); }

/* Multi-selector setting the mono small-caps look. Covers the standalone
   .eyebrow primitive plus many marketing-only classes (.sec__tag, etc.);
   the marketing classes don't exist on the dashboard so their rules are
   harmless no-ops. Preserved here (rather than in site/styles.css) so
   concatenation order with the standalone `.eyebrow { ... }` below is
   identical to the pre-split file. */
.eyebrow,
.sec__tag,
.sec__num,
.cap__tag,
.lens__num,
.lens__coord,
.hero__coords,
.ledger__head,
.field__k,
.foot__k,
.foot__base,
.hero__viz-cap,
.map__axis,
.map__points text,
.querylabel__text,
.flyw__cap {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-mid);
}

.prose p + p { margin-top: var(--s-4); }
.prose p {
  font-size: clamp(1rem, 1.1vw, var(--t-lg));
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 54ch;
}
.prose em {
  font-family: var(--font-display);
  font-style: italic;
  font-variation-settings: "opsz" 36, "SOFT" 50;
  color: var(--ink);
  font-weight: 420;
}

/* ==========================================================
   EYEBROW: small caps label used on the site and the dashboard
========================================================== */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  color: var(--ink-mid);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.eyebrow::after {
  content: "";
  width: 56px;
  height: 1px;
  background: var(--rule);
}
.eyebrow__sigil { color: var(--accent); font-family: var(--font-display); font-size: 1.1em; position: relative; top: 0.02em; text-transform: none; }

/* ==========================================================
   BUTTONS
========================================================== */
.btn {
  display: inline-flex;
  align-items: baseline;
  gap: 0.65em;
  padding: 0.9em 1.25em;
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid var(--ink);
  position: relative;
  cursor: pointer;
  transition: background var(--dur-1), color var(--dur-1), border-color var(--dur-1);
}
.btn__arrow {
  transition: transform var(--dur-1) var(--ease-out);
  font-family: var(--font-display);
  font-size: 1.1em;
}
.btn:hover .btn__arrow { transform: translate(3px, 0); }
.btn--primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.btn--primary:hover { background: var(--accent); border-color: var(--accent); }
.btn--ghost {
  background: transparent;
  color: var(--ink);
}
.btn--ghost:hover { background: var(--ink); color: var(--paper); }

/* ==========================================================
   FORM FIELDS
========================================================== */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.field {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  font-family: var(--font-body);
}
.field--wide { grid-column: 1 / -1; }
.field__k {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.12em;
  color: var(--ink-mid);
  text-transform: uppercase;
}
.field input,
.field select,
.field textarea {
  font-family: var(--font-body);
  font-size: var(--t-md);
  color: var(--ink);
  padding: var(--s-2) 0;
  border-bottom: 1px solid var(--ink);
  outline: none;
  resize: none;
  width: 100%;
  transition: border-color var(--dur-1);
}
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--accent); }
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23171410' fill='none' stroke-width='1'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right center;
  padding-right: var(--s-5);
  cursor: pointer;
}

/* ==========================================================
   REDUCED MOTION
========================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}

/* ==========================================================
   PRINT
========================================================== */
@media print {
  body::before, body::after { display: none; }
  * { color: #000 !important; background: #fff !important; }
}

/* ==========================================================
   GENERIC CONTAINER (dashboard-friendly)
   Marketing site uses its own scoped aliases (.sec__inner, etc.);
   dashboard uses this standalone class.
========================================================== */
.ds-container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
