:root {
  --ink: #17223b;
  --ink-strong: #0d1629;
  --blue: #263c68;
  --gold: #c7a24a;
  --gold-soft: #ead89e;
  --paper: #f8f5ef;
  --surface: #ffffff;
  --line: #ded8ca;
  --muted: #68718a;
  --green: #2e6f62;
  --red: #a33d3d;
  --shadow: 0 18px 44px rgba(23, 34, 59, 0.13);
}

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

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: "Outfit", system-ui, sans-serif;
}

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

a {
  color: inherit;
}

.site-hero {
  min-height: 680px;
  background: var(--ink-strong);
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px clamp(22px, 5vw, 64px) 44px;
}

.topbar,
.directory-toolbar,
.admin-header,
.editor-title-row,
.browser-top,
.directory-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  font-weight: 600;
}

.brand-mark img {
  width: 124px;
  height: auto;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-link,
.secondary-button,
.primary-button,
.danger-button {
  border: 1px solid transparent;
  border-radius: 6px;
  min-height: 42px;
  padding: 10px 16px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  white-space: nowrap;
}

.admin-link {
  color: white;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.36);
}

.admin-link:hover,
.admin-link:focus-visible {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink-strong);
}

.primary-button {
  background: var(--blue);
  color: white;
}

.secondary-button {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

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

.danger-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.hero-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  align-items: center;
  gap: clamp(28px, 8vw, 88px);
  margin-top: 32px;
}

.hero-content h1 {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(54px, 8vw, 96px);
  line-height: 0.96;
  letter-spacing: 0;
  margin: 14px 0 18px;
}

.hero-content em {
  color: var(--gold-soft);
}

.hero-subtitle,
.hero-note {
  color: rgba(255, 255, 255, 0.74);
}

.hero-note {
  max-width: 420px;
  line-height: 1.7;
}

.eyebrow {
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
  margin: 8px 0 0;
}

.directory-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px 24px 32px;
}

.directory-toolbar {
  align-items: flex-end;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 22px;
}

h1,
h2,
h3 {
  margin: 0;
}

h2,
.login-panel h1,
.admin-header h1 {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1;
}

.toolbar-controls,
.admin-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.search-box,
.select-box,
.profile-form label,
.login-form label {
  display: grid;
  gap: 6px;
}

.search-box span,
.select-box span,
.profile-form span,
.login-form span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 11px 12px;
}

textarea {
  resize: vertical;
}

.summary-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin: 28px 0 36px;
}

.summary-band div {
  background: var(--surface);
  padding: 20px;
}

.summary-band strong {
  display: block;
  font-family: "Cormorant Garamond", serif;
  font-size: 2.2rem;
}

.summary-band span {
  color: var(--muted);
  font-size: 0.86rem;
}

.section-heading {
  margin-bottom: 18px;
}

.exco-section {
  background: var(--ink);
  color: white;
  padding: 28px;
  margin-bottom: 24px;
}

.exco-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}

.exco-item {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: white;
  padding: 12px;
  text-decoration: none;
}

.exco-item span {
  color: var(--gold-soft);
  display: block;
  font-size: 0.72rem;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.profile {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 30px;
  padding: 34px 0;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 24px;
}

.profile-avatar,
.profile-avatar-initials {
  width: 190px;
  height: 238px;
  border-radius: 6px;
}

.profile-avatar {
  object-fit: cover;
  object-position: top center;
}

.profile-avatar-initials {
  background: var(--ink);
  color: var(--gold-soft);
  display: grid;
  place-items: center;
  font-family: "Cormorant Garamond", serif;
  font-size: 3.4rem;
  font-weight: 700;
}

.profile-heading {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.profile-heading h3 {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.75rem;
  line-height: 1.1;
}

.profile-heading span,
.profile-links a {
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 700;
}

.profile-education,
.profile-role,
.profile-about {
  margin: 8px 0 0;
}

.profile-education,
.profile-role span {
  color: var(--muted);
}

.profile-role {
  font-weight: 700;
}

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.profile-tags span {
  background: #eef4f0;
  border: 1px solid #d6e5dd;
  border-radius: 999px;
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 5px 10px;
}

.profile-tags .exco-badge {
  background: #fff5d8;
  border-color: #ead18a;
  color: #8a6414;
}

.profile-about {
  color: #3f485e;
  line-height: 1.72;
}

.profile-links {
  margin-top: 10px;
}

.directory-footer {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 24px 48px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.86rem;
}

.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.admin-body {
  background: #eef1f4;
}

.admin-shell {
  min-height: 100vh;
  padding: 28px;
}

.login-panel {
  width: min(520px, 100%);
  margin: 11vh auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 30px;
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.form-message {
  min-height: 20px;
  color: var(--red);
  margin: 0;
}

.admin-workspace {
  max-width: 1320px;
  margin: 0 auto;
}

.admin-header {
  align-items: flex-start;
  margin-bottom: 24px;
}

.admin-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 20px;
}

.record-browser,
.editor-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.record-browser {
  padding: 18px;
}

.browser-top {
  align-items: end;
  margin-bottom: 16px;
}

.record-list {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 230px);
  overflow: auto;
  padding-right: 4px;
}

.record-button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 4px;
  padding: 12px;
  text-align: left;
}

.record-button span {
  color: var(--muted);
  font-size: 0.84rem;
}

.record-button.is-active {
  border-color: var(--gold);
  background: #fffaf0;
}

.editor-panel {
  padding: 24px;
}

.profile-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.full-span {
  grid-column: 1 / -1;
}

.file-action {
  position: relative;
  overflow: hidden;
}

.file-action input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.empty-state {
  color: var(--muted);
  padding: 18px 0;
}

.is-hidden {
  display: none !important;
}

@media print {
  .topbar,
  .directory-toolbar,
  .summary-band,
  .back-to-top {
    display: none;
  }

  .site-hero {
    min-height: 100vh;
    page-break-after: always;
  }

  .profile {
    break-inside: avoid;
  }
}

@media (max-width: 860px) {
  .hero-content,
  .directory-toolbar,
  .profile,
  .admin-layout,
  .profile-form {
    grid-template-columns: 1fr;
  }

  .directory-toolbar,
  .admin-header,
  .editor-title-row,
  .directory-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar-controls,
  .search-box,
  .select-box,
  .admin-actions {
    width: 100%;
  }

  .summary-band {
    grid-template-columns: 1fr;
  }

  .profile-avatar,
  .profile-avatar-initials {
    width: 148px;
    height: 184px;
  }
}

@media (max-width: 560px) {
  .site-hero {
    min-height: 88vh;
    padding: 22px 18px 38px;
  }

  .brand-mark img {
    width: 96px;
  }

  .brand-mark span {
    display: none;
  }

  .topbar {
    align-items: center;
  }

  .browser-top {
    align-items: stretch;
  }

  .browser-top {
    flex-direction: column;
  }

  .admin-shell {
    padding: 14px;
  }

  .login-panel,
  .editor-panel,
  .record-browser {
    padding: 18px;
  }
}
