:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --text: #333333;
  --muted: rgba(51, 51, 51, 0.7);
  --brand: #333333;
  --border: #eeeeee;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  width: 100%;
  margin: 0 auto;
  padding: 16px;
}

/* Keep header layout as-is (wider). */
.header .container {
  width: min(980px, 100%);
}

/* Spec update: content area is narrower, header unchanged. */
.main .container {
  width: min(600px, 100%);
}

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: #eeeeee;
  border-bottom: 1px solid var(--border);
  z-index: 50;
}

.header-inner {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  font-weight: 750;
  letter-spacing: 0.2px;
}

.brand a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--brand);
}

.icon-button {
  border: none;
  background: transparent;
  color: var(--text);
  border-radius: 10px;
  height: 40px;
  width: 40px;
  padding: 0;
  font-size: 28px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-button:active { transform: translateY(1px); }

.main {
  padding-top: 56px;
}

.hero {
  padding: 22px 0 6px;
}

h1 {
  margin: 0 0 6px;
  font-size: 20px;
}

.lead {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 14px 0 28px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 14px;
  box-shadow: none;
}

.card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.pair {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  margin-top: 10px;
}

.pair-sep {
  color: var(--muted);
  font-weight: 650;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  align-self: start;
  padding-top: 2px;
  -webkit-user-select: none;
  user-select: none;
}

.pair-single {
  grid-template-columns: 1fr;
}

.person {
  word-break: break-word;
  text-align: center;
}

.person-name {
  font-weight: 650;
  font-size: 18px;
  line-height: 1.4;
}

.person-description {
  margin-top: 2px;
  font-size: 14px;
  color: #666666;
  line-height: 1.4;
}

.person-left { text-align: center; }
.person-right { text-align: center; }
.person-single { text-align: center; }

.date {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  white-space: nowrap;
}

.meta {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

.footer {
  color: var(--muted);
  font-size: 12px;
  padding: 18px 0 32px;
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
  z-index: 60;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(320px, 86vw);
  height: 100vh;
  background: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform 180ms ease;
  z-index: 70;
}

.drawer-inner {
  padding: 14px;
}

.drawer h3 {
  margin: 10px 0 8px;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.2px;
}

.navlist {
  display: grid;
  gap: 8px;
}

.navitem {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.02);
}

.years-placeholder {
  display: contents;
}

.drawer-open .drawer-overlay {
  opacity: 1;
  pointer-events: auto;
}

.drawer-open .drawer {
  transform: translateX(0);
}

@media (min-width: 720px) {
  h1 { font-size: 24px; }
  /* Spec: show one marriage per row (always 1 column). */
}
