/* KeyTrellis shared styles: fonts, colours, header, footer, buttons and forms.
   Every page loads this file first, then its own page stylesheet. */

/* ---------- Fonts (self-hosted in /fonts) ---------- */
@font-face { font-family: "Space Grotesk"; font-weight: 400; font-display: swap; src: url("../fonts/space-grotesk-400-normal-latin.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-weight: 500; font-display: swap; src: url("../fonts/space-grotesk-500-normal-latin.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-weight: 600; font-display: swap; src: url("../fonts/space-grotesk-600-normal-latin.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-weight: 700; font-display: swap; src: url("../fonts/space-grotesk-700-normal-latin.woff2") format("woff2"); }
@font-face { font-family: "DM Sans"; font-weight: 400; font-display: swap; src: url("../fonts/dm-sans-400-normal-latin.woff2") format("woff2"); }
@font-face { font-family: "DM Sans"; font-weight: 500; font-display: swap; src: url("../fonts/dm-sans-500-normal-latin.woff2") format("woff2"); }
@font-face { font-family: "DM Sans"; font-weight: 600; font-display: swap; src: url("../fonts/dm-sans-600-normal-latin.woff2") format("woff2"); }
@font-face { font-family: "DM Sans"; font-weight: 700; font-display: swap; src: url("../fonts/dm-sans-700-normal-latin.woff2") format("woff2"); }

/* ---------- Brand colours and sizes ----------
   The site is light-only on purpose, so it looks the same for every visitor. */
:root {
  color-scheme: light;
  --background: #fbf7f4;
  --foreground: #32131f;
  --card: #fffdfc;
  --primary: #5a1733;
  --primary-hover: #451128;
  --primary-foreground: #fff8fa;
  --secondary: #f5e4ea;
  --muted: #f2e9e8;
  --muted-foreground: #6a515a;
  --accent: #efb0c0;
  --border: #e5cfd6;
  --input: #c9aeb9;
  --ring: #8a3e5d;
  --dark: #32131f;
  --font-display: "Space Grotesk", Arial, sans-serif;
  --font-body: "DM Sans", Arial, sans-serif;
  --radius: 1rem;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 620; color: var(--foreground); }
p { margin: 0; }
img { display: block; max-width: 100%; }
a { color: var(--primary); }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; }
.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;
}
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: 999px; background: var(--primary); color: #fff;
}
.skip-link:focus { top: 12px; }

.shell {
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--background) 94%, transparent);
  backdrop-filter: blur(10px);
}
.site-header .shell {
  display: flex;
  min-height: 72px;
  align-items: center;
  gap: 24px;
}
.brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  color: var(--foreground);
  text-decoration: none;
}
.brand svg { width: 34px; height: 34px; }
.brand span {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.055em;
}
.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-left: auto;
}
.site-nav a {
  color: var(--muted-foreground);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 650;
  text-decoration: none;
  text-underline-offset: 4px;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--primary); text-decoration: underline; }
.site-nav .nav-fit-check {
  padding: 6px 12px;
  border: 1px solid var(--primary);
  border-radius: 999px;
  background: var(--secondary);
  color: var(--primary);
}
.site-nav .nav-fit-check:hover { text-decoration: none; background: #edc8d3; }
.site-nav .btn { min-height: 40px; padding-inline: 16px; color: #fffdfc; font-size: 0.82rem; }
.site-nav .btn:hover,
.site-nav .btn[aria-current="page"] { color: #fffdfc; text-decoration: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid var(--primary);
  border-radius: 999px;
  background: var(--primary);
  color: #fffdfc;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 3px 0 rgb(50 19 31 / 18%);
  transition: background 180ms ease, transform 180ms ease;
}
.btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fffdfc; transform: translateY(-1px); }
.btn svg { width: 16px; height: 16px; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-outline {
  background: #fffdfc;
  color: var(--primary);
  border-color: #8b6978;
  box-shadow: none;
}
.btn-outline:hover { background: var(--secondary); color: var(--primary); border-color: var(--primary); }
.btn-light { background: #fffdfc; color: var(--dark); border-color: #fff0f4; }
.btn-light:hover { background: #fff1f4; color: var(--dark); border-color: #fff1f4; }

/* ---------- Forms (Book a demo, fit check contact step) ---------- */
.form { display: grid; gap: 18px; }
.form-row { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; }
.field { display: grid; gap: 6px; }
.field label { font-family: var(--font-display); font-size: 0.88rem; font-weight: 650; }
.field .hint { color: var(--muted-foreground); font-size: 0.8rem; }
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid var(--input);
  border-radius: 12px;
  background: #fff;
  color: var(--foreground);
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus { outline: 2px solid var(--ring); outline-offset: 1px; border-color: var(--ring); }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 0.88rem; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--primary); flex: 0 0 auto; }
.form-status { min-height: 1.5em; font-size: 0.92rem; font-weight: 600; }
.form-status[data-state="error"] { color: #9d3f55; }
.form-status[data-state="success"] { color: #2f6b3f; }

/* ---------- Footer ---------- */
.site-footer {
  padding: 40px 0 22px;
  background: var(--dark);
  color: #fff1f4;
}
.footer-grid {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 36px;
}
.footer-grid > div:first-child { max-width: 320px; }
.footer-grid .brand { color: #fffdfc; margin-bottom: 12px; }
.footer-grid p { color: #e6c7d1; font-size: 0.9rem; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 22px;
}
.footer-links a {
  color: #f5dce3;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 650;
  text-decoration: none;
}
.footer-links a:hover { text-decoration: underline; text-underline-offset: 4px; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 38px;
  padding-top: 16px;
  border-top: 1px solid rgb(255 241 244 / 18%);
  color: #d5acba;
  font-size: 0.75rem;
}

/* ---------- Scroll reveal (see js/site.js) ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 600ms ease, transform 600ms ease; }
.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* ---------- Small screens ---------- */
@media (max-width: 820px) {
  .site-header { position: relative; }
  .site-header .shell { flex-wrap: wrap; gap: 12px; padding-block: 14px; }
  .site-nav { width: 100%; margin-left: 0; gap: 10px 14px; }
  .site-nav a { font-size: 0.8rem; }
  .site-nav .nav-fit-check { padding: 5px 10px; }
  .site-nav .btn { min-height: 36px; padding-inline: 12px; font-size: 0.78rem; }
  .site-nav .btn { margin-left: auto; }
  .footer-grid, .footer-bottom { flex-direction: column; }
  .footer-links { justify-content: flex-start; }
}
@media (max-width: 600px) {
  .shell { width: calc(100% - 32px); }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  /* Keep the menu on one line on phones; "What we do" is still in the footer */
  .site-nav a:first-child { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
}
