:root {
  --bg: #161d1a;
  --bg-alt: #202a25;
  --panel: #243b55;
  --panel-soft: #2b4665;
  --panel-dark: #1d3148;
  --ink: #f3f6fb;
  --muted: #d4ddea;
  --line: rgba(236, 230, 217, 0.12);
  --accent: #243b55;
  --accent-soft: #2b4665;
  --accent-alt: #6e8eaf;
  --navy: #325270;
  --shell-width: min(1360px, calc(100vw - 24px));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(circle at top, rgba(84, 119, 155, 0.12), transparent 30%),
    linear-gradient(180deg, #1b241f 0%, #141916 100%);
  color: var(--ink);
  font-family: "Manrope", Arial, sans-serif;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

.site-shell {
  width: var(--shell-width);
  margin: 0 auto;
  padding: 14px 0 34px;
}

.home-main,
.admin-main {
  display: grid;
  gap: 18px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 18px;
  padding: 16px 20px;
  background: rgba(32, 38, 35, 0.94);
  border-top: 2px solid var(--accent-alt);
  border: 1px solid rgba(236, 230, 217, 0.08);
  border-radius: 22px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
  position: sticky;
  top: 12px;
  z-index: 10;
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #f0eee6;
  font-family: "Manrope", Arial, sans-serif;
  transition: opacity 180ms ease;
}

.brand:hover {
  opacity: 0.92;
}

.brand strong {
  display: block;
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand span:last-child {
  color: rgba(230, 225, 211, 0.75);
  font-size: 0.82rem;
}

.main-nav,
.nav-family-links,
.contact-actions,
.admin-form-actions,
.member-editor-header,
.family-management-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.main-nav { justify-content: flex-end; }

.main-nav a,
.family-nav-link {
  min-width: 160px;
  padding: 12px 22px;
  border-radius: 999px;
  background: linear-gradient(180deg, #2f4c6d, #243b55);
  color: var(--ink);
  text-align: center;
  font-family: "Manrope", Arial, sans-serif;
  font-weight: 600;
  border: 1px solid rgba(243, 246, 251, 0.08);
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.main-nav a[aria-current="page"],
.family-nav-link[aria-current="page"] {
  background: linear-gradient(180deg, #3a5d86, #2b4665);
}

.main-nav a:hover,
.family-nav-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.hero-panel,
.story-grid,
.family-layout,
.admin-grid {
  display: grid;
  gap: 0;
}

.hero-panel,
.story-grid {
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.hero-copy,
.story-card,
.family-info-panel,
.family-photo-panel,
.contact-banner,
.admin-card,
.family-hero {
  background: linear-gradient(180deg, #2b4665 0%, #243b55 100%);
  border: 1px solid rgba(236, 230, 217, 0.08);
  border-radius: 24px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}

.hero-copy,
.story-card-light,
.family-info-panel,
.contact-banner,
.family-hero,
.admin-card {
  padding: 56px 52px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 520px;
}

.hero-copy h1,
.story-card h2,
.section-heading h2,
.contact-banner h2,
.family-hero-copy h1,
.admin-card h1,
.admin-card h2 {
  margin: 0 0 24px;
  font-family: "Newsreader", Georgia, serif;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.hero-copy h1 { font-size: clamp(2.8rem, 5vw, 4.4rem); max-width: 8.6ch; }
.section-heading h2,
.contact-banner h2,
.family-hero-copy h1,
.admin-card h1,
.admin-card h2 { font-size: clamp(2.1rem, 4vw, 3.4rem); }

.hero-copy p,
.story-card p,
.section-heading p,
.family-hero-copy p,
.member-card p,
.contact-banner p,
.admin-card p,
label {
  margin: 0;
  color: var(--muted);
  font-family: "Manrope", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.75;
}

.eyebrow {
  margin: 0 0 10px;
  color: #c8d8ea;
  font-size: 0.85rem;
  font-family: "Manrope", Arial, sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

.button-primary {
  background: linear-gradient(180deg, #3a5d86, #2b4665);
  color: var(--ink);
  font-family: "Manrope", Arial, sans-serif;
  font-weight: 700;
  border: 1px solid rgba(243, 246, 251, 0.08);
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button-secondary {
  background: linear-gradient(180deg, #2f4c6d, #243b55);
  color: var(--ink);
  font-family: "Manrope", Arial, sans-serif;
  font-weight: 700;
  border: 1px solid rgba(243, 246, 251, 0.08);
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2);
}

.hero-image-frame,
.story-card-image,
.family-photo-panel,
.family-preview-card { overflow: hidden; }

.hero-image-frame,
.story-card-image,
.family-photo-panel,
.family-preview-card,
.member-card,
.family-management-card,
.member-editor-card {
  cursor: pointer;
}

.hero-image-frame img,
.story-card-image img,
.family-photo-panel img,
.family-preview-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms ease, filter 300ms ease;
}

.hero-image-frame img,
.story-card-image img {
  min-height: 520px;
}

.story-card {
  min-height: 560px;
}

.story-card-light {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(180deg, #2b4665 0%, #243b55 100%);
}

.family-preview {
  display: grid;
  gap: 20px;
  margin-top: 22px;
}

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

.family-card-grid,
.member-list,
.family-management-list,
.admin-form,
.member-editor-list {
  display: grid;
  gap: 18px;
}

.family-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.family-preview-card,
.member-card,
.family-management-card,
.member-editor-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.family-preview-card img {
  height: 220px;
}

.family-preview-copy,
.member-card,
.member-editor-card,
.family-management-card {
  padding: 22px;
}

.family-preview-copy h3,
.member-card h3,
.family-management-card h3 {
  margin: 0 0 10px;
  color: var(--ink);
  font-family: "Manrope", Arial, sans-serif;
}

.family-preview-card:hover,
.member-card:hover,
.family-management-card:hover,
.member-editor-card:hover {
  transform: translateY(-4px);
  border-color: rgba(236, 230, 217, 0.22);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
}

.family-preview-card:hover img,
.family-photo-panel:hover img,
.hero-image-frame:hover img,
.story-card-image:hover img {
  transform: scale(1.03);
  filter: saturate(1.04);
}

.family-preview-copy p,
.member-card p,
.family-management-card p {
  color: var(--muted);
}

.contact-banner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: center;
}

.contact-banner h2 {
  font-size: clamp(2.3rem, 5vw, 4rem);
}

.contact-note {
  color: var(--ink);
  font-family: "Manrope", Arial, sans-serif;
}

.site-footer {
  display: grid;
  gap: 6px;
  justify-items: center;
  padding: 26px 20px 6px;
  color: var(--ink);
  text-align: center;
}

.site-footer p {
  margin: 0;
  color: var(--muted);
  font-family: "Manrope", Arial, sans-serif;
}

.site-footer a {
  color: var(--ink);
}

.family-hero {
  margin-bottom: 18px;
}

.family-layout {
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

.family-photo-panel {
  min-height: 640px;
}

.family-info-panel {
  background: linear-gradient(180deg, #243b55 0%, #1d3148 100%);
  min-width: 0;
}

.family-info-panel .section-heading h2,
.family-info-panel .section-heading p,
.family-hero-copy h1,
.family-hero-copy p,
.admin-card h1,
.admin-card h2,
.admin-card p,
label {
  color: var(--ink);
}

.member-card {
  background: linear-gradient(180deg, #2b4665 0%, #243b55 100%);
}

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

.member-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px 0;
}

.member-links a {
  color: #ffffff;
  font-family: "Manrope", Arial, sans-serif;
  font-weight: 700;
  transition: color 180ms ease;
}

.member-links a:hover {
  color: #d8e8ff;
}

.admin-topbar {
  position: static;
}

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

input,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(243, 246, 251, 0.14);
  background: #1d3148;
  color: var(--ink);
  font: inherit;
  border-radius: 14px;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

textarea { resize: vertical; }

input:focus,
textarea:focus {
  outline: none;
  border-color: rgba(158, 219, 131, 0.6);
  box-shadow: 0 0 0 3px rgba(158, 219, 131, 0.12);
}

.empty-state {
  padding: 20px;
  border: 1px dashed rgba(230, 225, 211, 0.2);
  color: var(--muted);
}

@media (max-width: 980px) {
  .topbar,
  .hero-panel,
  .story-grid,
  .family-layout,
  .contact-banner,
  .admin-grid,
  .family-management-card {
    display: grid;
    grid-template-columns: 1fr;
  }

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

  .hero-copy,
  .story-card-light,
  .family-info-panel,
  .contact-banner,
  .family-hero,
  .admin-card {
    padding: 30px 24px;
  }

  .hero-image-frame img,
  .story-card-image img,
  .family-photo-panel,
  .hero-image-frame,
  .story-card-image {
    min-height: 320px;
  }
}

@media (max-width: 640px) {
  .site-shell {
    width: 100%;
  }

  .topbar {
    padding: 14px 12px;
    border-radius: 18px;
  }

  .main-nav a,
  .family-nav-link {
    width: 100%;
  }

  .hero-copy h1 {
    max-width: none;
  }
}
