/* MACKI — the drowned types of the Baltic Gazette */
:root {
  --void: #020508;
  --abyss: #050b10;
  --deep: #0a151c;
  --slate: #122028;
  --panel: #0d181f;
  --line: rgba(62, 200, 220, 0.2);
  --line-strong: rgba(62, 200, 220, 0.42);
  --biolume: #3ec8dc;
  --biolume-hot: #7ef0ff;
  --biolume-dim: #1a7a88;
  --vein: #2a9aab;
  --foam: #d7e8eb;
  --mist: #8aa3a9;
  --ash: #5c7278;
  --bronze: #c4a15d;
  --bronze-dim: #7a6236;
  --ink: #e8f4f6;
  --display: "Cinzel Decorative", "Cinzel", serif;
  --head: "Cinzel", "Times New Roman", serif;
  --quote: "IM Fell English", "Palatino Linotype", serif;
  --body: "Cormorant Garamond", "Palatino Linotype", serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --pad: clamp(1.25rem, 4vw, 3.5rem);
  --max: 1180px;
  --prose: 68ch;
}

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

html { scroll-behavior: smooth; }

html,
body { min-height: 100%; }

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--foam);
  font-family: var(--body);
  font-size: clamp(1.15rem, 0.4vw + 1.05rem, 1.35rem);
  line-height: 1.65;
  background:
    radial-gradient(900px 520px at 80% 8%, rgba(62, 200, 220, 0.08), transparent 55%),
    radial-gradient(700px 480px at 8% 90%, rgba(26, 122, 136, 0.1), transparent 50%),
    var(--void);
  letter-spacing: 0.01em;
}

img { max-width: 100%; display: block; }
a { color: var(--biolume); text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { color: var(--biolume-hot); }
:focus-visible {
  outline: 1px solid var(--biolume-hot);
  outline-offset: 3px;
}

::selection {
  background: rgba(62, 200, 220, 0.28);
  color: var(--ink);
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 200;
  padding: 0.5rem 0.8rem;
  background: var(--deep);
  color: var(--ink);
}
.skip:focus { top: 1rem; }

/* atmosphere */
.grain,
.fog {
  pointer-events: none;
  position: fixed;
  inset: 0;
}

.grain {
  z-index: 80;
  opacity: 0.11;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 180 180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.fog {
  z-index: 0;
  background:
    radial-gradient(circle at 20% 10%, rgba(62, 200, 220, 0.05), transparent 28%),
    radial-gradient(circle at 80% 90%, rgba(14, 60, 70, 0.35), transparent 32%);
  animation: drift 28s ease-in-out infinite alternate;
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-2%, 1.5%, 0) scale(1.06); }
}

.tentacle-rail {
  position: fixed;
  z-index: 3;
  width: min(28vw, 280px);
  height: 240px;
  pointer-events: none;
  opacity: 0.35;
}
.tentacle-rail svg { width: 100%; height: 100%; }
.tentacle-rail path {
  stroke-dasharray: 8 14;
  animation: crawl 12s linear infinite;
}
.tentacle-rail.left { left: -20px; bottom: 8vh; }
.tentacle-rail.right { right: -20px; top: 22vh; transform: scaleX(-1); }

@keyframes crawl {
  to { stroke-dashoffset: -80; }
}

/* masthead */
.mast {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem var(--pad);
  background: linear-gradient(to bottom, rgba(2, 5, 8, 0.92), rgba(2, 5, 8, 0.62) 70%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
}

.mast.is-scrolled {
  border-bottom-color: var(--line);
  background: rgba(2, 5, 8, 0.88);
}

.mast-mark {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink);
  text-decoration: none;
}

.sigil {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--line-strong), 0 0 18px rgba(62, 200, 220, 0.25);
}

.wordmark {
  font-family: var(--display);
  font-size: 1.05rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  justify-content: center;
  gap: clamp(1rem, 3vw, 2.4rem);
}

.nav a {
  color: var(--mist);
  text-decoration: none;
  font-family: var(--head);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.nav a:hover,
.nav a[aria-current="page"] { color: var(--biolume-hot); }

.mast-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--head);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ash);
}

.sanity b,
.depth b {
  color: var(--biolume);
  font-weight: 500;
}

