/* Nautilus Steam Shipping Co. — www.nssc.uk */

:root {
  --paper: #F3ECDD;
  --paper-deep: #E9DFCB;
  --ink: #1E2430;
  --ink-soft: #4A4742;
  --sepia: #6B5A43;
  --line: #D6CAB2;
  --red: #A8182B;
  --red-dark: #861221;
  --sea: #2F4B5E;
  --white: #FFFFFF;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 1180px;
  --radius: 4px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 88px; }

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

img { max-width: 100%; height: auto; display: block; }
a { color: var(--red); }
a:hover { color: var(--red-dark); }

h1, h2 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.75rem); }
p { margin: 0 0 1em; text-wrap: pretty; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

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

.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 0.9rem;
}

.muted { color: var(--sepia); font-style: italic; font-family: var(--serif); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font: 600 0.95rem/1 var(--sans);
  letter-spacing: 0.02em;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.btn-primary { background: var(--red); color: var(--white); }
.btn-primary:hover { background: var(--red-dark); color: var(--white); }
.btn-ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--sea);
  outline-offset: 2px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(243, 236, 221, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 76px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--ink);
}
.brand-flag { width: 64px; height: 36px; color: #3A3835; flex: none; }
.brand-text { display: flex; flex-direction: column; }
.brand-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.15;
  color: var(--red);
  margin: 0;
}
.brand-tag {
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0;
}

.site-nav { display: flex; align-items: center; gap: 1.75rem; }
.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}
.site-nav a:hover { color: var(--red); }
.site-nav .nav-cta {
  border: 1.5px solid var(--red);
  color: var(--red);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
}
.site-nav .nav-cta:hover { background: var(--red); color: var(--white); }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  color: var(--ink);
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(3rem, 8vw, 6.5rem) 0;
  border-bottom: 1px solid var(--line);
}
.hero-chart {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.5;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, transparent 30%, #000 75%);
  mask-image: linear-gradient(to right, transparent 0%, transparent 30%, #000 75%);
}
.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.lede { font-size: 1.2rem; color: var(--ink-soft); max-width: 34ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }

.hero-photo, .flag-card, .chart-card { margin: 0; }
.hero-photo {
  background: var(--white);
  padding: 12px 12px 8px;
  box-shadow: 0 1px 0 var(--line), 0 18px 40px -24px rgba(30, 36, 48, 0.45);
  transform: rotate(1.2deg);
}
.hero-photo img { filter: sepia(0.25) contrast(1.02); }
figcaption {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--sepia);
  padding-top: 0.5rem;
}

/* Sections */
.section { padding: clamp(4rem, 9vw, 7rem) 0; }
.section-head { max-width: 640px; margin-bottom: 2.5rem; }
.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}

.heritage { background: var(--white); }
.dates {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  margin: 2rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.dates div { display: flex; flex-direction: column; }
.dates dt { font-family: var(--serif); font-size: 2.25rem; font-weight: 600; color: var(--red); line-height: 1; }
.dates dd { margin: 0.35rem 0 0; font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); }

.flag-card svg {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px -28px rgba(30, 36, 48, 0.5);
}

/* Archive */
.archive { background: var(--paper-deep); }
.gallery {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}
.gallery li:first-child { grid-column: span 2; grid-row: span 2; }
.gallery-item {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 10px 10px 0;
  background: var(--white);
  border: 0;
  cursor: zoom-in;
  text-align: left;
  box-shadow: 0 1px 0 var(--line);
  transition: transform .25s, box-shadow .25s;
}
.gallery-item:hover { transform: translateY(-3px); box-shadow: 0 16px 30px -22px rgba(30, 36, 48, 0.55); }
.gallery-item img {
  width: 100%;
  flex: 1;
  min-height: 0;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  filter: sepia(0.2);
}
.gallery li:first-child .gallery-item img { aspect-ratio: auto; }
.gallery-cap {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--sepia);
  padding: 0.6rem 0.25rem 0.75rem;
}

/* Course */
.chart-card {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 10px;
  box-shadow: inset 0 0 60px rgba(107, 90, 67, 0.18);
}
.chart-card svg { width: 100%; height: auto; display: block; }

/* Contact */
.contact { background: var(--white); border-top: 1px solid var(--line); }
.contact-inner {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: var(--paper);
  border: 1px solid var(--line);
}
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field label { font-weight: 600; font-size: 0.9rem; }
.field input, .field textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--white);
  border: 1.5px solid #B9AC93;
  border-radius: var(--radius);
  padding: 0.8rem 0.9rem;
  min-height: 48px;
}
.field textarea { resize: vertical; min-height: 140px; }
.field input:focus, .field textarea:focus { border-color: var(--sea); }
.field.invalid input, .field.invalid textarea { border-color: var(--red); }
.contact-form .btn { align-self: flex-start; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-status { margin: 0; min-height: 1.5em; font-weight: 500; }
.form-status.ok { color: #1F5E3A; }
.form-status.err { color: var(--red); }

/* Footer */
.site-footer {
  background: var(--ink);
  color: #D8D2C6;
  padding: 3rem 0 2.5rem;
  font-size: 0.875rem;
}
.site-footer a { color: var(--white); }
.footer-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 2rem;
  align-items: start;
}
.footer-brand { display: flex; gap: 0.75rem; align-items: center; }
.footer-brand .brand-flag { color: #D8D2C6; }
.footer-brand .brand-name { color: var(--white); }
.footer-brand .brand-tag { color: #B5AEA2; }
.footer-meta p { margin: 0 0 0.35rem; }
.coords {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  color: #8E887D;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(20, 22, 28, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: min(1200px, 100%); }
.lightbox img { max-height: 80vh; width: auto; margin-inline: auto; }
.lightbox figcaption { color: #E6DFD2; text-align: center; }
.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Reveal on scroll */
.reveal { opacity: 1; transform: none; }
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.in { opacity: 1; transform: none; }


@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* Smaller screens */
@media (max-width: 900px) {
  .hero-inner, .two-col, .contact-inner { grid-template-columns: minmax(0, 1fr); }
  .hero-photo { transform: none; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-inner { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem 1.25rem 1rem;
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 0.85rem 0; border-bottom: 1px solid var(--line); }
  .site-nav .nav-cta { margin-top: 0.75rem; text-align: center; border-bottom: 1.5px solid var(--red); }
  .brand-flag { width: 52px; height: 29px; }
  .brand-name { font-size: 1rem; }
}

@media (max-width: 520px) {
  .gallery { grid-template-columns: minmax(0, 1fr); }
  .gallery li:first-child { grid-column: auto; grid-row: auto; }
  .gallery li:first-child .gallery-item img { aspect-ratio: 16 / 10; }
}
