/* =========================================================================
   Intelligent Planning Ltd — site styles
   Light, engineering-credible theme: white background, a single blue accent,
   system variable fonts, generous whitespace. Shared by the front page and the
   tools index. (The analyser sub-app carries its own scoped styles that reuse
   the same tokens.)
   ========================================================================= */

:root {
  /* Neutrals */
  --bg: #ffffff;
  --surface: #f8fafc;      /* slate-50  */
  --surface-2: #f1f5f9;    /* slate-100 */
  --border: #e2e8f0;       /* slate-200 */
  --border-strong: #cbd5e1;/* slate-300 */
  --text: #0f172a;         /* slate-900 */
  --muted: #475569;        /* slate-600 — AA on white */
  --muted-2: #64748b;      /* slate-500 */

  /* Single blue accent (kept AA-safe) */
  --brand: #2563eb;        /* blue-600  — links, buttons, most headings (5.2:1) */
  --brand-light: #3b82f6;  /* blue-500  — large display + motif only */
  --brand-dark: #1d4ed8;   /* blue-700  — hover/active */
  --brand-tint: #eff6ff;   /* blue-50   — subtle fills */
  --brand-tint-2: #dbeafe; /* blue-100  */

  --critical: #dc2626;
  --ok: #16a34a;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "Segoe UI Mono", Menlo, Consolas, monospace;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.06);
  --shadow-lg: 0 12px 40px rgba(15,23,42,.12);
  --maxw: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  /* Sticky footer: body fills the viewport, main grows, footer sits at the bottom. */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
body > main { flex: 1 0 auto; }

h1, h2, h3 { line-height: 1.15; color: var(--text); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); margin: 0 0 .5em; }
h3 { font-size: 1.2rem; margin: 0 0 .4em; }
p { margin: 0 0 1em; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); text-decoration: underline; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 84px 0; }
.section--tint { background: var(--surface); border-block: 1px solid var(--border); }
.eyebrow {
  font-family: var(--font-mono); font-size: .8rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--brand);
  margin: 0 0 14px;
}
.lede { font-size: 1.15rem; color: var(--muted); max-width: 62ch; }
.center { text-align: center; }
.center .lede { margin-inline: auto; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  font: inherit; font-weight: 600; font-size: .98rem;
  padding: 12px 22px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s, transform .05s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-ghost { background: #fff; color: var(--brand); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--brand); background: var(--brand-tint); color: var(--brand-dark); }

/* --- Focus states (accessibility) --- */
a:focus-visible, .btn:focus-visible, button:focus-visible, .nav-toggle:focus-visible {
  outline: 3px solid var(--brand-light); outline-offset: 2px; border-radius: 4px;
}

/* --- Skip link --- */
.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--brand); color: #fff;
  padding: 10px 16px; border-radius: 0 0 8px 0; z-index: 200;
}
.skip-link:focus { left: 0; }

/* --- Top nav --- */
.site-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.86); backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-nav .container { display: flex; align-items: center; gap: 20px; height: 66px; }
.brand-mark { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
.brand-mark:hover { text-decoration: none; }
.brand-mark svg { display: block; }
.brand-mark .co { font-size: 1.05rem; }
.nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-links a {
  color: var(--muted); font-weight: 500; font-size: .96rem; padding: 8px 12px; border-radius: 6px;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav-links .btn { margin-left: 8px; padding: 9px 16px; }
.nav-toggle {
  display: none; margin-left: auto; background: none; border: 1px solid var(--border-strong);
  border-radius: 8px; width: 42px; height: 40px; cursor: pointer; color: var(--text);
}
.nav-toggle svg { display: block; margin: 0 auto; }

@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 66px; left: 0; right: 0; flex-direction: column; align-items: stretch;
    gap: 2px; background: #fff; border-bottom: 1px solid var(--border); padding: 12px 16px 18px;
    box-shadow: var(--shadow); display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px; font-size: 1.02rem; }
  .nav-links .btn { margin: 6px 0 0; justify-content: center; }
}

/* --- Hero --- */
.hero { padding: 72px 0 76px; background:
  radial-gradient(1200px 480px at 78% -8%, var(--brand-tint) 0%, rgba(239,246,255,0) 62%); }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 52px; align-items: center; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.35rem); margin: 12px 0 18px; }
