/* BAMSA Marine Consulting: shared styles for every page */

:root {
  --navy: #0f2a52;
  --navy-deep: #0a1d3a;
  --navy-night: #07152b;
  --gold: #b08d57;
  --gold-soft: #d6b682;
  --gold-ink: #85663a;
  --mist: #f3f6f9;
  --paper: #ffffff;
  --ink: #0f1e33;
  --ink-muted: #4a5a70;
  --rule: #d5dde6;

  /* Surfaces for the light sections (swapped in dark mode) */
  --bg: var(--mist);
  --surface: var(--paper);
  --text: var(--ink);
  --text-muted: var(--ink-muted);
  --heading: var(--navy);
  --line: var(--rule);
  --accent-ink: var(--gold-ink);

  --font: "Jost", "Segoe UI", system-ui, sans-serif;
  --gutter: clamp(16px, 5vw, 64px);
  --max: 1240px;
  --header-h: 84px;
  --radius-pill: 999px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1829;
    --surface: #0f2038;
    --text: #e3e9f1;
    --text-muted: #a9b6c7;
    --heading: #f1f4f8;
    --line: #26395a;
    --accent-ink: var(--gold-soft);
  }
}
:root[data-theme="dark"] {
  --bg: #0b1829;
  --surface: #0f2038;
  --text: #e3e9f1;
  --text-muted: #a9b6c7;
  --heading: #f1f4f8;
  --line: #26395a;
  --accent-ink: var(--gold-soft);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
[id] { scroll-margin-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
}
body.menu-open { overflow: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 300; line-height: 1.12; color: var(--heading); text-wrap: balance; }
p { margin: 0; }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* Netlify injects a "Powered by Netlify" badge frame; the project setting to turn it off wasn't visible, so hide it here */
#nl-badge-frame { display: none !important; }

.skip {
  position: absolute; left: 16px; top: -80px; z-index: 200;
  background: var(--paper); color: var(--navy); padding: 12px 18px; font-weight: 500;
}
.skip:focus { top: 16px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 28px;
  border: 1px solid transparent; border-radius: var(--radius-pill);
  font-weight: 500; font-size: 1rem; line-height: 1; text-decoration: none; cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.btn-gold { background: var(--gold); color: var(--navy-night); }
.btn-gold:hover { background: var(--gold-soft); }
.btn-navy { background: var(--navy); color: var(--gold-soft); }
.btn-navy:hover { background: var(--navy-deep); color: #fff; }
.btn-ghost { border-color: rgba(255,255,255,.5); color: #fff; background: transparent; }
.btn-ghost:hover { border-color: #fff; background: rgba(255,255,255,.08); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn-navy { background: var(--gold); color: var(--navy-night); }
  :root:not([data-theme="light"]) .btn-navy:hover { background: var(--gold-soft); }
}
:root[data-theme="dark"] .btn-navy { background: var(--gold); color: var(--navy-night); }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  color: #fff;
  transition: background-color .3s ease, box-shadow .3s ease;
}
.site-header.is-solid { background: rgba(10, 29, 58, .96); box-shadow: 0 1px 0 rgba(255,255,255,.08); }
.site-header .wrap {
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; flex: none; }
.brand-mark { width: 50px; height: auto; }
.brand-word { width: 150px; height: auto; }
.header-tools { display: flex; align-items: center; gap: 22px; }
.nav-main { display: flex; gap: 30px; }
.nav-main a { text-decoration: none; font-weight: 400; padding: 10px 0; opacity: .9; position: relative; }
.nav-main a:hover, .nav-main a[aria-current="page"] { opacity: 1; }
.nav-main a[aria-current="page"]::after, .nav-main a:hover::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 2px; background: var(--gold);
}
.header-tools .btn { min-height: 44px; padding: 0 22px; }

.lang {
  position: relative; display: inline-flex; align-items: center;
}
.lang select {
  appearance: none; -webkit-appearance: none;
  background: transparent; color: inherit; cursor: pointer;
  border: 1px solid rgba(255,255,255,.35); border-radius: var(--radius-pill);
  min-height: 44px; padding: 0 36px 0 16px; font-size: .95rem;
}
.lang select:hover { border-color: rgba(255,255,255,.7); }
.lang select option { color: var(--ink); background: #fff; }
.lang::after {
  content: ""; position: absolute; right: 16px; top: 50%; width: 7px; height: 7px; margin-top: -5px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg);
  pointer-events: none;
}

.menu-btn {
  display: none; width: 48px; height: 48px; margin-right: -8px;
  background: none; border: 0; color: inherit; cursor: pointer; padding: 12px;
}
.menu-btn span { display: block; height: 2px; background: currentColor; margin: 7px 0; border-radius: 2px; }
.menu-btn span:nth-child(2) { width: 70%; margin-left: auto; }

@media (max-width: 1080px) {
  .nav-main, .header-tools > .lang, .header-tools > .btn { display: none; }
  .menu-btn { display: block; }
}
@media (max-width: 420px) { .brand-word { width: 120px; } .brand-mark { width: 42px; } }

/* Full-screen menu (mobile) */
.menu-panel {
  position: fixed; inset: 0; z-index: 60;
  background: var(--navy-night); color: #fff;
  display: flex; flex-direction: column;
  padding: 0 var(--gutter) 40px;
  overflow-y: auto;
}
.menu-panel[hidden] { display: none; }
.menu-panel-top { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; flex: none; }
.menu-close { width: 48px; height: 48px; margin-right: -8px; background: none; border: 0; color: #fff; cursor: pointer; position: relative; }
.menu-close::before, .menu-close::after {
  content: ""; position: absolute; left: 12px; right: 12px; top: 50%; height: 2px; background: currentColor;
}
.menu-close::before { transform: rotate(45deg); }
.menu-close::after { transform: rotate(-45deg); }
.menu-panel nav { margin-top: 32px; display: grid; }
.menu-panel nav a {
  font-size: clamp(2rem, 8vw, 2.75rem); font-weight: 300; text-decoration: none;
  padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.12);
}
.menu-panel nav a[aria-current="page"] { color: var(--gold-soft); }
.menu-panel-foot { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }

/* ---------- Home hero (photo + category band, after brevik.com) ---------- */
.hero {
  position: relative; isolation: isolate; color: #fff;
  background: var(--navy-night);
  display: grid; grid-template-rows: 1fr auto;
  min-height: 100vh; min-height: 100svh;
}
.hero-img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(7,21,43,.78) 0%, rgba(7,21,43,.35) 30%, rgba(7,21,43,.35) 55%, rgba(7,21,43,.88) 100%);
}
.hero-title {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: calc(var(--header-h) + 32px) var(--gutter) 40px;
}
.hero h1 {
  color: #fff; font-weight: 300;
  font-size: clamp(2.4rem, 5.6vw, 4.75rem); line-height: 1.06; letter-spacing: -.01em;
  max-width: 19ch;
}

