/* ==========================================================================
   NarwhAI - site styles
   Mobile-first. Change the look by editing the tokens in :root.
   Colour pairs used for text are checked against WCAG 2.2 AA (4.5:1).
   ========================================================================== */

:root {
  /* Surfaces */
  --bg:          #f7f7f5;   /* off-white page ground */
  --surface:     #ffffff;
  --sunken:      #eff1f2;

  /* Text. Navy is taken from the logo wordmark (#011d4c). */
  --navy:        #0a1f4b;   /* headings, dark bands */
  --navy-deep:   #061534;   /* footer */
  --ink:         #1f2933;   /* body copy (charcoal) */
  --muted:       #4f5d6b;   /* secondary copy       - 6.6:1 on white */
  --faint:       #66727f;   /* labels, meta         - 5.0:1 on white */

  /* Lines */
  --line:        #e1e4e8;
  --line-strong: #c9ced4;

  /* Accent: the logo's mid blue - the calmer of its two blues. */
  --accent:      #005bb2;   /* 6.7:1 on white, and white-on-accent */
  --accent-dark: #004a91;
  --accent-soft: #e6f0fa;

  /* On the navy band */
  --on-navy:       #e9edf2;
  --on-navy-muted: #b8c4d6;
  --accent-on-navy:#6cc9f2;  /* logo cyan, softened */

  --radius:    8px;
  --radius-lg: 12px;
  --shadow:    0 1px 2px rgba(20, 36, 58, .05), 0 2px 8px rgba(20, 36, 58, .04);

  /* System fonts only: no third-party font requests, nothing to download. */
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, "Noto Sans", sans-serif;

  --maxw: 1080px;
  --gutter: 20px;
  --header-h: 64px;

  color-scheme: light;
}

@media (min-width: 720px) {
  :root { --gutter: 32px; --header-h: 72px; }
}

/* --- Base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Anchor jumps land below the sticky header, not under it. */
  scroll-padding-top: calc(var(--header-h) + 12px);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; height: auto; }

h1, h2, h3 {
  margin: 0 0 .6em;
  color: var(--navy);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h1 { font-size: clamp(1.75rem, 1.2rem + 2.6vw, 2.75rem); letter-spacing: -0.025em; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.3vw, 2rem); }
h3 { font-size: 1.125rem; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-dark); }

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

/* --- Layout -------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(56px, 9vw, 96px); }
.section--white  { background: var(--surface); }
.section--sunken { background: var(--sunken); }

.section-head { max-width: 640px; margin-bottom: clamp(32px, 5vw, 48px); }

.eyebrow {
  display: block;
  margin-bottom: 10px;
  color: var(--accent);
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.lede { color: var(--muted); font-size: 1.125rem; }

.prose { max-width: 660px; }
.prose p { font-size: 1.125rem; color: var(--ink); }

.skip-link {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: var(--radius);
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; color: #fff; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 24px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-dark); color: #fff; }

.btn--outline { border-color: var(--line-strong); background: var(--surface); color: var(--navy); }
.btn--outline:hover { border-color: var(--navy); color: var(--navy); }

.btn--small { min-height: 40px; padding: 8px 16px; font-size: .9375rem; }

.btn[aria-disabled="true"] {
  border-color: var(--line-strong);
  background: var(--sunken);
  color: var(--muted);
  cursor: not-allowed;
}

/* --- Header -------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--navy);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.brand:hover { color: var(--navy); }

/* Logo: narwhal mark + wordmark, as two images so each stays legible at
   header size. Heights are set here; widths follow the image ratio. */
.brand__mark { width: auto; height: 34px; flex-shrink: 0; }
.brand__word { width: auto; height: 18px; flex-shrink: 0; }

@media (min-width: 720px) {
  .brand__mark { height: 40px; }
  .brand__word { height: 22px; }
}

.nav-toggle {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--navy);
  cursor: pointer;
}
.nav-toggle svg { width: 22px; height: 22px; }

/* Mobile: the nav drops down under the header. It is positioned against
   .site-header__inner, whose padding box is already full-width, so 0/0
   spans the screen edge to edge. */
