/* NavigAI8 site styles
 * One stylesheet for every page. Design tokens first, then base, layout,
 * components, and page-specific rules. Mobile overrides live at the end of
 * each section that needs them (breakpoint: 640px).
 */

/* ---------- Tokens ---------- */
:root {
  --ink: #0e1220;
  --ink-muted: #4a5574;
  --accent: #0a8cf7;
  --accent-pressed: #0874d0;
  --line: #d6e7f5;
  --field-line: #c9ddee;
  --placeholder: #7a84a3;
  --surface: #ffffff;
  --glow-top: #dcefff;
  --glow-bottom: #e2f2ff;

  --font: "Geist", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --gutter: clamp(20px, 4.5vw, 64px);
  --max-width: 1440px;
  --radius: 4px;

  /* Type scale: big headlines, small labels, very little weight contrast */
  --text-label: 13px;      /* buttons, nav, eyebrows, form labels */
  --text-body: 16px;
  --text-lede: 20px;
  --text-h2: 32px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background:
    radial-gradient(70% 38% at 70% 0%, var(--glow-top) 0%, rgba(220, 239, 255, 0) 100%),
    radial-gradient(80% 30% at 75% 100%, var(--glow-bottom) 0%, rgba(226, 242, 255, 0) 100%),
    var(--surface);
  font-family: var(--font);
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; }

a { color: var(--ink); }
a:hover { color: var(--accent); }

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

