html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  --site-bg: #0b1220;
  --site-surface: rgba(20, 32, 53, 0.82);
  --site-surface-raised: rgba(24, 40, 68, 0.94);
  --site-border: rgba(143, 175, 212, 0.16);
  --site-text: #e8f0fe;
  --site-muted: #8eafd4;
  --site-accent: #22c55e;
  --bg: var(--site-bg);
  --bg2: #0f1a2e;
  --bg3: #142035;
  --surface: #162340;
  --surface2: #1c2d50;
  --border: #1e3356;
  --green: var(--site-accent);
  --green-dim: #16a34a;
  --text: var(--site-text);
  --text2: var(--site-muted);
  --text3: #7290b4;
  background: var(--site-bg);
  color: var(--site-text);
  font-family: "DM Sans", "Segoe UI", sans-serif;
  min-height: 100vh;
  overflow-x: clip;
}

body::before {
  animation: none;
  background: radial-gradient(ellipse 70% 38rem at 50% 0, rgba(34, 197, 94, 0.12), transparent 72%);
  content: "";
  height: min(38rem, 90vh);
  inset: 0;
  left: 0;
  max-width: 100%;
  pointer-events: none;
  position: absolute;
  right: 0;
  transform: none;
  width: auto;
  z-index: 0;
}

