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

:root {
  --bg: #111;
  --fg: #fff;
  --toggle-bg: rgba(255, 255, 255, 0.12);
  --toggle-hover: rgba(255, 255, 255, 0.2);
}

:root.light {
  --bg: #f5f5f5;
  --fg: #111;
  --toggle-bg: rgba(0, 0, 0, 0.08);
  --toggle-hover: rgba(0, 0, 0, 0.14);
}

html {
  height: 100%;
}

body {
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 0;
  overflow-x: hidden;
}

.logo {
  width: clamp(8rem, 20vw, 20rem);
  height: auto;
  z-index: 2;
  transition: color 1.5s ease;
}

h1 {
  font-size: clamp(1.5rem, 5vw, 3rem);
  font-weight: 300;
  letter-spacing: 0.02em;
  text-align: center;
  padding: 1rem;
}

#byline {
  font-size: clamp(0.75rem, 2.5vw, 1.5rem);
  font-family: "Segoe Script", "Apple Chancery", "Comic Sans MS", cursive;
  letter-spacing: 0.05em;
  text-align: center;
  opacity: 0.3;
  transition: color 0.3s ease, opacity 0.3s ease;
  cursor: default;
}

#byline:hover {
  color: rgb(255, 0, 118);
  opacity: 1;
}

.theme-toggle {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 10;
  background: var(--toggle-bg);
  color: var(--fg);
  border: none;
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  font-size: 1.2rem;
  line-height: 1;
}

.theme-toggle:hover {
  background: var(--toggle-hover);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon { display: none; }

:root:not(.light) .theme-toggle .icon-sun { display: block; }
:root.light .theme-toggle .icon-moon { display: block; }

.site-footer {
  position: fixed;
  bottom: 1rem;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.75rem;
  opacity: 0.5;
}

.site-footer .disclaimer {
  margin-top: 0.25rem;
}

.info-tip {
  position: relative;
  margin-top: 2rem;
  text-align: center;
}

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  border: 1px solid var(--fg);
  font-size: 0.6rem;
  font-style: italic;
  font-family: Georgia, serif;
  opacity: 0.4;
  cursor: help;
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.info-bubble {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: 1.6rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--fg);
  color: var(--bg);
  font-size: 0.65rem;
  padding: 0.35rem 0.6rem;
  border-radius: 4px;
  white-space: nowrap;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
}

.info-bubble a {
  color: inherit;
  text-decoration: underline;
}

.info-icon:hover {
  color: #009D4F;
  border-color: #009D4F;
  opacity: 1;
}

.info-icon:hover + .info-bubble,
.info-icon:focus + .info-bubble {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

#mst-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

/* -- Subpages (body.page) -- */

body.page {
  display: block;
  padding: 0 1.5rem 4rem;
}

.page-header {
  max-width: 42rem;
  margin: 0 auto;
  padding: 1.5rem 0 0;
}

.back-link {
  color: var(--fg);
  text-decoration: none;
  font-size: 0.85rem;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.back-link:hover {
  opacity: 1;
}

.page-content {
  max-width: 42rem;
  margin: 0 auto;
  padding: 2rem 0;
  line-height: 1.7;
}

.page-content h1 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 300;
  letter-spacing: 0.02em;
  text-align: left;
  padding: 0 0 0.5rem;
}

.page-content h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 2rem 0 0.5rem;
}

.page-content h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
}

.page-content p {
  margin: 0.5rem 0;
  font-size: 0.9rem;
}

.page-content ul {
  margin: 0.5rem 0 1rem 1.5rem;
  font-size: 0.9rem;
}

.page-content li {
  margin: 0.3rem 0;
}

.page-content a {
  color: #27AAE1;
  text-decoration: none;
}

.page-content a:hover {
  text-decoration: underline;
}

.last-updated {
  font-size: 0.8rem;
  opacity: 0.5;
  margin-bottom: 1.5rem;
}

/* -- Footer links -- */

.footer-links {
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--fg);
  text-decoration: none;
  font-size: 0.7rem;
  opacity: 0.4;
  transition: opacity 0.2s ease;
}

.footer-links a:hover {
  opacity: 1;
}

.site-footer--page {
  position: static;
  padding: 2rem 0 1rem;
  max-width: 42rem;
  margin: auto auto 0;
}

/* -- Status page -- */

.status-banner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 1.25rem;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 500;
  margin: 1.5rem 0;
}

.status-ok {
  background: rgba(0, 157, 79, 0.12);
  color: #009D4F;
}

.status-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.status-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 1.5rem 0;
}

.status-table th,
.status-table td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid rgba(128, 128, 128, 0.15);
}

.status-table th {
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.5;
}

.status-badge {
  font-size: 0.8rem;
  font-weight: 500;
}

.status-badge--ok {
  color: #009D4F;
}

.status-note {
  margin-top: 2rem;
  font-size: 0.85rem;
  opacity: 0.6;
}

.status-note p {
  margin: 0.4rem 0;
}

.status-note a {
  color: #27AAE1;
  text-decoration: none;
}

.status-note a:hover {
  text-decoration: underline;
}

/* -- Cookie consent banner -- */

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--fg);
  color: var(--bg);
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.cookie-banner--visible {
  transform: translateY(0);
}

.cookie-banner-inner {
  max-width: 42rem;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.cookie-text {
  flex: 1;
  font-size: 0.8rem;
  line-height: 1.5;
  min-width: 200px;
}

.cookie-text a {
  color: inherit;
  text-decoration: underline;
}

.cookie-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.cookie-btn {
  padding: 0.45rem 0.9rem;
  border: none;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.cookie-btn:hover {
  opacity: 0.85;
}

.cookie-btn--accept {
  background: #27AAE1;
  color: #fff;
}

.cookie-btn--essential {
  background: transparent;
  color: inherit;
  border: 1px solid rgba(128, 128, 128, 0.4);
}
