/* ==========================================================================
   HMS Victory — Digital Museum
   Palette: midnight navy, charcoal, aged parchment, ivory, bronze gold
   ========================================================================== */

/* Both faces are variable fonts, so one file covers the whole weight range. */
@font-face {
  font-family: "Cormorant Garamond";
  src: url("../assets/fonts/cormorant-400.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("../assets/fonts/cormorant-400i.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/inter-400.woff2") format("woff2");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-display: "Cormorant Garamond", Constantia, "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Cascadia Mono", Consolas, ui-monospace, SFMono-Regular, monospace;

  --ink: #060a11;
  --navy: #0a1729;
  --navy-soft: #0e1f36;
  --navy-line: #1b3352;
  --char: #11151b;
  --parch: #efe6d2;
  --parch-deep: #e4d7bb;
  --parch-line: #cdbc97;
  --ivory: #f8f4ea;

  --bronze: #c2a24a;
  --bronze-bright: #d8bd74;
  --bronze-dark: #8e7430;
  --bronze-veil: rgba(194, 162, 74, 0.32);
  --bronze-veil-soft: rgba(194, 162, 74, 0.14);

  --txt-on-dark: #e6ecf4;
  --txt-dim: #a3b4c8;
  --txt-on-light: #1d2733;
  --txt-on-light-mid: #4c5967;

  --container: 1240px;
  --container-narrow: 880px;
  --radius: 2px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 0.55s;

  --nav-h: 76px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 12px);
}

body {
  margin: 0;
  background: var(--navy);
  color: var(--txt-on-dark);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.72;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.is-locked {
  overflow: hidden;
}

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

a {
  color: var(--bronze-bright);
  text-decoration: none;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}

a:hover {
  color: var(--ivory);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  margin: 0;
  letter-spacing: 0.005em;
}

p {
  margin: 0 0 1.05em;
}

p:last-child {
  margin-bottom: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

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

::selection {
  background: var(--bronze);
  color: var(--ink);
}

/* ---------- Paper grain overlay ---------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  opacity: 0.35;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.22'/%3E%3C/svg%3E");
}

/* ---------- Skip link ---------- */
.skip-link {
  position: fixed;
  top: -70px;
  left: 16px;
  z-index: 200;
  padding: 11px 20px;
  background: var(--bronze);
  color: #12100a;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: top 0.3s var(--ease);
}

.skip-link:focus {
  top: 14px;
  color: #12100a;
}

/* ---------- Layout ---------- */
.container {
  width: min(100% - 48px, var(--container));
  margin-inline: auto;
}

.container--narrow {
  width: min(100% - 48px, var(--container-narrow));
  margin-inline: auto;
}

.section {
  position: relative;
  padding: clamp(72px, 9vw, 132px) 0;
}

.section--navy {
  background: linear-gradient(180deg, #071322 0%, #0b1c31 55%, #081422 100%);
  color: var(--txt-on-dark);
}

.section--deep {
  background: linear-gradient(180deg, #05080d 0%, #0a0f17 60%, #05080d 100%);
  color: var(--txt-on-dark);
}

.section--paper {
  background: var(--parch);
  color: var(--txt-on-light);
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(255, 255, 255, 0.55), transparent 55%),
    radial-gradient(ellipse at 85% 100%, rgba(180, 154, 96, 0.16), transparent 60%);
}

.section--paper a {
  color: var(--bronze-dark);
}

.section--paper a:hover {
  color: var(--txt-on-light);
}

/* ---------- Section heading ---------- */
.section__head {
  max-width: 760px;
  margin-bottom: clamp(40px, 5vw, 64px);
}

.section__head--center {
  margin-inline: auto;
  text-align: center;
}

.section__no {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--bronze);
  margin-bottom: 18px;
}

.section__title {
  font-size: clamp(2.1rem, 4.6vw, 3.5rem);
  letter-spacing: -0.01em;
}

.section--paper .section__title {
  color: #17202c;
}

.section__lede {
  margin-top: 20px;
  font-size: 1.02rem;
  line-height: 1.78;
  color: var(--txt-dim);
  max-width: 640px;
}

.section--paper .section__lede {
  color: var(--txt-on-light-mid);
}

.section__head--center .section__lede {
  margin-inline: auto;
}

/* Gold rule with a diamond, used as a section divider */
.rule {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 260px;
  margin: 26px 0 0;
}

.section__head--center .rule {
  margin-inline: auto;
}

.rule::before,
.rule::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, var(--bronze-veil), transparent);
}

