:root {
  color-scheme: light;
  --page: #f5f7f2;
  --page-soft: #e7f1ef;
  --surface: #ffffff;
  --surface-soft: #eef6f4;
  --ink: #16211d;
  --muted: #5d6f68;
  --line: #cad8d2;
  --accent: #176f65;
  --accent-dark: #0f4f48;
  --accent-rgb: 23, 111, 101;
  --warm: #dd6d45;
  --sky: #2b72c6;
  --lime: #b6d94c;
  --blue-rgb: 43, 114, 198;
  --gradient-top: #e7f1ef;
  --gradient-mid: #f5f7f2;
  --gradient-bottom: #f5f7f2;
  --code-bg: #111b22;
  --code-ink: #eef7f4;
  --topbar-bg: rgba(0, 0, 0, 0.3);
  --footer-bg: rgba(0, 0, 0, 0.5);
  --footer-border: 1px solid rgba(255, 255, 255, 0.5);
  --shadow: 0 20px 50px rgba(30, 52, 47, 0.12);
  --topbar-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
  --footer-shadow: 0 -2px 0 rgba(0, 0, 0, 0.2);
  --radius: 8px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #020407;
  --page-soft: #121b26;
  --surface: #101a24;
  --surface-soft: #172537;
  --ink: #f4f8fc;
  --muted: #b7c5d3;
  --line: #26384c;
  --accent: #14ba23;
  --accent-dark: #58e265;
  --accent-rgb: 20, 186, 35;
  --warm: #e2a85d;
  --sky: #4ca3dd;
  --lime: #14ba23;
  --blue-rgb: 23, 104, 172;
  --gradient-top: #073f14;
  --gradient-blue: #104b7c;
  --gradient-mid: #121b26;
  --gradient-bottom: #020407;
  --code-bg: #070c12;
  --code-ink: #f1f7fb;
  --shadow: 0 24px 54px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 0%, rgba(var(--accent-rgb), 0.18), transparent 30rem),
    radial-gradient(circle at 84% 12%, rgba(var(--blue-rgb), 0.34), transparent 34rem),
    linear-gradient(180deg, var(--gradient-top) 0%, var(--gradient-blue, var(--gradient-mid)) 34%, var(--gradient-mid) 62%, var(--gradient-bottom) 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0;
}

modifier-topbar,
modifier-footer {
  display: block;
}

modifier-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  margin-bottom: 34px;
  isolation: isolate;
}

modifier-topbar::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  background: var(--topbar-bg);
  box-shadow: var(--topbar-shadow);
  backdrop-filter: blur(16px);
}

modifier-footer {
  position: relative;
  margin-top: 56px;
  isolation: isolate;
}

modifier-footer::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  border-top: var(--footer-border);
  background: var(--footer-bg);
  box-shadow: var(--footer-shadow);
  backdrop-filter: blur(16px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 0;
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(180px, 0.85fr) minmax(0, 1.5fr);
  gap: 28px;
  padding: 32px 0;
  color: #f8fffc;
}

.footer-brand {
  display: grid;
  align-content: start;
  gap: 8px;
}

.footer-brand strong {
  font-size: 1.35rem;
  line-height: 1;
}

.footer-brand span,
.footer-meta,
.footer-link,
.footer-dropdown summary {
  color: rgba(248, 255, 252, 0.76);
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.footer-group {
  display: grid;
  align-content: start;
  gap: 10px;
}

.footer-group h2 {
  margin: 0;
  color: #f8fffc;
  font-size: 0.88rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.footer-group nav,
.footer-dropdown nav {
  display: grid;
  gap: 8px;
}

.footer-link {
  width: fit-content;
  font-size: 0.9rem;
  line-height: 1.3;
  text-decoration: none;
}

.footer-link:hover,
.footer-link:focus-visible,
.footer-dropdown summary:hover,
.footer-dropdown summary:focus-visible {
  outline: none;
  color: #ffffff;
  text-decoration: underline;
}

.footer-dropdown {
  display: grid;
  gap: 8px;
}

.footer-dropdown summary {
  width: fit-content;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 760;
}

.footer-dropdown[open] summary {
  color: #ffffff;
}

.footer-dropdown nav {
  padding: 4px 0 0 14px;
}

.footer-meta {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.84rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}

.brand img {
  width: 112px;
  height: auto;
  object-fit: contain;
}

:root[data-theme="dark"] .brand img {
  filter: invert(1);
}

.brand span {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.2;
}

.nav-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.theme-toggle,
.topbar-link,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  font-weight: 750;
  text-decoration: none;
}

:root[data-theme="dark"] .theme-toggle,
:root[data-theme="dark"] .topbar-link,
:root[data-theme="dark"] .button {
  background: rgba(17, 27, 40, 0.82);
}

.theme-toggle {
  gap: 8px;
  width: auto;
  padding: 0 12px;
}

.theme-toggle span {
  white-space: nowrap;
}

.theme-toggle::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid currentColor;
  box-shadow: inset -5px -3px 0 currentColor;
}

:root[data-theme="dark"] .theme-toggle::before {
  box-shadow: none;
}

.topbar-link,
.button {
  padding: 0 15px;
}

.button {
  border-color: var(--accent);
  background: var(--accent);
  color: #f8fffc;
  box-shadow: 0 14px 28px rgba(var(--accent-rgb), 0.18);
}

:root[data-theme="dark"] .button:not(.button-secondary) {
  border-color: var(--accent);
  background: var(--accent);
  color: #061109;
}

.button-secondary {
  border-color: var(--line);
  background: transparent;
  color: var(--accent-dark);
  box-shadow: none;
}

.button:hover,
.button:focus-visible,
.theme-toggle:hover,
.theme-toggle:focus-visible,
.topbar-link:hover,
.topbar-link:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.14);
}

.button:hover,
.button:focus-visible {
  background: var(--accent-dark);
  color: #f8fffc;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
}

@media (max-width: 740px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 0;
  }

  modifier-topbar {
    margin-bottom: 24px;
  }

  modifier-footer {
    margin-top: 42px;
  }

  .topbar {
    align-items: flex-start;
    padding: 16px 0 18px;
  }

  .site-footer,
  .footer-nav {
    grid-template-columns: 1fr;
  }

  .site-footer {
    gap: 22px;
    padding: 26px 0;
  }

  .brand {
    display: grid;
    gap: 6px;
  }

  .brand img {
    width: 98px;
  }

  .topbar-link {
    display: none;
  }
}
