:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #5d6978;
  --line: #d9e0e8;
  --paper: #f7f8f8;
  --panel: #ffffff;
  --navy: #123047;
  --teal: #087b83;
  --gold: #b57a24;
  --green: #367659;
  --red: #b94b4b;
  --shadow: 0 18px 48px rgba(18, 48, 71, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.site-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(217, 224, 232, 0.85);
  background: rgba(247, 248, 248, 0.92);
  backdrop-filter: blur(18px);
}

.topbar-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 800;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  letter-spacing: 0;
}

.brand small {
  display: block;
  color: var(--muted);
  font-weight: 600;
  margin-top: 2px;
}

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

.nav a,
.ghost-button,
.primary-button,
.danger-button,
.small-button {
  border: 1px solid transparent;
  border-radius: 7px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 13px;
  font-weight: 700;
  color: var(--ink);
  background: transparent;
}

.nav a:hover,
.ghost-button:hover,
.small-button:hover {
  border-color: var(--line);
  background: #fff;
}

.primary-button {
  color: #fff;
  background: var(--teal);
  border-color: var(--teal);
}

.primary-button:hover {
  background: #06646b;
}

.danger-button {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}

.small-button {
  min-height: 34px;
  padding: 0 10px;
  background: #fff;
  border-color: var(--line);
}

.hero {
  background:
    linear-gradient(115deg, rgba(18, 48, 71, 0.94), rgba(8, 123, 131, 0.82)),
    url("https://images.unsplash.com/photo-1454165804606-c3d57bc86b40?auto=format&fit=crop&w=1800&q=80");
  background-size: cover;
  background-position: center;
  color: #fff;
}

.hero-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  min-height: calc(100vh - 72px);
  max-height: 860px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 48px;
  align-items: center;
  padding: 72px 0 92px;
}

.eyebrow {
  margin: 0 0 14px;
  color: #bdecef;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.hero h1 {
  font-size: clamp(2.7rem, 7vw, 5.7rem);
  line-height: 0.97;
  margin: 0 0 20px;
  letter-spacing: 0;
}

.hero-lead {
  max-width: 760px;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.88);
  margin: 0 0 28px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-actions .ghost-button {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}

.hero-card {
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 26px;
}

.profile-avatar {
  width: 128px;
  height: 128px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #e7f4f4;
  color: var(--teal);
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid #cae7e8;
}

.profile-avatar.has-photo {
  background: #fff;
  padding: 0;
}

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

.hero-card h2 {
  margin: 0 0 8px;
  font-size: 1.45rem;
}

.hero-card p {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.55;
}

.quick-links {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.quick-links span {
  padding: 10px 12px;
  background: #f3f7f7;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.section {
  padding: 72px 0;
}

.section.alt {
  background: #fff;
}

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

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.7rem);
}

.section-head p {
  max-width: 640px;
  color: var(--muted);
  line-height: 1.65;
  margin: 8px 0 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 14px;
}

.stat,
.card,
.admin-card,
.editor-row {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(18, 48, 71, 0.06);
}

.stat {
  padding: 20px;
}

.stat strong {
  display: block;
  font-size: 1.8rem;
  color: var(--teal);
}

.stat span {
  display: block;
  color: var(--muted);
  margin-top: 4px;
  font-weight: 700;
  line-height: 1.3;
}

.grid-2,
.grid-3 {
  display: grid;
  gap: 18px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  padding: 22px;
}

.card h3 {
  margin: 0 0 10px;
  font-size: 1.12rem;
}

.card p,
.card li {
  color: var(--muted);
  line-height: 1.6;
}

.card ul {
  padding-left: 18px;
  margin: 12px 0 0;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid #cae7e8;
  background: #eef9f9;
  color: #075d63;
  border-radius: 7px;
  padding: 0 11px;
  font-weight: 700;
}

.timeline {
  display: grid;
  gap: 16px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 20px;
}

.period {
  color: var(--gold);
  font-weight: 900;
}

.publication-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.publication-toolbar button.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.pub-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.pub-meta span {
  font-size: 0.88rem;
  padding: 6px 9px;
  border-radius: 7px;
  background: #f2f4f6;
  color: var(--muted);
  font-weight: 700;
}

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

.photo-card {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(18, 48, 71, 0.06);
}

.photo-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: #e7ecef;
}

.photo-card div {
  padding: 18px;
}

.photo-card span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 7px;
  background: #eef9f9;
  color: #075d63;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0 9px;
  margin-bottom: 10px;
}

.photo-card h3 {
  margin: 0 0 8px;
}

.photo-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.footer {
  padding: 34px 0;
  background: var(--navy);
  color: #fff;
}

.footer .container {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer .container > div {
  display: grid;
  gap: 6px;
}

.footer .container span {
  color: rgba(255, 255, 255, 0.78);
}

.footer-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.footer-links a {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 7px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  text-decoration: none;
  font-weight: 800;
}

.footer-links a:hover {
  background: rgba(255, 255, 255, 0.12);
}

.admin-shell {
  min-height: 100vh;
  background: #eef2f3;
}

.admin-header {
  background: var(--navy);
  color: #fff;
  padding: 22px 0;
}

.admin-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.admin-main {
  padding: 32px 0 60px;
}

.login-panel {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-box {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.login-box h1 {
  margin: 0 0 8px;
}

.login-box p {
  color: var(--muted);
  margin: 0 0 20px;
  line-height: 1.5;
}

.admin-help {
  color: var(--muted);
  line-height: 1.55;
  margin: -4px 0 18px;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.field label {
  font-weight: 800;
  color: var(--ink);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  min-height: 42px;
  padding: 10px 12px;
  color: var(--ink);
}

.field textarea {
  min-height: 110px;
  resize: vertical;
}

.admin-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 22px;
}

.admin-tabs {
  position: sticky;
  top: 88px;
  align-self: start;
  display: grid;
  gap: 8px;
}

.admin-tabs button {
  justify-content: flex-start;
  border: 1px solid var(--line);
  background: #fff;
}

.admin-tabs button.active {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}

.admin-card {
  padding: 22px;
  margin-bottom: 18px;
}

.admin-card h2 {
  margin: 0 0 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid .wide {
  grid-column: 1 / -1;
}

.editor-row {
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: none;
}

.custom-section-editor {
  background: #fbfdfd;
}

.nested-items {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 14px;
}

.nested-items h3 {
  margin: 0 0 12px;
}

.nested-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  margin-bottom: 12px;
}

.row-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 10px;
}

.profile-upload-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  margin: 8px 0 12px;
}

.profile-upload-preview img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.profile-upload-preview span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.status {
  min-height: 24px;
  color: var(--green);
  font-weight: 800;
}

.error {
  color: var(--red);
  font-weight: 800;
}

@media (max-width: 980px) {
  .hero-inner,
  .grid-2,
  .grid-3,
  .photo-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .hero-inner {
    min-height: auto;
  }

  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .timeline-item {
    grid-template-columns: 1fr;
  }

  .admin-tabs {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .topbar-inner,
  .section-head,
  .admin-header .container,
  .footer .container {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    justify-content: flex-start;
  }

  .hero-card {
    padding: 20px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .admin-tabs {
    grid-template-columns: 1fr;
  }
}