.rule__dot {
  width: 6px;
  height: 6px;
  transform: rotate(45deg);
  background: var(--bronze);
  flex: none;
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease), height 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}

.nav.is-scrolled {
  height: 64px;
  background: rgba(6, 11, 18, 0.92);
  backdrop-filter: blur(10px);
  border-bottom-color: rgba(194, 162, 74, 0.26);
}

.nav__inner {
  width: min(100% - 48px, var(--container));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
  color: var(--ivory);
}

.brand:hover {
  color: var(--ivory);
}

.brand__mark {
  font-family: var(--font-display);
  font-size: 1.32rem;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.brand__sub {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--bronze);
  white-space: nowrap;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav__link {
  position: relative;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #c6d3e2;
  padding: 6px 0;
}

.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--bronze);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}

.nav__link:hover,
.nav__link.is-active {
  color: var(--ivory);
}

.nav__link:hover::after,
.nav__link.is-active::after {
  transform: scaleX(1);
}

.nav__toggle {
  display: none;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  align-items: center;
  justify-content: center;
  color: var(--ivory);
}

.nav__toggle span {
  position: relative;
  display: block;
  width: 22px;
  height: 1px;
  background: currentColor;
  transition: transform 0.3s var(--ease), background 0.3s var(--ease);
}

.nav__toggle span::before,
.nav__toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 22px;
  height: 1px;
  background: currentColor;
  transition: transform 0.3s var(--ease), top 0.3s var(--ease);
}

.nav__toggle span::before {
  top: -7px;
}

.nav__toggle span::after {
  top: 7px;
}

.nav.is-open .nav__toggle span {
  background: transparent;
}

.nav.is-open .nav__toggle span::before {
  top: 0;
  transform: rotate(45deg);
}

.nav.is-open .nav__toggle span::after {
  top: 0;
  transform: rotate(-45deg);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  isolation: isolate;
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 52%;
  transform: scale(1.02);
  animation: heroDrift 24s var(--ease) forwards;
}

@keyframes heroDrift {
  from {
    transform: scale(1.035);
  }
  to {
    transform: scale(1);
  }
}

.hero__veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(4, 8, 14, 0.8) 0%, rgba(4, 8, 14, 0.16) 30%, rgba(4, 8, 14, 0.5) 58%, rgba(4, 8, 14, 0.9) 100%),
    linear-gradient(90deg, rgba(4, 8, 14, 0.88) 0%, rgba(4, 8, 14, 0.28) 52%, rgba(4, 8, 14, 0) 72%);
}

.hero__inner {
  width: min(100% - 48px, var(--container));
  margin-inline: auto;
  padding: calc(var(--nav-h) + 28px) 0 clamp(56px, 8vw, 96px);
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--bronze-bright);
  margin-bottom: 22px;
}

.hero__eyebrow::before {
  content: "";
  width: 34px;
  height: 1px;
  background: var(--bronze);
}

.hero__title {
  font-size: clamp(3.4rem, 10.5vw, 8.2rem);
  line-height: 0.92;
  letter-spacing: 0.015em;
  color: var(--ivory);
  text-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
}

.hero__subtitle {
  margin-top: 18px;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.15rem, 2.4vw, 1.72rem);
  color: #d7c79b;
  letter-spacing: 0.01em;
}

.hero__intro {
  margin-top: 26px;
  max-width: 560px;
  font-size: 1.02rem;
  line-height: 1.78;
  color: #d5dee9;
}

.hero__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 34px;
  border-top: 1px solid rgba(194, 162, 74, 0.3);
  border-bottom: 1px solid rgba(194, 162, 74, 0.3);
  max-width: 720px;
}

.hero__fact {
  flex: 1 1 150px;
  padding: 16px 26px 16px 0;
  border-right: 1px solid rgba(194, 162, 74, 0.2);
}

.hero__fact:last-child {
  border-right: 0;
}

.hero__fact dt {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--bronze);
  margin-bottom: 6px;
}

