/* Tempx — shared design system for tempx.uk and mail.tempx.uk
   System fonts only. No external requests. Light + dark via prefers-color-scheme. */

:root {
  color-scheme: light dark;

  --bg: #ffffff;
  --bg-subtle: #f7f8fb;
  --bg-elevated: #ffffff;
  --bg-inset: #eef1f7;

  --text: #10131a;
  --text-muted: #545b6b;
  --text-faint: #7b8394;

  --border: #e4e7ef;
  --border-strong: #d2d7e3;

  --brand: #2456e6;
  --brand-hover: #1c46c4;
  --brand-press: #17399e;
  --brand-subtle: #eef2fe;
  --brand-ring: rgba(36, 86, 230, 0.38);
  --on-brand: #ffffff;

  --warn-bd: #d97706;
  --warn-bg: #fff7ed;
  --danger: #c0341d;
  --ok: #1a7f4b;

  --shadow-sm: 0 1px 2px rgba(16, 19, 26, 0.06), 0 1px 1px rgba(16, 19, 26, 0.04);
  --shadow-md: 0 4px 14px rgba(16, 19, 26, 0.08), 0 2px 6px rgba(16, 19, 26, 0.05);
  --shadow-lg: 0 18px 48px rgba(16, 19, 26, 0.14), 0 6px 16px rgba(16, 19, 26, 0.08);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --maxw: 1120px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1116;
    --bg-subtle: #14171f;
    --bg-elevated: #171b24;
    --bg-inset: #1e2230;

    --text: #eef1f7;
    --text-muted: #a7aec0;
    --text-faint: #7f8798;

    --border: #262b38;
    --border-strong: #333a4b;

    --brand: #6b93ff;
    --brand-hover: #85a6ff;
    --brand-press: #9db8ff;
    --brand-subtle: #182036;
    --brand-ring: rgba(107, 147, 255, 0.4);
    --on-brand: #0c1220;

    --warn-bd: #f59e0b;
    --warn-bg: #241c10;
    --danger: #ff8a75;
    --ok: #55d39b;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; }

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3, h4 { line-height: 1.2; color: var(--text); margin: 0 0 0.5em; letter-spacing: -0.02em; font-weight: 700; }
h1 { font-size: clamp(2rem, 5.2vw, 2.85rem); }
h2 { font-size: clamp(1.45rem, 3.6vw, 1.95rem); margin-top: 1.7em; }
h3 { font-size: 1.18rem; margin-top: 1.5em; letter-spacing: -0.01em; }
p { margin: 0 0 1rem; }
ul, ol { padding-left: 1.35rem; }
li { margin: 0.4rem 0; }
strong { font-weight: 650; }
code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--bg-inset);
  padding: 0.12em 0.4em;
  border-radius: 6px;
}
hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }

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

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 22px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand);
  color: var(--on-brand);
  padding: 10px 18px;
  z-index: 200;
  border-radius: 0 0 10px 0;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 66px;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 1.16rem;
  color: var(--text);
  letter-spacing: -0.02em;
}
.brand:hover { text-decoration: none; color: var(--text); }
.brand svg { display: block; border-radius: 7px; }
.site-nav {
  margin-left: auto;
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}
.site-nav a:not(.btn) {
  color: var(--text-muted);
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  font-size: 0.96rem;
  font-weight: 500;
}
.site-nav a:not(.btn):hover { background: var(--bg-inset); color: var(--text); text-decoration: none; }
.site-nav a:not(.btn)[aria-current="page"] { color: var(--brand); background: var(--brand-subtle); }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--brand);
  --btn-fg: var(--on-brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 600;
  padding: 13px 22px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: var(--btn-bg);
  color: var(--btn-fg);
  cursor: pointer;
  min-height: 48px;
  transition: transform 0.06s ease, background-color 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
  box-shadow: var(--shadow-sm);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary:hover { background: var(--brand-hover); box-shadow: var(--shadow-md); color: var(--on-brand); }
.btn-primary:active { background: var(--brand-press); }
.btn-ghost {
  --btn-bg: var(--bg-elevated);
  --btn-fg: var(--brand);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.btn-ghost:hover { background: var(--bg-subtle); color: var(--brand-hover); border-color: var(--brand); }
.btn-nav { padding: 9px 16px; min-height: 40px; font-size: 0.93rem; box-shadow: none; }
.btn-lg { padding: 15px 26px; font-size: 1.03rem; }

/* ---------- Layout ---------- */
main { padding: clamp(36px, 6vw, 64px) 0; }
main.narrow .container { max-width: 760px; }
.section { margin-top: clamp(40px, 7vw, 68px); }
.section:first-child { margin-top: 0; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(48px, 9vw, 96px) 0 clamp(40px, 8vw, 72px);
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(60rem 40rem at 15% -10%, var(--brand-subtle), transparent 60%),
    radial-gradient(48rem 32rem at 95% 0%, color-mix(in srgb, var(--brand-subtle) 70%, transparent), transparent 55%),
    var(--bg);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(28px, 5vw, 56px);
  align-items: center;
}
.hero h1 { margin-bottom: 0.35em; }
.hero .lead {
  font-size: clamp(1.08rem, 2.4vw, 1.28rem);
  color: var(--text-muted);
  max-width: 44ch;
  margin: 0 0 1.7rem;
}
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .fineprint { margin-top: 16px; color: var(--text-faint); font-size: 0.92rem; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  padding: 6px 13px;
  border-radius: 999px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }

/* Hero mock preview */
.hero-mock {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.hero-mock .bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}
.hero-mock .bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.hero-mock .body { padding: 20px; }
.hero-mock .addr {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-family: var(--mono); font-size: 0.92rem; font-weight: 600;
  background: var(--bg-inset); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px; color: var(--text);
}
.hero-mock .addr span:last-child { color: var(--brand); font-family: var(--font); font-size: 0.8rem; }
.hero-mock .row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 4px; border-bottom: 1px solid var(--border);
}
.hero-mock .row:last-child { border-bottom: 0; }
.hero-mock .av {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto;
  background: var(--brand-subtle); color: var(--brand);
  display: grid; place-items: center; font-weight: 700; font-size: 0.82rem;
}
.hero-mock .lines { flex: 1; min-width: 0; }
.hero-mock .lines b { display: block; font-size: 0.9rem; }
.hero-mock .lines span { display: block; font-size: 0.82rem; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Cards / grids ---------- */
.grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(238px, 1fr));
  margin: 26px 0;
}
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.card .ic {
  width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center; margin-bottom: 14px;
  background: var(--brand-subtle); color: var(--brand);
}
.card h3 { margin: 0 0 6px; }
.card p:last-child { margin-bottom: 0; color: var(--text-muted); }

