/* TransformersAnimated.com, archive edition.
   Look: late-2000s Cartoon Network bumpers. Flat colour, thick black ink lines, a black and white
   checker strip, hard cel-style offset shadows. No gradients, glows or blur (see DESIGN.md). */

@font-face { font-family: "Chakra Petch"; src: url("/assets/fonts/chakra-petch-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Chakra Petch"; src: url("/assets/fonts/chakra-petch-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible Next"; src: url("/assets/fonts/atkinson-next.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible Next"; src: url("/assets/fonts/atkinson-next-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --ink: #141414;
  --paper: #fcfbf9;
  --sky: #a4b9d8;          /* the old site's background colour */
  --sky-deep: #6d8cc0;
  --cyber: #2350b8;        /* logo blue */
  --autobot: #d8261c;      /* logo red */
  --bee: #ffc914;
  --bridge: #f2681c;       /* space bridge orange */
  --steel: #adadad;        /* old title bar grey */
  --con: #6b2d8f;
  --link: #1a3f99;
  --muted: #4d4d4d;
  --line: 3px solid var(--ink);
  --cel: 5px 5px 0 var(--ink);
  --radius: 14px;
  --head: "Chakra Petch", "Arial Black", Impact, sans-serif;
  --body: "Atkinson Hyperlegible Next", Verdana, Tahoma, sans-serif;
  --gutter: clamp(16px, 3vw, 32px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--sky);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--body);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { color: var(--link); text-decoration-thickness: 2px; text-underline-offset: 2px; }
a:hover { color: var(--autobot); }
:focus-visible { outline: 3px solid var(--bridge); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--head); font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; }
h1 { font-size: clamp(1.9rem, 4.2vw, 3rem); margin: 0 0 0.4em; }
h2 { font-size: clamp(1.3rem, 2.4vw, 1.65rem); margin: 1.4em 0 0.5em; }
h3 { font-size: 1.15rem; margin: 1.2em 0 0.4em; }
hr { border: 0; border-top: 2px dashed var(--steel); margin: 1.2em 0; }
table { border-collapse: collapse; display: block; max-width: 100%; overflow-x: auto; }
td, th { border: 2px solid var(--ink); padding: 0.3em 0.6em; }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--bee); color: var(--ink); padding: 0.5em 1em; border: var(--line); z-index: 10; }
.skip-link:focus { left: 8px; }

/* ---- masthead ---------------------------------------------------------- */
.masthead { background: var(--ink); color: var(--paper); padding: 10px var(--gutter) 0; }
.masthead__bar { display: flex; align-items: center; gap: 12px 24px; flex-wrap: wrap; max-width: 1240px; margin: 0 auto; }
.brand { display: block; line-height: 0; }
.brand img { width: 199px; }
.masthead__note { margin: 0; max-width: 34ch; font-size: 0.95rem; color: #d9d9d9; flex: 1 1 220px; }
.nav-toggle {
  margin-left: auto; font: 700 1rem var(--head); letter-spacing: -0.01em;
  background: var(--bee); color: var(--ink); border: var(--line); border-color: var(--paper);
  border-radius: 999px; padding: 0.45em 1.1em; cursor: pointer;
}
.nav { max-width: 1240px; margin: 12px auto 0; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.nav a {
  display: block; padding: 0.4em 0.9em 0.45em; font: 600 1rem/1.2 var(--head);
  color: var(--ink); background: var(--paper); text-decoration: none;
  border: var(--line); border-bottom: 0; border-radius: 10px 10px 0 0;
}
.nav a:hover { background: var(--bee); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--autobot); color: var(--paper); }

.checker {
  height: 16px;
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Cpath d='M0 0h8v8H0zM8 8h8v8H8z' fill='%23141414'/%3E%3C/svg%3E");
  border-bottom: var(--line);
}

/* ---- page layout ------------------------------------------------------- */
.layout { max-width: 1240px; margin: 0 auto; padding: 28px var(--gutter) 48px; display: grid; gap: 28px; }
.layout--aside { grid-template-columns: minmax(0, 1fr) minmax(250px, 320px); align-items: start; }
.layout__main {
  background: var(--paper); border: var(--line); border-radius: var(--radius); box-shadow: var(--cel);
  padding: clamp(18px, 3vw, 36px); min-width: 0;
}
.layout__main > :first-child, .layout__main > .crumbs + * { margin-top: 0; }
.layout__aside { display: grid; gap: 22px; min-width: 0; }
.layout__aside > .panel__more { margin: 0; }

.crumbs ol { list-style: none; margin: 0 0 1em; padding: 0; display: flex; flex-wrap: wrap; gap: 0 0.5em; font-size: 0.92rem; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 0.5em; color: var(--ink); font-weight: 700; }

.subtitle { margin: -0.3em 0 1em; font: 600 1.1rem/1.4 var(--head); color: var(--muted); }
.lede { font-size: 1.15rem; max-width: 62ch; }
.block { margin: 0 0 1.4em; max-width: 75ch; }
.block.prose, .story { max-width: 72ch; }
.layout__main p { max-width: 72ch; }

/* Panels: the old grey "title bar" boxes, redrawn. */
.panel { background: var(--paper); border: var(--line); border-radius: var(--radius); box-shadow: var(--cel); padding: 0 18px 16px; margin: 0 0 1.4em; overflow: hidden; }
.layout__main .panel { box-shadow: none; }
.panel > h2:first-child {
  margin: 0 -18px 12px; padding: 0.45em 18px; font-size: 1.15rem;
  background: var(--bee); border-bottom: var(--line);
}
.layout__aside .panel:nth-child(3n+2) > h2:first-child { background: var(--sky); }
.layout__aside .panel:nth-child(3n+3) > h2:first-child { background: var(--bridge); }
.panel > h2:first-child::first-letter { text-transform: uppercase; }
.panel__body { font-size: 0.98rem; }
.panel__more { margin: 0.8em 0 0; font-weight: 700; }

/* "On this page" links (character and credit profiles) */
.jump ul { list-style: none; padding: 0; margin: 0 0 1.4em; display: flex; flex-wrap: wrap; gap: 8px; }
.jump a { display: inline-block; padding: 0.25em 0.8em; border: 2px solid var(--ink); border-radius: 999px; background: var(--paper); color: var(--ink); text-decoration: none; font: 600 0.95rem var(--head); }
.jump a:hover { background: var(--bee); }
.profile-section { scroll-margin-top: 16px; max-width: 72ch; }
.profile-section > h2 { border-bottom: 3px solid var(--bee); padding-bottom: 0.15em; display: inline-block; }

/* Character / credit fact box */
.profile__pic { float: left; margin: 0 24px 16px 0; line-height: 0; }
.profile__pic img { border: var(--line); border-radius: 10px; }
.profile__facts { overflow: hidden; background: var(--sky); border: var(--line); border-radius: 10px; padding: 12px 16px; margin-bottom: 1.4em; max-width: 520px; }
.profile__facts strong { font-family: var(--head); }
.layout__main .profile__facts + * { clear: both; }

/* ---- thumbnails, cards and galleries ---------------------------------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 10px; margin: 1em 0 1.6em; }
.gallery a, .gallery > img { display: block; line-height: 0; border: 2px solid var(--ink); border-radius: 8px; overflow: hidden; background: var(--ink); aspect-ratio: 4 / 3; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.15s; }
.gallery > img { box-sizing: border-box; }
.gallery a:hover { box-shadow: 3px 3px 0 var(--autobot); }
.gallery a:hover img { transform: scale(1.04); }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin: 1em 0 1.6em; }
.card { border: var(--line); border-radius: 12px; background: var(--paper); overflow: hidden; display: flex; flex-direction: column; }
.card > a:first-child, .card > img:first-child { line-height: 0; display: block; background: var(--ink); }
.card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.card h2, .card h3 { margin: 0; padding: 0.4em 0.6em; font-size: 1rem; border-top: var(--line); background: var(--bee); }
.card h2 a, .card h3 a { color: var(--ink); text-decoration: none; }
.card:hover { box-shadow: 4px 4px 0 var(--ink); transform: translate(-2px, -2px); }
.card--link a { color: var(--ink); text-decoration: none; display: flex; flex-direction: column; }
.card--link a h2 { order: 2; }
.card--link img { aspect-ratio: 4 / 3; }

.wallpaper { display: inline-grid; grid-template-columns: 200px auto; gap: 12px; align-items: start; margin: 0 18px 18px 0; vertical-align: top; }
.wallpaper img { border: var(--line); border-radius: 8px; }
.wallpaper__sizes { display: flex; flex-direction: column; gap: 6px; }
.wallpaper__sizes a { display: inline-block; padding: 0.15em 0.7em; border: 2px solid var(--ink); border-radius: 999px; background: var(--paper); color: var(--ink); text-decoration: none; font: 600 0.92rem var(--head); white-space: nowrap; }
.wallpaper__sizes a:hover { background: var(--bee); }

/* ---- video ------------------------------------------------------------- */
.player { margin: 1em 0 1.6em; border: var(--line); border-radius: 12px; overflow: hidden; background: var(--ink); color: var(--paper); max-width: 640px; }
.player iframe, .player ruffle-player, .player ruffle-object { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; border: 0; }
.player--youtube iframe { aspect-ratio: 16 / 10; }
.player p { margin: 0; padding: 1.2em; }
.player--missing { background: var(--steel); color: var(--ink); border-style: dashed; }
.clip-group h2 { margin-top: 1.6em; }
.clip-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.clip-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.clip a, .clip--gone { display: flex; flex-direction: column; color: var(--ink); text-decoration: none; border: 2px solid var(--ink); border-radius: 10px; overflow: hidden; background: var(--paper); height: 100%; }
.clip-list .clip a, .clip-list .clip--gone { flex-direction: row; align-items: center; gap: 10px; }
.clip img { display: block; width: 100%; aspect-ratio: 120 / 65; object-fit: cover; background: var(--ink); }
.clip span { padding: 0.4em 0.6em; font: 600 0.95rem/1.3 var(--head); }
.clip small { display: block; font: 400 0.82rem var(--body); color: var(--muted); }
.clip a:hover { background: var(--bee); }
.clip a[aria-current="page"] { background: var(--sky); }
.clip--gone { opacity: 0.7; border-style: dashed; }
.clip-list .clip img { width: 96px; flex: none; }
.clip__nothumb { display: block; aspect-ratio: 120 / 65; background: var(--steel); }

/* ---- news ------------------------------------------------------------- */
.headline-list { margin: 0; padding-left: 1.3em; display: grid; gap: 0.45em; }
.headline-list time { display: block; font-size: 0.85rem; color: var(--muted); }
.headline-list--dated { list-style: none; padding: 0; }
.headline-list--dated li { display: grid; grid-template-columns: 9.5em 1fr; gap: 0 12px; }
.headline-list--dated time { display: inline; font-size: 0.95rem; font-family: var(--head); font-weight: 600; color: var(--ink); }
.layout__aside .headline-list--dated li, .home__news .headline-list--dated li { grid-template-columns: 1fr; }
.year h2 { border-bottom: var(--line); padding-bottom: 0.1em; }
.year--lost li { color: var(--muted); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 2em; }
.pager a { display: block; padding: 0.8em 1em; border: var(--line); border-radius: 12px; color: var(--ink); text-decoration: none; font-weight: 700; }
.pager a:hover { background: var(--bee); }
.pager span { display: block; font: 600 0.85rem var(--head); color: var(--muted); }
.pager__newer { grid-column: 2; text-align: right; }

/* ---- home ------------------------------------------------------------- */
.kind-home .layout__main { background: transparent; border: 0; box-shadow: none; padding: 0; }
.home { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; }
.home > section, .home > div { margin: 0; }
.home__intro { grid-column: 1 / span 8; background: var(--paper); border: var(--line); border-radius: var(--radius); box-shadow: var(--cel); padding: clamp(18px, 3vw, 36px); }
.home__intro h1 { font-size: clamp(2.2rem, 5.5vw, 3.8rem); color: var(--cyber); -webkit-text-stroke: 1px var(--ink); }
.home__intro p { font-size: 1.12rem; }
.home__spotlight { grid-column: 9 / span 4; position: relative; padding-top: 0; }
.home__spotlight a { display: block; color: var(--ink); font-weight: 700; text-decoration: none; }
.home__spotlight a img { display: block; width: 100%; border: var(--line); border-radius: 8px; margin: 70px 0 8px; }
.home__spotlight a:hover span { text-decoration: underline; }
.home__skyspy { position: absolute; top: 52px; left: 50%; translate: -50% 0; animation: hover 3s ease-in-out infinite; }
@keyframes hover { 50% { translate: -50% -6px; } }
.home__guide { grid-column: 1 / span 7; background: var(--ink); color: var(--paper); border-radius: var(--radius); padding: 6px clamp(16px, 2.5vw, 28px) 18px; }
.home__guide h2 { color: var(--bee); }
.guide { list-style: none; margin: 0; padding: 0; }
.guide a { display: grid; grid-template-columns: 8.5em 1fr; gap: 12px; padding: 0.55em 0; border-top: 2px solid #3a3a3a; color: var(--paper); text-decoration: none; }
.guide li:first-child a { border-top: 0; }
.guide__name { font: 700 1.1rem var(--head); color: var(--bee); }
.guide a:hover .guide__name { color: var(--bridge); }
.guide__what { color: #dedede; }
.home__news { grid-column: 8 / span 5; margin: 0; }
.home__features { grid-column: 1 / -1; display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 24px; }
.feature { display: grid; grid-template-rows: auto 1fr; background: var(--paper); border: var(--line); border-radius: var(--radius); overflow: hidden; }
.feature img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-bottom: var(--line); background: var(--ink); }
.feature:first-child { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
.feature:first-child img { height: 100%; border-bottom: 0; border-right: var(--line); }
.feature > div { padding: 0 16px 14px; }
.feature h2 { font-size: 1.2rem; margin: 0.8em 0 0.4em; }
.feature p { margin: 0; font-size: 0.98rem; }
.poll { grid-column: 1 / span 7; }
.poll__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.poll__list li { display: grid; grid-template-columns: 10em 1fr 8.5em; gap: 10px; align-items: center; }
.poll__label { font-weight: 700; }
.poll__bar { height: 18px; border: 2px solid var(--ink); border-radius: 999px; background: var(--paper); position: relative; overflow: hidden; }
.poll__bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--pct); background: var(--autobot); }
.poll__list li:nth-child(2) .poll__bar::after { background: var(--bridge); }
.poll__list li:nth-child(n+3) .poll__bar::after { background: var(--cyber); }
.poll__num { font: 600 0.95rem var(--head); }
.poll__num small { font: 400 0.8rem var(--body); color: var(--muted); }
.home__aired { grid-column: 8 / span 5; }
.aired { margin: 0; padding-left: 1.2em; }

/* ---- 404 -------------------------------------------------------------- */
.lost { display: grid; grid-template-columns: minmax(0, 393px) 1fr; gap: 28px; align-items: center; }

/* ---- footer ----------------------------------------------------------- */
.footer { background: var(--ink); color: #dedede; margin-top: 24px; }
.footer__skyline { display: block; width: 100%; height: auto; background: var(--sky); margin-top: -1px; }
.footer__inner { max-width: 1240px; margin: 0 auto; padding: 24px var(--gutter) 36px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; font-size: 0.95rem; }
.footer a { color: var(--bee); }
.footer a:hover { color: var(--paper); }
.footer__legal { color: #b5b5b5; }

/* ---- lightbox (site.js) ----------------------------------------------- */
.lightbox { border: var(--line); border-color: var(--paper); border-radius: var(--radius); padding: 0; background: var(--ink); color: var(--paper); max-width: min(96vw, 1100px); }
.lightbox::backdrop { background: rgb(20 20 20 / 0.88); }
.lightbox figure { margin: 0; display: grid; }
.lightbox img { display: block; max-width: 100%; max-height: 78vh; margin: 0 auto; object-fit: contain; }
.lightbox figcaption { padding: 10px 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; border-top: 2px solid #3a3a3a; }
.lightbox__count { margin-right: auto; font: 600 0.95rem var(--head); }
.lightbox button, .lightbox a.lightbox__open {
  font: 700 0.95rem var(--head); background: var(--paper); color: var(--ink); border: 2px solid var(--paper);
  border-radius: 999px; padding: 0.3em 0.9em; cursor: pointer; text-decoration: none;
}
.lightbox button:hover, .lightbox a.lightbox__open:hover { background: var(--bee); }

/* ---- small screens ---------------------------------------------------- */
@media (max-width: 960px) {
  .layout--aside { grid-template-columns: minmax(0, 1fr); }
  .home__intro, .home__spotlight, .home__guide, .home__news, .poll, .home__aired { grid-column: 1 / -1; }
  .home__features { grid-template-columns: 1fr 1fr; }
  .feature:first-child { grid-column: 1 / -1; }
  .footer__inner { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 1rem; }
  .js .nav-toggle { display: inline-block; }
  .js .nav:not(.is-open) { display: none; }
  .nav ul { display: grid; grid-template-columns: 1fr 1fr; padding-bottom: 12px; }
  .nav a { border-bottom: var(--line); border-radius: 10px; }
  .brand img { width: 160px; }
  .masthead__note { display: none; }
  .home__features { grid-template-columns: 1fr; }
  .feature:first-child { grid-template-columns: 1fr; }
  .feature:first-child img { border-right: 0; border-bottom: var(--line); }
  .headline-list--dated li { grid-template-columns: 1fr; }
  .guide a { grid-template-columns: 1fr; gap: 0; }
  .poll__list li { grid-template-columns: 1fr; gap: 2px; }
  .profile__pic { float: none; margin-right: 0; }
  .wallpaper { grid-template-columns: 1fr; margin-right: 0; }
  .lost { grid-template-columns: 1fr; }
  .pager { grid-template-columns: 1fr; }
  .pager__newer { grid-column: 1; text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