.hero__fact dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 600;
  color: var(--ivory);
  letter-spacing: 0.01em;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 38px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 15px 30px;
  font-size: 0.74rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border: 1px solid var(--bronze-veil);
  color: var(--ivory);
  background: rgba(194, 162, 74, 0.07);
  border-radius: var(--radius);
  transition: background 0.35s var(--ease), border-color 0.35s var(--ease), color 0.35s var(--ease), transform 0.35s var(--ease);
}

.btn:hover {
  background: var(--bronze);
  border-color: var(--bronze);
  color: #12100a;
  transform: translateY(-1px);
}

.btn--solid {
  background: var(--bronze);
  border-color: var(--bronze);
  color: #12100a;
  font-weight: 500;
}

.btn--solid:hover {
  background: var(--bronze-bright);
  border-color: var(--bronze-bright);
}

.btn__arrow {
  transition: transform 0.35s var(--ease);
}

.btn:hover .btn__arrow {
  transform: translateY(3px);
}

.hero__scroll {
  position: absolute;
  right: clamp(30px, 6vw, 78px);
  bottom: clamp(24px, 5vw, 52px);
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--txt-dim);
  writing-mode: vertical-rl;
  padding-right: 8px;
}

.hero__scroll::after {
  content: "";
  width: 1px;
  height: 54px;
  background: linear-gradient(180deg, var(--bronze), transparent);
  animation: scrollHint 2.6s ease-in-out infinite;
}

@keyframes scrollHint {
  0%, 100% {
    opacity: 0.25;
    transform: scaleY(0.5);
    transform-origin: top;
  }
  50% {
    opacity: 1;
    transform: scaleY(1);
  }
}

/* ---------- Intro / about ---------- */
.lede-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}

.lede-grid__body p {
  font-size: 1.06rem;
  line-height: 1.82;
  color: var(--txt-on-light);
}

.lede-grid__body p + p {
  margin-top: 1.05em;
}

.pullquote {
  border-left: 1px solid var(--bronze-veil);
  padding: 6px 0 6px 26px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.3rem;
  line-height: 1.5;
  color: #2c3644;
}

.pullquote cite {
  display: block;
  margin-top: 14px;
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bronze-dark);
}

.lede-grid__aside {
  position: sticky;
  top: calc(var(--nav-h) + 40px);
  padding-top: 10px;
}

.schematic__caption {
  margin-top: 16px;
  font-size: 0.84rem;
  line-height: 1.65;
  color: var(--txt-dim);
}

/* ---------- Stat cards ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1px;
  background: var(--parch-line);
  border: 1px solid var(--parch-line);
  margin-top: clamp(44px, 6vw, 72px);
}

.stat {
  position: relative;
  background: var(--ivory);
  padding: 34px 30px 32px;
  transition: background 0.4s var(--ease), transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.stat:hover {
  background: #fffdf6;
  transform: translateY(-3px);
  box-shadow: 0 18px 40px -22px rgba(30, 40, 55, 0.55);
  z-index: 1;
}

.stat__no {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.26em;
  color: var(--bronze-dark);
  margin-bottom: 16px;
}

.stat__value {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 3.4vw, 2.9rem);
  font-weight: 600;
  color: #18212d;
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.stat__value small {
  font-size: 0.86rem;
  font-family: var(--font-body);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--txt-on-light-mid);
}

.stat__label {
  margin-top: 12px;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--txt-on-light-mid);
}

.stat__note {
  margin-top: 10px;
  font-size: 0.82rem;
  line-height: 1.6;
  color: #5b6675;
}

/* ---------- Specification table ---------- */
.spec {
  margin-top: clamp(56px, 7vw, 88px);
  border-top: 1px solid var(--parch-line);
}

.spec__row {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid rgba(205, 188, 151, 0.55);
}

.spec__key {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bronze-dark);
  padding-top: 4px;
}

.spec__value {
  font-size: 1rem;
  line-height: 1.7;
  color: #202a36;
}

.spec__note {
  display: block;
  margin-top: 6px;
  font-size: 0.84rem;
  color: #5b6675;
}

.spec__src {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bronze-dark);
  border-bottom: 1px solid transparent;
}

.spec__src:hover {
  border-bottom-color: var(--bronze-dark);
}

