/* Zealand Defence Systems — single stylesheet, no external resources.
   Palette is taken from the logo: slate grey structure, brick-red accent. */

:root {
  /* --brand-grey and --brand-red are sampled from the supplied logo. */
  --brand-grey: #515456;
  --brand-red:  #99452f;

  --ink-900: #16191c;
  --ink-800: #1f2428;
  --ink-700: #2d3338;
  --ink-600: #515456;
  --ink-500: #6b7175;
  --ink-400: #8b9195;
  --ink-200: #c8cbcd;
  --ink-100: #e4e6e7;
  --paper:   #f5f4f2;
  --white:   #ffffff;

  --red-700: #7d3826;
  --red-600: #99452f;
  --red-500: #b05338;
  /* The brand red is too dark to meet contrast minimums on the dark
     backgrounds, so accent text there uses a lightened tint instead. */
  --red-on-dark: #cf7156;

  --font-sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, "DejaVu Sans Mono", monospace;

  --wrap: 68rem;
  --radius: 2px;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-800);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
}

h1, h2, h3 { line-height: 1.15; margin: 0 0 0.6em; font-weight: 700; letter-spacing: -0.015em; }
h1 { font-size: clamp(2rem, 5.2vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.125rem); }
h3 { font-size: 1.125rem; letter-spacing: 0; }
p { margin: 0 0 1.1rem; }
img, svg { max-width: 100%; height: auto; }

a { color: var(--red-700); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--red-600); }

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

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.skip {
  position: absolute;
  left: -9999px;
  background: var(--white);
  color: var(--ink-900);
  padding: 0.75rem 1rem;
  z-index: 10;
}
.skip:focus { left: 1rem; top: 1rem; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red-600);
  margin-bottom: 1rem;
}

/* ---------- Masthead ---------- */

/* Light, because the supplied logo is dark grey on transparent: on a dark bar
   the wordmark would be all but invisible. */
.masthead {
  background: var(--white);
  border-bottom: 1px solid var(--ink-100);
}

.masthead__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.875rem;
}

.brand { display: inline-flex; align-items: center; text-decoration: none; }

/* The supplied lockup stacks the wordmark on three lines, so it needs real
   height to stay legible — below ~14px per line it turns to mush. */
.brand img { display: block; width: auto; height: clamp(2.75rem, 6vw, 4.25rem); }

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem;
  align-items: center;
  min-width: 0;
}

/* Below this the logo and nav together exceed the viewport and force the whole
   document wider than the screen, so they stack instead. */
@media (max-width: 40rem) {
  .masthead__inner { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .nav { gap: 1.25rem; }
}
.nav a {
  color: var(--ink-700);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 600;
  padding-block: 0.25rem;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--brand-red); border-bottom-color: var(--brand-red); }

/* ---------- Hero ---------- */

/* Hero background is layered, topmost first:
   1. a scrim that guarantees text contrast regardless of the photo
   2. the photograph, if one has been supplied
   3. a CSS-drawn field and sky, shown when there is no photograph
   A background layer whose image fails to load simply renders nothing, so
   layer 3 appears automatically until hero.jpg exists — no code change needed.
   Drop a photo at public/assets/img/hero.jpg to take over. */
.hero {
  color: var(--white);
  padding-block: clamp(3.5rem, 9vw, 7rem);
  background-color: var(--ink-900);
  background-image:
    linear-gradient(100deg,
      rgba(11, 13, 15, 0.86) 0%,
      rgba(11, 13, 15, 0.70) 34%,
      rgba(11, 13, 15, 0.46) 68%,
      rgba(11, 13, 15, 0.34) 100%),
    url("/assets/img/hero.jpg"),
    linear-gradient(to bottom,
      #3f5163 0%,
      #5b6f80 30%,
      #8d9aa4 50%,
      #b4b39c 57%,
      #7c7a5e 60%,
      #5a5842 74%,
      #33321f 100%);
  background-size: cover, cover, cover;
  background-position: center, center 42%, center;
  background-repeat: no-repeat;
}

.hero__body { max-width: 34rem; }

.hero h1 { color: var(--white); text-wrap: balance; }

.hero .eyebrow, .band .eyebrow { color: var(--red-on-dark); }

.lede {
  font-size: clamp(1.0625rem, 2vw, 1.25rem);
  color: var(--ink-200);
  max-width: 34rem;
}

.hero__rule {
  width: 4.5rem;
  height: 3px;
  background: var(--red-500);
  margin: 0 0 1.75rem;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
  padding: 0.875rem 1.75rem;
  border-radius: var(--radius);
  border: 2px solid transparent;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
}

.btn--primary { background: var(--red-600); color: var(--white); border-color: var(--red-600); }
.btn--primary:hover { background: var(--red-700); border-color: var(--red-700); color: var(--white); }

.btn--ghost { color: var(--white); border-color: var(--ink-500); background: transparent; }
.btn--ghost:hover { border-color: var(--white); color: var(--white); }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.875rem; align-items: center; margin-top: 0.5rem; }

/* ---------- Sections ---------- */