.sanity-bar {
  display: inline-block;
  width: 52px;
  height: 3px;
  margin-left: 0.4rem;
  background: rgba(62, 200, 220, 0.15);
  vertical-align: middle;
}
.sanity-bar i {
  display: block;
  height: 100%;
  width: 87%;
  background: linear-gradient(90deg, var(--biolume-dim), var(--biolume-hot));
  box-shadow: 0 0 8px var(--biolume);
}

.nav-toggle {
  display: none;
  position: relative;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  justify-self: end;
}
.nav-toggle span {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 50%;
  height: 1px;
  background: var(--foam);
}
.nav-toggle span:last-child { display: none; }
.nav-toggle::before,
.nav-toggle::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  height: 1px;
  background: var(--foam);
  transition: transform 0.25s var(--ease), top 0.25s, bottom 0.25s;
}
.nav-toggle::before { top: 14px; }
.nav-toggle::after { bottom: 14px; }
.mast.is-open .nav-toggle span { opacity: 0; }
.mast.is-open .nav-toggle::before {
  top: 20px;
  transform: rotate(45deg);
}
.mast.is-open .nav-toggle::after {
  bottom: 20px;
  transform: rotate(-45deg);
}

/* veil */
.veil {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  background: var(--void);
  transition: opacity 1.1s var(--ease), visibility 1.1s;
}
.veil p {
  margin: 0;
  font-family: var(--quote);
  font-style: italic;
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  color: var(--biolume);
  letter-spacing: 0.06em;
}
.veil.is-gone {
  opacity: 0;
  visibility: hidden;
}

/* layout */
.wrap {
  width: min(var(--max), calc(100% - var(--pad) * 2));
  margin: 0 auto;
}

.hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr min(46vw, 620px);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
  min-height: calc(100svh - 74px);
  padding: 2rem var(--pad) 4rem;
  background:
    linear-gradient(90deg, rgba(2, 5, 8, 0.94) 0%, rgba(2, 5, 8, 0.78) 42%, rgba(2, 5, 8, 0.4) 100%),
    linear-gradient(to top, var(--void), transparent 28%),
    url("../img/ruins.jpg") center / cover no-repeat;
}

.hero-copy { max-width: 38rem; }

.eyebrow,
.catalog,
.kicker {
  font-family: var(--head);
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--bronze);
}

.hero h1 {
  margin: 0.6rem 0 0.4rem;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(4.2rem, 11vw, 8.4rem);
  line-height: 0.86;
  letter-spacing: 0.12em;
  color: var(--ink);
  text-shadow: 0 0 40px rgba(62, 200, 220, 0.22);
}

.definition {
  margin: 0 0 1.4rem;
  color: var(--mist);
  font-family: var(--quote);
  font-style: italic;
  font-size: 1.25rem;
}

.definition b {
  color: var(--foam);
  font-style: normal;
  font-family: var(--head);
  font-weight: 500;
  letter-spacing: 0.08em;
}

.manifesto {
  color: var(--foam);
  font-size: 1.28rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.8rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.8rem;
  padding: 0.55rem 1.2rem;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  font-family: var(--head);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s, box-shadow 0.25s;
}
.btn:hover {
  background: rgba(62, 200, 220, 0.1);
  color: var(--biolume-hot);
  box-shadow: 0 0 24px rgba(62, 200, 220, 0.16);
}
.btn.solid {
  background: var(--biolume);
  border-color: var(--biolume);
  color: var(--void);
}
.btn.solid:hover {
  background: var(--biolume-hot);
  color: var(--void);
}

.reliquary {
  position: relative;
  justify-self: end;
  width: min(100%, 620px);
  aspect-ratio: 1;
  padding: 14px;
  background:
    linear-gradient(var(--abyss), var(--abyss)) padding-box,
    conic-gradient(from 130deg, transparent 0 12%, var(--biolume) 18%, transparent 28% 58%, var(--bronze) 66%, transparent 74%) border-box;
  border: 1px solid transparent;
  box-shadow:
    0 0 0 1px rgba(62, 200, 220, 0.12),
    0 0 80px rgba(62, 200, 220, 0.16),
    0 30px 80px rgba(0, 0, 0, 0.55);
}

.reliquary::before,
.reliquary::after {
  content: "";
  position: absolute;
  pointer-events: none;
}
.reliquary::before {
  inset: 6px;
  border: 1px solid rgba(196, 161, 93, 0.28);
}
.reliquary::after {
  inset: -22px;
  border: 1px dashed rgba(62, 200, 220, 0.22);
  animation: spin 48s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.reliquary img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(1.04) saturate(1.05);
}