.nav {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  padding: 8px var(--gutter) 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 20px rgba(20, 36, 58, .08);
}
.nav[hidden] { display: none; }

.nav__link {
  display: block;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
}
.nav__link:hover { color: var(--accent); }

.nav .btn { margin-top: 16px; }

@media (min-width: 900px) {
  .nav-toggle { display: none; }

  .nav,
  .nav[hidden] {
    position: static;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: none;
  }

  .nav__link {
    padding: 8px 12px;
    border: 0;
    border-radius: var(--radius);
    color: var(--muted);
    font-size: .9375rem;
  }
  .nav__link:hover { background: var(--sunken); color: var(--navy); }

  .nav .btn { margin: 0 0 0 12px; }
}

/* --- Hero ---------------------------------------------------------------- */
.hero {
  padding-block: clamp(48px, 9vw, 104px);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.hero__grid { display: grid; gap: 48px; align-items: center; }

.hero h1 { max-width: 22em; }

.hero__sub {
  max-width: 560px;
  color: var(--muted);
  font-size: 1.1875rem;
}

.hero__cta { margin-top: 32px; }
.hero__note { margin-top: 12px; color: var(--faint); font-size: .9375rem; }

.hero__art { display: none; }

@media (min-width: 900px) {
  .hero__grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
  .hero__art { display: block; color: var(--navy); }
  .hero__art svg { width: 100%; max-width: 320px; margin-left: auto; }
}

/* --- Trust strip under the hero ----------------------------------------- */
.trust {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: .9375rem;
}
.trust li { display: flex; align-items: center; gap: 8px; }
.trust svg { width: 18px; height: 18px; color: var(--accent); flex-shrink: 0; }

/* --- Service cards ------------------------------------------------------- */
.services { display: grid; gap: 16px; }

@media (min-width: 640px)  { .services { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; } }
@media (min-width: 1000px) { .services { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.card {
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.card__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--accent);
}
.card__icon svg { width: 24px; height: 24px; }

.card h3 { margin-bottom: 6px; }
.card__summary { margin-bottom: 16px; color: var(--muted); font-size: 1rem; }

/* "Learn more" expander - native <details>, no JavaScript needed.
   margin-top: auto pins it to the bottom of the card, so the expanders line
   up across a row even when the summaries are different lengths. */
.card__more { margin-top: auto; border-top: 1px solid var(--line); }

.card__more summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding-top: 12px;
  color: var(--accent);
  font-size: .9375rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.card__more summary::-webkit-details-marker { display: none; }

.card__more summary::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 4px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform .15s ease;
}
.card__more[open] summary::after { transform: rotate(-135deg) translateY(-2px); }

.card__more-body { padding-top: 8px; font-size: .9875rem; }
.card__more-body p { margin-bottom: .75em; }

.card__standard { color: var(--faint); font-size: .875rem; }
.card__standard strong { color: var(--muted); font-weight: 600; }

.card__ask {
  display: inline-block;
  margin-top: 4px;
  font-size: .9375rem;
  font-weight: 600;
}

/* --- Process ------------------------------------------------------------- */
.steps {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

@media (min-width: 800px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; } }

.step {
  position: relative;
  padding: 24px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  counter-increment: step;
}

.step::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 16px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
}

.step h3 { margin-bottom: 8px; }
.step p { color: var(--muted); font-size: 1rem; }