/* ---------- Notes on the figures ---------- */
.notes {
  margin-top: 48px;
  border: 1px solid var(--parch-line);
  background: rgba(255, 255, 255, 0.34);
}

.notes__head {
  padding: 24px 26px 20px;
  border-bottom: 1px solid rgba(205, 188, 151, 0.7);
}

.notes__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bronze-dark);
  margin-bottom: 10px;
}

.notes__head p {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--txt-on-light-mid);
  max-width: 660px;
}

.notes__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 0;
}

.notes__list li {
  padding: 18px 26px;
  border-bottom: 1px solid rgba(205, 188, 151, 0.42);
  font-size: 0.9rem;
  line-height: 1.68;
  color: #3d4856;
}

.notes__list li:last-child,
.notes__list li:nth-last-child(2) {
  border-bottom: 0;
}

.notes__list strong {
  color: #1b2430;
  font-weight: 500;
}

/* ---------- Glossary accordion ---------- */
.gloss {
  margin-top: 56px;
  border: 1px solid var(--parch-line);
  background: rgba(255, 255, 255, 0.32);
}

.gloss__head {
  padding: 22px 26px;
  border-bottom: 1px solid var(--parch-line);
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bronze-dark);
}

.gloss__item {
  border-bottom: 1px solid rgba(205, 188, 151, 0.5);
}

.gloss__item:last-child {
  border-bottom: 0;
}

.gloss__btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 26px;
  text-align: left;
  font-size: 0.96rem;
  color: #232d3a;
  transition: background 0.3s var(--ease);
}

.gloss__btn:hover {
  background: rgba(194, 162, 74, 0.09);
}

.gloss__btn::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--bronze-dark);
  transition: transform 0.3s var(--ease);
}

.gloss__item.is-open .gloss__btn::after {
  transform: rotate(45deg);
}

.gloss__panel {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.42s var(--ease);
}

.gloss__panel p {
  padding: 0 26px 18px;
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--txt-on-light-mid);
}

/* ---------- Structure / feature rows ---------- */
.features {
  display: grid;
  gap: clamp(40px, 5vw, 72px);
  margin-top: clamp(40px, 5vw, 64px);
}

.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(28px, 4.5vw, 64px);
  align-items: center;
}

.feature:nth-child(even) .feature__media {
  order: 2;
}

.feature__media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid rgba(194, 162, 74, 0.3);
  background: #0c1a2b;
}

.feature__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease), filter 0.6s var(--ease);
  filter: saturate(0.92);
}

.feature:hover .feature__media img {
  transform: scale(1.045);
  filter: saturate(1);
}

.feature__index {
  position: absolute;
  top: 0;
  left: 0;
  padding: 9px 14px;
  background: rgba(6, 11, 18, 0.82);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--bronze-bright);
  z-index: 2;
  border-right: 1px solid rgba(194, 162, 74, 0.35);
  border-bottom: 1px solid rgba(194, 162, 74, 0.35);
}

.feature__body h3 {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  color: var(--ivory);
  margin-bottom: 14px;
}

.feature__body p {
  font-size: 0.99rem;
  line-height: 1.78;
  color: var(--txt-dim);
}

.feature__tag {
  display: inline-block;
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bronze);
  border: 1px solid rgba(194, 162, 74, 0.35);
  padding: 6px 12px;
}

/* ---------- Timeline ---------- */
.timeline {
  position: relative;
  margin-top: clamp(44px, 5vw, 64px);
  padding-left: 132px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 118px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--parch-line) 6%, var(--parch-line) 94%, transparent);
}

.tl-item {
  position: relative;
  padding-bottom: clamp(36px, 4.6vw, 56px);
}

.tl-item:last-child {
  padding-bottom: 0;
}

.tl-item__year {
  position: absolute;
  left: -132px;
  top: 2px;
  width: 104px;
  text-align: right;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: #2a3441;
  letter-spacing: 0.02em;
}

