/* Rook / population prototype 01
   A scroll-controlled comparison inside the Falcopolis Background ecosystem. */

.page-rook{
  --rook-night: #171714;
  --rook-night-soft: #22231f;
  --rook-map: #aaa997;
  --rook-map-edge: #e8e0cf;
  --rook-river: #819da0;
  --rook-text: #f1eadc;
  --rook-muted: rgba(241, 234, 220, .60);
  --rook-panel: #b9c8bd;
  --rook-panel-ink: #161a17;
  --rook-black: #171816;
  --rook-falcon: #e15c3d;
  --rook-box: #e0b951;
  --rook-border: rgba(241, 234, 220, .17);
  --rook-header-h: 62px;

  margin: 0;
  color: var(--rook-text);
  background: var(--rook-night);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.page-rook .sr-only{
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.rook-skip-link{
  position: fixed;
  top: 10px;
  left: -9999px;
  z-index: 500;
  padding: 10px 14px;
  color: var(--rook-night);
  background: var(--rook-text);
}

.rook-skip-link:focus{ left: 10px; }

/* Shared header, re-skinned for this page. */
.page-rook .site-header{
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--rook-header-h);
  color: var(--rook-text);
  background: linear-gradient(90deg, var(--rook-panel) 0 320px, rgba(23, 23, 20, .89) 320px 100%);
  border-bottom: 1px solid var(--rook-border);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.page-rook .site-header__inner{
  height: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 10px 16px;
}

.page-rook .site-header__brand{
  display: inline-flex;
  align-items: center;
  color: var(--rook-panel-ink);
  text-decoration: none;
}

.page-rook .site-header__brandmark{
  display: block;
  width: 154px;
  height: 34px;
  background: currentColor;
  -webkit-mask: url("/assets/shared/icons/falcopolis-H-600.svg") center / contain no-repeat;
  mask: url("/assets/shared/icons/falcopolis-H-600.svg") center / contain no-repeat;
}

.page-rook .site-header__brandtext{ display: none; }

.page-rook .site-header__nav{
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.page-rook .site-header__link,
.page-rook .site-header__back{
  color: var(--rook-muted);
  text-decoration: none;
  font-size: 13px;
  line-height: 1;
  border-radius: 999px;
}

.page-rook .site-header__link{ padding: 8px 10px; }

.page-rook .site-header__link:hover,
.page-rook .site-header__link.is-current,
.page-rook .site-header__link[aria-current="page"]{
  color: var(--rook-text);
  background: rgba(241, 234, 220, .10);
}

.page-rook .site-header__right{
  display: flex;
  justify-content: flex-end;
}

.page-rook .site-header__back{
  padding: 9px 12px;
  border: 1px solid var(--rook-border);
}

.page-rook .site-header__link:focus-visible,
.page-rook .site-header__back:focus-visible,
.rook-intro__parent:focus-visible,
.rook-play:focus-visible,
.rook-reset:focus-visible,
.rook-progress input:focus-visible{
  outline: 2px solid var(--rook-text);
  outline-offset: 3px;
}

.rook-story{ position: relative; }

.rook-shell{
  position: sticky;
  top: 0;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  box-sizing: border-box;
  height: 100vh;
  min-height: 100vh;
  padding-top: var(--rook-header-h);
  overflow: hidden;
}

.rook-scroll-space{
  height: 430vh;
  pointer-events: none;
}

.rook-intro{
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 20px;
  box-sizing: border-box;
  height: calc(100vh - var(--rook-header-h));
  padding: 28px 24px 18px;
  color: var(--rook-panel-ink);
  background: var(--rook-panel);
  border-right: 1px solid rgba(22, 26, 23, .18);
}

.rook-intro__parent{
  display: inline-block;
  color: currentColor;
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .13em;
}

.rook-intro__title{
  margin: 12px 0 0;
  font-size: clamp(56px, 5vw, 76px);
  line-height: .82;
  font-weight: 760;
  letter-spacing: -.075em;
}

.rook-intro__latin{
  margin: 10px 0 0;
  font-size: 11px;
  font-style: italic;
  letter-spacing: .04em;
  opacity: .58;
}

.rook-intro__lede{
  max-width: 27ch;
  margin: 15px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: rgba(22, 26, 23, .72);
}

.rook-series{
  align-self: start;
  display: grid;
  border-top: 1px solid rgba(22, 26, 23, .22);
}

.rook-series__item{
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 2px 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(22, 26, 23, .22);
}

.rook-series__swatch{
  grid-row: 1 / span 2;
  display: block;
  width: 28px;
  height: 5px;
}

.rook-series__swatch.is-rook{ background: var(--rook-black); }
.rook-series__swatch.is-falcon{ background: var(--rook-falcon); }

.rook-series__item strong{
  font-size: 13px;
  line-height: 1.15;
}

.rook-series__item span:last-child{
  font-size: 9px;
  opacity: .62;
}

.rook-series__note{
  margin: 13px 0 0;
  max-width: 26ch;
  font-size: 10.5px;
  line-height: 1.42;
  color: rgba(22, 26, 23, .67);
}

.rook-intro__note{
  align-self: end;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
  font-size: 9px;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: .08em;
  border-top: 1px solid rgba(22, 26, 23, .22);
}

.rook-panel{
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  height: calc(100vh - var(--rook-header-h));
  background: var(--rook-night);
}

.rook-visual{
  position: relative;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 22% 46%, rgba(185, 200, 189, .075), transparent 30%),
    radial-gradient(circle at 78% 54%, rgba(225, 92, 61, .04), transparent 25%),
    var(--rook-night);
}

.rook-visual__svg{
  display: block;
  width: 100%;
  height: 100%;
}

.rook-visual__status{
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 6;
  transform: translate(-50%, -50%);
  color: var(--rook-muted);
  font-size: 12px;
}

.rook-visual__status[hidden]{ display: none; }

.rook-year{
  position: absolute;
  top: 22px;
  right: 22px;
  display: grid;
  justify-items: end;
  gap: 1px;
  pointer-events: none;
}

.rook-year span{
  color: var(--rook-muted);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .13em;
}

.rook-year strong{
  font-size: clamp(30px, 4vw, 58px);
  line-height: .95;
  font-weight: 520;
  letter-spacing: -.05em;
  font-variant-numeric: tabular-nums;
}

.rook-values{
  position: absolute;
  top: 22px;
  left: 22px;
  display: flex;
  gap: 8px;
  pointer-events: none;
}

.rook-value{
  min-width: 132px;
  padding: 9px 11px 10px;
  background: rgba(23, 23, 20, .78);
  border: 1px solid var(--rook-border);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.rook-value span,
.rook-value small{
  display: block;
  color: var(--rook-muted);
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: .09em;
}

.rook-value strong{
  display: block;
  margin: 4px 0 3px;
  font-size: 17px;
  line-height: 1;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
}

.rook-value.is-rook{ border-top: 3px solid var(--rook-map-edge); }
.rook-value.is-falcon{ border-top: 3px solid var(--rook-falcon); }

.rook-chapter{
  position: absolute;
  left: 22px;
  bottom: 24px;
  z-index: 5;
  display: grid;
  max-width: 380px;
  gap: 5px;
  padding-left: 14px;
  color: var(--rook-text);
  border-left: 2px solid var(--rook-panel);
  pointer-events: none;
}

.rook-chapter__index{
  color: var(--rook-panel);
  font-size: 10px;
  letter-spacing: .12em;
}

.rook-chapter strong{
  font-size: clamp(20px, 2.1vw, 31px);
  line-height: 1.04;
  font-weight: 520;
  letter-spacing: -.035em;
}

.rook-chapter span:last-child{
  color: var(--rook-muted);
  font-size: 12px;
  line-height: 1.42;
}

.rook-visual__key{
  position: absolute;
  right: 22px;
  bottom: 24px;
  display: grid;
  justify-items: end;
  gap: 2px;
  color: var(--rook-muted);
  font-size: 8.5px;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: .08em;
  pointer-events: none;
}

/* SVG map and chart */
.rook-country{
  fill: var(--rook-map);
  stroke: var(--rook-map-edge);
  stroke-width: 1.1;
  vector-effect: non-scaling-stroke;
}

.rook-river{
  fill: none;
  stroke: var(--rook-river);
  stroke-width: .75;
  opacity: .66;
  vector-effect: non-scaling-stroke;
}

.rook-colony{
  fill: var(--rook-black);
  stroke: rgba(241, 234, 220, .52);
  stroke-width: .55;
  vector-effect: non-scaling-stroke;
}

.rook-nest-box{
  fill: none;
  stroke: var(--rook-box);
  stroke-width: 1.25;
  vector-effect: non-scaling-stroke;
}

.rook-map-label,
.rook-chart-label,
.rook-axis-label,
.rook-point-label{
  font-family: inherit;
  pointer-events: none;
}

.rook-map-label{
  fill: rgba(23, 23, 20, .72);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .12em;
}

.rook-chart-title{
  fill: var(--rook-text);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.rook-axis text{
  fill: var(--rook-muted);
  font-size: 8.5px;
}

.rook-axis path,
.rook-axis line{
  stroke: var(--rook-border);
}

.rook-grid line{
  stroke: rgba(241, 234, 220, .09);
}

.rook-grid path{ display: none; }

.rook-series-base{
  fill: none;
  stroke: rgba(241, 234, 220, .14);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.rook-series-line{
  fill: none;
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
}

.rook-series-line.is-rook{ stroke: var(--rook-map-edge); }
.rook-series-line.is-falcon{ stroke: var(--rook-falcon); }

.rook-series-point{
  stroke: var(--rook-night);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.rook-series-point.is-rook{ fill: var(--rook-map-edge); }
.rook-series-point.is-falcon{ fill: var(--rook-falcon); }

.rook-cursor{
  stroke: var(--rook-panel);
  stroke-width: 1;
  stroke-dasharray: 3 4;
  opacity: .68;
  vector-effect: non-scaling-stroke;
}

.rook-cursor-point{
  fill: var(--rook-night);
  stroke-width: 2.25;
  vector-effect: non-scaling-stroke;
}

.rook-cursor-point.is-rook{ stroke: var(--rook-map-edge); }
.rook-cursor-point.is-falcon{ stroke: var(--rook-falcon); }

.rook-chart-legend text{
  fill: var(--rook-muted);
  font-size: 8.5px;
}

.rook-chart-legend line{
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

.rook-chart-legend .is-rook{ stroke: var(--rook-map-edge); }
.rook-chart-legend .is-falcon{ stroke: var(--rook-falcon); }

.rook-controls{
  display: none;
  grid-template-columns: auto minmax(100px, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--rook-text);
  background: var(--rook-night-soft);
  border-top: 1px solid var(--rook-border);
}

.rook-play,
.rook-reset{
  color: inherit;
  background: transparent;
  border: 1px solid var(--rook-border);
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 11px;
  cursor: pointer;
}

.rook-play{
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.rook-progress input{
  width: 100%;
  accent-color: var(--rook-falcon);
}

.rook-detail{
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 9px 16px 10px;
  color: var(--rook-muted);
  background: var(--rook-night-soft);
  border-top: 1px solid var(--rook-border);
  font-size: 9px;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: .065em;
}

.rook-source{
  position: relative;
  z-index: 3;
  padding: 18px 22px;
  color: rgba(241, 234, 220, .68);
  background: #10110f;
  border-top: 1px solid var(--rook-border);
}

.rook-source p{
  max-width: 1100px;
  margin: 0;
  font-size: 10.5px;
  line-height: 1.5;
}

.rook-source a{ color: var(--rook-text); }

@media (max-width: 1100px){
  .rook-values{
    top: 16px;
    left: 16px;
  }

  .rook-value{ min-width: 112px; }
  .rook-chapter{ left: 16px; bottom: 18px; max-width: 310px; }
  .rook-visual__key{ right: 16px; bottom: 18px; }
}

@media (max-width: 980px){
  .page-rook .site-header{
    position: sticky;
    height: auto;
    min-height: var(--rook-header-h);
    background: var(--rook-night);
  }

  .page-rook .site-header__inner{
    min-height: var(--rook-header-h);
    height: auto;
  }

  .rook-shell{
    position: relative;
    display: block;
    height: auto;
    min-height: 0;
    padding-top: 0;
    overflow: visible;
  }

  .rook-scroll-space{ display: none; }

  .rook-intro{
    height: auto;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) minmax(220px, .75fr);
    grid-template-rows: auto auto;
    padding: 28px 22px 20px;
  }

  .rook-intro__note{ grid-column: 1 / -1; }

  .rook-panel{
    height: auto;
    min-height: 720px;
    grid-template-rows: minmax(560px, 72vh) auto auto;
  }

  .rook-controls{ display: grid; }
}

@media (max-width: 720px){
  .page-rook .site-header__inner{
    grid-template-columns: 1fr auto;
    gap: 9px 12px;
  }

  .page-rook .site-header__brandmark{
    width: 122px;
    height: 28px;
  }

  .page-rook .site-header__nav{
    grid-column: 1 / -1;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  .page-rook .site-header__right{
    grid-column: 2;
    grid-row: 1;
  }

  .rook-intro{
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 18px;
    padding: 24px 18px 16px;
  }

  .rook-intro__title{ font-size: 56px; }

  .rook-panel{
    min-height: 680px;
    grid-template-rows: minmax(500px, 68vh) auto auto;
  }

  .rook-year{
    top: 14px;
    right: 14px;
  }

  .rook-values{
    top: 72px;
    left: 14px;
    right: 14px;
    gap: 5px;
  }

  .rook-value{
    min-width: 0;
    flex: 1 1 0;
    padding: 8px 9px;
  }

  .rook-value strong{ font-size: 14px; }

  .rook-chapter{
    left: 14px;
    right: 14px;
    bottom: 46px;
    max-width: none;
  }

  .rook-chapter strong{ font-size: 22px; }
  .rook-chapter span:last-child{ font-size: 10.5px; }

  .rook-visual__key{
    right: 14px;
    bottom: 12px;
  }

  .rook-controls{
    grid-template-columns: 1fr auto;
  }

  .rook-progress{
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .rook-detail{ display: none; }
}

@media (prefers-reduced-motion: reduce){
  .rook-colony,
  .rook-nest-box,
  .rook-series-point{
    transition: none !important;
  }
}
