/* Dans of the Lineage, giovannielabs.ai/karate/timeline.html
   A white poster in the Visual Capitalist "Positions of Power" idiom:
   columns = federations with a flag-style logo header, years running down
   both edges, one cut-out head per promotion sitting on its column line
   at the year it was graded, names in condensed caps underneath.
   Layered on styles.css for the navbar only; everything else is light. */

.timeline-page {
  background: #ffffff;
  color: #1c1c1c;
  font-family: 'Barlow', 'Outfit', sans-serif;
}
.timeline-page .navbar { background: rgba(10, 14, 20, 0.92); }

.poster {
  max-width: 1240px;
  margin: 0 auto;
  padding: 44px 20px 24px;
}

/* ---- title block ---- */
.poster-head { text-align: center; margin-bottom: 26px; }
.poster-kicker {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #7a7a7a;
  margin: 0 0 10px;
}
.poster-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 900;
  font-size: clamp(2.2rem, 7.2vw, 5.4rem);
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #111;
  margin: 0;
  padding: 16px 0 14px;
  border-top: 3px double #111;
  border-bottom: 3px double #111;
  display: inline-block;
}
.poster-title em {
  font-style: italic;
  font-weight: 400;
  text-transform: lowercase;
  font-size: 0.62em;
  letter-spacing: 0.02em;
  margin: 0 0.12em;
  vertical-align: 0.1em;
}
.poster-sub {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: #2a2a2a;
  margin: 18px 0 0;
}
.poster-key {
  list-style: none;
  margin: 18px auto 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
}
.poster-key li {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #555;
  display: flex;
  align-items: center;
  gap: 6px;
}
.poster-key i {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: inset 0 0 0 2px #fff, 0 0 0 1px var(--c);
}

.scroll-hint {
  display: none;
  text-align: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8a8a8a;
  margin: 0 0 10px;
}

/* ---- board ---- */
.board-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.board {
  --gutter: 54px;
  --line: #2b2b2b;
  --grid: #d9d9d9;
  display: grid;
  grid-template-columns: var(--gutter) repeat(var(--cols, 5), minmax(150px, 1fr)) var(--gutter);
  min-width: 1040px;
  position: relative;
}
.board > * { min-width: 0; }

/* Federation headers (top and bottom), styled like VC's flag strip. */
.org-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 6px 14px;
  position: relative;
}
.org-head.bottom { padding: 16px 6px 10px; }
.org-flag {
  width: 64px; height: 44px;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 3px 8px rgba(0, 0, 0, 0.12);
  background: #fff;
}
.org-flag.text {
  display: grid; place-items: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.08em;
  color: #fff;
  background: var(--org);
}
.org-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #1c1c1c;
  margin-top: 8px;
}
.org-count {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8a8a8a;
  margin-top: 2px;
}
/* The column line starts under the header flag... */
.org-head.top::after,
.org-head.bottom::before {
  content: '';
  position: absolute;
  left: 50%;
  width: 2px;
  background: var(--line);
  transform: translateX(-50%) scaleY(0);
  transform-origin: top;
  transition: transform 700ms ease;
}
.org-head.top::after { bottom: 0; height: 12px; }
.org-head.bottom::before { top: 0; height: 14px; transform-origin: bottom; }
.board.drawn .org-head.top::after,
.board.drawn .org-head.bottom::before { transform: translateX(-50%) scaleY(1); }

/* Year gutters */
.ylabel {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.98rem;
  color: #1c1c1c;
  padding-top: 6px;
  text-align: right;
  padding-right: 10px;
  border-top: 1px dotted var(--grid);
}
.ylabel.right { text-align: left; padding-right: 0; padding-left: 10px; }
.ylabel.empty { color: #9a9a9a; font-weight: 500; }
.corner { border: 0; }

/* One cell = one federation in one year */
.cell {
  position: relative;
  min-height: 56px;
  border-top: 1px dotted var(--grid);
  padding: 10px 4px 14px;
}
.cell.populated { min-height: 120px; }
/* ... and runs the full height of every cell. */
.cell::before {
  content: '';
  position: absolute;
  left: 50%; top: 0; bottom: 0;
  width: 2px;
  background: var(--line);
  transform: translateX(-50%) scaleY(0);
  transform-origin: top;
  transition: transform 600ms ease;
  transition-delay: var(--draw, 0ms);
}
.board.drawn .cell::before { transform: translateX(-50%) scaleY(1); }
/* Dot on the line marking the promotion year. */
.cell.populated::after {
  content: '';
  position: absolute;
  left: 50%; top: 8px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--line);
  transform: translate(-50%, 0) scale(0);
  transition: transform 350ms cubic-bezier(0.34, 1.56, 0.64, 1) 400ms;
}
.cell.in.populated::after { transform: translate(-50%, 0) scale(1); }