.tl-item__dot {
  position: absolute;
  left: -14px;
  top: 12px;
  width: 9px;
  height: 9px;
  transform: rotate(45deg);
  background: var(--parch);
  border: 1px solid var(--bronze-dark);
  transition: background 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.tl-item.is-visible .tl-item__dot {
  background: var(--bronze-dark);
  box-shadow: 0 0 0 5px rgba(194, 162, 74, 0.16);
}

.tl-item__card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(205, 188, 151, 0.8);
  padding: clamp(24px, 3vw, 34px);
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.tl-item:hover .tl-item__card {
  background: rgba(255, 255, 255, 0.62);
  border-color: var(--parch-line);
  box-shadow: 0 24px 50px -34px rgba(30, 40, 55, 0.6);
}

.tl-item__date {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bronze-dark);
}

.tl-item__title {
  margin-top: 8px;
  font-size: clamp(1.35rem, 2.2vw, 1.72rem);
  color: #1c2531;
}

.tl-item__body {
  margin-top: 12px;
  font-size: 0.97rem;
  line-height: 1.78;
  color: #3b4654;
}

.tl-item__media {
  overflow: hidden;
  border: 1px solid rgba(205, 188, 151, 0.9);
  aspect-ratio: 16 / 9;
  background: #dfd3b6;
}

.tl-item__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease);
}

.tl-item:hover .tl-item__media img {
  transform: scale(1.04);
}

.tl-item__src {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: #6b6450;
}

.tl-item--wide .tl-item__card {
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
}

/* ---------- Trafalgar ---------- */
.trafalgar {
  position: relative;
  color: var(--txt-on-dark);
  overflow: hidden;
}

.trafalgar__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.trafalgar__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.8) brightness(0.62);
}

.trafalgar__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, #05080d 0%, rgba(5, 8, 13, 0.62) 26%, rgba(5, 8, 13, 0.38) 55%, rgba(5, 8, 13, 0.9) 100%),
    radial-gradient(ellipse at 70% 24%, rgba(194, 162, 74, 0.1), transparent 62%);
}

.trafalgar .container {
  position: relative;
  z-index: 1;
}

.traf__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: rgba(194, 162, 74, 0.18);
  border: 1px solid rgba(194, 162, 74, 0.22);
  margin-top: clamp(40px, 5vw, 64px);
}

.traf__cell {
  background: rgba(8, 14, 22, 0.72);
  padding: clamp(26px, 3vw, 38px);
  transition: background 0.4s var(--ease);
}

.traf__cell:hover {
  background: rgba(13, 23, 36, 0.86);
}

.traf__cell--lead {
  grid-column: 1 / -1;
  background: rgba(6, 11, 18, 0.82);
}

.traf__no {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.24em;
  color: var(--bronze);
  margin-bottom: 12px;
}

.traf__cell h3 {
  font-size: clamp(1.3rem, 2.2vw, 1.7rem);
  color: var(--ivory);
  margin-bottom: 12px;
}

.traf__cell p {
  font-size: 0.96rem;
  line-height: 1.8;
  color: #bccada;
}

.traf__figures {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 34px;
  border-top: 1px solid rgba(194, 162, 74, 0.26);
  border-bottom: 1px solid rgba(194, 162, 74, 0.26);
}

.traf__figure {
  flex: 1 1 160px;
  padding: 18px 24px 18px 0;
  border-right: 1px solid rgba(194, 162, 74, 0.18);
}

.traf__figure:last-child {
  border-right: 0;
}

.traf__figure b {
  display: block;
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 600;
  color: var(--bronze-bright);
  line-height: 1;
}

.traf__figure span {
  display: block;
  margin-top: 8px;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--txt-dim);
}

/* Battle schematic */
.schematic {
  margin-top: clamp(40px, 5vw, 56px);
  border: 1px solid rgba(194, 162, 74, 0.26);
  background: rgba(6, 11, 18, 0.7);
  padding: clamp(20px, 3vw, 34px);
}

.schematic__label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bronze);
  margin-bottom: 18px;
}

.schematic svg {
  width: 100%;
  height: auto;
  display: block;
}

.schematic figcaption {
  margin-top: 16px;
  font-size: 0.84rem;
  line-height: 1.65;
  color: var(--txt-dim);
}

/* ---------- Knowledge cards ---------- */
.kcards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 26px;
  margin-top: clamp(40px, 5vw, 60px);
}

.kcard {
  position: relative;
  background: rgba(255, 255, 255, 0.46);
  border: 1px solid rgba(205, 188, 151, 0.9);
  padding: 32px 30px;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), background 0.4s var(--ease);
  display: flex;
  flex-direction: column;
}

