/* ==========================================================================
   Norlys Kystlinjen FY2026 Annual Report - public web edition
   Nordic editorial. Cool neutrals, warm single accent, generous grid,
   restrained motion. Type scale declared once, never deviated from.
   ========================================================================== */

:root {
  /* palette */
  --paper: #f4f1ea;
  --paper-2: #eae6da;
  --ink: #202c33;
  --ink-2: #43525b;
  --line: #d8d2c4;
  --accent: #a8471f;
  --accent-deep: #8a3a18;
  --water: #d9e0e4;
  --water-2: #c3cdd4;

  /* type families: locally available stacks only */
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: "Avenir Next", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  /* type scale: one place, never deviate */
  --t-display: clamp(2.9rem, 6.4vw, 4.6rem);
  --t-h2: clamp(2.1rem, 4.2vw, 3rem);
  --t-h3: 1.9rem;
  --t-body: 1.1875rem;
  --t-small: 1rem;
  --t-mono: 0.8125rem;

  /* spacing scale */
  --s1: 8px;
  --s2: 16px;
  --s3: 24px;
  --s4: 40px;
  --s5: 64px;

  /* layout */
  --container: 1160px;
  --nav-h: 56px;
}

/* ==========================================================================
   Base
   ========================================================================== */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--t-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { font-family: var(--serif); line-height: 1.12; color: var(--ink); margin: 0 0 0.5em; font-weight: 600; }
h1 { font-size: var(--t-display); letter-spacing: -0.015em; }
h2 { font-size: var(--t-h2); letter-spacing: -0.012em; }
h3 { font-size: var(--t-h3); }
h4 { font-size: 1.35rem; }

p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.4em; }
li { margin-bottom: 0.35em; }

a { color: var(--accent-deep); }

img, svg { max-width: 100%; }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  z-index: 200;
  font-family: var(--sans);
}
.skip-link:focus { left: 0; }

.container { max-width: var(--container); margin-inline: auto; padding-inline: clamp(1.25rem, 4vw, 3rem); }
.section { padding-block: var(--s5); scroll-margin-top: calc(var(--nav-h) + 12px); }
.section-alt { background: var(--paper-2); }

/* ==========================================================================
   Masthead
   ========================================================================== */

.masthead { padding: clamp(3rem, 8vw, 6rem) 0 clamp(2rem, 5vw, 4rem); }
.masthead-inner { max-width: var(--container); margin-inline: auto; padding-inline: clamp(1.25rem, 4vw, 3rem); }
.masthead-kicker {
  font-family: var(--sans);
  font-size: 0.8125rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: 1.2em;
}
.masthead-sub { font-family: var(--sans); font-size: 0.95rem; color: var(--ink-2); margin: 0; }

/* ==========================================================================
   Sticky header with progress
   ========================================================================== */

.site-head {
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(244, 241, 234, 0.94);
  backdrop-filter: blur(6px);
  border-block: 1px solid var(--line);
}

.progress { height: 3px; background: transparent; }
.progress-bar { display: block; height: 100%; width: 0%; background: var(--accent); }

.site-nav { border-block: 1px solid var(--line); }
.site-nav-inner {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.site-nav-inner::-webkit-scrollbar { display: none; }
.site-nav a {
  font-family: var(--sans);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  text-decoration: none;
  padding: 0.85rem 0.75rem;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="true"] { color: var(--accent-deep); border-bottom-color: var(--accent); }

/* ==========================================================================
   Section scaffolding
   ========================================================================== */

.section-head { margin-bottom: 2.2em; max-width: 22em; }
.kicker {
  font-family: var(--sans);
  font-size: 0.8125rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin-bottom: 0.8em;
}
.lede { font-size: 1.2rem; line-height: 1.55; color: var(--ink-2); max-width: 38em; }
.fineprint { font-family: var(--sans); font-size: 0.85rem; color: var(--ink-2); margin-top: 1.2em; }
.subhead { margin-top: 2.4em; }
.table-wrap { overflow-x: auto; scrollbar-width: none; }
.table-wrap::-webkit-scrollbar { display: none; }

/* ==========================================================================
   Opening
   ========================================================================== */

.statement { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.05; letter-spacing: -0.015em; max-width: 20em; }
.timetable { width: 100%; border-collapse: collapse; font-size: 0.98rem; background: var(--paper); }
.timetable caption { text-align: left; font-family: var(--sans); font-size: 0.85rem; color: var(--ink-2); padding-bottom: 0.6em; }
.timetable th, .timetable td { border-bottom: 1px solid var(--line); padding: 0.7em 0.9em; text-align: left; font-family: var(--sans); }
.timetable th { font-weight: 600; color: var(--ink); border-bottom: 2px solid var(--ink); }

/* ==========================================================================
   Figures
   ========================================================================== */

.figure-hero { margin: 0 0 2.4em; }
.figure-label { font-family: var(--sans); font-size: 0.85rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); }
.figure-value { font-size: clamp(4rem, 12vw, 7.5rem); line-height: 1; letter-spacing: -0.03em; margin: 0.2em 0; font-weight: 600; }
.figure-note { font-family: var(--sans); font-size: 0.95rem; color: var(--ink-2); max-width: 34em; }

