/* =========================================================
   Weather Eye Maritime Training
   Muted, warm-neutral palette; prose-forward layout.
   ========================================================= */

:root {
  --paper:       #EDE9E0;   /* page background, warm bone */
  --paper-deep:  #E1DACB;   /* section band */
  --card:        #F6F3EC;   /* lightest surface */
  --ink:         #2A2925;   /* body text */
  --ink-soft:    #5B564C;   /* secondary text */
  --slate:       #4C5F67;   /* headings, links */
  --slate-deep:  #303C41;   /* dark band, footer */
  --rust:        #7A3448;   /* accent — buttons, emphasis (muted burgundy) */
  --rust-deep:   #5C2636;
  --line:        #D3CBB8;   /* hairlines on paper */
  --line-dark:   #47555C;   /* hairlines on dark */

  --font-display: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-body: "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --max-width: 780px;
  --max-width-wide: 1020px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--rust-deep); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--rust); }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--slate-deep);
  line-height: 1.22;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2rem, 4.4vw, 3rem); font-weight: 500; }
h2 { font-size: clamp(1.5rem, 2.8vw, 1.9rem); font-weight: 500; }
h3 { font-size: 1.15rem; font-weight: 600; }

p { margin: 0 0 1.2em; }
p.lede { font-size: 1.15rem; color: var(--ink-soft); }

.wrap {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 0 28px;
}
.prose {
  max-width: var(--max-width);
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
/* ---------------- Section rail (in-page jump nav) ---------------- */
.section-rail {
  position: fixed;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
}
.rail-toggle { display: none; }
.rail-links {
  list-style: none;
  margin: 0;
  padding-left: 16px;
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.rail-links a {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
}
.rail-links a:hover { color: var(--rust); }
.rail-links a.active { color: var(--rust-deep); }
.rail-arrow { font-size: 0.78rem; color: var(--line-dark); }
.rail-links a.active .rail-arrow, .rail-links a:hover .rail-arrow { color: var(--rust); }

/* ---------------- Header ---------------- */
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 22px; padding-bottom: 22px;
}
.brand { display: flex; flex-direction: column; color: var(--slate-deep); text-decoration: none; }
.brand:hover { color: var(--rust-deep); }
.brand-name { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; }
.brand-name .sub {
  display: block; font-family: var(--font-body); font-size: 0.74rem;
  color: var(--ink-soft); margin-top: 3px; font-weight: 400; letter-spacing: 0.01em;
}

.main-nav ul { list-style: none; display: flex; gap: 28px; margin: 0; padding: 0; }
.main-nav a {
  color: var(--slate-deep); text-decoration: none; font-size: 1rem; font-weight: 500;
  padding-bottom: 3px; border-bottom: 1px solid transparent;
}
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--rust-deep); border-bottom-color: var(--rust); }