/* Trust strip */
.trust {
  display: flex; flex-wrap: wrap; gap: 12px 28px;
  padding: 20px 24px; margin: 28px 0;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-subtle);
}
.trust span { display: inline-flex; align-items: center; gap: 9px; font-size: 0.95rem; color: var(--text-muted); }
.trust span svg { color: var(--ok); flex: 0 0 auto; }

/* Steps */
.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li {
  counter-increment: step;
  padding-left: 56px;
  position: relative;
  margin: 22px 0;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: -2px;
  width: 38px; height: 38px;
  border-radius: 12px;
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 700;
  display: grid; place-items: center;
  box-shadow: var(--shadow-sm);
}

/* Callouts */
.callout {
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
  background: var(--brand-subtle);
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  margin: 24px 0;
}
.callout.warn { border-left-color: var(--warn-bd); background: var(--warn-bg); }
.callout :last-child { margin-bottom: 0; }

/* CTA band */
.cta-band {
  margin-top: clamp(48px, 8vw, 72px);
  background: linear-gradient(135deg, var(--brand), var(--brand-press));
  color: #fff;
  border-radius: var(--radius-lg);
  padding: clamp(30px, 5vw, 48px);
  text-align: center;
  box-shadow: var(--shadow-md);
}
.cta-band h2 { color: #fff; margin: 0 0 0.4em; }
.cta-band p { color: rgba(255, 255, 255, 0.86); max-width: 48ch; margin: 0 auto 18px; }
.cta-band .btn { background: #fff; color: var(--brand); border-color: #fff; }
.cta-band .btn:hover { background: #f0f3ff; color: var(--brand-press); }

/* Tables */
table.data {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 22px 0;
  font-size: 0.96rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
table.data th, table.data td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}
table.data tr:last-child th, table.data tr:last-child td { border-bottom: 0; }
table.data thead th { background: var(--bg-inset); font-weight: 650; }
table.data tbody th { background: var(--bg-subtle); font-weight: 600; width: 30%; }

/* FAQ */
dl.faq { margin: 8px 0; }
dl.faq dt { font-weight: 650; margin-top: 1.5rem; font-size: 1.03rem; }
dl.faq dd { margin: 0.4rem 0 0; color: var(--text-muted); }

/* Breadcrumbs */
.breadcrumbs { font-size: 0.88rem; color: var(--text-faint); margin-bottom: 14px; }
.breadcrumbs a { color: var(--text-faint); }
.breadcrumbs a:hover { color: var(--brand); }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 7px; padding: 0; margin: 0; }
.breadcrumbs li + li::before { content: "/"; margin-right: 7px; color: var(--border-strong); }

/* Prose helpers */
.prose > :first-child { margin-top: 0; }
.lead-p { font-size: 1.1rem; color: var(--text-muted); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
  padding: 48px 0 30px;
  font-size: 0.95rem;
}
.footer-grid {
  display: grid;
  gap: 30px;
  grid-template-columns: 1.5fr repeat(3, 1fr);
}
.footer-grid h2 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-faint);
  margin: 0 0 12px;
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin: 9px 0; }
.footer-grid a { color: var(--text-muted); }
.footer-grid a:hover { color: var(--brand); }
.footer-brand p { color: var(--text-muted); margin: 10px 0 0; max-width: 34ch; }
.footer-legal {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 0.86rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-mock { max-width: 460px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  .container { padding-inline: 18px; }
  .site-header .container { min-height: 58px; gap: 8px; }
  .site-nav { width: 100%; gap: 2px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { padding: 8px 11px; font-size: 0.9rem; white-space: nowrap; }
  .btn-nav { flex: 0 0 auto; }
  .hero .actions { flex-direction: column; }
  .hero .actions .btn { width: 100%; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  table.data tbody th { width: auto; }
}
