:root {
  --paper: #F2EFE6;
  --paper-2: #E8E3D4;
  --sea: #1E4E6E;
  --sea-deep: #153A53;
  --brass: #B48A3C;
  --red: #C0392B;
  --ink: #23272B;
  --muted: #5A5F63;
  --rule: rgba(30, 78, 110, 0.14);
  --display: "Della Respira", Georgia, serif;
  --body: "Be Vietnam Pro", system-ui, sans-serif;
  --mono: "Reddit Mono", ui-monospace, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--rule) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 28px 28px;
}

img, svg { max-width: 100%; height: auto; display: block; }

a { color: var(--sea); text-decoration-color: var(--brass); text-underline-offset: 3px; }
a:hover { color: var(--red); }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }

.wrap { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }
.mono { font-family: var(--mono); letter-spacing: 0.02em; }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--ink); color: var(--paper); padding: 0.6rem 1rem;
}
.skip:focus { top: 1rem; }

.strip { background: var(--ink); color: #D9D3C2; font-family: var(--mono); font-size: 0.75rem; }
.strip__row { display: flex; gap: 2rem; justify-content: space-between; padding: 0.35rem 0; text-transform: uppercase; overflow: hidden; white-space: nowrap; }

.mast { background: var(--paper); border-bottom: 2px solid var(--ink); }
.mast__row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 0; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--ink); }
.brand__mark { width: 40px; height: 40px; }
.brand__name { font-family: var(--display); font-size: 1.7rem; letter-spacing: 0.01em; }
.nav { display: flex; gap: 0.25rem; font-family: var(--mono); text-transform: uppercase; font-size: 0.85rem; }
.nav a { text-decoration: none; color: var(--ink); padding: 0.4rem 0.8rem; border: 1px solid transparent; }
.nav a:hover { border-color: var(--brass); color: var(--sea); }
.nav a[aria-current="page"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }

h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.15; color: var(--sea-deep); }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.6rem); margin: 0.3rem 0 1rem; }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); margin: 0.2rem 0 1rem; }
h3 { font-size: 1.3rem; margin: 0.2rem 0 0.4rem; }

.eyebrow { font-family: var(--mono); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--brass); margin: 0; }
.eyebrow--light { color: #E2C383; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 62ch; }

.btn {
  display: inline-block; font-family: var(--mono); font-size: 0.9rem; text-transform: uppercase;
  text-decoration: none; padding: 0.75rem 1.2rem; background: var(--sea); color: var(--paper);
  border: 2px solid var(--sea); margin: 0 0.6rem 0.6rem 0;
}
.btn:hover { background: var(--red); border-color: var(--red); color: var(--paper); }
.btn--ghost { background: transparent; color: var(--sea); }

.hero { padding: clamp(2.5rem, 6vw, 5rem) 0; }
.hero__grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 3rem; align-items: center; }
.hero__links { margin-top: 1.5rem; }

.fixcard {
  background: #FBF9F3; border: 2px solid var(--ink); padding: 1.4rem 1.5rem;
  box-shadow: 8px 8px 0 var(--brass); position: relative;
}
.fixcard::before {
  content: ""; position: absolute; inset: 6px; border: 1px dashed var(--rule); pointer-events: none;
}
.fixcard__head { font-size: 0.78rem; color: var(--red); margin: 0 0 1rem; }
.fixcard dl { margin: 0; display: grid; gap: 0.8rem; }
.fixcard dl div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 0.6rem; border-bottom: 1px solid var(--rule); padding-bottom: 0.6rem; }
.fixcard dt { font-family: var(--mono); font-size: 0.82rem; text-transform: uppercase; color: var(--sea); }
.fixcard dd { margin: 0; }
.fixcard__foot { font-size: 0.72rem; color: var(--muted); margin: 1rem 0 0; }

