/* Apex Point Consulting company site.
   Layout follows the services page design: grey hero, white numbered
   service grid, dark "How we work" band, client types, contact call.
   Fonts are self-hosted (Sora for headings, Inter for text). */

@font-face {
  font-family: "Sora";
  src: url("/assets/fonts/sora-wght.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --paper: #f3f4f6;
  --surface: #ffffff;
  --ink: #111827;
  --ink-2: #1f2937;
  --muted: #4b5563;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --brand: #234f72;
  --accent: #c2410c;
  --accent-hover: #9a3412;
  --night: #111827;
  --night-text: #e5e7eb;
  --night-muted: #9ca3af;
  --night-line: #374151;
  --focus: #c2410c;

  --display: "Sora", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --wrap: 72rem;
  --radius: 10px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-underline-offset: 0.18em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
[id] { scroll-margin-top: 88px; }

h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -0.025em; margin: 0; color: var(--ink); }
h1 { font-size: clamp(2.375rem, 1.5rem + 3.4vw, 4rem); line-height: 1.04; }
h2 { font-size: clamp(1.875rem, 1.4rem + 1.8vw, 2.625rem); line-height: 1.1; }
h3 { font-size: 1.1875rem; line-height: 1.3; letter-spacing: -0.015em; }
p { margin: 0; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
@media (max-width: 40rem) { .wrap { padding: 0 16px; } }

.skip {
  position: absolute; left: 16px; top: -100px; z-index: 10;
  background: var(--surface); color: var(--ink); padding: 8px 12px; border-radius: var(--radius);
}
.skip:focus { top: 12px; }

.eyebrow {
  font: 600 0.75rem/1 var(--body); letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 20px;
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: rgb(243 244 246 / 0.88);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--brand); }
.brand-mark { width: 40px; height: auto; flex: none; }
.brand-text { display: flex; flex-direction: column; gap: 4px; }
.brand-name { font: 700 1.0625rem/1 var(--display); letter-spacing: 0.04em; text-transform: uppercase; }
.brand-sub { font: 500 0.5625rem/1 var(--display); letter-spacing: 0.24em; text-transform: uppercase; }
.site-nav { display: flex; align-items: center; gap: 28px; font-size: 0.9375rem; }
.site-nav a { text-decoration: none; color: var(--ink-2); }
.site-nav a:hover { color: var(--accent); }
.site-nav .nav-cta { padding: 8px 16px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); font-weight: 500; }
.site-nav .nav-cta:hover { border-color: var(--ink); color: var(--ink); }
@media (max-width: 52rem) { .site-nav .nav-link { display: none; } }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px; border-radius: 8px;
  font: 600 0.9375rem/1 var(--body); text-decoration: none;
  border: 1px solid transparent; transition: background-color 0.15s, border-color 0.15s;
}
.button-dark { background: var(--ink); color: #fff; }
.button-dark:hover { background: #000; }
.button-light { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.button-light:hover { border-color: var(--ink); }
.button-accent { background: var(--accent); color: #fff; }
.button-accent:hover { background: var(--accent-hover); }
.button svg { width: 16px; height: 16px; }

/* Hero */
.hero { position: relative; overflow: hidden; padding: 72px 0 96px; }
.hero .wrap { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 56px; align-items: center; }
.hero-copy { max-width: 50rem; }
.lead { margin-top: 28px; max-width: 36rem; font-size: 1.1875rem; line-height: 1.6; color: var(--muted); }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--line-strong); font-size: 0.875rem; color: var(--muted); }
.hero-meta span { display: inline-flex; align-items: center; gap: 8px; }
.hero-meta span::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.hero-art { position: relative; display: grid; place-items: center; aspect-ratio: 1; }
.hero-art::before {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(var(--line-strong) 1px, transparent 1px) 0 0 / 25% 25%,
    linear-gradient(90deg, var(--line-strong) 1px, transparent 1px) 0 0 / 25% 25%;
  -webkit-mask-image: radial-gradient(circle at center, #000 40%, transparent 70%);
  mask-image: radial-gradient(circle at center, #000 40%, transparent 70%);
}
.hero-art img { position: relative; width: 88%; height: auto; }
@media (max-width: 56rem) {
  .hero { padding: 48px 0 72px; }
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-art { display: none; }
}

/* Sections */
.section { padding: 104px 0; }
.section-white { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 24rem); gap: 24px 48px; align-items: end; margin-bottom: 48px; }
.section-head p { color: var(--muted); }
@media (max-width: 52rem) { .section-head { grid-template-columns: 1fr; } .section { padding: 72px 0; } }

/* Service grid */
.services {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0; padding: 0; list-style: none;
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--line); gap: 1px;
}
.service { background: var(--surface); padding: 32px 28px 36px; transition: background-color 0.2s; }
.service:hover { background: #fafafa; }
.service .num { display: block; font: 600 0.8125rem/1 var(--display); color: var(--accent); margin-bottom: 18px; letter-spacing: 0.02em; }
.service h3 { margin-bottom: 12px; }
.service p { color: var(--muted); font-size: 0.9375rem; }
.service ul { margin: 18px 0 0; padding: 0; list-style: none; font-size: 0.875rem; color: var(--ink-2); }
.service li { position: relative; padding-left: 16px; margin-top: 6px; }
.service li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 5px; height: 5px; border-radius: 50%; background: var(--ink-2); }
@media (max-width: 60rem) { .services { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 40rem) { .services { grid-template-columns: 1fr; } .service { padding: 28px 20px; } }

/* Shopproof */
.product { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.product-copy p { color: var(--muted); margin-top: 20px; max-width: 34rem; }
.product-copy .owned { color: var(--ink); font-weight: 500; padding-left: 16px; border-left: 3px solid var(--accent); }
.product-copy .note { font-size: 0.875rem; }
.product-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 32px; box-shadow: 0 1px 2px rgb(17 24 39 / 0.04), 0 12px 32px -12px rgb(17 24 39 / 0.12); }
.product-card .product-name { display: block; font: 600 1.25rem/1 var(--display); letter-spacing: -0.02em; margin-bottom: 24px; }
.product-card .product-name span { color: var(--accent); }
.product-card dl { display: grid; grid-template-columns: auto 1fr; gap: 14px 24px; margin: 0 0 28px; font-size: 0.9375rem; }
.product-card dt { color: var(--muted); }
.product-card dd { margin: 0; font-weight: 500; }
.product-card .button { width: 100%; }
@media (max-width: 52rem) { .product { grid-template-columns: 1fr; gap: 40px; } }

/* How we work */
.night { background: var(--night); color: var(--night-text); }
.night h2, .night h3 { color: #fff; }
.principles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; margin: 48px 0 0; padding: 0; list-style: none; }
.principles li { border-top: 1px solid var(--night-line); padding-top: 24px; }
.principles h3 { margin-bottom: 10px; }
.principles p { color: var(--night-muted); font-size: 0.9375rem; }
@media (max-width: 52rem) { .principles { grid-template-columns: 1fr; gap: 28px; } }

/* Clients */
.subhead { margin-top: 16px; color: var(--muted); }
.clients { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 40px 0 0; padding: 0; list-style: none; }
.clients li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 28px; }
.clients h3 { font-size: 1.0625rem; margin-bottom: 10px; }
.clients p { color: var(--muted); font-size: 0.9375rem; }
@media (max-width: 52rem) { .clients { grid-template-columns: 1fr; } }

/* Contact */
.contact .wrap { display: flex; align-items: center; justify-content: space-between; gap: 32px 48px; flex-wrap: wrap; }
.contact p { margin-top: 16px; color: var(--muted); }
.contact .mail { font-weight: 600; color: var(--ink); }

/* Footer */
.site-footer { padding: 56px 0 40px; font-size: 0.875rem; color: var(--muted); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.footer-grid h2 { font: 600 0.75rem/1 var(--body); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink); margin-bottom: 14px; }
.footer-grid p, .footer-grid li { line-height: 1.7; }
.footer-grid ul { margin: 0; padding: 0; list-style: none; }
.footer-grid a { color: var(--muted); }
.footer-grid a:hover { color: var(--accent); }
.footer-grid .brand { color: var(--brand); margin-bottom: 16px; }
.footer-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line-strong); }
@media (max-width: 52rem) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 34rem) { .footer-grid { grid-template-columns: 1fr; } }

