/* Veldrin foundation: type, space, radius, motion, layout, the triangle, and reference components.
 * Load AFTER veldrin-colors.css. Components use only --color-* roles from that file.
 *
 * One typeface: Figtree (SIL Open Font License). Either self-host ../assets/fonts/Figtree-wght.ttf, or add to <head>:
 * <link rel="preconnect" href="https://fonts.googleapis.com">
 * <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
 * <link href="https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600&display=swap" rel="stylesheet">
 */
:root {
  /* ---------- type: Figtree for everything ---------- */
  --font-sans: Figtree, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;   /* code, and on the website labels and data (28 Nov 2026); never reading text */

  /* fluid scale: 375px -> 1440px viewport */
  --text-display: clamp(3.5rem, 2.38rem + 4.77vw, 6.5rem);   /* 56 -> 104 */
  --text-h1:      clamp(2.5rem, 1.8rem + 3vw, 4.5rem);       /* 40 -> 72  */
  --text-h2:      clamp(2rem, 1.65rem + 1.5vw, 3rem);        /* 32 -> 48  */
  --text-h3:      clamp(1.5rem, 1.32rem + 0.75vw, 2rem);     /* 24 -> 32  */
  --text-h4:      1.125rem;                                  /* 18 */
  --text-lead:    clamp(1.125rem, 1.08rem + 0.19vw, 1.25rem);/* 18 -> 20  */
  --text-body:    1rem;                                      /* 16, never smaller for paragraphs */
  --text-small:   0.875rem;                                  /* 14 */
  --text-label:   0.75rem;                                   /* 12, uppercase labels only */

  --weight-regular: 400;   /* body */
  --weight-medium: 500;    /* UI: nav, buttons */
  --weight-semibold: 600;  /* headings, labels, the wordmark's weight */

  --leading-display: 1.0;
  --leading-heading: 1.08;
  --leading-snug: 1.3;
  --leading-body: 1.6;

  --tracking-display: -0.035em;
  --tracking-h1: -0.03em;
  --tracking-h2: -0.025em;
  --tracking-h3: -0.02em;
  --tracking-label: 0.12em;

  --measure: 64ch;

  /* ---------- the triangle (equilateral, 60 degrees: the same shape as the logo's i-dot) ---------- */
  --tri-ratio: 0.866;                                         /* height = width x 0.866 */
  --tri-clip: polygon(50% 0, 100% 100%, 0 100%);

  /* ---------- space (4px base) ---------- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --space-10: 128px;
  --section-y: clamp(64px, 40px + 6vw, 128px);

  /* ---------- layout ---------- */
  --container: 1200px;
  --gutter: clamp(20px, 8px + 3.2vw, 64px);
  --grid-gap: clamp(16px, 12px + 1vw, 24px);

  /* ---------- radius ---------- */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  /* ---------- the ground: a heavy rule that sections and pages can stand on ---------- */
  --ground-height: clamp(6px, 4px + 0.3vw, 8px);

  /* ---------- borders and elevation ---------- */
  --border-width: 1px;
  --shadow-overlay: 0 12px 32px -12px rgb(13 21 28 / 0.28); /* menus, dialogs, popovers ONLY */

  /* ---------- motion ---------- */
  --duration-fast: 160ms;
  --duration-base: 240ms;
  --duration-slow: 480ms;
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --ease-exit: cubic-bezier(0.4, 0, 1, 1);
  --reveal-distance: 8px;
}

/* Phones (below 768 px, 28 November 2026): tighter section padding, so a long page reads as fewer screens. */
@media (max-width: 767px) {
  :root { --section-y: var(--space-7); }
}

@media (prefers-reduced-motion: reduce) {
  :root { --duration-fast: 0ms; --duration-base: 0ms; --duration-slow: 0ms; --reveal-distance: 0px; }
}

/* ======================================================================
 * Reference components. Copy the values, rename classes to fit your stack.
 * ====================================================================== */

.v-display { font: var(--weight-semibold) var(--text-display)/var(--leading-display) var(--font-sans); letter-spacing: var(--tracking-display); text-wrap: balance; }
.v-h1 { font: var(--weight-semibold) var(--text-h1)/1.02 var(--font-sans); letter-spacing: var(--tracking-h1); text-wrap: balance; }
.v-h2 { font: var(--weight-semibold) var(--text-h2)/var(--leading-heading) var(--font-sans); letter-spacing: var(--tracking-h2); text-wrap: balance; }
.v-h3 { font: var(--weight-semibold) var(--text-h3)/1.12 var(--font-sans); letter-spacing: var(--tracking-h3); }
.v-h4 { font: var(--weight-semibold) var(--text-h4)/var(--leading-snug) var(--font-sans); }
.v-lead { font: var(--weight-regular) var(--text-lead)/1.5 var(--font-sans); color: var(--color-text-muted); max-width: var(--measure); }
.v-body { font: var(--weight-regular) var(--text-body)/var(--leading-body) var(--font-sans); max-width: var(--measure); }
.v-small { font: var(--weight-regular) var(--text-small)/1.5 var(--font-sans); color: var(--color-text-muted); }
.v-label { font: var(--weight-semibold) var(--text-label)/1 var(--font-sans); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--color-text-muted); }