/* --- Sample finding ------------------------------------------------------ */
.finding {
  max-width: 760px;
  padding: clamp(24px, 4vw, 40px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.finding__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: .8125rem;
  font-weight: 600;
}

.finding__body { margin: 0; font-size: 1.125rem; line-height: 1.7; }

.finding__footnote {
  max-width: 760px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 1rem;
  font-style: italic;
}

/* --- About --------------------------------------------------------------- */
.about { display: grid; gap: 40px; }

@media (min-width: 860px) { .about { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 64px; } }

.creds {
  margin: 0;
  padding: 24px;
  list-style: none;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.creds__title {
  margin-bottom: 12px;
  color: var(--faint);
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.creds li {
  display: flex;
  gap: 10px;
  padding-block: 10px;
  border-top: 1px solid var(--line);
  font-size: 1rem;
}
.creds li:first-of-type { border-top: 0; }
.creds svg { width: 18px; height: 18px; margin-top: 4px; color: var(--accent); flex-shrink: 0; }

.disclaimer {
  margin-top: 24px;
  padding: 16px 20px;
  background: var(--accent-soft);
  border-radius: var(--radius);
  color: var(--navy);
  font-size: 1rem;
}

/* --- Resources ----------------------------------------------------------- */
.resource {
  display: grid;
  gap: 20px;
  max-width: 760px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

@media (min-width: 640px) {
  .resource { grid-template-columns: auto 1fr; align-items: start; gap: 24px; padding: 28px; }
}

.resource__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 64px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--accent);
}
.resource__icon svg { width: 28px; height: 28px; }

.resource h3 { margin-bottom: 6px; }
.resource p { color: var(--muted); font-size: 1rem; }
.resource .btn { margin-top: 16px; }

/* --- Contact ------------------------------------------------------------- */
.contact {
  background: var(--navy);
  color: var(--on-navy);
}

.contact h2 { color: #fff; }
.contact .eyebrow { color: var(--accent-on-navy); }
.contact .lede { color: var(--on-navy-muted); }

.contact__grid { display: grid; gap: 40px; }

@media (min-width: 900px) { .contact__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 64px; } }

.details { margin: 32px 0 0; }
.details div { padding-block: 12px; border-top: 1px solid rgba(233, 237, 242, .14); }
.details dt {
  color: var(--on-navy-muted);
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.details dd { margin: 2px 0 0; color: #fff; font-size: 1.0625rem; }
.details a { color: #fff; }
.details a:hover { color: var(--accent-on-navy); }

/* The form itself sits on a white card for legibility. */
.form-card {
  padding: clamp(20px, 4vw, 32px);
  background: var(--surface);
  border-radius: var(--radius-lg);
  color: var(--ink);
}

.form { display: grid; gap: 18px; }

.field { display: grid; gap: 6px; }
.field label { color: var(--navy); font-size: .9375rem; font-weight: 600; }
.field .optional { color: var(--faint); font-weight: 400; }

.field input,
.field select {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;   /* 16px+ stops iOS zooming into the field */
}

.field select {
  appearance: none;
  padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field input[aria-invalid="true"],
.field select[aria-invalid="true"] { border-color: #b42318; }

.form .btn { width: 100%; }
@media (min-width: 480px) { .form .btn { width: auto; } }

.collection-notice { color: var(--muted); font-size: .875rem; line-height: 1.55; }

.form-status {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: .9375rem;
}
.form-status--ok    { background: #e7f4ec; color: #14532d; }
.form-status--error { background: #fdecea; color: #7a1d14; }

/* Honeypot - hidden from people, visible to naive spam bots. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* --- Footer -------------------------------------------------------------- */
.site-footer {
  padding-block: 40px;
  background: var(--navy-deep);
  color: var(--on-navy-muted);
  font-size: .9375rem;
}

.site-footer__grid { display: grid; gap: 24px; }

@media (min-width: 760px) {
  .site-footer__grid { grid-template-columns: 1fr auto; align-items: end; }
}

.site-footer .brand { color: #fff; }
.site-footer a { color: var(--on-navy); }
.site-footer a:hover { color: var(--accent-on-navy); }

.footer-meta { margin: 12px 0 0; padding: 0; list-style: none; }
.footer-meta li { margin-bottom: 4px; }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer__legal {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(233, 237, 242, .12);
  font-size: .875rem;
}

/* --- Simple pages (privacy, terms, 404) ---------------------------------- */
.page { padding-block: clamp(48px, 8vw, 88px); background: var(--surface); min-height: 60vh; }
.page .prose h2 { margin-top: 1.6em; font-size: 1.375rem; }

.draft-banner {
  margin-bottom: 32px;
  padding: 14px 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--sunken);
  color: var(--muted);
  font-size: .9375rem;
}