.hero h1 .accent { color: var(--brand-light); }
.hero .lede { font-size: 1.22rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.hero-stat {
  display: inline-flex; align-items: baseline; gap: 10px; margin-top: 30px;
  padding: 12px 18px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.hero-stat .num { font-size: 1.5rem; font-weight: 800; color: var(--brand); letter-spacing: -.02em; }
.hero-stat .txt { color: var(--muted); font-size: .98rem; }
.hero-figure { border: 1px solid var(--border); border-radius: 16px; background: #fff; box-shadow: var(--shadow); padding: 18px; }
.hero-figure svg { width: 100%; height: auto; display: block; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 34px; }
  .hero-figure { order: 2; }
}

/* --- Generic card grids --- */
.grid { display: grid; gap: 22px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr; } .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow);
}
.card h3 { color: var(--text); }
.card .ico {
  width: 44px; height: 44px; border-radius: 10px; background: var(--brand-tint);
  color: var(--brand); display: grid; place-items: center; margin-bottom: 16px;
}
.card .ico svg { width: 24px; height: 24px; }
.card p { color: var(--muted); margin-bottom: 0; font-size: .98rem; }

/* Sector cards (compact) */
.sector { display: flex; flex-direction: column; gap: 6px; }
.sector .tag { font-family: var(--font-mono); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.sector h3 { margin: 0; font-size: 1.1rem; }
.sector p { font-size: .93rem; }

/* --- Tools feature panel --- */
.tools-panel {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center;
  background: #fff; border: 1px solid var(--border); border-radius: 18px;
  padding: 40px; box-shadow: var(--shadow);
}
@media (max-width: 900px) { .tools-panel { grid-template-columns: 1fr; gap: 26px; padding: 28px; } }
.privacy-flag {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ok);
  background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 999px; padding: 6px 14px; font-size: .9rem;
  margin-bottom: 16px;
}
.tick-list { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 10px; }
.tick-list li { display: flex; gap: 10px; align-items: flex-start; color: var(--text); }
.tick-list svg { flex: 0 0 auto; margin-top: 3px; color: var(--brand); }
.howto { font-family: var(--font-mono); font-size: .88rem; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; }
.tool-visual { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); padding: 16px; }
.tool-visual svg { width: 100%; height: auto; display: block; }

/* --- Why us --- */
.proof { display: flex; gap: 16px; align-items: flex-start; }
.proof .n { font-family: var(--font-mono); font-weight: 700; color: var(--brand); font-size: .95rem; min-width: 28px; }
.proof h3 { font-size: 1.08rem; margin-bottom: 4px; }
.proof p { color: var(--muted); font-size: .96rem; margin: 0; }

/* --- Contact --- */
.contact-card {
  background: var(--brand); color: #fff; border-radius: 18px; padding: 44px; text-align: center;
}
.contact-card h2 { color: #fff; }
.contact-card p { color: #dbeafe; }
.contact-card .btn-primary { background: #fff; color: var(--brand); }
.contact-card .btn-primary:hover { background: #eef2ff; color: var(--brand-dark); }
.contact-card .btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); }
.contact-card .btn-ghost:hover { background: rgba(255,255,255,.12); color: #fff; border-color: #fff; }
.contact-methods { display: flex; flex-wrap: wrap; gap: 10px 28px; justify-content: center; margin-top: 22px; font-size: 1rem; }
.contact-methods a { color: #fff; font-weight: 600; }
.todo { font-family: var(--font-mono); font-size: .74rem; color: var(--critical); background: #fef2f2; border: 1px solid #fecaca; padding: 1px 6px; border-radius: 4px; }

/* --- Footer --- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 40px 0; color: var(--muted-2); font-size: .9rem; }
.site-footer .foot-grid { display: flex; flex-wrap: wrap; gap: 18px 40px; justify-content: space-between; align-items: flex-start; }
.site-footer a { color: var(--muted); }
.site-footer .privacy-note { max-width: 46ch; }

/* --- Reusable back-link header (analyser + tools) --- */
.tool-topbar { border-bottom: 1px solid var(--border); background: #fff; }
.tool-topbar .container { display: flex; align-items: center; gap: 16px; height: 56px; }
.tool-topbar .back { color: var(--muted); font-weight: 500; font-size: .92rem; }
.tool-topbar .sep { color: var(--border-strong); }