.kcard:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 26px 54px -36px rgba(30, 40, 55, 0.75);
}

.kcard__icon {
  width: 40px;
  height: 40px;
  margin-bottom: 20px;
  color: var(--bronze-dark);
}

.kcard__icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
}

.kcard h3 {
  font-size: 1.36rem;
  color: #1b2430;
  margin-bottom: 12px;
}

.kcard__body {
  font-size: 0.95rem;
  line-height: 1.76;
  color: #3c4755;
}

.kcard__more {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.45s var(--ease);
}

.kcard__more p {
  padding-top: 12px;
  font-size: 0.92rem;
  line-height: 1.72;
  color: #4b5665;
}

.kcard__toggle {
  margin-top: 18px;
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bronze-dark);
  border-bottom: 1px solid var(--bronze-veil);
  padding-bottom: 3px;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.kcard__toggle:hover {
  color: #1b2430;
  border-bottom-color: var(--bronze-dark);
}

/* ---------- Gallery ---------- */
.gal {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: clamp(40px, 5vw, 56px);
}

.gal__item {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(194, 162, 74, 0.22);
  background: #0b1626;
  cursor: zoom-in;
}

.gal__item--wide {
  grid-column: span 2;
  aspect-ratio: 2 / 1;
}

.gal__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease), filter 0.5s var(--ease);
  filter: saturate(0.9) brightness(0.92);
}

.gal__item:hover img {
  transform: scale(1.06);
  filter: saturate(1.05) brightness(1);
}

.gal__cap {
  position: absolute;
  inset: auto 0 0 0;
  padding: 34px 16px 14px;
  background: linear-gradient(180deg, transparent, rgba(4, 8, 14, 0.92));
  font-size: 0.78rem;
  line-height: 1.4;
  color: #e8eef6;
  transform: translateY(8px);
  opacity: 0.85;
  transition: transform 0.4s var(--ease), opacity 0.4s var(--ease);
}

.gal__item:hover .gal__cap {
  transform: translateY(0);
  opacity: 1;
}

.gal__hint {
  margin-top: 22px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--txt-dim);
}

/* ---------- Lightbox ---------- */
.lb {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  background: rgba(3, 6, 10, 0.985);
  padding: clamp(16px, 4vw, 48px);
}

.lb.is-open {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
}

.lb__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.lb__counter {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  color: var(--bronze);
}

.lb__close {
  width: 46px;
  height: 46px;
  border: 1px solid rgba(194, 162, 74, 0.35);
  color: var(--ivory);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}

.lb__close:hover {
  background: var(--bronze);
  color: var(--ink);
}

.lb__stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.lb__img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border: 1px solid rgba(194, 162, 74, 0.18);
  background: #070d15;
}

.lb__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 54px;
  height: 54px;
  border: 1px solid rgba(194, 162, 74, 0.32);
  background: rgba(6, 11, 18, 0.66);
  color: var(--ivory);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
  z-index: 2;
}

.lb__nav:hover {
  background: var(--bronze);
  color: var(--ink);
}

.lb__nav--prev {
  left: 0;
}

.lb__nav--next {
  right: 0;
}

.lb__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.lb__caption {
  max-width: 720px;
}

.lb__title {
  font-family: var(--font-display);
  font-size: 1.24rem;
  color: var(--ivory);
  margin-bottom: 6px;
}

.lb__meta {
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--txt-dim);
}

.lb__meta a {
  color: var(--bronze-bright);
}

.lb__help {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6d7d90;
  white-space: nowrap;
}

/* ---------- Footer ---------- */
.footer {
  background: #05080d;
  border-top: 1px solid rgba(194, 162, 74, 0.2);
  padding: clamp(56px, 7vw, 84px) 0 34px;
  color: var(--txt-dim);
  font-size: 0.9rem;
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: clamp(28px, 4vw, 56px);
}

.footer__brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--ivory);
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}

.footer h4 {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bronze);
  margin-bottom: 16px;
  font-weight: 400;
}

.footer li + li {
  margin-top: 9px;
}

.footer a {
  color: #b6c4d4;
}

.footer a:hover {
  color: var(--ivory);
}

