/* Shared design system: tokens, type, buttons, pills, rulers, phones. */

:root {
  --ink: #303030;
  --ink-2: #5d605e;
  --ink-3: #8b8f8c;
  --paper: #ffffff;
  --canvas: #f2f3f1;
  --mint: #e1efe9;
  --mint-2: #cde4da;
  --lilac: #d4ddf9;
  --lilac-2: #bccaf3;
  --peach: #f1e5dc;
  --line: rgba(48, 48, 48, 0.1);
  --line-2: rgba(48, 48, 48, 0.18);
  --hair: rgba(48, 48, 48, 0.26);
  --caption: #ffd400;
  --good: #2b8a5f;
  --good-bg: #d9efe3;
  --warn: #a96d0b;
  --warn-bg: #f7ead2;
  --bad: #c2414f;
  --bad-bg: #f8dfe1;

  --r-xl: 40px;
  --r-lg: 28px;
  --r-md: 20px;
  --r-sm: 14px;
  --pill: 999px;
  --shadow: 0 1px 2px rgba(48, 48, 48, 0.04), 0 18px 40px -18px rgba(48, 48, 48, 0.18);
  --shadow-lg: 0 2px 4px rgba(48, 48, 48, 0.04), 0 40px 80px -30px rgba(48, 48, 48, 0.28);

  --font: "Urbanist", ui-sans-serif, system-ui, sans-serif;
  --mono: "DM Mono", ui-monospace, "Cascadia Mono", monospace;
  --gradient: linear-gradient(115deg, #dcefe6 0%, #e9eee6 28%, #f1e5dc 55%, #e2e1f4 78%, #d4ddf9 100%);

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--canvas); color: var(--ink); font-family: var(--font);
  font-size: 17px; line-height: 1.55; font-weight: 400; -webkit-font-smoothing: antialiased;
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
[hidden] { display: none !important; }
::selection { background: var(--lilac); }

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

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

/* ---------------------------------------------------------------- type */

.display { font-weight: 300; letter-spacing: -0.035em; line-height: 0.98; }
.h2 { font-size: clamp(34px, 5vw, 56px); font-weight: 300; letter-spacing: -0.03em; line-height: 1.04; }
.h3 { font-size: 22px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.2; }
.lede { font-size: clamp(17px, 1.6vw, 19px); color: var(--ink-2); max-width: 56ch; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.mono { font-family: var(--mono); font-size: 0.86em; letter-spacing: 0; }
.dot-label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); }
.dot-label::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: 0.7; }