nav {
  align-items: center;
  backdrop-filter: blur(20px);
  background: rgba(11, 18, 32, 0.88);
  border-bottom: 1px solid var(--site-border);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  min-height: 4.25rem;
  padding: 0.7rem clamp(1rem, 4vw, 2.5rem);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-logo {
  align-items: center;
  color: var(--site-text);
  display: inline-flex;
  font-family: "Syne", "Segoe UI", sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.nav-logo span {
  color: var(--site-accent);
}

.nav-links {
  align-items: center;
  display: flex;
  flex: 1;
  gap: 0.25rem;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a,
.subject-simple-links a {
  border-radius: 0.6rem;
  color: var(--site-muted);
  display: inline-flex;
  padding: 0.55rem 0.7rem;
  text-decoration: none;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.nav-links a:hover,
.nav-links a.active,
.subject-simple-links a:hover {
  background: rgba(34, 197, 94, 0.08);
  color: var(--site-text);
}

.mobile-menu {
  background: rgba(11, 18, 32, 0.98);
  border: 1px solid var(--site-border);
  border-radius: 0 0 1rem 1rem;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.32);
  display: none;
  gap: 0.25rem;
  inset: 100% 0 auto;
  padding: 0.75rem 1rem 1rem;
  position: absolute;
  z-index: 101;
}

.mobile-menu a {
  color: var(--site-muted);
  display: flex;
  padding: 0.65rem 0.75rem;
  text-decoration: none;
}

.mobile-menu.active {
  display: grid;
}

.mobile-menu a:hover,
.mobile-menu a.active {
  color: var(--site-accent);
}

.nav-hamburger {
  align-items: center;
  background: transparent;
  border: 1px solid var(--site-border);
  border-radius: 0.55rem;
  color: var(--site-text);
  cursor: pointer;
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  height: 2.75rem;
  justify-content: center;
  padding: 0.5rem;
  width: 2.75rem;
}

.nav-hamburger span {
  background: currentColor;
  border-radius: 2px;
  display: block;
  height: 2px;
  transition: opacity 180ms ease, transform 180ms ease;
  width: 1.1rem;
}

.nav-hamburger.open span:first-child {
  transform: translateY(6px) rotate(45deg);
}

.nav-hamburger.open span:nth-child(2) {
  opacity: 0;
}

.nav-hamburger.open span:last-child {
  transform: translateY(-6px) rotate(-45deg);
}

.nav-hamburger:hover {
  background: rgba(34, 197, 94, 0.1);
}

.hero,
.page-hero,
.shop-hero,
.eco-hero {
  animation: none;
  background: transparent;
  isolation: isolate;
  margin: 0 auto;
  max-width: 1440px;
  padding: clamp(3rem, 8vw, 6.5rem) clamp(1rem, 5vw, 4rem) 2.5rem;
  position: relative;
}

.hero::before,
.page-hero::before,
.shop-hero::before {
  display: none;
}

.hero-badge,
.eco-kicker,
.section-tag {
  color: var(--site-accent);
}

.hero-badge,
.eco-kicker {
  align-items: center;
  background: rgba(34, 197, 94, 0.09);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 700;
  gap: 0.45rem;
  letter-spacing: 0.08em;
  padding: 0.55rem 0.85rem;
  text-transform: uppercase;
}

.hero h1,
.page-hero h1,
.shop-hero h1,
.eco-hero h1 {
  color: var(--site-text);
  font-size: clamp(2.2rem, 5.5vw, 4rem);
  line-height: 1.08;
  margin: 1.1rem 0;
}

.hero h1 em,
.page-hero h1 em,
.shop-hero h1 em,
.eco-hero h1 em {
  color: var(--site-accent);
  font-style: normal;
}

.hero > p,
.page-hero .page-hero-text > p,
.shop-hero > p,
.eco-hero > p {
  color: var(--site-muted);
  line-height: 1.75;
  margin: 0;
  max-width: 700px;
}

.page-hero .page-hero-inner {
  align-items: end;
  display: flex;
  gap: 2rem;
  justify-content: space-between;
  margin: 0 auto;
  max-width: none;
}

.page-hero .page-hero-text {
  max-width: 800px;
}

.page-hero .page-icon {
  align-items: center;
  border: 1px solid var(--site-border);
  border-radius: 1rem;
  display: inline-flex;
  height: 3.5rem;
  justify-content: center;
  margin-right: 0.65rem;
  vertical-align: middle;
  width: 3.5rem;
}

.breadcrumb {
  align-items: center;
  color: var(--site-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0 0 1.75rem;
}

.breadcrumb a {
  color: var(--site-muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--site-accent);
}

.breadcrumb svg {
  height: 1rem;
  width: 1rem;
}

.page-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.page-tags .tag {
  background: rgba(20, 32, 53, 0.8);
  border: 1px solid var(--site-border);
  border-radius: 999px;
  color: var(--site-muted);
  padding: 0.4rem 0.7rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.hero-actions .btn {
  align-items: center;
  border: 1px solid var(--site-border);
  border-radius: 0.75rem;
  display: inline-flex;
  gap: 0.5rem;
  justify-content: center;
  min-height: 2.8rem;
  padding: 0.7rem 1rem;
  text-decoration: none;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.hero-actions .btn-primary,
button.btn-primary {
  background: var(--site-accent);
  border-color: var(--site-accent);
  color: #07120b;
  font-weight: 700;
}

.hero-actions .btn-ghost {
  background: var(--site-surface);
  color: var(--site-text);
}

.hero-actions .btn:hover {
  transform: translateY(-2px);
}

.stats-row,
.eco-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0 auto;
  max-width: 1440px;
  padding: 0 clamp(1rem, 5vw, 4rem) 2rem;
}

.stat-item,
.eco-stat {
  background: var(--site-surface);
  border: 1px solid var(--site-border);
  border-radius: 1rem;
  min-width: 8rem;
  padding: 1rem 1.25rem;
}

.stat-num,
.eco-stat strong {
  color: var(--site-text);
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
}

.stat-num > span {
  color: var(--site-accent);
  display: inline;
  font-size: inherit;
}

.stat-label {
  color: var(--site-muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section,
.content-section,
.shop-section,
.eco-subjects,
.eco-content {
  margin: 0 auto;
  max-width: 1440px;
  padding: 2rem clamp(1rem, 5vw, 4rem) 5rem;
  position: relative;
  z-index: 1;
}

.section-header {
  margin: 0 0 1.75rem;
  max-width: 720px;
  text-align: left;
}

.section-tag {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  margin-bottom: 0.65rem;
  text-transform: uppercase;
}

.section-header h2,
.section h2,
.content-section-header h2,
.eco-subjects > h2,
.eco-section h2 {
  color: var(--site-text);
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.section-header p {
  color: var(--site-muted);
  line-height: 1.6;
  margin: 0;
}

.subjects-grid,
.eco-subject-grid,
.items-grid,
.products-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
}

.subject-card,
.eco-subject-card,
.item-card,
.product-card,
.contact-card,
.resource-card,
.feature-card,
.class-card,
.year-card {
  background: linear-gradient(145deg, var(--site-surface-raised), rgba(18, 30, 51, 0.96));
  border: 1px solid var(--site-border);
  border-radius: 1rem;
  color: var(--site-text);
  min-width: 0;
  padding: 1.25rem;
  position: relative;
  text-decoration: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.subject-card:hover,
.eco-subject-card:hover,
.item-card:hover,
.product-card:hover,
.contact-card:hover,
.resource-card:hover,
.feature-card:hover,
.class-card:hover,
.year-card:hover {
  border-color: rgba(34, 197, 94, 0.48);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.24);
  transform: translateY(-3px);
}

.subject-icon {
  align-items: center;
  border: 1px solid var(--site-border);
  border-radius: 0.85rem;
  display: inline-flex;
  font-size: 1.4rem;
  height: 3rem;
  justify-content: center;
  margin-bottom: 1rem;
  width: 3rem;
}

.subject-card h3,
.eco-subject-card strong,
.item-card h3,
.product-card h3,
.contact-card h3,
.resource-card h3,
.feature-card h3,
.class-card h3,
.year-card h3 {
  color: var(--site-text);
  display: block;
  font-size: 1rem;
  line-height: 1.45;
  margin: 0 0 0.55rem;
}

.subject-card > p,
.eco-subject-card span,
.item-card p,
.product-card p,
.contact-card p,
.resource-card p,
.feature-card p,
.class-card p,
.year-card p {
  color: var(--site-muted);
  font-size: 0.88rem;
  line-height: 1.65;
  margin: 0;
}

.subject-meta {
  border-top: 1px solid var(--site-border);
  color: var(--site-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.76rem;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 0.8rem;
}

.subject-arrow {
  color: var(--site-accent);
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 1rem;
}

.eco-hero {
  padding-bottom: 1.5rem;
}

.eco-stats {
  margin-top: 1.5rem;
  padding-bottom: 1rem;
}

.eco-stat {
  color: var(--site-muted);
}

.eco-stat strong {
  display: inline;
  font-size: 1rem;
  margin-right: 0.25rem;
}

.eco-subjects {
  padding-bottom: 2rem;
}

.eco-subject-card {
  display: block;
}

.eco-controls {
  background: rgba(11, 18, 32, 0.92);
  border-block: 1px solid var(--site-border);
}

.eco-controls-inner {
  margin: 0 auto;
  max-width: 1440px;
  padding: 0 clamp(1rem, 5vw, 4rem);
}

.eco-search,
.eco-select {
  background: var(--site-bg);
  border-color: var(--site-border);
  color: var(--site-text);
}

.eco-search:focus,
.eco-select:focus {
  border-color: var(--site-accent);
}

.toolbar,
.filters-bar,
.eco-controls {
  background: rgba(11, 18, 32, 0.92);
  border-color: var(--site-border);
}

.search-wrap,
.filter-search,
.subject-search,
.eco-search,
.eco-select,
.sort-select {
  border-color: var(--site-border);
}

.search-wrap:focus-within,
.filter-search:focus-within,
.subject-search:focus-within,
.eco-search:focus,
.eco-select:focus,
.sort-select:focus {
  border-color: var(--site-accent);
}

.search-input,
.filter-search input,
.subject-search input,
.eco-search,
.eco-select,
.sort-select {
  color: var(--site-text);
}

.search-input::placeholder,
.filter-search input::placeholder,
.subject-search input::placeholder,
.eco-search::placeholder {
  color: var(--site-muted);
}

.content-section-header,
.count-badge,
.empty-state,
.eco-folder,
.eco-file {
  border-color: var(--site-border);
}

.count-badge {
  background: var(--site-surface);
  color: var(--site-accent);
}

.empty-state,
.eco-folder,
.eco-file {
  background: var(--site-surface);
  color: var(--site-muted);
}

.eco-folder summary {
  color: var(--site-text);
}

.eco-folder summary::after {
  color: var(--site-accent);
}

.eco-file-name,
.eco-empty {
  color: var(--site-muted);
}

.eco-empty {
  border-color: var(--site-border);
}

.products-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
}

.product-body,
.item-card,
.contact-card,
.resource-card,
.feature-card {
  color: var(--site-text);
}

button,
.btn,
.eco-open,
.custom-alert-btn {
  border-radius: 0.75rem;
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

button:hover,
.btn:hover,
.eco-open:hover,
.custom-alert-btn:hover {
  transform: translateY(-2px);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--site-accent);
  outline-offset: 3px;
}

footer {
  background: rgba(11, 18, 32, 0.76);
  border-top: 1px solid var(--site-border);
  color: var(--site-muted);
}

footer h4,
footer .nav-logo {
  color: var(--site-text);
}

footer a {
  color: var(--site-muted);
}

footer a:hover {
  color: var(--site-accent);
}

.edtn-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 480ms ease, transform 480ms cubic-bezier(0.16, 1, 0.3, 1);
}

.edtn-reveal.is-visible {
  opacity: 1;
  transform: none;
}

.edtn-nav-enter {
  animation: edtn-nav-enter 420ms ease-out both;
}

@keyframes edtn-nav-enter {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

.edtn-toast-region {
  display: grid;
  gap: 0.75rem;
  inset: 1rem 1rem auto auto;
  max-width: min(25rem, calc(100vw - 2rem));
  pointer-events: none;
  position: fixed;
  z-index: 100001;
}

.edtn-toast {
  align-items: start;
  animation: edtn-toast-in 220ms ease-out both;
  background: rgba(20, 32, 53, 0.97);
  border: 1px solid var(--site-border);
  border-inline-start: 3px solid var(--site-accent);
  border-radius: 0.9rem;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.38);
  color: var(--site-text);
  display: grid;
  gap: 0.75rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 0.9rem 1rem;
  pointer-events: auto;
}

.edtn-toast[data-type="error"] { border-inline-start-color: #fb7185; }
.edtn-toast[data-type="warning"] { border-inline-start-color: #fbbf24; }
.edtn-toast[data-type="info"] { border-inline-start-color: #60a5fa; }

.edtn-toast-icon {
  font-size: 1.1rem;
  line-height: 1.4;
}

.edtn-toast-message {
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.edtn-toast-close {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--site-muted);
  cursor: pointer;
  display: inline-flex;
  font-size: 1.1rem;
  justify-content: center;
  min-height: 1.75rem;
  min-width: 1.75rem;
  padding: 0;
}

.edtn-toast-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--site-text);
  transform: none;
}

@keyframes edtn-toast-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.edtn-toast.is-leaving {
  animation: edtn-toast-out 180ms ease-in both;
}

@keyframes edtn-toast-out {
  to { opacity: 0; transform: translateY(-6px) scale(0.98); }
}

@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }

  .hero,
  .page-hero,
  .shop-hero,
  .eco-hero {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .page-hero .page-hero-inner {
    align-items: stretch;
    flex-direction: column;
  }

  .section,
  .content-section,
  .shop-section,
  .eco-subjects,
  .eco-content {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .stats-row,
  .eco-stats {
    gap: 0.5rem;
  }

  .stat-item,
  .eco-stat {
    flex: 1 1 7rem;
    min-width: 0;
    padding: 0.85rem;
  }

  .subjects-grid,
  .eco-subject-grid,
  .items-grid,
  .products-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  }

  .edtn-toast-region {
    inset: 0.75rem 0.75rem auto;
    max-width: none;
  }
}

@media (max-width: 480px) {
  .subjects-grid,
  .eco-subject-grid,
  .items-grid,
  .products-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-actions .btn { flex: 1 1 100%; }

  .subject-card,
  .item-card,
  .product-card,
  .contact-card,
  .resource-card,
  .feature-card {
    border-radius: 0.85rem;
  }

  .footer-inner { gap: 1.5rem; }
}

[dir="rtl"] .edtn-toast-region { inset: 1rem auto auto 1rem; }

@media (max-width: 720px) {
  [dir="rtl"] .edtn-toast-region { inset: 0.75rem 0.75rem auto; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
