/* African City — hub
   Palette and type deliberately match parenting.africancity.ch so the
   districts read as one family. */

@view-transition { navigation: auto; }

:root {
  --paper: #edefe8;
  --chalk: #fbfaf6;
  --ink: #16211c;
  --deep: #22332b;
  --mist: #8b978e;
  --line: rgba(22, 33, 28, 0.18);

  --plum: #6e4b63;
  --moss: #3e5c50;
  --ochre: #a2762c;
  --indigo: #46507d;

  --display: "Petrona", Georgia, serif;
  --body: "IBM Plex Sans", system-ui, sans-serif;
  --gutter: clamp(1.1rem, 5vw, 4rem);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.1; letter-spacing: -0.015em; margin: 0 0 0.5em; text-wrap: balance; }
p { margin: 0 0 1em; max-width: 62ch; text-wrap: pretty; }
a { color: var(--plum); text-underline-offset: 3px; }

:focus-visible { outline: 3px solid var(--plum); outline-offset: 3px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 0; top: 0; z-index: 30; background: var(--ink); color: var(--chalk); padding: 0.6rem 1rem; }

.accent-plum { --accent: var(--plum); }
.accent-moss { --accent: var(--moss); }
.accent-ochre { --accent: var(--ochre); }
.accent-indigo { --accent: var(--indigo); }