/* Legal pages */
.page { padding: 56px 0 96px; }
.prose { max-width: 46rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 48px; }
.prose h1 { font-size: clamp(2rem, 1.6rem + 1.6vw, 2.75rem); margin-bottom: 16px; }
.prose h2 { font-size: 1.25rem; margin: 36px 0 10px; }
.prose p { margin-top: 12px; color: var(--ink-2); }
.prose a { color: var(--accent); }
.prose .updated { color: var(--muted); font-size: 0.875rem; }
.prose dl { display: grid; grid-template-columns: minmax(8rem, 14rem) 1fr; gap: 10px 20px; margin: 28px 0 0; padding: 24px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.prose dt { color: var(--muted); }
.prose dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 40rem) {
  .prose { padding: 28px 20px; }
  .prose dl { grid-template-columns: 1fr; gap: 2px; }
  .prose dd + dt { margin-top: 12px; }
}

/* Contact form, in the dialog and on /contact/ */
.modal {
  width: min(36rem, calc(100% - 32px)); max-height: calc(100dvh - 48px);
  padding: 0; border: 0; border-radius: 14px; background: var(--surface); color: var(--ink);
  box-shadow: 0 24px 64px -16px rgb(17 24 39 / 0.35);
  overscroll-behavior: contain;
}
.modal::backdrop { background: rgb(17 24 39 / 0.55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.modal[open] { animation: modal-in 0.2s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .modal[open] { animation: none; } }
.modal-open { overflow: hidden; }
.modal-inner { padding: 32px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.modal-head h2 { font-size: 1.625rem; }
.modal-intro { margin-top: 8px; color: var(--muted); font-size: 0.9375rem; }
.modal-close {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; margin: -6px -8px 0 0;
  border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer;
}
.modal-close:hover { background: var(--paper); color: var(--ink); }
.modal-close svg { width: 18px; height: 18px; }
@media (max-width: 40rem) {
  /* Bottom sheet on phones */
  .modal { width: 100%; max-width: none; max-height: 92dvh; margin: auto 0 0; border-radius: 16px 16px 0 0; }
  .modal-inner { padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); }
  @keyframes modal-in { from { transform: translateY(100%); } to { transform: none; } }
}

.contact-form { display: grid; gap: 16px; margin-top: 24px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 0.875rem; font-weight: 600; color: var(--ink-2); }
.field .optional { font-weight: 400; color: var(--muted); }
.field input, .field textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--surface); color: var(--ink); font: inherit; font-size: 1rem;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
.field-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.turnstile { min-height: 65px; }
.form-note { font-size: 0.8125rem; color: var(--muted); }
.form-note a { color: var(--brand); }
.form-status { font-size: 0.9375rem; font-weight: 500; }
.form-status:empty { display: none; }
.form-status.is-error, .form-result.is-error { color: #b91c1c; }
.form-status.is-success, .form-result { color: #166534; }
.contact-form .button { justify-self: start; min-width: 10rem; cursor: pointer; }
.contact-form .button:disabled { opacity: 0.6; cursor: progress; }
@media (max-width: 40rem) { .contact-form .button { justify-self: stretch; } }
.prose .contact-form { margin-top: 28px; }
.prose .form-result { font-weight: 500; margin-top: 16px; }