.hero-lede { margin-top: 20px; font-size: clamp(1.0625rem, 1.7vw, 1.3rem); color: rgba(255,255,255,.9); max-width: 40ch; }

.categories {
  background: rgba(7, 21, 43, .62);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border-top: 1px solid rgba(255,255,255,.12);
}
.categories .wrap { padding-top: 28px; padding-bottom: 28px; }
.categories h2 { color: #fff; font-size: 1.0625rem; font-weight: 500; margin-bottom: 20px; }
.cat-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.cat-grid a {
  display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center;
  padding: 18px 10px 16px; text-decoration: none; color: #fff; border-radius: 4px;
  transition: background-color .2s ease;
}
.cat-grid a:hover { background: rgba(255,255,255,.07); }
.cat-grid svg { width: 100%; max-width: 132px; height: auto; aspect-ratio: 120 / 64; color: #fff; }
.cat-grid svg .accent { color: var(--gold-soft); }
.cat-grid span { font-size: 1.0625rem; }
@media (max-width: 760px) { .cat-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Inner page hero ---------- */
.page-hero {
  position: relative; isolation: isolate; color: #fff; background: var(--navy-night);
  min-height: clamp(380px, 62vh, 620px); display: flex; align-items: flex-end;
}
.page-hero img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.page-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(7,21,43,.75) 0%, rgba(7,21,43,.2) 40%, rgba(7,21,43,.85) 100%);
}
.page-hero .wrap { width: 100%; padding-top: calc(var(--header-h) + 40px); padding-bottom: clamp(40px, 7vw, 72px); }
.page-hero h1 { color: #fff; font-size: clamp(2.5rem, 6vw, 4.5rem); }
.page-hero p { margin-top: 16px; font-size: clamp(1.0625rem, 1.6vw, 1.25rem); max-width: 42ch; color: rgba(255,255,255,.9); }

/* ---------- Content blocks (image + text, alternating) ---------- */
.block { padding: clamp(64px, 10vw, 128px) 0; }
.block-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: center; }
.block-grid.flip .block-media { order: 2; }
.block-media { margin: 0; overflow: hidden; background: var(--navy); }
.block-media img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 5; }
.block-media.wide img { aspect-ratio: 4 / 3; }
.block h2 { font-size: clamp(2.1rem, 4.2vw, 3.4rem); }
.block p { margin-top: 20px; font-size: 1.125rem; color: var(--text-muted); max-width: 36em; }
.block .btn { margin-top: 32px; }
.block-dark { background: var(--navy); color: #fff; }
.block-dark h2 { color: #fff; }
.block-dark p { color: rgba(255,255,255,.82); }
.block-dark .bar { display: block; width: 88px; height: 4px; background: var(--gold); margin-bottom: 28px; border-radius: 2px; }
@media (max-width: 820px) {
  .block-grid { grid-template-columns: 1fr; }
  .block-grid.flip .block-media { order: 0; }
  .block-media img { aspect-ratio: 4 / 3; }
}

/* ---------- Services page ---------- */
.intro { padding: clamp(56px, 8vw, 104px) 0 0; }
.intro p { font-size: clamp(1.25rem, 2.2vw, 1.625rem); font-weight: 300; line-height: 1.45; color: var(--heading); max-width: 34em; }
.svc-group { padding: clamp(48px, 7vw, 88px) 0 0; }
.svc-group:last-of-type { padding-bottom: clamp(64px, 9vw, 120px); }
.svc-group h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); padding-bottom: 18px; border-bottom: 2px solid var(--gold); }
.svc-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 clamp(32px, 5vw, 72px); }
.svc-list.three { grid-template-columns: repeat(3, 1fr); }
.svc { padding: 32px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 40px 1fr; gap: 4px 18px; align-content: start; }
.svc svg { width: 32px; height: 32px; color: var(--accent-ink); grid-row: span 2; margin-top: 2px; }
.svc h3 { font-size: 1.4rem; font-weight: 400; }
.svc p { color: var(--text-muted); }
@media (max-width: 980px) { .svc-list.three { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 680px) { .svc-list, .svc-list.three { grid-template-columns: 1fr; } }

/* ---------- About page ---------- */
.story { padding: clamp(64px, 9vw, 120px) 0; }
.story-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(40px, 7vw, 104px); align-items: start; }
.story .tagline { font-size: clamp(1.6rem, 3.2vw, 2.5rem); line-height: 1.2; color: var(--heading); font-weight: 300; }
.story .tagline + .bar { display: block; width: 88px; height: 4px; background: var(--gold); margin: 32px 0; border-radius: 2px; }
.story-text p { font-size: 1.125rem; line-height: 1.75; max-width: 38em; }
.story-text p + p { margin-top: 1.1em; }
.story-text p:last-child { color: var(--heading); font-size: 1.25rem; }
.story-media { position: sticky; top: calc(var(--header-h) + 24px); margin: 0; }
.story-media img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
@media (max-width: 860px) { .story-grid { grid-template-columns: 1fr; } .story-media { position: static; } .story-media img { aspect-ratio: 4 / 3; } }