.nav-toggle {
  display: none; background: var(--card); border: 1px solid var(--line); border-radius: 4px;
  color: var(--slate-deep); padding: 8px 14px; font-family: var(--font-body); font-size: 0.9rem;
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5em;
  font-family: var(--font-body); font-weight: 600; font-size: 1rem;
  text-decoration: none; padding: 13px 26px; border-radius: 3px;
  border: 1.5px solid transparent; cursor: pointer; transition: background 0.12s ease, color 0.12s ease;
}
.btn-rust { background: var(--rust); color: #fff; }
.btn-rust:hover { background: var(--rust-deep); color: #fff; }
.btn-outline { background: transparent; border-color: var(--slate); color: var(--slate-deep); }
.btn-outline:hover { background: var(--slate); color: var(--paper); }
.btn-outline-light { background: transparent; border-color: rgba(237,233,224,0.5); color: var(--paper); }
.btn-outline-light:hover { background: rgba(237,233,224,0.12); }

/* ---------------- Hero ---------------- */
.hero { background: var(--paper); }
.hero .wrap { padding-top: 60px; padding-bottom: 0; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 44px; align-items: center; padding-bottom: 54px; }
.hero-grid.reverse { grid-template-columns: 0.85fr 1.15fr; }
/* Reverse sections put the image first visually on desktop even though the
   text comes first in the markup (so mobile can stay text-then-image). */
@media (min-width: 861px) {
  .hero-grid.reverse figure { order: -1; }
}
.section .hero-grid { padding-bottom: 0; }
.hero h1 { margin-bottom: 0.4em; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 1.6em; }
.hero-figure img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4/3.2; filter: saturate(0.75) contrast(1.02); border: 1px solid var(--line); }
.hero-figure figcaption { text-align: center; font-size: 0.85rem; color: var(--ink-soft); margin-top: 10px; font-style: italic; }
.hero-figure.tall img { aspect-ratio: 3/4; }

/* Thin horizon-line divider — the one quiet maritime motif */
.horizon-divider { display: block; width: 100%; height: 28px; }
.horizon-divider path { fill: none; stroke: var(--line); stroke-width: 1.4; }

/* ---------------- Stability figure ---------------- */
.stability-figure { max-width: 300px; margin: 0 auto; text-align: center; }
.stability-figure img { width: 100%; height: auto; border: 1px solid var(--line); background: #fff; }
.stability-figure figcaption { font-size: 0.85rem; color: var(--ink-soft); margin-top: 10px; font-style: italic; }

.icon-figure { max-width: 200px; margin: 0 auto; text-align: center; }
.icon-figure img { width: 100%; height: auto; }
.icon-figure figcaption { font-size: 0.85rem; color: var(--ink-soft); margin-top: 10px; font-style: italic; }

/* ---------------- Sections ---------------- */
.section { padding: 68px 0; }
.section-band { background: var(--paper-deep); }
.section-dark { background: var(--slate-deep); color: var(--paper); }
.section-dark h2 { color: var(--paper); }
.section-dark p { color: #C7CFD1; }
.section-dark .prose p.lede { color: #D7DEDF; }

.section h2 { margin-bottom: 0.6em; }

/* ---------------- CTA band ---------------- */
.cta-band { background: var(--slate-deep); color: var(--paper); padding: 64px 0; }
.cta-band .prose { text-align: left; }
.cta-band h2 { color: var(--paper); }
.cta-band p { color: #C7CFD1; }

/* ---------------- Page hero (contact) ---------------- */
.page-hero { background: var(--paper-deep); padding: 54px 0 42px; border-bottom: 1px solid var(--line); }
.page-hero p { color: var(--ink-soft); font-size: 1.08rem; }

/* ---------------- Contact form ---------------- */
.contact-form-wrap { max-width: 640px; }

form.inquiry { background: var(--card); border: 1px solid var(--line); padding: 32px; }
.form-row { margin-bottom: 20px; }
.form-row label { display: block; font-weight: 600; font-size: 0.92rem; color: var(--slate-deep); margin-bottom: 7px; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; background: #fff; border: 1.4px solid var(--line);
  padding: 12px 14px; font-family: var(--font-body); font-size: 1rem; color: var(--ink);
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: 2px solid var(--rust); outline-offset: 1px; border-color: var(--rust);
}
.form-two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-note { font-size: 0.85rem; color: var(--ink-soft); margin-top: 2px; }
.form-required { color: var(--rust-deep); }
.form-status {
  font-size: 0.9rem; padding: 12px 16px; background: var(--paper-deep);
  color: var(--ink); margin-bottom: 18px; display: none; border-left: 3px solid var(--slate);
}
.form-status.visible { display: block; }

.form-success, .form-error {
  background: var(--card); border: 1px solid var(--line); padding: 32px;
}
.form-success h3 { margin-top: 0; }
.form-success p, .form-error p { margin: 0; color: var(--ink-soft); }
.form-error { border-left: 3px solid var(--rust-deep); }

/* ---------------- Footer ---------------- */
.site-footer { background: var(--slate-deep); color: #A9B4B6; }
.footer-inner {
  padding: 40px 0 26px; display: flex; justify-content: space-between; align-items: flex-start;
  flex-wrap: wrap; gap: 24px;
}
.footer-brand { font-family: var(--font-display); font-size: 1.1rem; color: var(--paper); margin-bottom: 6px; }
.footer-inner p { color: #A9B4B6; font-size: 0.9rem; max-width: 40ch; margin: 0; }
.footer-links ul { list-style: none; display: flex; gap: 22px; margin: 0; padding: 0; }
.footer-links a { color: #C7CFD1; text-decoration: none; font-size: 0.95rem; }
.footer-links a:hover { color: var(--paper); }
.footer-bottom {
  border-top: 1px solid var(--line-dark); padding: 16px 0 24px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  font-size: 0.78rem; color: #7C8A8D;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 860px) {
  .hero-grid, .hero-grid.reverse { grid-template-columns: 1fr; }
  /* Photos read smaller than full-bleed on a phone, and sit below the text
     they belong to (the markup is already text-then-image). */
  .hero-figure { max-width: 320px; margin: 0 auto; }

  /* Section rail collapses to a small floating toggle + popover list */
  .section-rail { left: 16px; top: auto; bottom: 16px; transform: none; }
  .rail-toggle {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--rust); color: #fff; border: none; border-radius: 20px;
    padding: 10px 18px; font-family: var(--font-body); font-weight: 600; font-size: 0.88rem;
    cursor: pointer;
  }
  .rail-links {
    display: none;
    position: absolute; left: 0; bottom: calc(100% + 10px);
    background: var(--card); border: 1px solid var(--line); border-left: 1px solid var(--line);
    border-radius: 6px; padding: 16px 18px; gap: 12px;
    box-shadow: 0 6px 18px rgba(42,41,37,0.15);
  }
  .rail-links.open { display: flex; }
}
@media (max-width: 620px) {
  .main-nav { display: none; }
  .nav-toggle { display: inline-flex; }
  .main-nav.open {
    display: flex; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
    padding: 16px 28px 22px; z-index: 50;
  }
  .main-nav.open ul { flex-direction: column; gap: 14px; }
  .site-header { position: relative; }
  .form-two { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}