/* Highlighted year band (2026, the three gradings). */
.band-cell { background: #f4f4f2; }
.band-label {
  position: absolute;
  left: 8px; top: 8px;
  font-family: 'Barlow', sans-serif;
  font-size: 0.68rem;
  line-height: 1.25;
  color: #8a8a8a;
  max-width: 120px;
  pointer-events: none;
}

/* Examiner note at the top of a graded cell: gray, dotted leader, VC style. */
.examiner {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px auto 10px;
  width: fit-content;
  max-width: 100%;
  padding: 4px 8px 4px 4px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px dotted #b5b5b5;
  border-radius: 999px;
}
.examiner img {
  height: 40px; width: auto; max-width: 64px;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.3));
}
.examiner div { display: flex; flex-direction: column; line-height: 1.1; }
.ex-k { font-family: 'Barlow', sans-serif; font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase; color: #9a9a9a; }
.ex-n { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 0.82rem; color: #333; }
.ex-d { font-family: 'Barlow', sans-serif; font-size: 0.64rem; color: #7a7a7a; }

/* Heads */
.heads {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 10px 0;
  margin-top: 14px;
}
.head {
  --ring: #F5C518;
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0 -4px;
  width: 78px;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: inherit;
  cursor: pointer;
  position: relative;
  opacity: 0;
  transform: translateY(14px) scale(0.6);
  transition: opacity 420ms ease, transform 560ms cubic-bezier(0.34, 1.56, 0.64, 1);
  transition-delay: calc(var(--i, 0) * 60ms + 150ms);
}
.cell.in .head { opacity: 1; transform: none; }
.head:hover, .head:focus-visible { z-index: 5; }
.head:focus-visible { outline: 2px solid var(--ring); outline-offset: 4px; border-radius: 10px; }
.head-img-wrap { position: relative; height: 66px; display: flex; align-items: flex-end; }
.head-img {
  height: 66px; width: auto; max-width: 74px;
  object-fit: contain;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35));
  transition: transform 180ms ease;
}
.head:hover .head-img, .head:focus-visible .head-img { transform: translateY(-3px) scale(1.08); }
.head-flag {
  position: absolute;
  right: -4px; bottom: 2px;
  width: 20px; height: 14px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px #fff, 0 1px 3px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  background: #eee;
}
.head-flag img { width: 100%; height: 100%; object-fit: cover; display: block; }
.head-first {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 500;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #3a3a3a;
  margin-top: 5px;
  line-height: 1;
}
.head-last {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #111;
  line-height: 1.05;
  text-align: center;
  max-width: 84px;
}
.head-rank {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ring);
  margin-top: 3px;
  padding-top: 2px;
  border-top: 2px solid var(--ring);
  line-height: 1;
}

