:root {
  --navy: #081221;
  --slate: #15263d;
  --teal: #20c6b7;
  --sky: #70b7ff;
  --amber: #ffb547;
  --paper: #f5f8fc;
  --ink: #182233;
  --muted: #657084;
  --mauve: #c45b86;
  --line: rgba(24, 34, 51, 0.12);
  --bg: var(--paper);
  --fg: var(--ink);
  --panel: #ffffff;
  --head: var(--navy);
  --focus: var(--teal);
  --font-sans: "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-serif: "Palatino Linotype", Palatino, "Iowan Old Style", "Times New Roman", serif;
  --font-mono: "Cascadia Mono", Consolas, ui-monospace, monospace;
}
html[data-theme="dark"] {
  --bg: #081221;
  --fg: #e8eef6;
  --panel: #101c2e;
  --muted: #b4c0d0;
  --line: rgba(245, 248, 252, 0.18);
  --head: #050b14;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--fg);
  background:
    radial-gradient(1200px 500px at 100% -10%, rgba(32, 198, 183, 0.08), transparent 50%),
    var(--bg);
  line-height: 1.6;
  min-height: 100vh;
}
img { max-width: 100%; height: auto; }
a { color: #0a6b63; }
html[data-theme="dark"] a { color: #5ed4c8; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.skip-link {
  position: absolute; left: 0.75rem; top: -3rem;
  background: var(--amber); color: var(--navy); padding: 0.5rem 0.8rem; z-index: 20;
}
.skip-link:focus { top: 0.75rem; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
.site-head {
  background: var(--head); color: #f5f8fc; padding: 0.75rem 1.25rem 0;
  position: sticky; top: 0; z-index: 10;
  border-bottom: 1px solid rgba(196, 91, 134, 0.35);
}
.site-head__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  max-width: 1180px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; color: inherit; }
.brand__mark { width: 36px; height: auto; mix-blend-mode: lighten; }
.brand__word {
  font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--mauve); font-size: 1.05rem;
}
.site-head__tools { display: flex; align-items: center; gap: 0.5rem; }
.search-mini {
  display: flex; background: rgba(245,248,252,0.1);
  border: 1px solid rgba(245,248,252,0.35);
}
.search-mini input {
  background: transparent; border: 0; color: #f5f8fc; padding: 0.45rem 0.6rem; width: 14rem;
}
.search-mini input::placeholder { color: #c5d0de; opacity: 1; }
.search-mini button, .theme-toggle, .nav-toggle {
  background: rgba(245,248,252,0.08);
  border: 1px solid rgba(245,248,252,0.45);
  color: #f5f8fc; padding: 0.4rem 0.65rem; cursor: pointer; font: inherit; font-weight: 600;
}
.search-mini button:hover, .theme-toggle:hover, .nav-toggle:hover {
  background: rgba(245,248,252,0.16); color: #ffffff;
}
.nav-checkbox {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.nav-toggle {
  display: none;
  cursor: pointer;
}
.site-nav { max-width: 1180px; margin: 0 auto; }
.site-nav ul {
  display: flex; flex-wrap: wrap; gap: 0.15rem 1rem; list-style: none;
  margin: 0.65rem 0 0; padding: 0 0 0.7rem;
}
.site-nav a {
  color: #f5f8fc; text-decoration: none; font-size: 0.92rem;
  padding: 0.25rem 0; border-bottom: 2px solid transparent;
}
html[data-theme="dark"] .site-nav a { color: #f5f8fc; }
.site-nav a[aria-current="page"], .site-nav a:hover { border-bottom-color: var(--teal); }
main { max-width: 1180px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
.hero {
  display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 2rem; align-items: end;
  min-height: 68vh; padding: 2.5rem 0 3rem;
}
.hero h1 {
  font-family: var(--font-serif); font-size: clamp(2.4rem, 6vw, 4.4rem);
  line-height: 1.05; margin: 0.2rem 0 1rem; font-weight: 600; letter-spacing: -0.02em;
}
.lede { font-size: 1.15rem; max-width: 38rem; color: var(--muted); }
.kicker {
  font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--teal); margin: 0;
}
.hero__cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.hero__object { position: relative; justify-self: end; }
.hero__object img {
  width: min(280px, 70vw); mix-blend-mode: lighten;
  filter: drop-shadow(0 20px 40px rgba(32,198,183,0.25));
}
html[data-theme="light"] .hero__object img { mix-blend-mode: multiply; }
.hero__caption { font-size: 0.8rem; color: var(--muted); max-width: 16rem; }
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.7rem 1.15rem;
  text-decoration: none; border: 1px solid transparent; font: inherit; font-weight: 650; cursor: pointer;
}
.btn--primary,
a.btn--primary,
html[data-theme="dark"] a.btn--primary {
  background: #20c6b7;
  color: #061018;
  box-shadow: 0 0 0 1px rgba(32,198,183,0.3), 0 8px 24px rgba(32,198,183,0.2);
}
.btn--ghost,
a.btn--ghost,
html[data-theme="dark"] a.btn--ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--line);
}
html[data-theme="dark"] a.btn--ghost,
html[data-theme="dark"] .btn--ghost {
  color: #f5f8fc;
  border-color: rgba(245, 248, 252, 0.45);
}
.btn--danger,
a.btn--danger { background: #8b2e3b; color: #fff; }
.instrument {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2rem;
  background: var(--slate); color: #e8eef6; padding: 2rem; margin: 1rem 0 3rem; position: relative;
}
.instrument::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(var(--teal), var(--mauve));
}
.instrument a { color: #8ee8de; }
.instrument a.btn--primary { color: #061018; }
.instrument a.btn--ghost { color: #f5f8fc; border-color: rgba(245,248,252,0.4); }
.instrument__steps { margin: 0; padding-left: 1.2rem; }
.band { margin: 3rem 0; }
.band--paper { background: var(--panel); padding: 1.75rem; border-left: 4px solid var(--amber); }
.section-lead { color: var(--muted); max-width: 42rem; }
.split { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 2rem; align-items: center; margin: 3rem 0; }
.ledger { list-style: none; margin: 0; padding: 0; }
.ledger a {
  display: grid; gap: 0.2rem; padding: 0.85rem 0; border-bottom: 1px solid var(--line);
  text-decoration: none; color: inherit;
}
.ledger span { color: var(--muted); font-size: 0.95rem; }
.steps { padding-left: 1.2rem; }
.instruments {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; list-style: none; padding: 0;
}
.instruments a {
  display: grid; gap: 0.35rem; min-height: 8rem; padding: 1rem 1rem 1.1rem 1.1rem;
  background: var(--panel); border: 1px solid var(--line); text-decoration: none; color: inherit;
  border-left: 3px solid var(--teal);
}
.story-list { list-style: none; padding: 0; display: grid; gap: 1rem; }
.story-list a {
  display: grid; grid-template-columns: 160px 1fr; gap: 1rem; text-decoration: none; color: inherit; align-items: center;
}
.story-list em { display: block; color: var(--muted); font-style: normal; }
.link-row { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; list-style: none; padding: 0; }
.callout { background: var(--navy); color: #f5f8fc; padding: 2rem; margin: 3rem 0; }
.callout a { color: var(--amber); }
.sources-home { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; padding: 0; list-style: none; }
.figure-plain { margin: 0; }
.crumbs ol {
  display: flex; flex-wrap: wrap; gap: 0.35rem; list-style: none; padding: 0; margin: 0 0 1.25rem;
  font-size: 0.88rem; color: var(--muted);
}
.crumbs li:not(:last-child)::after { content: " / "; margin-left: 0.35rem; }
.prose { max-width: 42rem; }
.prose h1, .article h1 {
  font-family: var(--font-serif); font-size: clamp(2rem, 4vw, 2.8rem); line-height: 1.15;
}
.prose h2, .article-body h2 { font-size: 1.4rem; margin-top: 2rem; }
.prose table, .article-body table, .table-wrap table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.prose th, .prose td, .article-body th, .article-body td, .table-wrap th, .table-wrap td {
  border-bottom: 1px solid var(--line); padding: 0.55rem 0.4rem; text-align: left; vertical-align: top;
}
.table-wrap { overflow-x: auto; }
.meta-line { color: var(--muted); font-size: 0.9rem; }
.article-hero { margin: 0 0 1.5rem; }
.article-hero img { width: 100%; background: var(--navy); }
.credit { font-size: 0.8rem; color: var(--muted); }
.site-foot { background: var(--navy); color: #d5deea; padding: 3rem 1.25rem 2rem; margin-top: 2rem; }
.site-foot a { color: var(--sky); }
.site-foot__grid {
  max-width: 1180px; margin: 0 auto; display: grid;
  grid-template-columns: 1.4fr repeat(5, 1fr); gap: 1.5rem;
}
.site-foot h2 { font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--teal); }
.site-foot ul { list-style: none; padding: 0; margin: 0; }
.site-foot li { margin: 0.3rem 0; }
.site-foot__legal, .site-foot__copy {
  max-width: 1180px; margin: 2rem auto 0; font-size: 0.85rem; color: #93a0b5;
}
.linkish { background: none; border: 0; color: var(--sky); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }
.tool-shell { display: grid; grid-template-columns: 1fr 0.9fr; gap: 2rem; align-items: start; }
.panel {
  background: var(--panel); border: 1px solid var(--line); padding: 1.25rem; border-top: 3px solid var(--teal);
}
.panel label { display: block; font-weight: 650; margin: 0.75rem 0 0.25rem; }
.panel input, .panel select, .panel textarea {
  width: 100%; padding: 0.55rem 0.6rem; border: 1px solid var(--line);
  background: var(--bg); color: var(--fg); font: inherit;
}
.fieldset-options { border: 0; padding: 0; margin: 0 0 1rem; }
.fieldset-options legend { font-weight: 650; margin-bottom: 0.4rem; }
.readout { font-family: var(--font-mono); font-size: 1.6rem; color: var(--teal); }
.alert { padding: 0.8rem 1rem; border-left: 4px solid var(--amber); background: rgba(255,181,71,0.12); margin: 1rem 0; }
.alert--danger { border-left-color: #e23d4a; background: rgba(226,61,74,0.12); }
.live { min-height: 1.2em; }
.guide-list { list-style: none; padding: 0; }
.guide-list label {
  display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.45rem 0; border-bottom: 1px solid var(--line);
}
.moon-disc {
  width: 160px; height: 160px; border-radius: 50%; margin: 1rem 0;
  background: #cfd8e3; box-shadow: inset -18px -8px 0 rgba(8,18,33,0.55);
}
.moon-disc[data-phase="nova"] { background: #1b2433; box-shadow: none; }
.moon-disc[data-phase="cheia"] { box-shadow: none; }
.consent[hidden] { display: none; }
.consent { position: fixed; inset: auto 1rem 1rem 1rem; z-index: 30; }
.consent__panel {
  background: var(--panel); color: var(--fg); padding: 1rem 1.2rem; border: 1px solid var(--line);
  max-width: 40rem; margin: 0 auto; box-shadow: 0 12px 40px rgba(8,18,33,0.25);
}
.admin-body { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.admin-side { background: var(--navy); color: #e8eef6; padding: 1.25rem 1rem; }
.admin-side a { color: #e8eef6; display: block; padding: 0.35rem 0; text-decoration: none; }
.admin-main { padding: 1.5rem; background: #f3f5f8; color: var(--ink); }
.admin-table { width: 100%; border-collapse: collapse; background: #fff; }
.admin-table th, .admin-table td { padding: 0.55rem 0.6rem; border-bottom: 1px solid #e2e6ee; text-align: left; }
.md-toolbar { display: flex; gap: 0.3rem; margin-bottom: 0.4rem; flex-wrap: wrap; }
.md-toolbar button { font: inherit; padding: 0.25rem 0.5rem; cursor: pointer; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; }
.stat { background: #fff; padding: 0.9rem; border-left: 3px solid var(--teal); }
.flash { padding: 0.7rem 1rem; margin-bottom: 1rem; }
.flash-ok { background: #d7f5ef; }
.flash-err { background: #fde2e2; }
.card-grid { display: grid; gap: 1rem; }
.compare-table { font-size: 0.9rem; }
.err-page { min-height: 50vh; }
@media (max-width: 900px) {
  .hero, .instrument, .split, .tool-shell, .instruments, .site-foot__grid, .admin-body, .story-list a, .stats {
    grid-template-columns: 1fr;
  }
  .hero { min-height: auto; }
  .search-mini { display: none; }
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none;
    width: 100%;
    background: var(--head);
    border-top: 1px solid rgba(245, 248, 252, 0.12);
    padding: 0.35rem 0 0.85rem;
  }
  .site-nav ul {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 0.35rem 0 0;
  }
  .site-nav a {
    display: block;
    padding: 0.7rem 0.15rem;
    border-bottom: 1px solid rgba(245, 248, 252, 0.1);
  }
  .nav-checkbox:checked ~ .site-nav,
  .site-nav.is-open {
    display: block;
  }
}
@media (max-width: 320px) {
  main, .site-head, .site-foot { padding-left: 0.75rem; padding-right: 0.75rem; }
}