/* The rise: an inline equilateral triangle in the current text colour. For growth and results only. */
.v-rise { display: inline-block; width: 0.62em; height: calc(0.62em * var(--tri-ratio)); background: currentColor; clip-path: var(--tri-clip); margin-right: 0.22em; vertical-align: 0.02em; }

/* The i-dot move (once per page, in one headline): <span class="v-tri-i">ı</span> uses a dotless i (U+0131). */
/* line-height 1 pins the box: its bottom sits 0.155em below the baseline (Figtree metrics), so the dot's base lands at 0.596em, as in the logo spec. */
/* letter-spacing 0 keeps the box as wide as the glyph, so left: 50% is the stem's centre; the heading's tracking comes back as margin. */
.v-tri-i { position: relative; display: inline-block; line-height: 1; letter-spacing: 0; margin-right: var(--tri-i-tracking, var(--tracking-display)); }
.v-h1 .v-tri-i { --tri-i-tracking: var(--tracking-h1); }
.v-h2 .v-tri-i { --tri-i-tracking: var(--tracking-h2); }
.v-h3 .v-tri-i { --tri-i-tracking: var(--tracking-h3); }
.v-tri-i::before { content: ""; position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(0.596em + 0.155em); width: 0.148em; height: calc(0.148em * var(--tri-ratio)); background: var(--color-highlight, currentColor); clip-path: var(--tri-clip); } /* same proportions as the logo's dot; Sand on the website, never in the logo */

/* The ground: a heavy rule that a hero, cover or page stands on.
 * It must sit INSIDE its section with space or a caption row beneath it. As a section's last edge it would merge
 * into the next section's background. */
.v-ground { display: block; height: var(--ground-height); background: var(--color-text); border: 0; margin: 0; }
.v-ground-caption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-3); padding-block: var(--space-4) var(--space-5);
  font: var(--weight-semibold) var(--text-label)/1 var(--font-sans); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--color-text-muted); }

/* Buttons: Ink on Paper, or Paper on Ink. No accent colour. */
.v-button {
  display: inline-flex; align-items: center; gap: var(--space-2);
  min-height: 48px; padding: 0 22px; border-radius: var(--radius-pill);
  font: var(--weight-semibold) 15px/1 var(--font-sans); text-decoration: none; cursor: pointer;
  background: var(--color-text); color: var(--color-bg); border: var(--border-width) solid transparent;
  transition: background-color var(--duration-fast) var(--ease-standard);
}
.v-button:hover { background: color-mix(in oklch, var(--color-text) 86%, var(--color-bg)); }
.v-button--secondary { background: transparent; color: var(--color-text); border-color: var(--color-border-strong); }
.v-button--secondary:hover { background: var(--color-bg-subtle); }
.v-button .v-arrow { transition: transform var(--duration-fast) var(--ease-standard); }
.v-button:hover .v-arrow { transform: translate(2px, -2px); }

.v-link {
  color: var(--color-text); text-decoration: underline; text-decoration-thickness: 1px;
  text-underline-offset: 4px; text-decoration-color: var(--color-border-strong);
  transition: text-decoration-color var(--duration-fast) var(--ease-standard);
}
.v-link:hover { text-decoration-color: var(--color-text); }

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--color-focus); outline-offset: 3px;
}

.v-card {
  background: var(--color-bg-raised); color: var(--color-text);
  border: var(--border-width) solid var(--color-border); border-radius: var(--radius-lg);
  padding: clamp(var(--space-5), 2vw + 12px, var(--space-6));
}

.v-chip {
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: var(--radius-pill);
  background: var(--color-bg-raised); border: var(--border-width) solid var(--color-border);
  font: var(--weight-medium) 14px/1 var(--font-sans); color: var(--color-text);
}
.v-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-text-muted); flex: none; }

.v-input {
  width: 100%; min-height: 48px; padding: 0 var(--space-4); border-radius: var(--radius-md);
  background: var(--color-bg-raised); color: var(--color-text);
  border: var(--border-width) solid var(--color-border-strong); font: var(--weight-regular) 16px/1.4 var(--font-sans);
}

.v-container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
.v-section { padding-block: var(--section-y); }
.v-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--grid-gap); }

.v-reveal { opacity: 0; transform: translateY(var(--reveal-distance)); transition: opacity var(--duration-slow) var(--ease-standard), transform var(--duration-slow) var(--ease-standard); }
.v-reveal.is-visible { opacity: 1; transform: none; }
