/* ==========================================================
   CALINFRA Power LLP — styles
   ========================================================== */

:root {
  /* Colour tokens */
  --ink: #0c1a24;
  --ink-muted: #44535e;
  --paper: #f6f5f1;
  --surface: #ffffff;
  --muted-bg: #ecebe5;
  --line: #d6d8d3;
  --accent: #74234f;        /* CALINFRA brand plum (from logo) */
  --accent-hover: #561437;  /* logo shadow face */
  --accent-bright: #eab0cf; /* plum tint for use on dark backgrounds */
  --night: #1a1319;
  --night-2: #251b23;
  --night-line: #3b2d38;
  --night-text: #f3edf1;
  --night-muted: #bcaeb8;

  /* Type */
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  /* Spacing scale (4px base) */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4rem;
  --s-9: 6rem;

  --radius: 4px;
  --container: 72rem;
  --header-h: 4rem;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 600; letter-spacing: -0.015em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; }
address { font-style: normal; }
sup { line-height: 0; }

a { color: var(--accent); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--s-4);
}
@media (min-width: 48rem) {
  .container { padding-inline: var(--s-6); }
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: var(--s-4);
  top: -3rem;
  z-index: 100;
  padding: var(--s-2) var(--s-4);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius);
}
.skip-link:focus { top: var(--s-2); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: var(--s-3) var(--s-5);
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: 500 0.9375rem/1.2 var(--font-sans);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { border-color: currentColor; color: inherit; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); }
.btn-block { width: 100%; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  color: var(--ink);
  text-decoration: none;
}
.brand-mark { height: 2.25rem; width: auto; }
.brand-name { font-weight: 600; letter-spacing: 0.08em; font-size: 1rem; }
.brand-sub { font-weight: 400; letter-spacing: 0.02em; color: var(--ink-muted); margin-left: var(--s-1); }

.site-nav ul { display: flex; gap: var(--s-2); align-items: center; }
.site-nav a {
  display: block;
  padding: var(--s-2) var(--s-3);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9375rem;
  border-radius: var(--radius);
}
.site-nav a:hover { color: var(--accent); }
.site-nav .nav-cta {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #fff;
  margin-left: var(--s-2);
}
.site-nav .nav-cta:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }

.nav-toggle { display: none; }

/* Mobile nav (only collapses once JS has loaded; without JS the links stay visible) */
@media (max-width: 47.99rem) {
  .js .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem; height: 2.75rem;
    background: none;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    cursor: pointer;
  }
  .nav-toggle-bar,
  .nav-toggle-bar::before,
  .nav-toggle-bar::after {
    display: block;
    width: 1.125rem; height: 2px;
    background: currentColor;
    position: relative;
    transition: transform 0.2s ease, background-color 0.2s ease;
  }
  .nav-toggle-bar::before,
  .nav-toggle-bar::after { content: ""; position: absolute; left: 0; }
  .nav-toggle-bar::before { top: -6px; }
  .nav-toggle-bar::after { top: 6px; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { transform: translateY(6px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { transform: translateY(-6px) rotate(-45deg); }

  .header-inner { flex-wrap: wrap; }
  .site-nav { width: 100%; }
  .site-nav ul { flex-wrap: wrap; gap: 0 var(--s-1); padding-bottom: var(--s-3); }
  .js .site-nav { display: none; }
  .js .site-nav.is-open { display: block; }
  .js .site-nav ul { flex-direction: column; align-items: stretch; padding: var(--s-2) 0 var(--s-4); }
  .js .site-nav a { padding: var(--s-3) 0; border-bottom: 1px solid var(--line); border-radius: 0; }
  .js .site-nav .nav-cta { margin: var(--s-3) 0 0; text-align: center; border-radius: var(--radius); border-bottom: 1px solid var(--accent); }
  .brand-sub { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background-color: var(--night);
  background-image:
    linear-gradient(var(--night-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--night-line) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: -1px -1px;
  color: var(--night-text);
  padding-block: var(--s-8) var(--s-8);
  overflow: hidden;
}
.hero::after {
  /* fades the grid towards the bottom-left so the copy sits on a calm field */
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 20% 60%, var(--night) 35%, rgba(26, 19, 25, 0.6) 75%);
  pointer-events: none;
}
.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  gap: var(--s-7);
  align-items: center;
}
@media (min-width: 64rem) {
  .hero { padding-block: var(--s-9); }
  .hero-grid { grid-template-columns: 1.35fr 1fr; gap: var(--s-8); }
}

.eyebrow,
.section-num,
.spec-title,
.office-label {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.eyebrow { color: var(--accent-bright); margin-bottom: var(--s-4); }

.hero h1 {
  font-size: clamp(2.125rem, 5.2vw, 3.5rem);
  max-width: 16ch;
  margin-bottom: var(--s-5);
}
.lede {
  font-size: clamp(1.0625rem, 1.6vw, 1.1875rem);
  color: var(--night-muted);
  max-width: 38rem;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-top: var(--s-6);
}
.hero .btn-primary { background: var(--accent-bright); color: var(--night); }
.hero .btn-primary:hover { background: #f4cfe2; }
.hero :focus-visible { outline-color: var(--accent-bright); }

/* Spec sheet */
.spec-sheet {
  background: var(--night-2);
  border: 1px solid var(--night-line);
  border-radius: var(--radius);
  padding: var(--s-5);
}
.spec-title {
  color: var(--night-muted);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--night-line);
}
.spec-sheet dl { margin: 0; }
.spec-sheet dl > div {
  display: flex;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--night-line);
}
.spec-sheet dl > div:last-child { border-bottom: 0; padding-bottom: 0; }
.spec-sheet dt { color: var(--night-muted); font-size: 0.9375rem; }
.spec-sheet dd { margin: 0; text-align: right; font-weight: 500; font-family: var(--font-mono); font-size: 0.9375rem; }

/* ---------- Sections ---------- */
.section { padding-block: var(--s-8); }
@media (min-width: 64rem) { .section { padding-block: var(--s-9); } }

.section-muted { background: var(--muted-bg); }

.section-num { color: var(--accent); margin-bottom: var(--s-3); }

.section h2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); max-width: 20ch; }
.section-intro { margin-top: var(--s-4); color: var(--ink-muted); max-width: 36rem; font-size: 1.0625rem; }
.section-head.narrow { max-width: 44rem; margin-bottom: var(--s-7); }

