@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("https://fonts.gstatic.com/s/fraunces/v31/6xKgdSZaM9iE8KbpRA_hKZpNzw.woff2") format("woff2");
}

:root {
  --bg: #f6f0e8;
  --ink: #1f1c18;
  --accent: #1e5b57;
  --accent-2: #c06b3e;
  --card: #fff8f0;
  --line: #d7c5b2;
  --muted: #6c6258;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Fraunces", "Georgia", serif;
  color: var(--ink);
  background: radial-gradient(1200px 800px at 10% -10%, #fff2dc, transparent),
              radial-gradient(1200px 800px at 90% 110%, #ffe9d2, transparent),
              var(--bg);
}

.page {
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 20px 60px;
  display: grid;
  gap: 20px;
}

.hero h1 {
  font-size: 40px;
  margin: 0 0 6px;
}

.hero p { margin: 0; color: var(--muted); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.06);
}

.auth-grid {
  display: grid;
  gap: 12px;
}

.auth-block {
  display: grid;
  gap: 12px;
}

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

.people {
  display: grid;
  gap: 14px;
}

.person {
  display: grid;
  gap: 10px;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: #fffdf8;
}

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

.person-title { margin: 0; font-size: 20px; }

.remove-person {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.update-person {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 14px;
}

input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: white;
  font-size: 16px;
}

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

button {
  border: none;
  background: var(--accent);
  color: white;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 15px;
  cursor: pointer;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--accent);
  color: white;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

button#fill-example {
  background: var(--accent-2);
}

button#add-person {
  background: #314b6a;
}

.error { color: #8b1f1f; min-height: 1.2em; }
.notice { color: var(--muted); min-height: 1.2em; }

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

.year-grid {
  position: relative;
  height: 32px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}

.year-tick {
  position: absolute;
  bottom: 0;
  width: 1px;
  height: 12px;
  background: var(--line);
}

.year-label {
  position: absolute;
  bottom: 15px;
  transform: translateX(-50%);
  font-size: 12px;
  color: var(--muted);
}

.event-marker {
  position: absolute;
  bottom: -14px;
  width: 22px;
  height: 22px;
  background: #f4e6d2;
  border: 1px solid #2d1a10;
  border-radius: 50%;
  transform: translateX(-50%);
  cursor: help;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.event-marker-icon {
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Twemoji Mozilla", "Fraunces", serif;
  font-size: 14px;
  line-height: 1;
}

.event-tooltip {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.75);
  color: #ffffff;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 11px;
  white-space: normal;
  text-align: left;
  min-width: 320px;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.event-tooltip-title {
  font-size: 15px;
  white-space: nowrap;
}

.event-tooltip-person {
  font-size: 13px;
}

.event-marker:hover .event-tooltip {
  opacity: 1;
}

.event-marker.is-open .event-tooltip {
  opacity: 1;
}

.timeline-row {
  display: grid;
  gap: 6px;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--muted);
}

.timeline-track {
  position: relative;
  height: 26px;
}

.timeline-bar {
  height: 16px;
  background: linear-gradient(90deg, #f0e1cd, #ecd3b6);
  border-radius: 999px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
}

.timeline-fill {
  height: 100%;
  background: var(--person-color, var(--accent));
}


.age-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.age-tick {
  position: absolute;
  bottom: 0;
  width: 1px;
  height: 8px;
  background: #9b8a78;
  opacity: 0.9;
}

.age-label {
  position: absolute;
  bottom: 10px;
  transform: translateX(-50%);
  font-size: 10px;
  color: #7b6c5d;
}

.timeline-row:hover .age-layer {
  opacity: 1;
}

.timeline-row:hover .age-label {
  bottom: 22px;
  font-size: 12px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.35);
  padding: 1px 4px;
  border-radius: 999px;
}

.timeline-label {
  font-size: 16px;
  font-weight: 700;
}

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.muted { color: var(--muted); }

@media (min-width: 720px) {
  .actions { grid-column: span 2; }
  .error { grid-column: span 2; }
}

.session-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auth-page {
  min-height: 100vh;
  align-content: center;
}

.auth-card {
  max-width: 520px;
  width: 100%;
}