.figure-support { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-bottom: 3em; }
.support-card { background: var(--paper); padding: 1.4em 1.2em; }
.support-value { font-size: 2rem; font-weight: 600; margin: 0; }
.support-label { font-family: var(--sans); font-size: 0.82rem; color: var(--ink-2); margin: 0.3em 0 0; }

.stat-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.stat { background: var(--paper); padding: 1.6em 1.4em; }
.stat-value { font-size: 2.4rem; font-weight: 600; margin: 0; }
.stat-label { font-family: var(--sans); font-size: 0.85rem; color: var(--ink-2); margin: 0.3em 0 0; }
.figure-source { font-family: var(--sans); font-size: 0.85rem; color: var(--ink-2); margin-top: 1.2em; }

/* ==========================================================================
   Map
   ========================================================================== */

.map-frame {
  border: 1px solid var(--ink);
  background: var(--paper);
  padding: 0.6em;
  max-width: 64em;
}
#route-map { display: block; width: 100%; height: auto; background: var(--paper); }
.map-bg { fill: var(--paper); }
.map-coast { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.map-fjord { fill: var(--water); stroke: none; }
#map-routes path {
  fill: none;
  stroke: rgba(32, 44, 51, 0.35);
  stroke-width: 2.5;
  stroke-linecap: round;
  cursor: pointer;
  transition: stroke 0.25s ease, stroke-width 0.25s ease, opacity 0.25s ease;
}
#map-routes path:hover { stroke: var(--accent); stroke-width: 4; opacity: 1; }
#map-routes path.selected { stroke: var(--accent-deep); stroke-width: 4.5; opacity: 1; }
#map-routes path.dim { opacity: 0.18; }
.map-ports circle { fill: var(--ink); stroke: var(--paper); stroke-width: 3; }
.map-ports text { font-family: var(--mono); font-size: 15px; fill: var(--ink); }
.map-legend { padding: 0.8em 0.4em 0.2em; }
.legend-title { font-family: var(--sans); font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 0.5em; }
#map-legend-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.4em 2em; }
#map-legend-list li { font-family: var(--sans); font-size: 0.88rem; color: var(--ink-2); display: flex; gap: 0.6em; align-items: baseline; }
#map-legend-list li::before { content: ""; width: 18px; height: 3px; background: var(--ink); display: inline-block; flex: none; }
#map-legend-list li.selected-legend::before { background: var(--accent-deep); }

/* ==========================================================================
   Fleet
   ========================================================================== */