/* ---------- Contact page + form ---------- */
.contact-page { padding: clamp(56px, 8vw, 104px) 0 clamp(72px, 10vw, 128px); }
.contact-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(40px, 7vw, 104px); align-items: start; }
.contact-aside h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
.contact-aside p { margin-top: 18px; color: var(--text-muted); font-size: 1.125rem; max-width: 30em; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }

.form-card { background: var(--surface); border: 1px solid var(--line); padding: clamp(22px, 4vw, 44px); }
.cform { display: grid; gap: 20px; }
.cform .row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 560px) { .cform .row { grid-template-columns: 1fr; } }
.field { display: grid; gap: 6px; align-content: start; }
.field label { font-weight: 500; color: var(--heading); }
.field .opt { font-weight: 400; color: var(--text-muted); }
.field .hint { font-size: .9rem; color: var(--text-muted); }
.field input, .field textarea {
  width: 100%; min-height: 50px; padding: 12px 14px;
  color: var(--ink); background: #fff;
  border: 1px solid #aebacb; border-radius: 4px;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--gold); outline-offset: 0; border-color: var(--navy); }
.field [aria-invalid="true"] { border-color: #b3261e; }
.field .error { color: #b3261e; font-size: .92rem; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .field .error { color: #ffb4ab; } }
:root[data-theme="dark"] .field .error { color: #ffb4ab; }
.field .error:empty { display: none; }
.hp { position: absolute; left: -9999px; }
.cform .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.cform button[disabled] { opacity: .6; cursor: progress; }
.form-status { font-size: 1rem; }
.form-status:empty { display: none; }
.form-status.ok { color: #1e6b3a; font-weight: 500; }
.form-status.bad { color: #b3261e; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .form-status.ok { color: #8fd6a4; }
  :root:not([data-theme="light"]) .form-status.bad { color: #ffb4ab; }
}
:root[data-theme="dark"] .form-status.ok { color: #8fd6a4; }
:root[data-theme="dark"] .form-status.bad { color: #ffb4ab; }

/* Contact dialog ("Request contact" on every page) */
.cdialog {
  width: min(640px, calc(100vw - 32px)); max-height: calc(100dvh - 32px);
  padding: 0; border: 0; border-radius: 6px;
  background: var(--surface); color: var(--text);
  box-shadow: 0 30px 80px rgba(7,21,43,.45);
}
.cdialog::backdrop { background: rgba(7, 21, 43, .7); }
.cdialog-head { background: var(--navy); color: #fff; padding: 24px clamp(20px, 4vw, 36px); display: flex; justify-content: space-between; gap: 16px; align-items: start; }
.cdialog-head h2 { color: #fff; font-size: 1.75rem; }
.cdialog-head p { margin-top: 6px; color: rgba(255,255,255,.82); }
.cdialog-body { padding: clamp(20px, 4vw, 36px); }
.cdialog .menu-close { flex: none; margin: -8px -12px 0 0; }
@media (prefers-reduced-motion: no-preference) {
  .cdialog[open] { animation: rise .28s var(--ease); }
  @keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-night); color: rgba(255,255,255,.78); padding: clamp(56px, 8vw, 88px) 0 32px; }
.footer-grid { display: grid; grid-template-columns: auto 1fr auto; gap: 40px 64px; align-items: start; }
.footer-logo { width: 190px; }
.footer-nav { display: grid; gap: 6px; justify-self: center; }
.footer-nav a { text-decoration: none; padding: 4px 0; }
.footer-nav a:hover { color: #fff; text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 5px; }
.footer-side { display: grid; gap: 16px; justify-items: start; }
.footer-side .lang { color: #fff; }
.footer-bottom { margin-top: 56px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.12); font-size: .92rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-nav { justify-self: start; }
}