.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;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  text-decoration: none;
}
.skip-link:focus { top: 12px; color: #fff; }

/* Small text: the body family tuned for label sizes */
.label {
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.02em;
  font-feature-settings: "ss01", "tnum";
}

/* ---------- Header ---------- */
.site-header {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 28px var(--gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 40px;
}

.site-header__logo { display: block; line-height: 0; }
.site-header__logo img { height: 44px; width: auto; }

.site-header__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 32px;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}

/* ---------- Buttons ---------- */
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 8px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  text-decoration: none;
  font-family: inherit;
  cursor: pointer;
}
.button--primary { background: var(--accent); color: #fff; }
.button--primary:hover { background: var(--accent-pressed); color: #fff; }
.button--secondary { background: var(--surface); border-color: var(--line); color: var(--ink); }
.button--secondary:hover { border-color: var(--accent); color: var(--ink); }
.button[disabled] { opacity: 0.6; cursor: progress; }

@media (max-width: 640px) {
  .button { height: 48px; }
}

/* ---------- Home: hero ---------- */
.hero {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  /* Content sits on the optical centre: a little more room below than above */
  padding: 8px var(--gutter) 64px;
  display: flex;
  flex-direction: row-reverse;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px 64px;
}

.hero__visual {
  flex: 1 1 520px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Square, but never taller than the space left under the header */
.hero__stage {
  width: min(100%, calc(100svh - 230px), 46rem);
  min-width: 320px;
  aspect-ratio: 1 / 1;
  margin-inline: auto;
}
.hero__stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
  /* Still of the compass's first frame, shown until the 3D has drawn (compass.js then sets
     data-navig-ready). Its 1.5:1.85 shape is the region the 3D camera fits, so "contain"
     lines it up with the model. Regenerate with design/compass-poster.html. */
  background: url("/assets/img/compass-poster.webp") center / contain no-repeat;
}
.hero__stage canvas[data-navig-ready] { background-image: none; }

.hero__copy {
  flex: 1 1 560px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.display {
  margin: 0;
  max-width: 11ch;
  font-size: clamp(2.75rem, 6.5vw, 6.5rem);
  line-height: 0.9;
  font-weight: 500;
  letter-spacing: -0.055em;
}

.lede {
  margin: 0;
  max-width: 30ch;
  font-size: var(--text-lede);
  line-height: 1.45;
  letter-spacing: -0.01em;
}
.lede a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
}
.lede a:hover { color: var(--accent); }

/* Phone layout, matching the mobile design frame */
@media (max-width: 640px) {
  body.page-home {
    background:
      radial-gradient(90% 32% at 72% 0%, var(--glow-top) 0%, rgba(220, 239, 255, 0) 100%),
      radial-gradient(110% 26% at 75% 100%, var(--glow-bottom) 0%, rgba(226, 242, 255, 0) 100%),
      var(--surface);
  }
  .page-home .site-header { padding: 17px 14px 0; }
  .page-home .site-header__logo img { height: 42px; }
  .page-home .site-nav { display: none; }

  .hero {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0;
    padding: 0;
  }
  /* The compass band takes whatever height the copy leaves, up to 470px,
     so the buttons stay on screen on shorter phones */
  /* Spare height on taller phones is shared above and below the band, so the compass sits
     centred between the header and the headline */
  .hero__visual { flex: 1 1 0; min-height: 0; gap: 0; justify-content: center; }
  .hero__stage { flex: 1 1 0; width: 100%; min-width: 0; margin: 0; aspect-ratio: auto; height: auto; min-height: 240px; max-height: 470px; }
  .hero__copy {
    flex: none;
    margin-top: auto;
    padding: 16px 14px 34px;
    gap: 20px;
  }
  .page-home .display { max-width: none; font-size: 44px; line-height: 0.92; }
  .page-home .lede { max-width: none; line-height: 1.4; }
  .page-home .button-row { gap: 10px; padding-top: 6px; }
  .page-home .button { padding: 0 18px; }
}

/* ---------- Enquiry pages (looking to hire, looking for work) ---------- */
.enquiry {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px var(--gutter) 96px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 48px 80px;
}

.enquiry__intro {
  flex: 1 1 380px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.enquiry__eyebrow { margin: 0; color: var(--accent); }
.enquiry .display { max-width: 10ch; font-size: clamp(2.75rem, 5.2vw, 4.75rem); }
.enquiry .lede { max-width: 32ch; }
.enquiry__direct { margin: 0; font-size: var(--text-body); line-height: 1.5; color: var(--ink-muted); }
.enquiry__direct a { text-decoration: underline; text-underline-offset: 3px; }

/* Reasons to work with us: a full-width row under the intro and form */
.points { flex: 1 1 100%; display: flex; flex-direction: column; gap: 28px; padding-top: 24px; }
.points h2 {
  margin: 0;
  font-size: var(--text-h2);
  line-height: 1;
  font-weight: 500;
  letter-spacing: -0.04em;
}
.points__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 32px 40px;
}
.points__list li { display: flex; flex-direction: column; gap: 10px; padding-top: 20px; border-top: 1px solid var(--line); }
.points__list h3 { margin: 0; font-size: var(--text-lede); line-height: 1.2; font-weight: 500; letter-spacing: -0.01em; }
.points__list p { margin: 0; font-size: var(--text-body); line-height: 1.5; color: var(--ink-muted); }

.panel {
  flex: 1 1 520px;
  min-width: 0;
  max-width: 680px;
  padding: clamp(20px, 3vw, 40px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.form { display: flex; flex-direction: column; gap: 20px; }

.form__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.field { display: flex; flex-direction: column; gap: 8px; }
.field__optional { font-weight: 500; color: var(--ink-muted); }

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--field-line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: var(--text-body); /* 16px stops iOS zooming on focus */
  font-weight: 500;
}
.field input,
.field select { height: 48px; padding: 0 14px; }
.field select { padding: 0 12px; }
.field textarea { padding: 12px 14px; line-height: 1.5; resize: vertical; }
.field ::placeholder { color: var(--placeholder); }
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible { outline-offset: 2px; }

/* Spam trap: hidden from people, filled in by bots */
.form__trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form__actions { padding-top: 4px; }
.form__actions .button { padding: 0 28px; border: 0; }

.form__error { margin: 0; color: #b42318; font-size: var(--text-body); line-height: 1.5; }

.success { display: flex; flex-direction: column; gap: 16px; }
.success h2 {
  margin: 0;
  font-size: var(--text-h2);
  line-height: 1;
  font-weight: 500;
  letter-spacing: -0.04em;
}
.success p { margin: 0; font-size: var(--text-body); line-height: 1.5; color: var(--ink-muted); }

[hidden] { display: none !important; }

/* ---------- 404 ---------- */
.not-found {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px var(--gutter) 96px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
