/* Shared styles for Clarq's web pages. One accent (#1F49C7), greys otherwise,
   8px spacing grid. IBM Plex is bundled (fonts/OFL-LICENSE.txt). */
@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; src: url('fonts/ibm-plex-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 500; src: url('fonts/ibm-plex-sans-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 600; src: url('fonts/ibm-plex-sans-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 500; src: url('fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2'); }

:root {
  --sans: 'IBM Plex Sans', -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --bg: #F6F6F6;
  --surface: #FFFFFF;
  --text: #1A1A1A;
  --muted: #6E6E6E;
  --line: #E6E6E6;
  --line-strong: #D4D4D4;
  --accent: #1F49C7;
  --accent-hover: #1A3DA8;
  --danger: #B3261E;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Small single-purpose pages: one centred panel */
body.center-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.page {
  width: 100%;
  max-width: 400px;
  padding: 40px 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.wordmark { display: block; margin-bottom: 40px; font-family: var(--mono); font-size: 16px; font-weight: 500; }

h1 { font-size: 24px; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; margin-bottom: 8px; }
p { color: var(--muted); margin-bottom: 24px; }
.caption { font-size: 13px; margin: 24px 0 0; }

.button {
  display: inline-block;
  height: 40px;
  padding: 0 24px;
  border: 0;
  border-radius: 4px;
  background: var(--accent);
  color: #FFFFFF;
  font: inherit;
  font-weight: 500;
  line-height: 40px;
  text-decoration: none;
  cursor: pointer;
}
.button:hover:not(:disabled) { background: var(--accent-hover); }
.button:disabled { opacity: 0.6; cursor: default; }
.button.full { width: 100%; }

form { margin-bottom: 0; }
label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 8px; }
input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  margin-bottom: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
input:focus { outline: none; border-color: var(--accent); }
.error { min-height: 1.5em; margin-bottom: 8px; color: var(--danger); font-size: 13px; }

/* ===== Website: home and account pages ===== */
body.site { background: var(--surface); }
a { color: var(--accent); }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 24px; }

.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 64px; }
.site-header .wordmark { margin: 0; color: var(--text); text-decoration: none; }
.site-nav { display: flex; align-items: center; gap: 24px; font-size: 14px; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover { color: var(--text); }
.site-nav .button { color: #FFFFFF; height: 32px; line-height: 32px; padding: 0 16px; font-size: 14px; }

.section { padding: 64px 0; border-bottom: 1px solid var(--line); }
.section:last-of-type { border-bottom: 0; }
.hero { padding: 96px 0 64px; }
.hero h1 { font-size: 40px; line-height: 1.15; letter-spacing: -0.02em; max-width: 640px; margin-bottom: 16px; }
.hero p { font-size: 17px; max-width: 600px; margin-bottom: 32px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.button.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); line-height: 38px; }
.button.secondary:hover { background: var(--surface); border-color: var(--text); }

h2 { font-size: 24px; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; margin-bottom: 8px; }
.lead { max-width: 600px; margin-bottom: 40px; }

/* Before / after example */
.example { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 4px; }
.example > div { padding: 24px; }
.example > div + div { border-left: 1px solid var(--line); }
.label { display: block; margin-bottom: 16px; font-size: 12px; font-weight: 500; color: var(--muted); }
.example pre {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
.example-note { margin: 16px 0 0; font-size: 13px; }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; list-style: none; }
.steps li { border-top: 1px solid var(--text); padding-top: 16px; }
.steps .num { display: block; font-family: var(--mono); font-size: 13px; font-weight: 500; margin-bottom: 8px; }
.steps strong { display: block; font-weight: 600; margin-bottom: 8px; }
.steps p { margin: 0; font-size: 14px; }
.sites { margin: 40px 0 0; font-size: 14px; }

/* Free allowance */
.free { display: flex; align-items: center; gap: 24px; padding: 24px; border: 1px solid var(--line); border-radius: 4px; }
.free .amount { font-family: var(--mono); font-size: 40px; font-weight: 500; letter-spacing: -0.02em; line-height: 1; }
.free > div { flex: 1; }
.free .what { display: block; font-weight: 600; margin-bottom: 4px; }
.free p { margin: 0; font-size: 14px; }

/* FAQ */
.faq { border-top: 1px solid var(--line); max-width: 720px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-family: var(--mono); color: var(--muted); }
.faq details[open] summary::after { content: '\2212'; }
.faq details p { margin: 0 0 16px; max-width: 640px; }
.faq details p:last-child { margin-bottom: 24px; }

.site-footer { border-top: 1px solid var(--line); }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px; padding-top: 24px; padding-bottom: 24px; font-size: 13px; color: var(--muted); }
.site-footer a { color: var(--muted); text-decoration: none; }

/* Account page */
.account { max-width: 400px; margin: 0 auto; padding: 64px 0 96px; }
.account .view { display: none; }
.account .view.active { display: block; }
.account p.intro { margin-bottom: 32px; }
.account .button.full + .button.full { margin-top: 8px; }
.links { display: flex; justify-content: space-between; gap: 16px; margin-top: 16px; font-size: 14px; }
.links a { text-decoration: none; }
.links a:hover { text-decoration: underline; }
.notice { margin-bottom: 16px; font-size: 14px; color: var(--accent); }
.usage-count { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.usage-count .number { font-family: var(--mono); font-size: 40px; font-weight: 500; line-height: 1; letter-spacing: -0.02em; }
.usage-count .of { color: var(--muted); }
.bar { height: 4px; background: #EDEDED; border-radius: 2px; overflow: hidden; margin-bottom: 8px; }
.bar i { display: block; width: 0; height: 100%; background: var(--accent); }
.block { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--line); }
.block > p { margin-bottom: 0; font-size: 14px; }

@media (max-width: 720px) {
  .site-nav a:not(.button) { display: none; }
  .hero { padding: 64px 0 48px; }
  .hero h1 { font-size: 32px; }
  .example, .steps { grid-template-columns: 1fr; }
  .example > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .free { flex-direction: column; align-items: flex-start; }
  .steps { gap: 32px; }
}

.account .error { min-height: 0; margin-bottom: 16px; }
.account .error:empty { display: none; }
.account form + .button { margin-top: 8px; }
.account #resetText { margin: 0; }

/* Examples carousel: scroll sideways, snap one example at a time */
.example-bar { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 16px; }
.example-tabs { position: relative; display: flex; gap: 24px; overflow-x: auto; scrollbar-width: none; }
.example-tabs::-webkit-scrollbar { display: none; }
.example-tab {
  flex: none;
  padding: 8px 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.example-tab:hover { color: var(--text); }
.example-tab.active { color: var(--text); font-weight: 500; border-bottom-color: var(--accent); }
.example-arrows { display: flex; gap: 8px; flex: none; }
.example-arrow {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.example-arrow:hover:not(:disabled) { border-color: var(--text); }
.example-arrow:disabled { opacity: 0.4; cursor: default; }

.example-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.example-track::-webkit-scrollbar { display: none; }
.example-track:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.example-slide { flex: 0 0 100%; scroll-snap-align: start; }
.example-slide .example { height: 100%; }

@media (max-width: 720px) {
  .example-arrows { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .example-track { scroll-behavior: auto; }
}
