/* EmbedCore site: tokens, base type, header, footer, buttons and forms shared by every page.
   Paper-and-ink palette with the logo's cobalt as the one accent and a highlighter yellow for matches.
   Light and dark follow the visitor's system setting. */

:root {
  color-scheme: light dark;

  --bg: #f4f0e6;
  --bg-2: #ebe5d6;
  --fg: #16140f;
  --fg-2: #4a4639;
  --fg-3: #6b6556;
  --line: rgba(22, 20, 15, 0.16);
  --line-strong: rgba(22, 20, 15, 0.85);

  --accent: #1c4fd1;        /* links and focus rings */
  --accent-fill: #2459e0;   /* filled surfaces (the logo's blue) */
  --on-accent-fill: #ffffff;

  --mark: #ffd93d;
  --on-mark: #16140f;

  --band: #2152d6;
  --on-band: #ffffff;
  --on-band-2: rgba(255, 255, 255, 0.88);
  --band-line: rgba(255, 255, 255, 0.28);

  --inv: #16140f;
  --on-inv: #f4f0e6;
  --on-inv-2: rgba(244, 240, 230, 0.74);
  --inv-line: rgba(244, 240, 230, 0.22);

  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .055 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --shot-bg: #1c1a4f;       /* shows while a screenshot loads; matches their desktop backdrop */
  --shadow: 0 1px 0 rgba(22, 20, 15, 0.06), 0 24px 48px -24px rgba(22, 20, 15, 0.45);

  --f-display: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --f-body: 'Hanken Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --wrap: 1320px;
  --gutter: clamp(16px, 4vw, 48px);
  --header-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1012;
    --bg-2: #16181c;
    --fg: #eeeadf;
    --fg-2: #b9b4a6;
    --fg-3: #928d80;
    --line: rgba(238, 234, 223, 0.16);
    --line-strong: rgba(238, 234, 223, 0.78);

    --accent: #8fadff;
    --accent-fill: #8fadff;
    --on-accent-fill: #0f1012;

    --band: #1d3fa6;
    --band-line: rgba(255, 255, 255, 0.24);

    --inv: #1a1c21;
    --on-inv: #eeeadf;
    --on-inv-2: rgba(238, 234, 223, 0.74);
    --inv-line: rgba(238, 234, 223, 0.2);

    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .045 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.4), 0 24px 48px -24px rgba(0, 0, 0, 0.8);
  }
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg) var(--grain);
  color: var(--fg);
  font: 400 1.0625rem/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }

h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
a:hover { text-decoration-thickness: 2px; }

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection { background: var(--mark); color: var(--on-mark); }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 100;
  padding: 0.7rem 1rem;
  background: var(--fg);
  color: var(--bg);
  border-radius: 3px;
  text-decoration: none;
  font-weight: 600;
}
.skip-link:focus { top: 0.75rem; }

.wrap {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
}

/* ── Type ─────────────────────────────────────────────── */
h1, h2, .display {
  font-family: var(--f-display);
  font-weight: 800;
  letter-spacing: -0.035em;
  word-spacing: 0.1em;
  line-height: 0.98;
  text-wrap: balance;
}

h3 { font-family: var(--f-display); font-weight: 700; letter-spacing: -0.015em; word-spacing: 0.06em; line-height: 1.2; }

.label {
  font: 500 0.75rem/1.2 var(--f-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-3);
}

.lead {
  font-size: clamp(1.125rem, 1.04rem + 0.4vw, 1.3rem);
  line-height: 1.55;
  color: var(--fg-2);
  text-wrap: pretty;
  max-width: 38em;
}

/* The highlighter: how EmbedCore shows what matched, reused as the page's one flourish. */
mark {
  color: var(--on-mark);
  background: linear-gradient(transparent 12%, var(--mark) 12%, var(--mark) 90%, transparent 90%) no-repeat 0 0 / 100% 100%;
  padding: 0 0.12em;
  margin: 0 -0.04em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  border-radius: 2px;
}
@media (prefers-reduced-motion: no-preference) {
  mark.sweep { animation: sweep 0.9s cubic-bezier(0.22, 0.7, 0.2, 1) 0.35s backwards; }
  @keyframes sweep {
    from { background-size: 0% 100%; color: var(--fg); }
    55% { color: var(--fg); }
    56%, to { color: var(--on-mark); }
  }
}

.kicker {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font: 500 0.75rem/1 var(--f-mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--fg-2);
}
.kicker .num { color: var(--accent); }
.kicker::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.band .kicker, .inv .kicker { color: inherit; }
.band .kicker .num, .inv .kicker .num { color: var(--mark); }
.band .kicker::after { background: var(--band-line); }
.inv .kicker::after { background: var(--inv-line); }