.split { display: grid; gap: var(--s-6); }
@media (min-width: 64rem) {
  .split { grid-template-columns: 5fr 7fr; gap: var(--s-8); }
}

.prose { display: grid; gap: var(--s-4); font-size: 1.0625rem; color: var(--ink-muted); max-width: 40rem; }

.focus-list { margin-top: var(--s-3); border-top: 1px solid var(--line); }
.focus-list li {
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.focus-list li::before {
  content: "";
  flex: none;
  width: 0.5rem; height: 0.5rem;
  background: var(--accent);
}

/* Role list */
.role-list { counter-reset: role; border-top: 1px solid var(--line); }
.role-list li {
  counter-increment: role;
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: var(--s-1) var(--s-4);
  padding: var(--s-5) 0;
  border-bottom: 1px solid var(--line);
}
.role-list li::before {
  content: counter(role, decimal-leading-zero);
  grid-row: span 2;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--accent);
  padding-top: 0.2em;
}
.role-list h3 { font-size: 1.1875rem; font-weight: 500; }
.role-list p { color: var(--ink-muted); }

/* Principles */
.principles { display: grid; gap: var(--s-6); }
@media (min-width: 40rem) { .principles { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 64rem) { .principles { grid-template-columns: repeat(4, 1fr); gap: var(--s-5); } }
.principles li { border-top: 2px solid var(--ink); padding-top: var(--s-4); }
.principles h3 { font-size: 1.125rem; font-weight: 500; margin-bottom: var(--s-2); }
.principles p { color: var(--ink-muted); font-size: 0.9375rem; }

/* ---------- Contact ---------- */
.contact-cards { display: grid; gap: var(--s-4); align-self: start; }
.contact-card {
  padding: var(--s-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  line-height: 1.7;
}
@media (min-width: 48rem) { .contact-card { padding: var(--s-6); } }
.office-label { display: block; color: var(--ink-muted); margin-bottom: var(--s-2); }
.contact-email {
  font-size: clamp(1.125rem, 2.4vw, 1.5rem);
  font-weight: 600;
  overflow-wrap: anywhere;
  text-underline-offset: 4px;
}
.contact-email:hover { color: var(--accent-hover); }
.contact-note { margin-top: var(--s-2); color: var(--ink-muted); font-size: 0.9375rem; }
.text-link {
  display: inline-block;
  margin-top: var(--s-3);
  font-weight: 500;
  text-underline-offset: 3px;
}
.text-link:hover { color: var(--accent-hover); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--night);
  color: var(--night-muted);
  font-size: 0.9375rem;
  padding-top: var(--s-7);
}
.footer-grid { display: grid; gap: var(--s-5); padding-bottom: var(--s-6); }
@media (min-width: 48rem) { .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--s-8); } }
.site-footer p + p { margin-top: var(--s-2); }
.footer-brand { color: var(--night-text); font-weight: 600; letter-spacing: 0.04em; margin-bottom: var(--s-2); }
.disclaimer { font-size: 0.875rem; }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s-3);
  padding-block: var(--s-5);
  border-top: 1px solid var(--night-line);
  font-size: 0.875rem;
}
.site-footer a { color: var(--night-text); text-underline-offset: 3px; }
.site-footer a:hover { color: var(--accent-bright); }
.site-footer :focus-visible { outline-color: var(--accent-bright); }

/* ---------- Simple pages (thanks / 404) ---------- */
.simple-page {
  min-height: calc(100vh - var(--header-h));
  display: grid;
  place-items: center;
  padding-block: var(--s-8);
  text-align: center;
}
.simple-page h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); margin-bottom: var(--s-4); }
.simple-page p { color: var(--ink-muted); max-width: 32rem; margin: 0 auto var(--s-6); }