.instrument { background: var(--sea); color: #E9E4D6; padding: clamp(3rem, 6vw, 5rem) 0; }
.instrument h2 { color: var(--paper); }
.instrument__lede { max-width: 66ch; color: #CFD8DE; }
.instrument__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 2rem; }
.plate { margin: 0; background: var(--paper); border: 1px solid var(--brass); padding: 1rem; box-shadow: inset 0 0 0 6px var(--paper), inset 0 0 0 7px var(--brass); }
.plate figcaption { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; padding: 0.6rem 0.5rem 0.2rem; }

.sextant .frame { stroke: var(--ink); stroke-width: 2; opacity: 0.55; fill: none; }
.sextant .arc { fill: none; stroke: var(--brass); stroke-width: 5; }
.sextant .arc--inner { stroke-width: 1.5; }
.sextant .ticks line { stroke: var(--ink); stroke-width: 1.2; }
.sextant .ticks .tick--major { stroke-width: 2.4; stroke: var(--sea); }
.sextant .scale text { font-family: var(--mono); font-size: 13px; fill: var(--sea); }
.sextant .reading circle { fill: var(--red); }
.sextant .reading line { stroke: var(--red); stroke-width: 1.2; }
.sextant .reading text { font-family: var(--mono); font-size: 13px; fill: var(--ink); }
.sextant .reading__name { font-weight: 600; text-transform: uppercase; }
.sextant .reading__val { fill: var(--muted); }
.sextant .arm line { stroke: var(--sea-deep); stroke-width: 4; stroke-linecap: round; }
.sextant .arm rect { fill: var(--brass); stroke: var(--ink); }
.sextant .arm { transform-box: view-box; transform-origin: 320px 46px; }
.sextant .pivot { fill: var(--paper); stroke: var(--ink); stroke-width: 3; }
.sextant .caption { font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; fill: var(--muted); }

.chart .grid line { stroke: rgba(30, 78, 110, 0.18); stroke-width: 1; }
.chart .rose circle { fill: none; stroke: var(--brass); stroke-width: 1.5; }
.chart .rose path { fill: var(--paper-2); stroke: var(--ink); stroke-width: 1; }
.chart .rose .rose__n { fill: var(--red); }
.chart .rose text { font-family: var(--mono); font-size: 12px; fill: var(--ink); }
.chart .course { fill: none; stroke: var(--red); stroke-width: 3; stroke-dasharray: 9 6; stroke-linecap: round; }
.chart .wp circle { fill: var(--paper); stroke: var(--sea); stroke-width: 2.5; }
.chart .wp text { font-family: var(--mono); font-size: 12.5px; fill: var(--sea-deep); }
.chart .chart__label { font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; fill: var(--brass); }

@media (prefers-reduced-motion: no-preference) {
  .sextant .arm { animation: swing 4.5s ease-in-out 0.3s both; }
  .chart .course { stroke-dasharray: 1200; stroke-dashoffset: 1200; animation: plot 3.4s ease-out 0.8s forwards; }
  .chart .wp { animation: appear 0.5s ease-out both; }
  .chart .wp:nth-of-type(1) { animation-delay: 0.8s; }
  .chart .wp:nth-of-type(2) { animation-delay: 1.5s; }
  .chart .wp:nth-of-type(3) { animation-delay: 2.1s; }
  .chart .wp:nth-of-type(4) { animation-delay: 2.8s; }
  .chart .wp:nth-of-type(5) { animation-delay: 3.6s; }
}

@keyframes swing {
  0% { transform: rotate(-24deg); }
  45% { transform: rotate(14deg); }
  70% { transform: rotate(-5deg); }
  100% { transform: rotate(3deg); }
}
@keyframes plot { to { stroke-dashoffset: 0; } }
@keyframes appear { from { opacity: 0; } to { opacity: 1; } }

.band { padding: clamp(3rem, 6vw, 4.5rem) 0; border-top: 2px solid var(--ink); }
.band--paper { background: rgba(232, 227, 212, 0.75); }

.table-wrap { overflow-x: auto; border: 2px solid var(--ink); background: #FBF9F3; }
table { width: 100%; border-collapse: collapse; min-width: 680px; }
caption { text-align: left; font-family: var(--mono); font-size: 0.8rem; text-transform: uppercase; color: var(--muted); padding: 0.8rem 1rem; border-bottom: 1px solid var(--rule); }
th, td { text-align: left; vertical-align: top; padding: 0.85rem 1rem; border-bottom: 1px solid var(--rule); }
thead th { font-family: var(--mono); font-size: 0.8rem; text-transform: uppercase; background: var(--ink); color: var(--paper); font-weight: 400; }
tbody th { font-family: var(--display); font-weight: 400; font-size: 1.1rem; color: var(--sea-deep); white-space: nowrap; }
tbody tr:nth-child(even) { background: rgba(180, 138, 60, 0.07); }

.hazards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; }
.hazards li { background: #FBF9F3; border: 1px solid var(--ink); border-left: 6px solid var(--red); padding: 1.1rem 1.2rem; }
.hazard__no { font-size: 0.75rem; color: var(--red); }
.hazards p { margin: 0; font-size: 0.98rem; }

.log { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--ink); }
.log__item { display: grid; grid-template-columns: 4rem 1fr; gap: 1.2rem; padding: 1.3rem 0; border-bottom: 1px solid var(--ink); }
.log__no { font-size: 2rem; color: var(--brass); line-height: 1; }
.log__tag { font-size: 0.75rem; color: var(--red); margin: 0; text-transform: uppercase; }
.log h3 a { text-decoration: none; color: var(--sea-deep); }
.log h3 a:hover { color: var(--red); text-decoration: underline; }
.log p { margin: 0.2rem 0 0; }

.contact-box { display: flex; justify-content: space-between; align-items: end; gap: 2rem; flex-wrap: wrap; }
.contact-box__note { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; border: 1px dashed var(--brass); padding: 0.7rem 1rem; margin: 0; }

.page-head { padding: clamp(2.5rem, 5vw, 4rem) 0 1.5rem; max-width: 780px; }
.page-head--center { margin-inline: auto; text-align: center; padding-bottom: 5rem; }
.page-head--center .lede { margin-inline: auto; }
.stamp { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; }

.sheet { background: #FBF9F3; border: 2px solid var(--ink); padding: clamp(1.4rem, 4vw, 3rem); margin-bottom: 3rem; max-width: 780px; box-shadow: 10px 10px 0 rgba(30, 78, 110, 0.18); }
.prose h2 { font-size: 1.55rem; margin-top: 2rem; padding-top: 1rem; border-top: 1px dashed var(--rule); }
.prose h2:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: 0.45rem; }
.prose li::marker { color: var(--brass); }
.mailline { font-family: var(--mono); font-size: 1.25rem; }
.note { margin-top: 2rem; border-left: 4px solid var(--brass); padding: 0.4rem 1rem; background: rgba(180, 138, 60, 0.08); font-size: 0.92rem; }
.note p { margin: 0; }
.next { max-width: 780px; display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 4rem; padding: 1rem 1.2rem; border: 1px dashed var(--sea); }
.next span { font-size: 0.75rem; text-transform: uppercase; color: var(--muted); }
.next a { font-family: var(--display); font-size: 1.3rem; }

.foot { background: var(--ink); color: #D9D3C2; padding: 3rem 0 1.2rem; margin-top: 0; }
.foot a { color: #E2C383; }
.foot__grid { display: grid; grid-template-columns: 2fr 1fr; gap: 2rem; }
.foot__brand { font-family: var(--display); font-size: 1.6rem; color: var(--paper); margin: 0 0 0.5rem; }
.foot nav { display: grid; gap: 0.35rem; font-family: var(--mono); font-size: 0.9rem; text-transform: uppercase; }
.foot__base { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-top: 1px solid #3B4045; margin-top: 2rem; padding-top: 1rem; font-size: 0.82rem; }

@media (max-width: 860px) {
  .hero__grid, .instrument__grid, .foot__grid { grid-template-columns: 1fr; }
  .strip__row span:nth-child(3) { display: none; }
}

@media (max-width: 520px) {
  body { font-size: 1rem; }
  .fixcard dl div { grid-template-columns: 1fr; gap: 0.1rem; }
  .log__item { grid-template-columns: 2.6rem 1fr; gap: 0.8rem; }
  .log__no { font-size: 1.4rem; }
  .strip__row span:nth-child(2) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
