/* Black Flag */
:root {
  --bg: #0a0a0c;
  --cloth: #17121e;
  --bone: #cfc6b4;
  --text: #b5ad9d;
  --muted: #7a7366;
  --line: #3a352f;
  --serif: "IM Fell English", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --serif-sc: "IM Fell English SC", "IM Fell English", Georgia, serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { background: var(--bg); }
body {
  color: var(--text);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.5;
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* layers */
.bg-video {
  position: fixed; inset: 0; z-index: 0;
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 2s ease; pointer-events: none;
  filter: saturate(.75) brightness(.58);
}
html.has-video .bg-video { opacity: .85; }

.scene {
  position: fixed; inset: 0; z-index: 1;
  width: 100%; height: 100%;
  opacity: 1; transition: opacity 2s ease; pointer-events: none;
}
html.has-video .scene { opacity: .22; }

.grain {
  position: fixed; inset: -50%; z-index: 4; pointer-events: none;
  width: 200%; height: 200%;
  opacity: .11;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.9  0 0 0 0 0.88  0 0 0 0 0.8  0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mix-blend-mode: overlay;
  animation: grain 1.2s steps(6) infinite;
}
.vignette {
  position: fixed; inset: 0; z-index: 3; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 60% at 50% 42%, transparent 35%, rgba(5, 5, 7, .5) 75%, rgba(5, 5, 7, .88) 100%),
    linear-gradient(180deg, rgba(0,0,0,.35), transparent 30%, transparent 70%, rgba(0,0,0,.3));
}

/* page */
main { position: relative; z-index: 2; text-shadow: 0 1px 2px rgba(0,0,0,.8); }
.page {
  position: relative;
  min-height: 100vh; min-height: 100dvh;
  background: radial-gradient(ellipse 60% 70% at 50% 60%, rgba(8,8,10,.55), rgba(8,8,10,0) 70%);
  width: 100%; max-width: 860px;
  margin: 0 auto;
  padding: 12px 16px 24px;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
}

.flag-wrap { width: 100%; max-width: 380px; margin: 0 0 0; }
.flag { display: block; width: 100%; height: auto; filter: drop-shadow(0 22px 26px rgba(0, 0, 0, .55)); }
.flag-still { display: block; width: 70%; margin: 0 auto; }

.title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 7vw, 74px);
  line-height: 1.1;
  letter-spacing: .1em;
  color: var(--bone);
}
.lede {
  margin: 8px 0 0;
  font-size: clamp(17px, 2.3vw, 21px);
  color: var(--text);
}
.lede em { font-style: italic; }

.creed {
  max-width: 50ch;
  margin: 18px auto 0;
  font-size: clamp(16px, 2.1vw, 19px);
  line-height: 1.55;
  color: var(--text);
}
.creed p { margin: 0; }
.creed .lead {
  font-size: 1.2em;
  font-style: italic;
  color: var(--bone);
}

.articles {
  list-style: none;
  margin: 18px 0 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center;
  font-family: var(--serif-sc);
  font-size: 15px;
  letter-spacing: .09em;
  color: var(--text);
}
.articles li { padding: 0 2px; }
.articles li + li::before { content: "·"; margin: 0 14px; color: var(--muted); }

.count {
  margin: 34px 0 0;
  font-family: var(--serif-sc);
  font-size: clamp(16px, 2.1vw, 20px);
  letter-spacing: .04em;
  color: var(--text);
}
.count b { font-weight: 400; color: var(--bone); font-variant-numeric: tabular-nums; }
html.open .count { color: var(--bone); font-size: clamp(22px, 3vw, 28px); }

.cta { margin: 14px 0 0; font-size: clamp(18px, 2.4vw, 22px); }
.cta a {
  color: var(--bone);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: border-color .25s, color .25s;
}
.cta a:hover, .cta a:focus-visible { color: #ece6d8; border-bottom-color: var(--bone); outline: none; }
.cta a:focus-visible { outline: 1px dotted var(--bone); outline-offset: 6px; }

.foot {
  margin: 20px 0 0;
  font-family: var(--serif-sc);
  font-size: 14px;
  letter-spacing: .05em;
  color: var(--muted);
}

/* about */
.about {
  width: 100%; max-width: 820px;
  margin: 30px auto 0;
  text-align: center;
}
.h2 {
  margin: 0;
  font-weight: 400;
  font-size: clamp(26px, 3.6vw, 34px);
  line-height: 1.15;
  color: var(--bone);
}
.about-lede {
  max-width: 52ch;
  margin: 6px auto 0;
  font-size: clamp(16px, 2vw, 18px);
  font-style: italic;
  color: var(--text);
}
.blocks {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px 44px;
  max-width: 720px;
  margin: 22px auto 0;
  text-align: center;
}
.block h3 {
  margin: 0 0 6px;
  font-family: var(--serif-sc);
  font-weight: 400;
  font-size: 16px;
  letter-spacing: .08em;
  color: var(--bone);
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}
.block p {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
}

.sound {
  position: fixed; right: 16px; top: 12px; z-index: 5;
  margin: 0;
  font-family: var(--serif-sc);
  font-size: 13px;
  letter-spacing: .08em;
  color: var(--muted);
  pointer-events: none;
  white-space: nowrap;
}
.sound[hidden] { display: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@keyframes grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -4%); }
  60% { transform: translate(-4%, -1%); }
  80% { transform: translate(3%, 3%); }
  100% { transform: translate(0, 0); }
}

@media (max-width: 640px) {
  .blocks { grid-template-columns: 1fr; gap: 18px; margin-top: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .grain { animation: none; }
  .bg-video, .scene { transition: none; }
}
