:root {
  --bg: #e9e0d3;
  --surface: #f8f4ec;
  --surface-muted: #efe7dc;
  --border: #d0c1ae;
  --border-strong: #a88463;
  --text: #241d18;
  --muted: #6d6156;
  --accent: #8c4b2f;
  --shadow-soft: 0 12px 30px rgba(64, 41, 22, 0.08);
  --panel: #f3ebdf;
  --card-accent: #8c4b2f;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Source Sans 3", sans-serif;
  color: var(--text);
  background: var(--bg);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.page-shell {
  width: min(1440px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.site-header,
.header-actions,
.hero-actions,
.directory-header,
.filters-meta,
.profile-main,
.profile-footer,
.form-actions {
  display: flex;
}

.site-header,
.directory-header,
.profile-main,
.profile-footer {
  justify-content: space-between;
  align-items: center;
}

.site-header {
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(174, 184, 174, 0.7);
}

.header-actions,
.hero-actions,
.tag-row,
.form-actions {
  align-items: center;
  gap: 12px;
}

.site-kicker,
.section-kicker,
.profile-meta {
  margin: 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.74rem;
  font-weight: 700;
}

.hero-section h2,
.directory-header h3,
.modal-header h3,
.profile-name {
  margin: 0;
  font-family: "Libre Baskerville", serif;
  font-weight: 700;
  line-height: 1.05;
}

.brand-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.brand-logo {
  display: block;
  width: min(320px, 40vw);
  height: auto;
}

.nav-link,
.text-button {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.button,
.text-button,
.modal-close {
  border: 0;
  background: transparent;
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
}

.button-primary {
  background: var(--accent);
  color: white;
  font-weight: 700;
}

.button-secondary {
  background: #f0eee8;
  color: var(--text);
  border: 1px solid var(--border);
  font-weight: 600;
}

.page-content {
  display: grid;
  gap: 32px;
  padding-top: 28px;
}

.hero-section {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.hero-section h2 {
  margin-top: 10px;
  font-size: clamp(2.8rem, 5vw, 4.8rem);
}

.hero-text,
.directory-note,
.profile-form label,
.form-status {
  color: var(--muted);
}

.hero-text {
  max-width: 68ch;
  margin: 18px auto 0;
  line-height: 1.75;
  font-size: 1rem;
}

.hero-actions {
  margin-top: 24px;
  justify-content: center;
}

.hero-meta {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}

.access-message {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.hero-meta strong {
  color: var(--text);
}

.directory-header {
  gap: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.directory-section {
  padding: 28px 30px 10px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: 0 8px 22px rgba(24, 32, 27, 0.04);
}

.directory-header h3,
.modal-header h3 {
  margin-top: 6px;
  font-size: 2rem;
}

.directory-note {
  margin: 0;
}

.filters-bar {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr auto;
  gap: 14px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.filters-bar label,
.profile-form label {
  display: grid;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 600;
}

.filters-meta {
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  gap: 8px;
}

.filters-meta p {
  margin: 0;
  font-weight: 700;
}

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

.is-disabled {
  opacity: 0.58;
}

input,
select {
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #faf8f3;
  color: var(--text);
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px rgba(140, 75, 47, 0.12);
}

.profiles-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 24px;
  padding-top: 20px;
  align-items: stretch;
}

.profile-card {
  display: grid;
  gap: 14px;
  padding: 22px 22px 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  border-left: 5px solid var(--card-accent);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.profile-card:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  box-shadow: 0 16px 34px rgba(64, 41, 22, 0.11);
}

.profile-main {
  gap: 16px;
  align-items: flex-start;
}

.profile-name {
  margin-top: 6px;
  font-size: 1.42rem;
}

.profile-meta {
  color: #5f675f;
}

.profile-badge {
  flex-shrink: 0;
  padding-top: 3px;
  background: transparent;
  border: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
}

.profile-summary {
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.55;
}

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

.profile-footer {
  gap: 24px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.detail-item {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 12px;
  background: #fcf8f1;
  border: 1px solid #e2d6c8;
}

.detail-label {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-value {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.45;
}

.contact-block {
  display: grid;
  gap: 4px;
}

.contact-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-email,
.profile-socials {
  color: var(--text);
  font-size: 0.94rem;
  line-height: 1.4;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 40px 24px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 18px;
  background: var(--surface);
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 20;
}

.modal.is-open {
  display: block;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 18, 16, 0.4);
}

.modal-panel {
  position: relative;
  width: min(980px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  margin: 20px auto;
  padding: 24px;
  border-radius: 18px;
  background: var(--surface);
  overflow: auto;
}

.modal-panel-compact {
  width: min(520px, calc(100vw - 32px));
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 18px;
}

.modal-close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  font-size: 1.5rem;
  line-height: 1;
}

.profile-form,
.form-grid {
  display: grid;
  gap: 16px;
}

.modal-step {
  display: grid;
  gap: 16px;
}

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

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

.otp-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.otp-label {
  display: grid;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--muted);
}

#otp-input {
  max-width: 240px;
  letter-spacing: 0.32em;
  text-align: center;
  font-size: 1.1rem;
}

.form-status {
  min-height: 1.2rem;
  margin: 0;
}

.support-content {
  display: grid;
  gap: 12px;
}

.support-content p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.support-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
  word-break: break-word;
}

.support-link:hover,
.support-link:focus-visible {
  text-decoration: underline;
}

.modal-open {
  overflow: hidden;
}

@media (max-width: 980px) {
  .page-shell {
    width: min(100vw - 24px, 1440px);
  }

  .directory-header,
  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .filters-bar,
  .profiles-list,
  .form-grid,
  .profile-details {
    grid-template-columns: 1fr;
  }

  .form-grid-full {
    grid-column: auto;
  }

  .filters-meta {
    align-items: flex-start;
  }

  .directory-section {
    padding: 22px 20px 8px;
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding-top: 16px;
  }

  .brand-logo {
    width: min(250px, 68vw);
  }

  .header-actions,
  .hero-actions,
  .form-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .button {
    width: 100%;
  }

  .hero-section h2 {
    font-size: 2.6rem;
  }

  .modal-panel {
    padding: 18px;
  }
}