.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section--paper { background: var(--paper); }
.section--white { background: var(--white); border-block: 1px solid var(--ink-100); }

.section__head { max-width: 44rem; margin-bottom: 2.5rem; }
.section__head p { color: var(--ink-600); margin-bottom: 0; }

.grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

/* Four points of equal weight read better as a square than as one long row,
   and auto-fit would give the latter: four 15rem columns fit inside the
   65rem content width. Hence a fixed pair of columns. Collapses to one
   column at the same 40rem breakpoint as the masthead, below which two
   columns leave each card too narrow for the body copy. */
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (max-width: 40rem) {
  .grid--2 { grid-template-columns: 1fr; }
}

.card {
  background: var(--white);
  border: 1px solid var(--ink-100);
  border-top: 3px solid var(--red-600);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
}
.section--white .card { background: var(--paper); }
.card h3 { color: var(--ink-900); }
.card p { color: var(--ink-600); margin-bottom: 0; font-size: 0.9375rem; }

.card__index {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  color: var(--ink-400);
  display: block;
  margin-bottom: 0.75rem;
}

/* ---------- Long-form prose (privacy notice) ---------- */

.prose { max-width: 44rem; }
.prose h3 {
  margin-top: 2.25rem;
  color: var(--ink-900);
  font-size: 1.125rem;
}
.prose h3:first-child { margin-top: 0; }
.prose p { color: var(--ink-700); }
.prose code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--ink-100);
  padding: 0.1em 0.35em;
  border-radius: var(--radius);
}

/* ---------- Call to action band ---------- */

.band {
  background: var(--ink-800);
  color: var(--white);
  padding-block: clamp(2.75rem, 6vw, 4.5rem);
}
.band h2 { color: var(--white); }
.band p { color: var(--ink-200); max-width: 38rem; }

/* ---------- Forms ---------- */

.form-layout {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: start;
}
@media (max-width: 52rem) {
  .form-layout { grid-template-columns: 1fr; }
}

.panel {
  background: var(--white);
  border: 1px solid var(--ink-100);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3vw, 2.25rem);
}

.aside {
  background: var(--ink-800);
  color: var(--ink-200);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3vw, 2rem);
}
.aside h2 { color: var(--white); font-size: 1.25rem; }
.aside p { font-size: 0.9375rem; }
.aside p:last-child { margin-bottom: 0; }
.aside a { color: var(--white); }

.aside__list {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  font-size: 0.875rem;
}
.aside__list li {
  position: relative;
  padding-left: 1.125rem;
  margin-bottom: 0.75rem;
}
.aside__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.4375rem;
  height: 0.4375rem;
  background: var(--red-on-dark);
}

.aside__note {
  border-top: 1px solid var(--ink-600);
  padding-top: 1rem;
  color: var(--ink-400);
  font-size: 0.875rem;
}

.field { margin-bottom: 1.25rem; }

.field label {
  display: block;
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 0.375rem;
  color: var(--ink-900);
}

.field .req { color: var(--red-600); }

.field .hint {
  display: block;
  font-weight: 400;
  font-size: 0.8125rem;
  color: var(--ink-500);
  margin-top: 0.125rem;
}

.field input,
.field textarea {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink-900);
  background: var(--white);
  border: 1px solid var(--ink-400);
  border-radius: var(--radius);
  padding: 0.6875rem 0.75rem;
}
.field textarea { min-height: 7rem; resize: vertical; }

.field input:hover, .field textarea:hover { border-color: var(--ink-600); }
.field input:focus, .field textarea:focus { border-color: var(--red-600); }

.field--error input, .field--error textarea { border-color: var(--red-700); background: #fdf6f4; }

.field-error {
  display: block;
  color: var(--red-700);
  font-size: 0.875rem;
  font-weight: 600;
  margin-top: 0.375rem;
}

/* Honeypot. Kept out of the accessibility tree and off the tab order, so a
   screen-reader user is never offered it — only a scripted filler finds it. */
.decoy {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.notice {
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.75rem;
  border-left: 4px solid;
  font-size: 0.9375rem;
}
.notice--error { background: #fdf3f1; border-color: var(--red-600); color: #6b2e21; }
.notice--ok { background: #eef4ef; border-color: #3f7a52; color: #235437; }
.notice p:last-child { margin-bottom: 0; }
.notice strong { display: block; margin-bottom: 0.25rem; }

/* ---------- Footer ---------- */

.footer {
  background: var(--ink-900);
  color: var(--ink-400);
  padding-block: 2.5rem;
  font-size: 0.875rem;
}
.footer__inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem 2rem;
  align-items: center;
}
.footer a { color: var(--ink-200); text-decoration: none; }
.footer a:hover { color: var(--white); text-decoration: underline; }
.footer p { margin: 0; }
.footer__col--copyright { text-align: center; }
.footer__col--links { text-align: right; }
.footer__eu { display: block; width: 100%; max-width: 200px; height: auto; }

@media (max-width: 40rem) {
  .footer__inner { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .footer__col--links { text-align: center; }
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .btn, .nav a, .field input, .field textarea {
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
  }
}
