:root {
  color-scheme: dark light;
  --bg: #2b2d31;
  --panel: #35373d;
  --panel-light: #3f4249;
  --accent: #5ef2f2;
  --text: #f1f3f5;
  --muted: #b6bcc6;
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.12);
  --surface: rgba(255, 255, 255, 0.04);
  --surface-strong: rgba(255, 255, 255, 0.03);
  --header-bg: rgba(43, 45, 49, 0.85);
  --footer-bg: rgba(43, 45, 49, 0.9);
  --bg-gradient: radial-gradient(
    circle at top left,
    #3b3e44 0%,
    #2b2d31 45%,
    #24262a 100%
  );
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f2e9;
  --panel: #ffffff;
  --panel-light: #efe7da;
  --accent: #2f8f90;
  --text: #2f2b26;
  --muted: #6f6a63;
  --border-subtle: rgba(0, 0, 0, 0.08);
  --border: rgba(0, 0, 0, 0.12);
  --border-strong: rgba(0, 0, 0, 0.18);
  --surface: rgba(0, 0, 0, 0.04);
  --surface-strong: rgba(0, 0, 0, 0.05);
  --header-bg: rgba(246, 242, 233, 0.9);
  --footer-bg: rgba(246, 242, 233, 0.95);
  --bg-gradient: radial-gradient(
    circle at top left,
    #fffdf8 0%,
    #f6f2e9 45%,
    #efe7da 100%
  );
}

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

body {
  font-family: "Space Grotesk", sans-serif;
  background: var(--bg-gradient);
  color: var(--text);
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.site-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.logo {
  display: flex;
  align-items: center;
  justify-self: start;
  height: 10px;
}

.logo img {
  width: 250px;
  max-width: 100%;
  height: auto;
}

.nav-links {
  display: flex;
  gap: 20px;
  justify-self: center;
}

.nav-actions {
  display: flex;
  justify-self: end;
}

.nav-user {
  position: relative;
}

.nav-login-button {
  border: 1px solid var(--border-strong);
  background: var(--panel-light);
  color: var(--text);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 10px 20px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.nav-user-button {
  gap: 8px;
}

.nav-user-button::after {
  content: "▸";
  font-size: 0.8em;
  display: inline-block;
  transition: transform 0.2s ease;
  transform-origin: center;
}

.nav-user-button[aria-expanded="true"]::after {
  transform: rotate(90deg);
}

.nav-login-button:hover {
  transform: translateY(-1px);
}

.nav-login-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.nav-user-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 180px;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 20;
}

.nav-user-menu.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.nav-user-menu form {
  margin: 0;
}

.nav-user-menu__item {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  text-align: left;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.nav-user-menu__item:hover,
.nav-user-menu__item:focus-visible {
  background: var(--panel-light);
}

.nav-links a {
  color: var(--text);
  font-weight: 600;
}

.nav-links a.is-active {
  color: var(--accent);
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 100;
}

.modal.hidden {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 10, 12, 0.7);
  backdrop-filter: blur(4px);
}

.modal__content {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 32px;
  width: min(92vw, 420px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  z-index: 1;
  display: grid;
  gap: 16px;
}

.modal__categories {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  background: var(--panel-light);
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
}

.modal__category {
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: var(--text);
}

.modal__category.is-active {
  background: var(--accent);
  color: #0e1a1a;
}

.modal__category:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.modal__title {
  font-size: 1.6rem;
}

.modal__subtitle {
  color: var(--muted);
  font-size: 0.95rem;
}

.modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--panel-light);
  color: var(--text);
  cursor: pointer;
}

.modal__form {
  display: grid;
  gap: 12px;
}

.modal__field {
  display: grid;
  gap: 8px;
}

.modal__field.is-hidden {
  display: none;
}

.is-hidden {
  display: none;
}

.modal__label {
  font-weight: 600;
}

.modal__input {
  background: var(--panel-light);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--text);
}

.modal__input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.modal__submit {
  margin-top: 4px;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: #0e1a1a;
  font-weight: 700;
  padding: 12px 16px;
  cursor: pointer;
}

.modal__message {
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 600;
}

.modal__message--error {
  background: rgba(255, 106, 106, 0.15);
  border: 1px solid rgba(255, 106, 106, 0.35);
  color: #ffb6b6;
}

.modal__message--success {
  background: rgba(61, 203, 150, 0.15);
  border: 1px solid rgba(61, 203, 150, 0.35);
  color: #9ff3d1;
}


.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--footer-bg);
  backdrop-filter: blur(6px);
  padding: 24px 32px 32px;
}

.footer-content {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 16px 24px;
}

.footer-brand {
  color: var(--muted);
  font-size: 0.95rem;
}

.footer-disclaimer {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.5;
  flex-basis: 100%;
}

.footer-navigation {
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--muted);
}

.footer-nav-title {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.footer-nav-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-nav-links a {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.footer-nav-links a:hover,
.footer-nav-links a:focus-visible {
  color: var(--accent);
}

.footer-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.footer-language {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.footer-language label {
  font-weight: 600;
}

.footer-theme {
  display: flex;
  align-items: center;
}

.footer-language select {
  background: var(--panel-light);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
}

.footer-language select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-toggle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--panel-light);
  color: var(--text);
  display: grid;
  place-items: center;
  position: relative;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-toggle__icon {
  position: absolute;
  width: 16px;
  height: 16px;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.theme-toggle__icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle__icon--sun svg circle {
  fill: currentColor;
  stroke: none;
}

:root[data-theme="light"] .theme-toggle__icon--moon {
  opacity: 1;
  transform: scale(1);
}

:root[data-theme="dark"] .theme-toggle__icon--sun {
  opacity: 1;
  transform: scale(1);
}

@media (max-width: 720px) {
  .site-nav {
    padding: 16px 20px;
  }

  .nav-links {
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .site-footer {
    padding: 20px;
  }
}
