/* ============================================================
   HEXLY — shared design system
   "Specimen sheet + inspection accents"
   Light mode only · warm paper · near-black ink · one electric accent
   Loaded by every page. Page-specific decoration stays inline per page.
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* Paper + ink (warm, never pure #fff / #000) */
  --paper:            #FAF8F3;   /* page background — warm off-white */
  --paper-alt:        #F1EEE5;   /* alternating section band */
  --card:             #FFFFFF;   /* raised surfaces sit brighter than paper */
  --ink:              #17150F;   /* near-black warm — the brand color */
  --ink-2:            #423F37;   /* secondary text */
  --muted:            #6C6759;   /* warm muted grey */
  --hairline:         #E4E0D4;   /* thin rules */
  --hairline-strong:  #CDC7B6;   /* crop marks / heavier rules */

  /* One electric accent — inspection artifacts + primary CTA only */
  --accent:           #1B4DF5;
  --accent-press:     #123BC9;
  --accent-tint:      rgba(27, 77, 245, 0.08);
  --on-accent:        #FFFFFF;

  /* Type families */
  --font-display: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", system-ui, Arial, sans-serif;
  --font-sans:    -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, Helvetica, Arial, sans-serif;
  --font-mono:    "Sometype Mono", ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, monospace;

  /* Fluid type scale */
  --fs-mono:    0.75rem;                                    /* 12px  annotations */
  --fs-small:   0.8125rem;                                  /* 13px */
  --fs-body:    1rem;                                       /* 16px */
  --fs-lead:    clamp(1.0625rem, 0.98rem + 0.42vw, 1.25rem);
  --fs-h3:      clamp(1.15rem, 1.06rem + 0.45vw, 1.4rem);
  --fs-h2:      clamp(1.9rem, 1.42rem + 2.1vw, 3rem);
  --fs-display: clamp(2.85rem, 1.15rem + 7.6vw, 6.75rem);

  /* Spacing (4px base) */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px; --sp-5: 24px;
  --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-9: 96px; --sp-10: 128px;

  --maxw: 1160px;
  --gutter: clamp(20px, 5vw, 56px);
  --radius: 12px;
  --radius-sm: 8px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset-ish ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font-family: inherit; }
::selection { background: var(--accent); color: var(--on-accent); }

/* ---------- Layout primitives ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(64px, 10vw, 128px); }
.band-alt { background: var(--paper-alt); }

/* Thin hairline rule (a spec-sheet register line) */
.rule { border: 0; border-top: 1px solid var(--hairline); margin: 0; }
.rule--strong { border-top-color: var(--hairline-strong); }

/* Swatch strip — colored register bar used as a section divider */
.swatch-strip { display: flex; height: 6px; width: 100%; }
.swatch-strip span { flex: 1; }

/* Crop marks — small corner ticks framing a block */
.cropped { position: relative; }
.cropped::before, .cropped::after {
  content: ""; position: absolute; width: 10px; height: 10px; pointer-events: none;
}
.cropped::before { top: -1px; left: -1px; border-top: 1px solid var(--hairline-strong); border-left: 1px solid var(--hairline-strong); }
.cropped::after  { bottom: -1px; right: -1px; border-bottom: 1px solid var(--hairline-strong); border-right: 1px solid var(--hairline-strong); }

/* ---------- Typography ---------- */
.display {
  font-family: var(--font-display);
  font-size: var(--fs-display);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.035em;
  margin: 0;
}
.h2 {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  font-weight: 750;
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0;
}
.h3 {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
}
.lead { font-size: var(--fs-lead); line-height: 1.55; color: var(--ink-2); margin: 0; }
.body { font-size: var(--fs-body); color: var(--ink-2); margin: 0; }
.muted { color: var(--muted); }

/* Monospace marginalia / section index — the spec-sheet annotation voice */
.mono { font-family: var(--font-mono); }
.marginalia {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.index-num {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--accent);
}

/* Inline hex / value chip pinned next to a real color used on the page */
.hexchip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.02em;
  color: var(--muted); background: var(--card);
  border: 1px solid var(--hairline); border-radius: 5px;
  padding: 2px 7px; vertical-align: middle;
}
.hexchip .dot { width: 9px; height: 9px; border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12); }

/* ---------- Inspection artifact (signature hover accent) ----------
   Add data-inspect="<selector label>" to a small number of elements.
   On hover the element is "inspected": dashed accent outline + selector tag.
   BUDGET: 1–2 per viewport. */