/* ---------- top bar ---------- */
.bar {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  padding: 1.1rem var(--gutter);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
}
.bar__mark { font-family: var(--display); font-weight: 700; font-size: 1.2rem; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.bar__mark em { font-style: italic; font-weight: 400; color: var(--mist); }
.bar__meta { font-size: 0.85rem; color: var(--mist); margin: 0; }

/* ---------- hero ---------- */
.hero { padding: clamp(1.8rem, 4vw, 2.8rem) var(--gutter) 0; }
.hero__grid { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 900px) {
  .hero__grid { grid-template-columns: minmax(0, 1.15fr) minmax(20rem, 0.85fr); gap: clamp(2rem, 5vw, 4rem); }
}

.hero h1 { font-size: clamp(2.2rem, 5.4vw, 3.8rem); margin: 0 0 0.35em; max-width: 13ch; }
.hero h1 .outline { color: transparent; -webkit-text-stroke: 1.2px var(--ink); }
.hero__lede { font-size: clamp(1rem, 2vw, 1.14rem); color: #33463c; max-width: 44ch; }
.hero__hint { font-size: 0.88rem; color: var(--mist); margin: 0; }

/* ---------- live panel ---------- */
.panel {
  border: 1px solid var(--line);
  background: var(--chalk);
  display: flex; flex-direction: column;
  container-type: inline-size;
}
.panel__live {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 1.1rem; border-bottom: 1px solid var(--line);
  font-size: 0.82rem; color: var(--mist);
}
.panel__count { margin-left: auto; }
.panel__live .news__dot { background: var(--moss); }

.ticker { position: relative; padding: 1.2rem 1.1rem 1.5rem; min-height: 11rem; display: grid; }
.ticker__item {
  grid-area: 1 / 1;
  display: flex; flex-direction: column; gap: 0.45rem;
  opacity: 0; visibility: hidden;
  transform: translateY(8px);
  transition: opacity 900ms ease, transform 900ms ease, visibility 0s linear 900ms;
  border-left: 3px solid var(--accent);
  padding-left: 0.9rem;
}
.ticker__item.is-showing {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity 900ms ease, transform 900ms ease, visibility 0s;
}
.ticker__meta { font-size: 0.78rem; color: var(--mist); margin: 0; display: flex; gap: 0.5rem; align-items: center; }
.ticker__tag { color: var(--accent); font-weight: 500; }
.ticker__title { font-family: var(--display); font-size: clamp(1.2rem, 2.4vw, 1.5rem); margin: 0; line-height: 1.15; }
.ticker__link { font-size: 0.9rem; font-weight: 500; color: var(--accent); }

.ticker__bar { position: absolute; left: 1.1rem; right: 1.1rem; bottom: 0.9rem; height: 2px; background: var(--line); }
.ticker__bar span { display: block; height: 100%; width: 0; background: color-mix(in srgb, var(--accent, var(--plum)) 55%, transparent); }
@media (prefers-reduced-motion: reduce) { .ticker__bar { display: none; } }

.panel__form { border-top: 1px solid var(--line); padding: 1.1rem; margin: 0; }
.panel__form label { display: block; font-size: 0.9rem; font-weight: 500; margin-bottom: 0.5rem; }
.panel__row { display: flex; gap: 0.5rem; }
.panel__row input {
  flex: 1 1 auto; min-width: 0; font: inherit; padding: 0.6rem 0.7rem;
  border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 2px;
}
.panel__row button {
  font: inherit; font-weight: 500; cursor: pointer; padding: 0.6rem 1.1rem;
  border: 1px solid var(--ink); background: var(--ink); color: var(--chalk); border-radius: 2px;
}
.panel__row button:hover { background: var(--deep); }
.panel__fine { font-size: 0.78rem; color: var(--mist); margin: 0.6rem 0 0; }
.panel__notice { font-size: 0.88rem; background: rgba(110, 75, 99, 0.1); border-left: 3px solid var(--plum); padding: 0.55rem 0.7rem; margin: 0 0 0.7rem; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; }

@container (max-width: 22rem) {
  .panel__row { flex-wrap: wrap; }
  .panel__row button { width: 100%; }
}

/* ---------- the skyline ---------- */
.skyline-wrap {
  padding: clamp(1rem, 3vw, 2rem) var(--gutter) 0;
  position: relative;
}
.skyline {
  display: block; width: 100%; height: auto;
  overflow: visible;
}
.sky-ground { stroke: var(--line); stroke-width: 1; }

.bldg { cursor: pointer; }
.bldg__body {
  fill: var(--chalk);
  stroke: var(--ink);
  stroke-width: 1.5;
  transition: fill 240ms ease;
}
.bldg__roof { fill: var(--chalk); stroke: var(--ink); stroke-width: 1.5; transition: fill 240ms ease; }
.win {
  fill: var(--paper);
  transition: fill 280ms ease;
  transition-delay: calc(var(--wd, 0) * 22ms);
}
.bldg__label {
  font-family: var(--body); font-size: 13px; font-weight: 500;
  fill: var(--ink);
}
.bldg__sub { font-family: var(--body); font-size: 11px; fill: var(--mist); }
.bldg__base { fill: none; stroke: var(--accent, var(--plum)); stroke-width: 0; transition: stroke-width 200ms ease; }

.bldg:hover .bldg__body,
.bldg:focus-visible .bldg__body,
.bldg.is-active .bldg__body { fill: color-mix(in srgb, var(--accent) 12%, var(--chalk)); }
.bldg:hover .win,
.bldg:focus-visible .win,
.bldg.is-active .win { fill: var(--accent); }
.bldg:hover .bldg__base,
.bldg:focus-visible .bldg__base,
.bldg.is-active .bldg__base { stroke-width: 4; }
.bldg--soon .bldg__body { stroke-dasharray: 5 4; }

/* the little marker that walks the ground line */
.sky-marker { fill: var(--accent, var(--plum)); opacity: 0; transition: opacity 200ms ease; }
.bldg.is-active .sky-marker { opacity: 1; }

/* ---------- district cards ---------- */
.section { padding: clamp(2.6rem, 7vw, 4.5rem) var(--gutter); }
.section__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.75rem; margin-bottom: 1.8rem; }
.section__head h2 { font-size: clamp(1.5rem, 4vw, 2.2rem); margin: 0; }
.section__note { color: var(--mist); font-size: 0.92rem; margin: 0; }

.cards { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1060px) { .cards { grid-template-columns: repeat(3, 1fr); } }

.card {
  display: flex; flex-direction: column; gap: 0.5rem;
  background: var(--chalk); padding: 1.5rem 1.4rem;
  text-decoration: none; color: inherit; min-height: 13.5rem;
  border-top: 3px solid transparent;
  transition: background 180ms ease, border-color 180ms ease;
}
.card:hover, .card:focus-visible, .card.is-active { background: #fff; border-top-color: var(--accent); }
.card--closed { cursor: default; }
.card__native { font-size: 0.86rem; color: var(--mist); font-style: italic; }
.card__name { font-family: var(--display); font-size: 1.55rem; margin: 0; }
.card__blurb { font-size: 0.95rem; color: #46564e; margin: 0; flex: 1; }
.card__foot { display: flex; justify-content: space-between; align-items: center; font-size: 0.84rem; gap: 0.6rem; }
.card__status { color: var(--mist); }
.card__status--open { color: var(--moss); font-weight: 500; }
.card__enter { color: var(--accent); font-weight: 500; }

/* scroll-driven reveal, ignored by browsers that lack it */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .card, .news__item {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 5% cover 26%;
    }
    @keyframes rise {
      from { opacity: 0; transform: translateY(14px); }
      to { opacity: 1; transform: none; }
    }
  }
}

/* ---------- notice board carousel ---------- */
.news { background: var(--deep); color: var(--chalk); padding: clamp(2.6rem, 7vw, 4.5rem) 0; }
.news__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 1rem; padding: 0 var(--gutter); margin-bottom: 1.6rem; }
.news__head h2 { color: var(--chalk); font-size: clamp(1.5rem, 4vw, 2.2rem); margin: 0; }
.news__live { font-size: 0.85rem; color: rgba(251, 250, 246, 0.65); margin: 0; display: flex; align-items: center; gap: 0.5rem; }
.news__dot { width: 7px; height: 7px; border-radius: 50%; background: #8fc9a9; }
@media (prefers-reduced-motion: no-preference) {
  .news__dot { animation: pulse 4.5s ease-in-out infinite; }
  @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
}

.rail {
  display: grid; grid-auto-flow: column;
  grid-auto-columns: min(88vw, 27rem);
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 0 var(--gutter) 1.2rem;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }

.news__item {
  scroll-snap-align: start;
  background: color-mix(in srgb, var(--chalk) 8%, transparent);
  border: 1px solid rgba(251, 250, 246, 0.18);
  border-left: 3px solid var(--accent);
  padding: 1.4rem;
  display: flex; flex-direction: column; gap: 0.55rem;
}
.news__meta { font-size: 0.8rem; color: rgba(251, 250, 246, 0.6); display: flex; gap: 0.6rem; align-items: center; margin: 0; }
.news__tag { color: var(--chalk); border: 1px solid rgba(251, 250, 246, 0.3); padding: 0.1rem 0.5rem; border-radius: 2px; }
.news__item h3 { color: var(--chalk); font-size: 1.3rem; margin: 0; }
.news__item p { color: rgba(251, 250, 246, 0.82); font-size: 0.94rem; margin: 0; flex: 1; }
.news__item a { color: #dcc4d4; font-weight: 500; }

.rail__controls { display: flex; align-items: center; gap: 0.6rem; padding: 0 var(--gutter); }
.rail__btn {
  width: 2.4rem; height: 2.4rem; display: grid; place-items: center; cursor: pointer;
  background: transparent; color: var(--chalk); border: 1px solid rgba(251, 250, 246, 0.35);
  border-radius: 50%; font: inherit; line-height: 1;
}
.rail__btn:hover { background: rgba(251, 250, 246, 0.12); }
.rail__btn[disabled] { opacity: 0.3; cursor: default; }
.rail__pips { display: flex; gap: 0.4rem; margin-left: 0.4rem; }
.rail__pip { width: 22px; height: 3px; background: rgba(251, 250, 246, 0.25); border: 0; padding: 0; cursor: pointer; }
.rail__pip[aria-current="true"] { background: var(--chalk); }

/* ---------- footer ---------- */
.foot { padding: clamp(2.5rem, 6vw, 4rem) var(--gutter); border-top: 1px solid var(--line); display: grid; gap: 2rem; }
@media (min-width: 780px) { .foot { grid-template-columns: 1.4fr 1fr; gap: 4rem; } }
.foot h2 { font-size: 1.2rem; }
.foot ul { list-style: none; margin: 0; padding: 0; font-size: 0.95rem; }
.foot li { margin-bottom: 0.35rem; }
.foot .fineprint { font-size: 0.85rem; color: var(--mist); }