.fleet-controls { display: flex; justify-content: space-between; align-items: center; gap: 1em; flex-wrap: wrap; margin-bottom: 1.4em; }
.fuel-filters { display: flex; flex-wrap: wrap; gap: 0.5em; }
.fuel-filters button {
  font-family: var(--sans);
  font-size: 0.85rem;
  padding: 0.5em 1em;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.fuel-filters button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.fleet-count { font-family: var(--sans); font-size: 0.85rem; color: var(--ink-2); }

.fleet-table { width: 100%; border-collapse: collapse; font-size: 0.98rem; background: var(--paper); }
.fleet-table caption { text-align: left; font-family: var(--sans); font-size: 0.85rem; color: var(--ink-2); padding-bottom: 0.6em; }
.fleet-table th, .fleet-table td { border-bottom: 1px solid var(--line); padding: 0.75em 0.9em; text-align: left; font-family: var(--sans); }
.fleet-table th { font-weight: 600; color: var(--ink); border-bottom: 2px solid var(--ink); background: var(--paper-2); }
.fleet-table tbody tr:hover { background: #efe9dc; }
.fleet-table tbody tr.selected { background: #f0e2d4; }
.fleet-table tbody tr.dimmed { opacity: 0.4; }
.th-sort { background: none; border: 0; padding: 0; font: inherit; font-weight: inherit; color: inherit; cursor: pointer; text-align: left; }

.profiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5em; margin-top: 0.5em; }
.profile { margin: 0; border: 1px solid var(--line); background: var(--paper); padding: 1em; }
.profile svg { display: block; width: 100%; height: auto; background: var(--paper); }
.profile-shape { fill: #e3d9c6; stroke: var(--ink); stroke-width: 2; }
.profile-keel { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.profile-mast { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.profile-scale { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 4 3; }
.profile-scale-label { font-family: var(--sans); font-size: 12px; fill: var(--ink); }
.profile figcaption { font-family: var(--sans); font-size: 0.85rem; color: var(--ink-2); margin: 0.7em 0 0; }

/* ==========================================================================
   Charts
   ========================================================================== */

.chart { margin-bottom: 3em; }
.chart-box { border: 1px solid var(--line); background: var(--paper); padding: 0.8em; max-width: 46em; }
.chart-frame { fill: var(--paper); stroke: none; }
.chart text { font-family: var(--mono); }
.chart .axis { stroke: var(--ink-2); stroke-width: 1; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .bar { fill: var(--accent); }
.chart .bar-alt { fill: #c98a5f; }
.chart .line { fill: none; stroke: var(--accent-deep); stroke-width: 2.5; }
.chart .band { fill: rgba(168, 71, 31, 0.12); }

/* waterfall */
.wf-step { font-family: var(--mono); font-size: 13px; }
.wf-bar-rev { fill: var(--ink); }
.wf-bar-sub { fill: #b99b7e; }
.wf-bar-end { fill: var(--accent); }

/* ==========================================================================
   Small multiples
   ========================================================================== */

.multiples { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1.2em; }
.multiple { border: 1px solid var(--line); background: var(--paper); padding: 1em; }
.multiple svg { display: block; width: 100%; height: auto; background: var(--paper); }
.multiple-caption { font-family: var(--sans); font-size: 0.85rem; color: var(--ink); margin: 0.6em 0 0; }
.multiple-value { font-family: var(--mono); font-size: 0.85rem; color: var(--ink-2); margin: 0.2em 0 0; }

/* ==========================================================================
   Letter
   ========================================================================== */

.letter { max-width: 46em; font-size: 1.22rem; line-height: 1.75; }
.letter-date { font-family: var(--sans); font-size: 0.85rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); }
.letter p { margin-bottom: 1.2em; }
.letter-sign { font-family: var(--sans); font-size: 0.95rem; letter-spacing: 0.06em; color: var(--ink-2); margin-top: 2em; }
.footnotes { font-size: 0.95rem; color: var(--ink-2); }
.footnotes li { margin-bottom: 0.5em; }
.back-to-top { font-family: var(--sans); font-size: 0.9rem; }

/* ==========================================================================
   Board
   ========================================================================== */

.board-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 3em; max-width: 60em; }
.board-item { border-bottom: 1px solid var(--line); padding: 0.9em 0; }
.board-name { font-family: var(--sans); font-weight: 600; margin: 0; }
.board-role { font-family: var(--sans); font-size: 0.88rem; color: var(--ink-2); margin: 0.2em 0 0; }

/* ==========================================================================
   Checklist / notes
   ========================================================================== */

.checklist { max-width: 60em; font-size: 1rem; }
.checklist li { margin-bottom: 0.9em; }
.checklist em { font-style: normal; font-weight: 600; }

.design-rationale { max-width: 46em; margin-top: 2.5em; border-top: 2px solid var(--ink); padding-top: 1.6em; }
.design-rationale h3 { font-size: 1.4rem; }
.design-rationale p { font-size: 1rem; }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer { border-top: 1px solid var(--line); padding: 2.5em 0; margin-top: 2em; }
.site-footer p { font-family: var(--sans); font-size: 0.85rem; color: var(--ink-2); margin: 0; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
  .figure-support { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profiles { grid-template-columns: 1fr; }
  .board-list { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .figure-support { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .masthead-sub { font-size: 0.85rem; }
  .letter { font-size: 1.12rem; }
}

/* ==========================================================================
   Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; transition-duration: 0.001s !important; }
}

/* ==========================================================================
   Print
   ========================================================================== */

@media print {
  :root { --paper: #ffffff; --paper-2: #ffffff; }
  body { background: #ffffff; color: #000000; font-size: 11pt; }
  .site-head, .skip-link, .site-footer, .masthead-kicker, .masthead-sub { display: none !important; }
  .masthead { padding-top: 2em; }
  .section { padding-block: 1.5em; break-inside: auto; }
  h2, h3 { break-after: avoid; }
  h2 { font-size: 20pt; }
  h3 { font-size: 15pt; }
  p, li { break-inside: auto; }
  .section-head { margin-bottom: 1em; }
  .figure-value { font-size: 48pt; }
  .chart-box svg { width: 100% !important; height: auto; }
  .chart-box { border: 0; background: #ffffff; break-inside: avoid; }
  .timetable, .fleet-table, #chart-bars-data, #chart-waterfall-data, #chart-line-data, #fuel-emissions { font-size: 9pt; width: 100%; }
  .timetable th, .timetable td, .fleet-table th, .fleet-table td { padding: 0.4em 0.5em; }
  .figure-support { display: block; border: 0; }
  .support-card { border: 1px solid #ccc; break-inside: avoid; margin-bottom: 0.6em; }
  .stat-grid { display: none; }
  .map-frame { border: 0; }
  .profiles { display: block; }
  .profile { break-inside: avoid; }
  .letter { font-size: 11pt; }
  a { color: #000; text-decoration: none; }
}