.reliquary-caption {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 18px;
  padding: 0.45rem 0.6rem;
  background: linear-gradient(to top, rgba(2, 5, 8, 0.72), transparent);
  font-family: var(--head);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mist);
}

/* sections */
.section {
  position: relative;
  z-index: 1;
  padding: 4.5rem var(--pad);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1rem;
}

.section-head h2 {
  margin: 0.25rem 0 0;
  font-family: var(--head);
  font-weight: 500;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-head p {
  margin: 0;
  max-width: 34ch;
  color: var(--mist);
  font-family: var(--quote);
  font-style: italic;
}

/* cards */
.featured {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  min-height: 420px;
  margin-bottom: 1.2rem;
  border: 1px solid var(--line);
  background: var(--panel);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}
.featured:hover { border-color: var(--line-strong); color: inherit; }
.featured:hover h3 { color: var(--biolume-hot); }

.featured-art {
  position: relative;
  min-height: 280px;
}
.featured-art img,
.card-art img,
.page-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-body,
.card-body { padding: 1.4rem 1.5rem 1.6rem; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}

.card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  background: var(--panel);
  min-height: 100%;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: transform 0.35s var(--ease), border-color 0.35s, box-shadow 0.35s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35), 0 0 24px rgba(62, 200, 220, 0.08);
  color: inherit;
}

.card-art { aspect-ratio: 16 / 10; overflow: hidden; }
.card-art img,
.featured-art img { transition: transform 0.8s var(--ease); }
.card:hover .card-art img,
.featured:hover .featured-art img { transform: scale(1.04); }

.card h3,
.featured h3 {
  margin: 0.45rem 0 0.5rem;
  font-family: var(--head);
  font-weight: 500;
  font-size: 1.35rem;
  letter-spacing: 0.03em;
  color: var(--ink);
}

.excerpt { margin: 0; color: var(--mist); }

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1rem;
  margin-top: auto;
  padding-top: 1rem;
  font-family: var(--head);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ash);
}

/* lexicon */
.lexicon {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.lexicon article {
  padding: 1.3rem 1.4rem 1.5rem;
  background: var(--abyss);
}
.lexicon dt {
  font-family: var(--head);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--biolume);
}
.lexicon dd {
  margin: 0.45rem 0 0;
  color: var(--foam);
}
.lexicon .src {
  display: block;
  margin-top: 0.7rem;
  color: var(--ash);
  font-family: var(--quote);
  font-style: italic;
  font-size: 0.95rem;
}

/* quote band */
.epistle {
  text-align: center;
  padding-block: 5rem;
}
.epistle blockquote {
  margin: 0 auto;
  max-width: 22em;
  font-family: var(--quote);
  font-style: italic;
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  line-height: 1.35;
  color: var(--ink);
}
.epistle cite {
  display: block;
  margin-top: 1.1rem;
  font-family: var(--head);
  font-style: normal;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bronze);
}

/* article pages */
.page-hero {
  position: relative;
  height: min(58vh, 560px);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.page-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--void) 0%, rgba(2, 5, 8, 0.15) 48%, rgba(2, 5, 8, 0.35) 100%);
}
.page-hero img { filter: saturate(1.05); }

.article {
  width: min(780px, calc(100% - var(--pad) * 2));
  margin: -5.5rem auto 0;
  position: relative;
  z-index: 2;
}

.article header h1 {
  margin: 0.4rem 0 0.7rem;
  font-family: var(--head);
  font-weight: 500;
  font-size: clamp(2.1rem, 5vw, 3.6rem);
  line-height: 1.12;
  letter-spacing: 0.03em;
}

.deck {
  margin: 0 0 1.6rem;
  font-family: var(--quote);
  font-style: italic;
  font-size: 1.45rem;
  color: var(--mist);
}

.prose p { margin: 0 0 1.15rem; }
.prose h2 {
  margin: 2.2rem 0 0.7rem;
  font-family: var(--head);
  font-size: 1.35rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}
