:root {
  --brand: #99bad7;
  --brand-dark: #6f9ac0;
  --brand-darker: #4d7ea7;
  --brand-soft: #d9e6f3;
  --brand-faint: #f1f6fb;
  --ink: #2c3a48;
  --ink-soft: #5b6a7a;
  --bg: #fbfcfe;
  --card-bg: #ffffff;
  --border: #e1e8ef;
  --shadow: 0 6px 24px rgba(77, 126, 167, 0.08);
  --radius: 14px;
  --radius-sm: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg) url('texture-bg.webp') repeat center top;
  background-size: 1456px auto;
  color: var(--ink);
  line-height: 1.55;
}

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 20px;
}

.hero {
  background: var(--brand);
  color: #fff;
  padding: 32px 0 64px;
  margin-bottom: -32px;
}

.hero-row {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 160px;
}

.hero .logo {
  width: 160px;
  height: 160px;
  position: absolute;
  left: -20px;
  top: 50%;
  transform: translateY(-50%);
  object-fit: contain;
}

.hero-text {
  text-align: left;
  max-width: 520px;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.hero .lead {
  margin: 0;
  font-size: 1.05rem;
  max-width: 620px;
  opacity: 0.95;
}

@media (max-width: 720px) {
  .hero-row {
    flex-direction: column;
    align-items: center;
    min-height: 0;
    gap: 4px;
  }
  .hero .logo {
    position: static;
    transform: none;
    width: 130px;
    height: 130px;
  }
  .hero-text { text-align: left; }
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 32px;
}

.selector h2 {
  margin: 0 0 18px;
  font-size: 1.25rem;
  color: var(--brand-darker);
}

.slider-display {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 18px;
  padding: 14px 18px;
  background: var(--brand-faint);
  border-radius: var(--radius-sm);
}

.slider-display strong {
  font-size: 1.25rem;
  color: var(--brand-darker);
  font-weight: 700;
}

.slider-context {
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.slider-wrapper {
  position: relative;
  padding: 8px 0 28px;
}

#timeline-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  background: linear-gradient(to right,
    var(--brand-soft) 0%, var(--brand-soft) 33.6%,
    #f1ddc8 33.6%, #f1ddc8 100%);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}

#timeline-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--brand-darker);
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(77, 126, 167, 0.4);
  cursor: grab;
  transition: transform 0.1s;
}

#timeline-slider::-webkit-slider-thumb:active { cursor: grabbing; transform: scale(1.1); }

#timeline-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--brand-darker);
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(77, 126, 167, 0.4);
  cursor: grab;
}

#timeline-slider:focus { box-shadow: 0 0 0 3px var(--brand-soft); }

.slider-ticks {
  position: relative;
  margin-top: 10px;
  height: 14px;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.slider-ticks .tick {
  position: absolute;
  white-space: nowrap;
  transform: translateX(-50%);
}

.slider-ticks .tick-start { left: 0; transform: translateX(0); }
.slider-ticks .tick-birth { left: 33.6%; transform: translateX(-50%); }
.slider-ticks .tick-end   { left: 100%; transform: translateX(-100%); }

.tick-birth::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -16px;
  width: 2px;
  height: 8px;
  background: var(--brand-darker);
  transform: translateX(-50%);
}

.tick .tick-short { display: none; }

@media (max-width: 560px) {
  .slider-ticks { font-size: 0.72rem; }
  .tick .tick-full { display: none; }
  .tick .tick-short { display: inline; }
}

.hint {
  margin: 22px 0 0;
  font-size: 0.88rem;
  color: var(--ink-soft);
  text-align: center;
}

.results h2 {
  margin: 0 0 6px;
  font-size: 1.25rem;
  color: var(--brand-darker);
}

.summary {
  margin: 0 0 18px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.activity {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.activity:not(.activity-link) {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.activity-link:hover {
  transform: translateY(-2px);
  border-color: var(--brand);
  box-shadow: 0 10px 30px rgba(77, 126, 167, 0.16);
}

.activity-anchor {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.activity-cta {
  margin-top: auto;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--brand-darker);
  padding-top: 8px;
}

.activity h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--ink);
  font-weight: 600;
}

.activity .window {
  font-size: 0.85rem;
  color: var(--brand-darker);
  background: var(--brand-faint);
  padding: 6px 10px;
  border-radius: 999px;
  align-self: flex-start;
}

.activity .desc {
  margin: 0;
  font-size: 0.93rem;
  color: var(--ink-soft);
}

.empty, .error {
  padding: 24px;
  text-align: center;
  color: var(--ink-soft);
  background: var(--brand-faint);
  border-radius: var(--radius);
}

.error { color: #b3261e; background: #fdecea; }
.hidden { display: none; }

.site-footer {
  padding: 32px 20px 48px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

@media (max-width: 480px) {
  .hero { padding: 40px 0 56px; }
  .card { padding: 22px; }
}