[data-inspect] { position: relative; }
[data-inspect]:hover {
  outline: 1px dashed var(--accent);
  outline-offset: 5px;
}
[data-inspect]::after {
  content: attr(data-inspect);
  position: absolute; left: 0; top: 0; transform: translateY(-100%) translateY(-9px);
  font-family: var(--font-mono); font-size: 10px; line-height: 1; letter-spacing: 0.02em;
  color: var(--on-accent); background: var(--accent);
  padding: 4px 6px; border-radius: 5px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity 0.14s var(--ease);
}
[data-inspect]:hover::after { opacity: 1; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-sans); font-weight: 600; font-size: 0.9375rem; line-height: 1;
  border: 1px solid transparent; border-radius: 8px; padding: 13px 22px;
  cursor: pointer; white-space: nowrap;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease), transform 0.06s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-press); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--hairline-strong); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--lg { padding: 16px 28px; font-size: 1rem; }

/* Text link with monospace arrow */
.tlink {
  display: inline-flex; align-items: center; gap: 7px;
  font-weight: 600; font-size: 0.9375rem; color: var(--accent);
}
.tlink .arw { transition: transform 0.18s var(--ease); }
.tlink:hover .arw { transform: translateX(3px); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s var(--ease);
}
.nav.is-scrolled { border-bottom-color: var(--hairline); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.wordmark { display: inline-flex; align-items: center; gap: 9px; font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; letter-spacing: -0.03em; color: var(--ink); }
.wordmark img { width: 22px; height: 22px; }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-link { font-size: 0.9375rem; color: var(--muted); background: none; border: none; cursor: pointer; transition: color 0.15s var(--ease); }
.nav-link:hover { color: var(--ink); }
.nav-link[aria-current="page"] { color: var(--ink); font-weight: 600; }

.nav-menu { position: relative; }
.nav-menu > summary { display: inline-flex; align-items: center; gap: 5px; list-style: none; cursor: pointer; font-size: 0.9375rem; color: var(--muted); }
.nav-menu > summary::-webkit-details-marker { display: none; }
.nav-menu:hover > summary { color: var(--ink); }
.nav-menu.is-current > summary { color: var(--ink); font-weight: 600; }
.nav-menu .chev { transition: transform 0.18s var(--ease); }
.nav-menu[open] .chev { transform: rotate(180deg); }
.nav-menu-panel {
  position: absolute; top: calc(100% + 12px); right: 0; min-width: 184px; padding: 6px;
  background: var(--card); border: 1px solid var(--hairline); border-radius: 12px;
  box-shadow: 0 1px 2px rgba(17,17,17,0.04), 0 14px 32px rgba(17,17,17,0.10);
  display: flex; flex-direction: column;
}
.nav-menu-panel a { font-size: 0.9375rem; color: var(--muted); padding: 9px 12px; border-radius: 8px; white-space: nowrap; transition: background 0.12s var(--ease), color 0.12s var(--ease); }
.nav-menu-panel a:hover { background: var(--paper-alt); color: var(--ink); }
.nav-menu-panel a[aria-current="page"] { color: var(--ink); background: var(--paper-alt); }

@media (max-width: 680px) {
  .nav-links { gap: 18px; }
  .nav .btn { display: none; }
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--hairline); padding-block: 32px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.footer-left { display: flex; align-items: center; gap: 14px; font-size: 0.875rem; color: var(--muted); }
.footer-left .wordmark { font-size: 1rem; }
.footer-right { display: flex; align-items: center; flex-wrap: wrap; gap: 20px; }
.footer-right a { font-size: 0.875rem; color: var(--muted); transition: color 0.15s var(--ease); }
.footer-right a:hover { color: var(--ink); }

/* ---------- Scroll reveal (settles into place, spec-sheet compose) ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); will-change: opacity, transform; }
.reveal.is-in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal[data-delay="2"] { transition-delay: 0.16s; }
.reveal[data-delay="3"] { transition-delay: 0.24s; }

/* ---------- Inert "Pro launches soon" toast (pricing) ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(14px);
  background: var(--ink); color: var(--paper);
  font-family: var(--font-mono); font-size: 0.8125rem; letter-spacing: 0.01em;
  padding: 11px 16px; border-radius: 8px;
  box-shadow: 0 12px 30px rgba(17,17,17,0.22);
  opacity: 0; pointer-events: none; transition: opacity 0.2s var(--ease), transform 0.2s var(--ease); z-index: 100;
}
.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Reduced motion: full content, no motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
}