/* ---------------------------------------------------------------- buttons and pills */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 22px; border-radius: var(--pill); border: 1px solid var(--line-2);
  background: var(--paper); color: var(--ink); font-size: 16px; font-weight: 500;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { background: #1f1f1f; border-color: #1f1f1f; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: rgba(48, 48, 48, 0.05); border-color: transparent; }
.btn-sm { height: 38px; padding: 0 16px; font-size: 14.5px; }
.btn-block { width: 100%; }
.btn .arrow { transition: transform 0.15s ease; }
.btn:hover .arrow { transform: translateX(3px); }

.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--paper);
  display: inline-grid; place-items: center; cursor: pointer; flex: none; text-decoration: none;
}
.icon-btn:hover { border-color: var(--ink-3); }
.icon-btn svg { width: 18px; height: 18px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px;
  border-radius: var(--pill); background: rgba(255, 255, 255, 0.7); border: 1px solid var(--line);
  font-size: 13.5px; color: var(--ink-2); white-space: nowrap;
}
.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px;
  border-radius: var(--pill); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.badge-good { background: var(--good-bg); color: var(--good); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-ink { background: var(--ink); color: #fff; }

/* The nine16 wordmark (static/img/nine16-logo.svg), sized by height. Its canvas is trimmed to
   the letters, so the height is the height of the "1" and "6". The same on every page. */
.logo { display: inline-flex; align-items: center; text-decoration: none; flex: none; }
.logo img { height: 28px; width: auto; display: block; }
@media (max-width: 600px) {
  .logo img { height: 24px; }
}

/* ---------------------------------------------------------------- inputs */

.field { display: grid; gap: 7px; }
.field > span { font-size: 14px; color: var(--ink-2); }
.input {
  width: 100%; height: 50px; padding: 0 18px; border-radius: var(--r-sm); border: 1px solid var(--line-2);
  background: var(--paper); font-size: 16px; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px rgba(48, 48, 48, 0.07); }
.input::placeholder { color: var(--ink-3); }
select.input { appearance: none; padding-right: 40px; 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 1.5l5 5 5-5' fill='none' stroke='%23303030' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; }
.error-text { color: var(--bad); font-size: 14px; min-height: 1em; }

/* ---------------------------------------------------------------- the ruler (video timeline) */

.ruler {
  position: relative; height: 34px;
  background: repeating-linear-gradient(90deg, var(--hair) 0 1px, transparent 1px 7px) bottom / 100% 20px no-repeat;
}
.ruler-seg {
  position: absolute; bottom: 0; height: 34px;
  background: repeating-linear-gradient(90deg, var(--ink) 0 1.5px, transparent 1.5px 5px) bottom / 100% 100% no-repeat;
}
.ruler-seg::before {
  content: ""; position: absolute; left: 0; bottom: 0; height: 48px; width: 1.5px; background: var(--ink);
}
.ruler-label {
  position: absolute; bottom: 52px; left: 0; display: grid; gap: 1px; white-space: nowrap;
  font-size: 13px; color: var(--ink-2); line-height: 1.25; padding-left: 10px;
}
.ruler-label b { font-weight: 500; color: var(--ink); font-size: 15px; }

/* ---------------------------------------------------------------- phone mockups */

.phone {
  --w: 230px;
  position: relative; width: var(--w); aspect-ratio: 9 / 19.5; border-radius: calc(var(--w) * 0.16);
  padding: calc(var(--w) * 0.035); background: #fbfbfa; box-shadow: var(--shadow-lg);
  border: 1px solid var(--line); flex: none;
}
.phone-screen {
  position: relative; height: 100%; border-radius: calc(var(--w) * 0.13); overflow: hidden;
  background: var(--bg, #ccc); container-type: inline-size; isolation: isolate;
}
.phone-screen > svg.scene { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.phone-island {
  position: absolute; top: 3.5%; left: 50%; translate: -50% 0; width: 30%; height: 3.4%;
  border-radius: 99px; background: #161616; z-index: 3;
}
.phone .cap {
  position: absolute; left: 8%; right: 8%; top: 61%; text-align: center; z-index: 2;
  font-family: Arial, Helvetica, sans-serif; font-weight: 800; font-size: 9.6cqw; line-height: 1.15; color: #fff;
  text-shadow: 0 0 2px #000, 0 0 2px #000, 0 1px 3px rgba(0, 0, 0, 0.8);
}
.phone .cap mark { background: none; color: var(--caption); }
.phone .ui {
  position: absolute; inset: 0; z-index: 2; color: #fff; font-size: 4.3cqw; pointer-events: none;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.42), transparent 34%);
}
.phone .ui-rail { position: absolute; right: 4.5%; bottom: 17%; display: grid; gap: 7cqw; justify-items: center; }
.phone .ui-rail span { display: grid; justify-items: center; gap: 1cqw; font-size: 3.6cqw; font-weight: 600; }
.phone .ui-rail svg { width: 10cqw; height: 10cqw; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35)); }
.phone .ui-meta { position: absolute; left: 6%; right: 22%; bottom: 6.5%; display: grid; gap: 1.5cqw; }
.phone .ui-meta b { font-size: 4.6cqw; }
.phone .ui-meta span { opacity: 0.92; line-height: 1.3; }
.phone .ui-bar { position: absolute; left: 0; right: 0; bottom: 2.8%; height: 0.9cqw; background: rgba(255, 255, 255, 0.3); }
.phone .ui-bar i { display: block; height: 100%; width: var(--p, 40%); background: #fff; }

/* ---------------------------------------------------------------- cookie consent */

.consent {
  position: fixed; left: 20px; bottom: 20px; z-index: 80; width: min(440px, calc(100% - 24px));
  background: var(--paper); border-radius: var(--r-lg); padding: 22px; display: grid; gap: 12px;
  box-shadow: var(--shadow-lg); border: 1px solid var(--line); animation: consent-in 0.25s ease;
}
.consent-title { font-weight: 600; font-size: 17px; }
.consent-text { font-size: 14.5px; color: var(--ink-2); line-height: 1.5; }
.consent-text a { color: var(--ink); font-weight: 600; }
.consent-choices { display: grid; gap: 4px; border-top: 1px solid var(--line); padding-top: 8px; }
.consent-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 0; cursor: pointer; }
.consent-row span { display: grid; gap: 1px; font-size: 14.5px; }
.consent-row small { color: var(--ink-3); font-size: 12.5px; }
.consent-row input { width: 20px; height: 20px; accent-color: var(--ink); flex: none; }
.consent-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.consent-actions .btn:not(.btn-ghost) { flex: 1; }
@keyframes consent-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (max-width: 860px) {
  .consent { left: 12px; right: 12px; width: auto; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 90; }
}

/* Company details still to be filled in (see static/js/site.js). */
.placeholder { background: var(--warn-bg); color: var(--warn); border-radius: 4px; padding: 0 3px; }

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