/* Hover / tap card */
.card {
  position: absolute;
  z-index: 200;
  width: 250px;
  background: #111418;
  color: #f5f1e8;
  border-radius: 12px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
  padding: 12px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  pointer-events: auto;
}
.card[hidden] { display: none; }
.card-head { height: 64px; width: auto; max-width: 70px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.5)); }
.card-name { font-family: 'Cormorant Garamond', serif; font-weight: 500; font-size: 1.12rem; margin: 0; line-height: 1.15; }
.card-line { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ring, #F5C518); margin: 4px 0 0; }
.card-meta { font-family: 'Barlow', sans-serif; font-size: 0.78rem; color: rgba(245,241,232,.7); margin: 4px 0 0; }
.card-link { font-family: 'Barlow', sans-serif; font-size: 0.76rem; color: #F5C518; text-decoration: none; margin-top: 8px; display: inline-block; }
.card-link:hover { text-decoration: underline; }

/* Footer notes */
.poster-foot {
  max-width: 900px;
  margin: 22px auto 0;
  text-align: center;
}
.poster-foot p {
  font-family: 'Barlow', sans-serif;
  font-size: 0.76rem;
  line-height: 1.55;
  color: #6f6f6f;
  margin: 0 0 6px;
}
.poster-foot a { color: #444; }
.timeline-page .page-footer { background: #0a0e14; color: #f5f1e8; margin-top: 32px; }

@media (max-width: 1100px) {
  .scroll-hint { display: block; }
}
@media (max-width: 640px) {
  .poster { padding: 28px 12px 16px; }
  .poster-title { letter-spacing: 0.04em; }
  .poster-sub { font-size: 0.8rem; letter-spacing: 0.18em; }
  /* styles.css shows only the last two nav items on phones: here that is
     Lineage + Game, the nav order is set so the backlink survives. */
  .nav-link { font-size: 0.82rem; }
}
@media (prefers-reduced-motion: reduce) {
  .head, .cell::before, .cell.populated::after, .org-head.top::after, .org-head.bottom::before { transition: none; }
  .head { opacity: 1; transform: none; }
  .cell::before, .org-head.top::after, .org-head.bottom::before { transform: translateX(-50%) scaleY(1); }
  .cell.populated::after { transform: translate(-50%, 0) scale(1); }
}

/* Names sit on a halo so the column line never runs through the type. */
.head-first, .head-last, .head-rank { background: #fff; padding-left: 3px; padding-right: 3px; }
.band-cell .head-first, .band-cell .head-last, .band-cell .head-rank { background: #f4f4f2; }
.cell:not(.populated) { min-height: 44px; }

/* Light chrome: the poster is white, so the navbar and footer go light too. */
.timeline-page .navbar {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid #e3e3e3;
}
.timeline-page .nav-logo,
.timeline-page .nav-link { color: #141414; }
.timeline-page .nav-link { opacity: 0.72; }
.timeline-page .nav-link:hover { opacity: 1; }
.timeline-page .nav-link.nav-game {
  opacity: 1;
  color: #141414;
  background: linear-gradient(135deg, rgba(245, 197, 24, 0.28), rgba(245, 197, 24, 0.12));
  border-color: rgba(214, 170, 10, 0.7);
}
.timeline-page .page-footer {
  background: #ffffff;
  color: #6f6f6f;
  border-top: 1px solid #e3e3e3;
  margin-top: 28px;
}
.timeline-page .page-footer a { color: #444; }

/* Sticky federation strip: a compact copy of the column headers that
   appears once the real header has scrolled away, so a face in 2021 can
   always be read against its federation. Fixed (not sticky) so it takes
   no space in the flow; JS aligns it to the board and follows the
   sideways scroll on phones. */
.org-strip {
  position: fixed;
  z-index: 60;
  top: 64px;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid #e3e3e3;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.07);
  overflow: hidden;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease;
}
.org-strip.on { opacity: 1; transform: none; }
.org-strip-inner {
  display: grid;
  grid-template-columns: var(--gutter, 54px) repeat(var(--cols, 5), minmax(150px, 1fr)) var(--gutter, 54px);
  min-width: 1040px;
  will-change: transform;
}
.strip-org {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 4px;
  min-width: 0;
}
.strip-flag {
  width: 36px; height: 25px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  flex: 0 0 auto;
}
.strip-flag.text {
  display: grid; place-items: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  color: #fff;
  background: var(--org);
}
.strip-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #1c1c1c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.strip-year {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.98rem;
  color: #1c1c1c;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 10px;
}
.strip-year.right { justify-content: flex-start; padding-right: 0; padding-left: 10px; }
@media (max-width: 640px) {
  .strip-flag { width: 30px; height: 21px; }
  .strip-name { font-size: 0.64rem; letter-spacing: 0.08em; }
}
@media (prefers-reduced-motion: reduce) {
  .org-strip { transition: none; }
}

/* College badge on the left shoulder (country flag stays on the right). */
.head-uni {
  position: absolute;
  left: -6px; bottom: 2px;
  width: 20px; height: 14px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px #fff, 0 1px 3px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  background: #fff;
}
.head-uni img { width: 100%; height: 100%; object-fit: cover; display: block; }
.head-uni.contain img { object-fit: contain; padding: 1px; }

/* With a badge on each shoulder the heads need a little air between them. */
.head { margin: 0 2px; }
