/* academia360 design system: navy and teal, light and dark themes */
:root {
  --navy: #1B2A4A;
  --teal: #0D9488;
  --teal-soft: #CCFBF1;
  --bg: #F4F8F8;
  --surface: #FFFFFF;
  --ink: #14213D;
  --muted: #5B6B7F;
  --line: #D9E4E6;
  --hero-a: #1B2A4A;
  --hero-b: #0F766E;
  --shadow: 0 12px 32px -16px rgba(27, 42, 74, .28);
  --radius: 14px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --navy: #0B1B33;
  --teal: #2DD4BF;
  --teal-soft: #0F3D3E;
  --bg: #0A1424;
  --surface: #122039;
  --ink: #E6F1F3;
  --muted: #9AAEC2;
  --line: #22334D;
  --hero-a: #0B1B33;
  --hero-b: #0E5E58;
  --shadow: 0 12px 32px -16px rgba(0, 0, 0, .7);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --navy: #0B1B33; --teal: #2DD4BF; --teal-soft: #0F3D3E; --bg: #0A1424; --surface: #122039;
    --ink: #E6F1F3; --muted: #9AAEC2; --line: #22334D; --hero-a: #0B1B33; --hero-b: #0E5E58;
    --shadow: 0 12px 32px -16px rgba(0, 0, 0, .7); color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--ink); background: var(--bg);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px; line-height: 1.6; transition: background .3s ease, color .3s ease;
}
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
h2 { font-size: 1.35rem; margin-top: 2rem; }
p { margin: 0 0 1rem; }
a { color: var(--teal); }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 4px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .7rem clamp(1rem, 4vw, 2.5rem);
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: saturate(160%) blur(10px); -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand .logo { height: 40px; width: auto; display: block; }
.logo-dark { display: none; }
[data-theme="dark"] .logo-light { display: none; }
[data-theme="dark"] .logo-dark { display: block; }
.site-nav { display: flex; flex-wrap: wrap; gap: .25rem; }
.site-nav a {
  color: var(--ink); text-decoration: none; font-weight: 500; padding: .45rem .8rem; border-radius: 999px;
  transition: background .2s, color .2s;
}
.site-nav a:hover { background: var(--teal-soft); }
.site-nav a.active { background: var(--teal); color: #fff; }
.theme-toggle {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); cursor: pointer;
  background: var(--surface); color: var(--ink); display: grid; place-items: center; font-size: 1.1rem;
  transition: transform .2s;
}
.theme-toggle:hover { transform: rotate(12deg); }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: inline; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* Layout */
.container { max-width: 1040px; margin: 0 auto; padding: 1.5rem clamp(1rem, 4vw, 2rem) 3rem; }
.site-footer { text-align: center; color: var(--muted); padding: 2rem 1rem; font-size: .9rem; border-top: 1px solid var(--line); }

/* Hero (home) */
.hero {
  color: #fff; border-radius: 22px; padding: clamp(2rem, 6vw, 3.5rem) clamp(1.25rem, 5vw, 3rem);
  background: radial-gradient(circle at 85% 20%, rgba(45,212,191,.35), transparent 40%),
              linear-gradient(135deg, var(--hero-a), var(--hero-b));
  box-shadow: var(--shadow); margin-bottom: 1.5rem;
}
.hero h1 { color: #fff; max-width: 18ch; }
.hero p { color: rgba(255,255,255,.85); max-width: 60ch; }
.eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  background: rgba(255,255,255,.14); padding: .3rem .75rem; border-radius: 999px; margin-bottom: 1rem;
}
.search { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; max-width: 640px; }
.search input { flex: 1 1 260px; }

/* Forms and buttons */
input, select {
  font: inherit; padding: .6rem .85rem; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink); min-height: 44px;
}
input::placeholder { color: var(--muted); }
button, .btn {
  font: inherit; font-weight: 600; min-height: 44px; padding: .6rem 1.2rem; border: 0; border-radius: 10px;
  background: var(--teal); color: #fff; cursor: pointer; text-decoration: none; display: inline-flex;
  align-items: center; justify-content: center; transition: transform .15s, box-shadow .2s, filter .2s;
  box-shadow: 0 6px 16px -8px var(--teal);
}
button:hover, .btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--teal); border: 1px solid var(--teal); box-shadow: none; }
.filters { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.25rem 0; }

/* Stats and tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat, .tile, .card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.25rem;
}
.stat strong { display: block; font-size: 1.8rem; color: var(--teal); line-height: 1.1; }
.stat span { color: var(--muted); font-size: .9rem; }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.tile { text-decoration: none; color: var(--ink); transition: transform .2s, border-color .2s; }
.tile:hover { transform: translateY(-3px); border-color: var(--teal); }
.tile h3 { color: var(--ink); }
.tile p { color: var(--muted); margin: 0; font-size: .95rem; }

/* Lists and tables */
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.list li {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1.1rem;
  transition: border-color .2s;
}
.list li:hover { border-color: var(--teal); }
.list a { font-weight: 600; text-decoration: none; }
table {
  width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
th, td { text-align: left; padding: .75rem .9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: color-mix(in srgb, var(--teal-soft) 40%, var(--surface)); }
tr:last-child td { border-bottom: 0; }
.muted { color: var(--muted); font-size: .92rem; }
.badge {
  display: inline-block; font-size: .75rem; font-weight: 600; padding: .2rem .6rem; border-radius: 999px;
  background: var(--teal-soft); color: var(--teal);
}
.notice-error { color: #b91c1c; font-weight: 600; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media (max-width: 640px) {
  .site-header { flex-wrap: wrap; }
  .site-nav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* Logo switching (higher specificity so only one logo shows) */
.brand .logo-dark { display: none; }
[data-theme="dark"] .brand .logo-light { display: none; }
[data-theme="dark"] .brand .logo-dark { display: block; }
