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

/* ── TOKENS ── */

:root {
  --bg: #fff;
  --fg: #111;
  --muted: #888;
  --border: #e8e8e8;
  --accent: #306598;
  --accent-light: #e8f0f7;
  --card-bg: #fafafa;
  --max-w: 780px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  --bg: #0f1117;
  --fg: #e8eaf0;
  --muted: #666;
  --border: #272b35;
  --accent: #5b9fd4;
  --accent-light: #1a2535;
  --card-bg: #161b25;
}

html, body {
  height: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.7;
  font-size: 17px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
}

/* ── LOGO ── */

.logo-wrap {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  overflow: hidden;
  margin: 48px auto 48px;
  border: 2px solid var(--accent-light);
  flex-shrink: 0;
  box-shadow: 0 0 0 6px var(--accent-light);
  transition: box-shadow 0.3s ease, transform 0.3s var(--ease-out-expo);
}

.logo-wrap:hover {
  box-shadow: 0 0 0 10px var(--accent-light), 0 8px 32px rgba(48, 101, 152, 0.15);
  transform: scale(1.04);
}

.logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── MAIN ── */

main {
  flex: 1;
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  padding: 0 24px 0;
}

/* ── SECTIONS ── */

.section {
  border-bottom: 1px solid var(--border);
  transition: border-color 0.3s ease;
}

.section:first-of-type {
  border-top: 1px solid var(--border);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  cursor: pointer;
  list-style: none;
  user-select: none;
  gap: 16px;
  transition: color 0.15s;
}

.section-head::-webkit-details-marker {
  display: none;
}

.section-head::marker {
  display: none;
}

.section-head:hover .section-title {
  color: var(--accent);
}

.section-head:hover .chevron {
  color: var(--accent);
}

.section-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  transition: color 0.15s;
}

details[open] .section-title {
  color: var(--accent);
}

.chevron {
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
  transition: transform 0.25s var(--ease-out-expo), color 0.15s;
  flex-shrink: 0;
}

details[open] .chevron {
  transform: rotate(45deg);
  color: var(--accent);
}

.section-body {
  padding-bottom: 24px;
}

/* ── DOC LIST ── */

.doc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.doc-list li {
  opacity: 0;
  transform: translateX(-8px);
  animation: doc-enter 0.38s var(--ease-out-expo) forwards;
  animation-delay: calc(var(--i, 0) * 50ms + 80ms);
}

@keyframes doc-enter {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.doc-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 0;
  color: var(--fg);
  text-decoration: none;
  font-size: 16px;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s, padding-left 0.2s var(--ease-out-expo);
}

.doc-link::after {
  content: '↗';
  color: var(--muted);
  font-size: 12px;
  transition: color 0.15s, transform 0.2s var(--ease-out-expo);
}

.doc-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
  padding-left: 6px;
}

.doc-link:hover::after {
  color: var(--accent);
  transform: translate(2px, -2px);
}

/* ── SUBSECTIONS ── */

.subsection {
  padding-bottom: 8px;
}

.subsection + .subsection {
  padding-top: 4px;
}

.subsection-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px 0 4px;
}

/* ── EMPTY STATE ── */

.doc-empty {
  font-size: 14px;
  color: var(--muted);
  padding: 8px 0 4px;
  font-style: italic;
}

/* ── FOOTER ── */

footer {
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  padding: 48px 24px 56px;
}

.footer-top {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 32px;
}

.footer-info {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px 24px;
}

.footer-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.15s;
}

.footer-link:hover {
  color: var(--accent);
}

/* ── THEME TOGGLE ── */

.theme-btn {
  background: var(--accent-light);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 16px;
  color: var(--fg);
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.theme-btn:hover {
  border-color: var(--accent);
  transform: scale(1.06);
}

.theme-btn:active {
  transform: scale(0.96);
}

/* Show only the relevant icon */
[data-theme="dark"] .theme-icon--dark,
:root:not([data-theme="dark"]) .theme-icon--light {
  display: inline;
}

[data-theme="dark"] .theme-icon--light,
:root:not([data-theme="dark"]) .theme-icon--dark {
  display: none;
}

/* ── TEAM GRID ── */

.team-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px 16px;
}

.member {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 64px;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-light);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.2s ease, transform 0.2s var(--ease-out-expo);
  cursor: default;
}

.avatar:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-light);
  transform: translateY(-3px) scale(1.08);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.member-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.member-link:hover .avatar {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-light);
  transform: translateY(-3px) scale(1.08);
}

.member-link:hover .member-name {
  color: var(--accent);
}

.member-name {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  line-height: 1.3;
}

/* ── ENTRANCE ANIMATIONS ── */

.anim-pop {
  animation: pop-in 0.6s var(--ease-out-expo) both;
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.anim-slide-up {
  animation: slide-up 0.5s var(--ease-out-expo) both;
  animation-delay: calc(var(--i, 0) * 80ms + 200ms);
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.anim-fade {
  animation: fade-in 0.6s ease both;
  animation-delay: 500ms;
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