.prose blockquote {
  margin: 1.8rem 0;
  padding: 0.2rem 0 0.2rem 1.2rem;
  border-left: 1px solid var(--biolume);
  font-family: var(--quote);
  font-style: italic;
  font-size: 1.4rem;
  color: var(--ink);
}
.dropcap {
  float: left;
  margin: 0.1em 0.12em 0 0;
  font-family: var(--head);
  font-weight: 600;
  font-size: 3.5rem;
  line-height: 0.82;
  color: var(--biolume);
}
.prose ul { padding-left: 1.2rem; }
.prose li { margin: 0.35rem 0; }
.prose em { color: var(--ink); }

.footnote {
  margin-top: 2.4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--ash);
  font-size: 1rem;
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  width: min(780px, calc(100% - var(--pad) * 2));
  margin: 2.5rem auto 0;
  padding-bottom: 4rem;
}
.pager a {
  color: var(--mist);
  text-decoration: none;
  font-family: var(--head);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.pager a:hover { color: var(--biolume-hot); }

/* vessel / about */
.split {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}
.split .reliquary { justify-self: start; width: min(100%, 520px); }

/* rite */
.rite {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 2.5rem;
}

.field { margin-bottom: 1.1rem; }
.field label {
  display: block;
  margin-bottom: 0.35rem;
  font-family: var(--head);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bronze);
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  background: rgba(5, 11, 16, 0.8);
  color: var(--foam);
  font: inherit;
}
.field textarea { min-height: 10rem; resize: vertical; }

.rite-note {
  color: var(--mist);
  font-family: var(--quote);
  font-style: italic;
}

.omen {
  display: none;
  margin-top: 1.2rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line-strong);
  background: rgba(62, 200, 220, 0.06);
  color: var(--biolume-hot);
}
.omen.is-visible { display: block; }

/* archive */
.archive { display: grid; gap: 0; }
.archive a {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 1.2rem;
  align-items: center;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}
.archive a:hover { color: var(--biolume-hot); }
.archive h3 {
  margin: 0.2rem 0 0;
  font-family: var(--head);
  font-weight: 500;
  font-size: 1.35rem;
  color: var(--ink);
}
.archive .when {
  font-family: var(--head);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ash);
}

/* 404 */
.lost {
  min-height: 70svh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 4rem var(--pad);
}
.lost h1 {
  margin: 0.4rem 0;
  font-family: var(--display);
  font-size: clamp(3rem, 8vw, 6rem);
  letter-spacing: 0.12em;
}

/* footer */
.colophon {
  position: relative;
  z-index: 1;
  padding: 3rem var(--pad) 2.4rem;
  border-top: 1px solid var(--line);
  background: linear-gradient(to bottom, transparent, rgba(8, 20, 26, 0.65));
}
.colophon-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 2rem;
}
.colophon h2 {
  margin: 0 0 0.4rem;
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: 0.28em;
}
.colophon p, .colophon li { color: var(--mist); }
.colophon ul { list-style: none; padding: 0; margin: 0; }
.colophon li { margin: 0.3rem 0; }
.coords {
  font-family: var(--head);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ash);
}
.fineprint {
  margin-top: 2.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.95rem;
  color: var(--ash);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.ticker {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(10, 21, 28, 0.7);
}
.ticker p {
  margin: 0;
  padding: 0.45rem 0;
  font-family: var(--head);
  font-size: 0.64rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--biolume-dim);
  white-space: nowrap;
  animation: marquee 36s linear infinite;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  animation: rise 0.9s var(--ease) forwards;
}
.reveal:nth-child(2) { animation-delay: 0.08s; }
.reveal:nth-child(3) { animation-delay: 0.16s; }
.reveal:nth-child(4) { animation-delay: 0.24s; }
@keyframes rise {
  to { opacity: 1; transform: none; }
}

@media (max-width: 980px) {
  .hero,
  .featured,
  .split,
  .rite,
  .colophon-grid,
  .card-grid,
  .lexicon { grid-template-columns: 1fr; }
  .hero { min-height: auto; padding-top: 1rem; }
  .hero h1 { font-size: clamp(3.1rem, 22vw, 4.8rem); letter-spacing: 0.08em; }
  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .section-head p { max-width: none; }
  .reliquary { justify-self: center; }
  .reliquary::after { inset: -10px; }
  .archive a { grid-template-columns: 1fr; gap: 0.3rem; }
  .nav-toggle { display: block; }
  .mast { grid-template-columns: auto auto; }
  .mast-meta { display: none; }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 1rem var(--pad) 1.4rem;
    background: #020508;
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    gap: 0.9rem;
  }
  .mast.is-open .nav { display: flex; }
}

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