/* ── Buttons ──────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  min-height: 48px;
  padding: 0 1.35rem;
  border: 1px solid var(--fg);
  border-radius: 3px;
  background: var(--fg);
  color: var(--bg);
  font: 600 1rem/1 var(--f-body);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.18s, color 0.18s, border-color 0.18s;
}
.btn:hover {
  background: var(--accent-fill);
  border-color: var(--accent-fill);
  color: var(--on-accent-fill);
  text-decoration: none;
}
.btn--ghost { background: transparent; color: var(--fg); }
.btn--ghost:hover { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.btn--small { min-height: 40px; padding: 0 1rem; font-size: 0.9375rem; }
.btn--mark { background: var(--mark); border-color: var(--mark); color: var(--on-mark); }
.btn--mark:hover { background: #fff; border-color: #fff; color: var(--on-mark); }

.arrow {
  display: inline-block;
  width: 1.05em;
  height: 1.05em;
  background: currentColor;
  -webkit-mask: var(--arrow) center / contain no-repeat;
  mask: var(--arrow) center / contain no-repeat;
  transition: transform 0.18s;
  --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2 8h11M8.5 3.2 13.3 8l-4.8 4.8' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='square'/%3E%3C/svg%3E");
}
.btn:hover .arrow, .text-link:hover .arrow { transform: translateX(3px); }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  font-weight: 600;
  color: var(--fg);
  text-decoration-line: underline;
  text-decoration-color: var(--line-strong);
}
.text-link:hover { color: var(--accent); text-decoration-color: currentColor; }
.band .text-link, .inv .text-link { color: inherit; text-decoration-color: currentColor; }

/* ── Sign-up form ─────────────────────────────────────── */
.signup { display: flex; gap: 0.5rem; max-width: 34rem; }
.signup input[type="email"] {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 0 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--bg);
  color: var(--fg);
}
.signup input::placeholder { color: var(--fg-3); opacity: 1; }
.signup input:disabled { opacity: 0.6; }
.signup-note { margin-top: 0.8rem; font-size: 0.9rem; color: var(--fg-3); max-width: 34rem; }
.signup-note a { color: inherit; }
.band .signup input[type="email"] { border-color: transparent; background: #fff; color: #16140f; }
.band .signup input::placeholder { color: #5b574b; }
.band .signup-note { color: var(--on-band-2); }
.signup-note[data-state="error"] { color: #b3261e; font-weight: 600; }
.band .signup-note[data-state="error"] { color: #ffd0cc; }
@media (prefers-color-scheme: dark) {
  .signup-note[data-state="error"] { color: #ff9a92; }
}

/* ── Header ───────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.site-header.is-stuck { border-bottom-color: var(--line); }

.site-header .bar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--fg);
  text-decoration: none;
  font: 800 1.25rem/1 var(--f-display);
  letter-spacing: -0.03em;
  margin-right: auto;
}
.brand img { width: 28px; height: 28px; }
.brand:hover { text-decoration: none; }

.nav ul { display: flex; align-items: center; gap: clamp(1rem, 2.2vw, 2rem); }
.nav a {
  position: relative;
  display: inline-block;
  padding: 0.35rem 0;
  color: var(--fg-2);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0.1rem;
  height: 0.55em;
  background: var(--mark);
  z-index: -1;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s;
}
.nav a:hover { color: var(--fg); }
.nav a:hover::after, .nav a[aria-current="true"]::after { transform: scaleX(1); }
.nav a[aria-current="true"] { color: var(--fg); }
.nav a:hover::after { background: color-mix(in srgb, var(--mark) 60%, transparent); }

.header-cta { display: none; }
@media (min-width: 560px) { .header-cta { display: inline-flex; } }
/* The in-menu button stands in for the header button on narrow screens. */
.nav-cta { display: none; }

.menu-btn {
  display: none;
  width: 44px;
  height: 44px;
  margin-right: -8px;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  border-radius: 3px;
}
.menu-btn span, .menu-btn span::before, .menu-btn span::after {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--fg);
  transition: transform 0.2s, background-color 0.2s;
}
.menu-btn span { position: relative; }
.menu-btn span::before, .menu-btn span::after { content: ""; position: absolute; left: 0; }
.menu-btn span::before { top: -7px; }
.menu-btn span::after { top: 7px; }
.menu-btn[aria-expanded="true"] span { background: transparent; }
.menu-btn[aria-expanded="true"] span::before { transform: translateY(7px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 559px) { .js .nav-cta { display: block; } }
@media (max-width: 880px) {
  .js .menu-btn { display: inline-flex; }
  .js .nav {
    position: absolute;
    left: 0; right: 0; top: 100%;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem var(--gutter) 1.25rem;
    display: none;
  }
  .js .site-header.is-open .nav { display: block; }
  .js .nav-cta { margin-top: 1rem; }
  .js .nav .nav-cta a { display: flex; padding: 0 1.35rem; border-bottom: 0; color: var(--bg); font-size: 1rem; }
  .js .nav .nav-cta a:hover { color: var(--on-accent-fill); }
  .js .nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .js .nav a { display: block; padding: 0.9rem 0; font-size: 1.1rem; border-bottom: 1px solid var(--line); }
  .js .nav a::after { display: none; }
  /* Without JavaScript the links wrap under the brand instead of hiding. */
  html:not(.js) .site-header .bar { height: auto; flex-wrap: wrap; padding-block: 0.75rem; }
  html:not(.js) .nav ul { flex-wrap: wrap; }
}

/* ── Footer ───────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--line-strong);
  padding-block: clamp(2.5rem, 5vw, 4rem) 2rem;
  font-size: 0.95rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) repeat(2, minmax(0, 2fr));
  gap: 2rem;
}
.site-footer .brand { margin-right: 0; }
.footer-blurb { margin-top: 1rem; max-width: 26rem; color: var(--fg-2); }
.site-footer h2 {
  font: 500 0.75rem/1.2 var(--f-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 0.9rem;
}
.site-footer li + li { margin-top: 0.5rem; }
.site-footer a { color: var(--fg); text-decoration-color: var(--line-strong); }
.site-footer a:hover { color: var(--accent); }
.footer-base {
  margin-top: clamp(2rem, 4vw, 3.5rem);
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  color: var(--fg-3);
  font-size: 0.85rem;
}
/* Footer with only the legal line (demo, privacy, 404). */
.footer-base--solo { margin-top: 0; padding-top: 0; border-top: 0; }

@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
