:root {
  --page-bg: #f2f2f2;
  --surface: #ffffff;
  --line: #d9d9d9;
  --text: #111111;
  --muted: #3a3a3a;
  --active: #b30000;
  --accent: #0a5fd5;
  --gold: #fce98d;
  --font-main: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-display: "Poiret One", "Poiret", cursive;
}

* {
  box-sizing: border-box;
}

html {
  overflow-y: scroll;
}

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  font-family: var(--font-main);
}


.topbar {
  height: 82px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  padding: 0 18px;
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-left {
  display: flex;
  align-items: center;
}

.topbar-center {
  justify-self: center;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: #000;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 8px;
}

.icon-btn span {
  height: 3px;
  width: 100%;
  display: block;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
  transform-origin: center;
}

.icon-btn.is-open span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.icon-btn.is-open span:nth-child(2) {
  opacity: 0;
}

.icon-btn.is-open span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.big-logo {
  text-decoration: none;
  color: var(--gold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  height: 80px;
  transform: translateX(-12px);
  overflow: hidden;
}

.big-logo-image {
  display: block;
  height: 100px;
  width: auto;
  max-width: translateY(8px);
  transform: none;
  filter: brightness(0.60) saturate(1.1);
}

.big-logo-text {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.main-nav {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  letter-spacing: 0.2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px 12px;
  position: sticky;
  top: 82px;
  z-index: 19;
}

.main-nav a,
.side-panel a {
  font-family: 'Poiret One';
  letter-spacing: 0.2rem;
  color: #111;
  text-decoration: none;
  font-size: 17px;
  font-weight: 600;
  position: relative;
}

.main-nav a {
  padding: 9px 14px;
}

.main-nav a[href="/datasets"] { order: 1; }
.main-nav a[href="/contact"] { order: 2; }
.main-nav a[href="/"] { order: 3; }
.main-nav a[href="/news"] { order: 4; }
.main-nav a[href="/about"] { order: 5; }

.theme-toggle-btn {
  border: 0;
  background: transparent;
  color: #111;
  padding: 0;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
}

.main-nav a::after,
.side-panel a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -10px;
  height: 16px;
  background: var(--gold);
  opacity: 0;
  transform: translateY(2px) scaleX(0.96);
  transition: opacity 0.18s ease, transform 0.18s ease;
  -webkit-mask: url("/static/resources/images/nav_active_arrow.xml") center / 100% 100% no-repeat;
  mask: url("/static/resources/images/nav_active_arrow.xml") center / 100% 100% no-repeat;
}

.main-nav a.is-active::after,
.side-panel a.is-active::after {
  opacity: 1;
  transform: translateY(0) scaleX(1);
}

.main-nav a:hover,
.side-panel a:hover {
  color: #000;
  background: #e6e6e6;
  border-radius: 2px;
}

.theme-toggle-btn:hover,
.theme-toggle-btn:focus-visible {
  background: transparent;
  outline: none;
}

.side-theme-toggle-btn {
  margin-top: 14px;
  width: fit-content;
}

.theme-toggle-icon {
  display: block;
  width: 96px;
  height: 44px;
}

.theme-toggle-label {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  font-family: "Poiret One", "Poiret", cursive;
  letter-spacing: 0.06em;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  color: #222;
  pointer-events: none;
}

.theme-toggle-btn.is-dark .theme-toggle-label {
  left: auto;
  right: 14px;
  color: #f4f4f4;
}

.icon-btn:hover,
.icon-btn:focus-visible {
  background-color: #e6e6e6;
  border-radius: 2px;
}

.side-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: min(320px, 84vw);
  height: 100vh;
  background: #fff;
  border-right: 1px solid #cfcfcf;
  transform: translateX(-100%);
  transition: transform 0.24s ease;
  z-index: 40;
  padding: 16px 18px;
}

.side-panel.is-open {
  transform: translateX(0);
}

.side-panel-head {
  margin: 8px 0 18px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #666;
  font-weight: 700;
  text-align: center;
  text-decoration: underline;
  font-family: "Poiret One", "Poiret", cursive;
}

.side-panel-nav {
  display: grid;
  gap: 14px;
}

.side-panel-nav a {
  display: inline-block;
  width: fit-content;
  font-size: 21px;
  padding: 8px 10px;
}

.side-follow {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.side-follow-title {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: underline;
  font-family: "Poiret One", "Poiret", cursive;
}

.side-follow-links {
  display: grid;
  gap: 8px;
}

.side-follow-links a {
  display: inline-block;
  width: fit-content;
  font-size: 16px;
  font-weight: 600;
}

.side-follow-links a::after {
  display: none;
}

.side-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
  z-index: 30;
}

.side-panel-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.content {
  max-width: 920px;
  margin: 24px auto 0;
  padding: 0 18px 24px;
}


.story-link {
  color: inherit;
  text-decoration: none;
}

.story-link:hover {
  text-decoration: underline;
  text-decoration-color: var(--active);
}

.contact-sheet,
.contact-form-panel,
.page-card {
  max-width: 820px;
  margin: 0 auto 20px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 20px;
}

.contact-sheet h1,
.contact-form-panel h1,
.page-card h1,
.page-card h2 {
  letter-spacing: 0.2rem;
  text-align: center;
  font-family: 'Poiret One';
  margin: 0 0 12px;
  font-size: 31px;
  line-height: 1.1;
}

.contact-lead,
.page-card p {
  font-size: 16px;
  margin: 0 0 12px;
}

.cookie-consent {
  position: fixed;
  right: 14px;
  bottom: 14px;
  width: min(460px, calc(100vw - 24px));
  background: #fff;
  border: 1px solid #c9c9c9;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.2);
  padding: 16px;
  z-index: 60;
}

.cookie-consent h2 {
  font-family: var(--font-display);
  letter-spacing: 0.02em;
  margin: 0 0 8px;
  font-size: 23px;
}

.cookie-consent p {
  font-family: var(--font-display);
  letter-spacing: 0.02em;
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.45;
  color: #2a2a2a;
}

.cookie-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cookie-actions button {
  font-family: var(--font-display);
  letter-spacing: 0.03em;
  border: 0;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.cookie-accept-all {
  background: var(--accent);
  color: #fff;
}

.cookie-accept-all:hover {
  background: #0b4ea3;
}

.cookie-accept-minimal {
  background: #efefef;
  color: #111;
}

.cookie-accept-minimal:hover {
  background: #dddddd;
}

@media (max-width: 800px) {
  .main-nav {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding: 6px 10px;
  }

  .main-nav a {
    font-family: 'Poiret One';
    font-size: 15px;
  }

  .content {
    margin-top: 16px;
    padding-left: 12px;
    padding-right: 12px;
  }
  .cookie-consent {
    left: 12px;
    right: 12px;
    width: auto;
  }

  .cookie-actions {
    flex-direction: column;
  }

  .cookie-actions button {
    width: 100%;
  }
}
