/* Two architectural models cut directly from the game's 16:9 city renders.
   Keep the photographed streets in their physical orientation in both directions. */
.model-table {
  --accent: #deac65;
  --rule: #4b605a;
  --muted-ink: #bed0c8;
  position: relative;
  isolation: isolate;
  overflow-x: clip;
  color: #f5edda;
  background: radial-gradient(ellipse at 49% 82%, #203e3b, transparent 62%), #0d2022;
  border-block: 1px solid #42534c;
}
.model-table--empire {
  --accent: #91431d;
  --rule: #aa9673;
  --muted-ink: #4f594e;
  color: #173c39;
  background: radial-gradient(ellipse at 48% 32%, #f8efd8, transparent 64%), #e7d9b8;
  border-color: #bda981;
}
.model-table__in {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 2.46fr) minmax(0, .79fr);
  align-items: center;
  gap: clamp(1rem, 3.5vw, 3rem);
  padding-block: clamp(1.15rem, 2vw, 1.85rem);
}
.model-table__exhibit {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.36fr);
  align-items: center;
  gap: inherit;
}
.model-table__label { min-width: 0; }
.model-table__legend {
  display: flex;
  align-items: center;
  gap: .7rem;
  color: var(--accent);
  font-size: .73rem;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.model-table__legend::before { content: ""; width: 1.75rem; height: 2px; flex: none; background: currentColor; }
.model-table__title {
  margin-block: .35rem .25rem;
  font-family: "DM Serif Display", "Cairo", Georgia, serif;
  font-size: clamp(2.8rem, 5.6vw, 5.35rem);
  font-weight: 400;
  line-height: .99;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.model-table__place, .model-table__caption span {
  display: block;
  color: var(--muted-ink);
  font-size: clamp(.92rem, 1.25vw, 1.1rem);
  line-height: 1.5;
}
.model-table__action, .model-table__links a {
  display: inline-flex;
  align-items: center;
  gap: .9em;
  min-height: 44px;
  font: inherit;
  font-size: .92rem;
  font-weight: 550;
  line-height: 1.4;
}
.model-table__action { margin-block-start: .65rem; color: var(--accent); }
.model-table__action span:first-child { text-decoration: underline; text-underline-offset: .3em; text-decoration-thickness: 1px; }
.model-table__action:is(:hover, :focus-visible) span:first-child { text-decoration-thickness: 2px; }
.model-table__action::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.model-table__action:focus-visible, .model-table__links a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.model-table__arrow { direction: ltr; display: inline-block; color: var(--accent); font-family: Arial, sans-serif; }
[dir="rtl"] .model-table__arrow { transform: scaleX(-1); }
.model-table__magnify { font: 1.22rem/1 "Jost", sans-serif; }
.model-table__links { position: relative; z-index: 2; }
.model-table__links li { border-block-start: 1px solid var(--rule); }
.model-table__links li:last-child { border-block-end: 1px solid var(--rule); }
.model-table__links a { width: 100%; justify-content: space-between; overflow-wrap: anywhere; }
.model-table__links a:hover, .model-table__action:hover { color: var(--accent); }
.model-table__links a:hover span:first-child { text-decoration: underline; text-underline-offset: .25em; }
.model-table__caption { position: relative; padding-block-start: .85rem; border-block-start: 1px solid var(--rule); }
.model-table__caption::before {
  content: ""; position: absolute; inset-block-start: -3px; inset-inline-start: 0;
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
}
.model-table__caption b { font-size: 1.15rem; font-weight: 650; }
.city-model {
  position: relative;
  justify-self: center;
  width: 100%;
  max-width: 24rem;
  direction: ltr;
  pointer-events: none;
}
.city-model--giza {
  aspect-ratio: 505 / 352;
  --surface: polygon(0.79% 53.41%, 41.58% 1.42%, 99.21% 36.08%, 60% 93.47%);
  --near-face: polygon(0.79% 53.41%, 60% 93.47%, 60% 98.86%, 0.79% 58.81%);
  --far-face: polygon(60% 93.47%, 99.21% 36.08%, 99.21% 41.48%, 60% 98.86%);
  --photo-width: 158.4158%;
  --photo-left: -9.505%;
  --photo-top: -16.4773%;
}
.city-model--midtown {
  aspect-ratio: 215 / 333;
  --surface: polygon(
    0.93% 79.88%, 26.05% 54.05%, 24.19% 56.76%, 24.19% 54.8%, 25.12% 54.65%,
    25.35% 47.9%, 26.05% 47.45%, 26.74% 47.3%, 26.74% 28.98%, 26.74% 27.93%,
    28.14% 27.33%, 28.84% 26.88%, 28.84% 22.52%, 29.53% 21.77%, 32.56% 21.02%,
    32.56% 17.87%, 33.26% 17.42%, 33.95% 17.12%, 35.58% 15.77%, 39.53% 16.22%,
    40.47% 15.92%, 40.7% 11.86%, 41.16% 11.71%, 41.63% 8.86%, 42.09% 8.26%,
    42.33% 7.36%, 43.02% 7.06%, 43.95% 6.61%, 44.42% 5.71%, 44.65% 3.9%,
    44.88% 2.1%, 45.12% 1.95%, 45.35% 4.95%, 45.58% 5.71%, 45.81% 6.31%,
    47.21% 6.91%, 47.67% 7.66%, 47.91% 7.96%, 47.91% 9.46%, 48.37% 10.36%,
    48.6% 14.11%, 51.63% 14.56%, 52.56% 15.17%, 55.58% 15.47%, 57.44% 16.37%,
    57.44% 20.12%, 58.84% 20.87%, 59.3% 21.62%, 59.53% 26.73%, 60.23% 27.33%,
    61.16% 28.53%, 61.16% 43.69%, 62.33% 43.99%, 63.49% 44.89%, 63.72% 50.75%,
    65.12% 51.65%, 65.81% 52.7%, 65.81% 56.91%, 98.6% 62.76%, 61.86% 95.8%
  );
  --near-face: polygon(0.93% 79.88%, 61.86% 95.8%, 61.86% 99.7%, 0.93% 83.78%);
  --far-face: polygon(61.86% 95.8%, 98.6% 62.76%, 98.6% 66.67%, 61.86% 99.7%);
  --photo-width: 372.093%;
  --photo-left: -114.8837%;
  --photo-top: -23.7237%;
  max-width: 11.4rem;
}
/* The base, sides and surface share one coordinate system. The Midtown mask
   follows the setbacks and antenna above the rear edge of its street block. */
.city-model::before {
  content: ""; position: absolute; left: -15%; right: -15%; bottom: 2%; height: 73%;
  background-image: linear-gradient(#a7ba98 1px, transparent 1px), linear-gradient(90deg, #a7ba98 1px, transparent 1px);
  background-size: 24px 24px; opacity: .23;
  transform: rotateX(55deg) rotateZ(-30deg);
  mask-image: radial-gradient(ellipse, #000 12%, transparent 74%);
}
.model-table--empire .city-model::before { filter: brightness(.42); }
.city-model__block, .city-model__surface, .city-model__block::before, .city-model__block::after { position: absolute; inset: 0; }
.city-model__block { filter: drop-shadow(4px 9px 5px rgb(0 0 0 / 35%)); }
.city-model__block::before, .city-model__block::after {
  content: "";
  background: repeating-linear-gradient(7deg, transparent 0 3px, #f3d9a227 3.5px 4px, transparent 4.5px 7px), #9d744a;
  clip-path: var(--near-face);
}
.city-model__block::after {
  background: repeating-linear-gradient(-8deg, transparent 0 3px, #d8bf8b2e 3.5px 4px, transparent 4.5px 7px), #69563d;
  clip-path: var(--far-face);
}
.city-model__surface { z-index: 1; overflow: hidden; clip-path: var(--surface); }
.city-model__surface img {
  position: absolute; left: var(--photo-left); top: var(--photo-top);
  width: var(--photo-width); max-width: none; height: auto;
}
:lang(ar) .model-table__title { font-family: "Cairo", sans-serif; font-weight: 650; line-height: 1.32; }
@media (min-width: 761px) {
  .model-table--empire .model-table__in {
    --column-gap: clamp(1rem, 3.5vw, 3rem);
    --model-width: 11.4rem;
    --caption-space: clamp(1.5rem, 8vw, 7rem);
    --facade-inset: 4.6rem;
    column-gap: var(--column-gap);
  }
  [dir="rtl"] .model-table--empire .model-table__in { --facade-inset: 3.25rem; }
  .model-table--empire .model-table__exhibit {
    grid-template-columns: minmax(0, 1fr) var(--model-width);
    padding-inline-end: var(--caption-space);
  }
  /* Measure the leader from the tower's facade to its caption. Only the
     type changes sides in RTL; the left and right faces of the tower do not. */
  .model-table__caption {
    --leader: calc(var(--column-gap) + var(--caption-space) + var(--facade-inset) - .75rem - 2.5px);
    padding: 0;
    border: 0;
  }
  .model-table__caption::before {
    inset-inline-start: auto;
    inset-inline-end: calc(100% + .75rem + var(--leader));
    inset-block-start: .84rem;
  }
  .model-table__caption::after {
    content: "";
    position: absolute;
    inset-block-start: 1rem;
    inset-inline-end: calc(100% + .75rem);
    width: var(--leader);
    border-block-start: 1px solid var(--rule);
  }
}
@media (max-width: 760px) {
  .model-table__in { grid-template-columns: minmax(0, 1fr); gap: .55rem; padding-block: 1.2rem .7rem; }
  .model-table__exhibit { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); column-gap: 1rem; }
  .model-table__links, .model-table__caption { grid-column: 1 / -1; }
  .model-table__links { display: flex; flex-wrap: wrap; gap: 0 1.3rem; border-block-start: 1px solid var(--rule); }
  .model-table__links li, .model-table__links li:last-child { border: 0; }
  .model-table__links a { gap: .55em; }
  .model-table__caption { display: flex; align-items: baseline; flex-wrap: wrap; gap: .2em .8em; padding-block: .6rem .2rem; }
  .model-table__caption b { font-size: 1rem; }
  .city-model--giza { max-width: 17rem; }
  .city-model--midtown { max-width: 8.25rem; }
}
@media (max-width: 480px) {
  .model-table__exhibit { column-gap: .5rem; }
  .model-table__legend { font-size: .66rem; gap: .42rem; letter-spacing: .1em; }
  .model-table__legend::before { width: .85rem; }
  .model-table__title { font-size: clamp(2rem, 8.5vw, 2.9rem); }
  .model-table__action, .model-table__links a { font-size: .85rem; }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .city-model__block { transition: transform .24s ease-out; }
  .model-table__in:has(.model-table__action:hover, .model-table__action:focus-visible) .city-model__block { transform: translateY(-4px); }
}