.footer__bottom {
  margin-top: clamp(36px, 5vw, 56px);
  padding-top: 24px;
  border-top: 1px solid rgba(194, 162, 74, 0.16);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 26px;
  justify-content: space-between;
  font-size: 0.78rem;
  color: #76869a;
}

/* ---------- Back to top ---------- */
.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(194, 162, 74, 0.4);
  background: rgba(6, 11, 18, 0.86);
  color: var(--bronze-bright);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease), visibility 0.4s, background 0.3s var(--ease);
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.to-top:hover {
  background: var(--bronze);
  color: var(--ink);
}

/* ---------- Scroll reveal ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.85s var(--ease), transform 0.85s var(--ease);
  transition-delay: var(--delay, 0ms);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Image placeholder (broken/missing image fallback) ---------- */
.img-fallback {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 120px;
  background:
    repeating-linear-gradient(135deg, rgba(194, 162, 74, 0.06) 0 12px, transparent 12px 24px),
    #0d1a2b;
  color: var(--txt-dim);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: center;
  padding: 18px;
}

/* The hero placeholder sits under the darkening veil, so it needs more contrast. */
.hero .img-fallback {
  color: #dce6f2;
  font-size: 0.74rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .gal {
    grid-template-columns: repeat(3, 1fr);
  }
  .footer__grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 900px) {
  :root {
    --nav-h: 66px;
  }

  .nav__toggle {
    display: flex;
  }

  .nav__links {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 1;
    padding: calc(var(--nav-h) + 20px) 24px 32px;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    background: rgba(6, 11, 18, 0.98);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(194, 162, 74, 0.25);
    transform: translateY(-104%);
    transition: transform 0.45s var(--ease);
    visibility: hidden;
  }

  /* Keep the brand and the close control above the sliding sheet. */
  .brand,
  .nav__toggle {
    position: relative;
    z-index: 3;
  }

  .nav.is-open .nav__links {
    transform: none;
    visibility: visible;
  }

  .nav__link {
    font-size: 0.86rem;
    padding: 13px 0;
    width: 100%;
    border-bottom: 1px solid rgba(194, 162, 74, 0.12);
  }

  .lede-grid {
    grid-template-columns: 1fr;
  }

  .feature {
    grid-template-columns: 1fr;
  }

  .feature:nth-child(even) .feature__media {
    order: 0;
  }

  .traf__grid {
    grid-template-columns: 1fr;
  }

  .tl-item--wide .tl-item__card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 16px;
  }

  .container,
  .container--narrow,
  .nav__inner,
  .hero__inner {
    width: min(100% - 32px, var(--container));
  }

  .section {
    padding: clamp(56px, 12vw, 80px) 0;
  }

  .hero {
    min-height: 92svh;
  }

  .hero__title {
    font-size: clamp(3rem, 15vw, 4.4rem);
  }

  .hero__facts {
    flex-direction: column;
  }

  .hero__fact {
    flex: none;
    border-right: 0;
    border-bottom: 1px solid rgba(194, 162, 74, 0.16);
    padding: 13px 0;
  }

  .hero__fact:last-child {
    border-bottom: 0;
  }

  .hero__scroll {
    display: none;
  }

  .spec__row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .timeline {
    padding-left: 0;
  }

  .timeline::before {
    left: 0;
  }

  .tl-item {
    padding-left: 30px;
  }

  .tl-item__year {
    position: static;
    width: auto;
    text-align: left;
    margin-bottom: 8px;
    font-size: 1.3rem;
  }

  .tl-item__dot {
    left: -4px;
    top: 8px;
  }

  .gal {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .gal__item--wide {
    grid-column: span 2;
  }

  .footer__grid {
    grid-template-columns: 1fr;
  }

  .lb__nav {
    width: 42px;
    height: 42px;
  }

  .lb__nav--prev {
    left: -6px;
  }

  .lb__nav--next {
    right: -6px;
  }

  .lb__help {
    display: none;
  }

  .to-top {
    right: 14px;
    bottom: 14px;
    width: 42px;
    height: 42px;
  }
}

@media (max-width: 420px) {
  .gal {
    grid-template-columns: 1fr;
  }

  .gal__item--wide {
    grid-column: span 1;
    aspect-ratio: 4 / 3;
  }
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
