/* The Mega Dimension page: additions on top of wot.css (the Flatfoot Labs
   system) and assets/cards/cards.css (the Mega card carousel). Every class
   here is md-, apart from the g- step cards borrowed from the rift tester
   guide; the ff- classes are used as they are. The home page loads this file
   too, for its Mega Dimension band; nothing in it restyles an ff- class.

   The one idea: inside the Mega Dimension the world is drained of colour and
   only the Pokémon keep theirs. So this page's paper is gray, and colour is
   reserved for sprites, the violet rift and the gold clock. The cream paper
   comes back at the very end, where the page tears and hands you home. */

/* ── drained paper ──────────────────────────────────────────────────── */
.md-drained {
  --paper: #e9e7e3;
  --paper-card: #f4f2ee;
  --ink-soft: #47434d;
  --ink-faint: #67626d;
}
.md-home { --paper: #f5ecda; --paper-card: #fffaf0; --ink-soft: #433b49; --ink-faint: #6b6172; }

/* ── hero ───────────────────────────────────────────────────────────── */
.md-hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 48px; align-items: center; max-width: 1200px; margin: 0 auto; padding: 36px 40px 72px; }
.md-hero-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 22px; min-width: 0; }
/* The wordmark: the site's display face, ink, with the EN torn open in
   violet and gold. One size for both lines, so DIMENSION sets the width. */
.md-lockup { display: flex; flex-direction: column; margin: -8px 0 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(60px, 10.6vw, 134px); line-height: .9; letter-spacing: .005em; text-transform: uppercase; color: var(--ink); }
.md-lockup span { display: block; white-space: nowrap; }
.md-lockup em { font-style: normal; background: linear-gradient(180deg, var(--violet-glow), var(--violet) 55%, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.md-hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; }
.md-hero-facts { display: grid; grid-template-columns: repeat(4, max-content); gap: 16px 22px; margin-top: 6px; }
.md-hero-facts > div { display: flex; flex-direction: column; gap: 2px; }
.md-hero-facts b { font-family: var(--font-display); font-weight: 400; font-size: 30px; line-height: 1; letter-spacing: .02em; color: var(--violet); }
.md-hero-facts span { font-size: 13px; line-height: 17px; color: var(--ink-soft); }

.md-shot { position: relative; margin: 0; border: 4px solid var(--ink); box-shadow: 14px 14px 0 var(--violet); background: var(--night); min-width: 0; }
.md-shot img { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.md-shot figcaption { padding: 10px 14px; background: var(--ink); color: var(--on-night-soft); font-family: var(--font-pixel); font-size: 8px; line-height: 12px; display: flex; justify-content: space-between; gap: 10px; }
.md-shot figcaption span { color: var(--gold); }

/* The in-game HUD, drawn live. The game draws it top-left in a notched box;
   the colon is the one coloured thing in it. Gold under ten seconds, violet
   at zero, which are the game's own states. */
.md-hud { position: absolute; top: 12px; left: 12px; z-index: 2; display: inline-flex; align-items: baseline; font-family: var(--font-pixel); font-size: 18px; line-height: 1; padding: 11px 13px 9px; background: var(--night); color: var(--on-night); font-variant-numeric: tabular-nums; clip-path: polygon(0 4px, 4px 0, calc(100% - 4px) 0, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 0 calc(100% - 4px)); }
.md-hud i { font-style: normal; color: var(--violet-glow); }
.md-hud[data-state="late"] { color: var(--gold); }
.md-hud[data-state="collapse"] { background: var(--violet); color: var(--white); }
.md-hud[data-state="collapse"] i { color: var(--gold); }
.md-hud-note { position: absolute; right: 12px; top: 12px; z-index: 2; font-family: var(--font-pixel); font-size: 8px; line-height: 12px; color: var(--gold); background: rgba(13, 11, 16, .82); padding: 6px 8px; }

/* ── bands ──────────────────────────────────────────────────────────── */
.md-head { display: flex; flex-direction: column; gap: 16px; margin-bottom: 36px; }
.md-head .ff-lede { max-width: 58ch; }
.md-sub { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px 24px; margin: 44px 0 18px; }
.md-sub h3 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 30px; line-height: 1; text-transform: uppercase; letter-spacing: .02em; }
.md-sub p { margin: 0; font-size: 14px; color: var(--on-night-soft); max-width: 60ch; }
.ff-paper .md-sub p { color: var(--ink-faint); }

/* the stills rail reuses .ff-shots; four across, scrolls sideways on phones */
.md-stills { margin-top: 48px; }

/* ── how a run works ────────────────────────────────────────────────── */
.md-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.md-step { --n: var(--notch-md); position: relative; display: flex; flex-direction: column; gap: 12px; padding: 24px 24px 26px; background: var(--night); color: var(--on-night); box-shadow: var(--shadow-hard); min-width: 0; }
.md-step-time { font-family: var(--font-pixel); font-size: 22px; line-height: 1; color: var(--gold); }
.md-step-time i { font-style: normal; color: var(--violet-glow); }
.md-step h3 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 30px; line-height: .95; text-transform: uppercase; }
.md-step p { margin: 0; font-size: 15px; line-height: 22px; color: var(--on-night-soft); }
.md-step img { width: 100%; height: auto; image-rendering: pixelated; border: 3px solid var(--night-raised); margin-top: 4px; }
.md-rules { margin-top: 26px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; border: 1px solid var(--line); }
.md-rule { padding: 18px 20px; background: var(--paper-card); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.md-rule b { font-family: var(--font-display); font-weight: 400; font-size: 20px; line-height: 1; text-transform: uppercase; letter-spacing: .02em; }
.md-rule span { font-size: 14px; line-height: 20px; color: var(--ink-soft); }
.md-rule .ff-tag { align-self: flex-start; margin-bottom: 4px; }

/* ── partners ───────────────────────────────────────────────────────── */
.md-partners { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.md-partner { --n: var(--notch-md); position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 12px 16px; background: linear-gradient(180deg, #2a3f8a, #1c2b66 70%); color: var(--white); text-align: center; min-width: 0; }
.md-partner img { width: 128px; height: 128px; image-rendering: pixelated; }
.md-partner b { font-family: var(--font-display); font-weight: 400; font-size: 22px; line-height: 1; letter-spacing: .06em; text-transform: uppercase; }
.md-partner span { font-size: 13px; line-height: 18px; color: #c9d2f5; text-wrap: pretty; }
.md-partner-note { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: center; margin-top: 40px; }
.md-partner-note .md-shot { box-shadow: 14px 14px 0 var(--violet-deep); }
.md-partner-note ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 16px; line-height: 24px; color: var(--on-night-soft); }
.md-partner-note li b { color: var(--on-night); }

/* ── megas ──────────────────────────────────────────────────────────── */
.md-megas .ff-dex-megagrid { margin-top: 18px; }

/* ── keep your save ─────────────────────────────────────────────────── */
.md-update { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; }
.md-update-card { --n: var(--notch-md); display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 28px; background: var(--paper-card); box-shadow: var(--shadow-hard); min-width: 0; }
.md-update-card h3 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 34px; line-height: .95; text-transform: uppercase; }
.md-update-card p { margin: 0; font-size: 15px; line-height: 22px; color: var(--ink-soft); }
.md-home-line { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 40px; font-size: 15px; color: var(--ink-soft); }
.md-home-line b { font-family: var(--font-display); font-weight: 400; font-size: 24px; letter-spacing: .02em; text-transform: uppercase; color: var(--ink); }
.md-home-line img { width: 34px; height: auto; image-rendering: pixelated; }

/* ── responsive ─────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .md-partners { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md-rules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .md-hero { grid-template-columns: minmax(0, 1fr); padding: 24px 18px 56px; gap: 36px; }
  .md-steps, .md-partner-note, .md-update { grid-template-columns: minmax(0, 1fr); }
  .md-hero-facts { grid-template-columns: repeat(2, max-content); }
}
@media (max-width: 600px) {
  .md-partners { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md-partner img { width: 96px; height: 96px; }
  .md-rules { grid-template-columns: minmax(0, 1fr); }
  .md-hud { font-size: 14px; }
  .md-shot { box-shadow: 8px 8px 0 var(--violet); }
}
@media (prefers-reduced-motion: reduce) {
  .md-hud { transition: none; }
}

/* ── late additions ─────────────────────────────────────────────────── */
/* the tear between the gray paper and the cream paper that follows it;
   the gray behind it is the page's own, so the torn edge shows */
main.md-drained { background-color: var(--paper); }
.md-tear { height: 26px; background: #f5ecda; margin-bottom: -1px; clip-path: polygon(0 100%, 0 55%, 5% 85%, 11% 40%, 17% 90%, 23% 50%, 29% 100%, 35% 60%, 41% 95%, 47% 45%, 53% 90%, 59% 55%, 65% 100%, 71% 65%, 77% 95%, 83% 50%, 89% 85%, 95% 40%, 100% 70%, 100% 100%); }
.md-home { padding-top: 72px; }
/* the partner note sits on paper */
.md-partner-note ul { color: var(--ink-soft); }
.md-partner-note li b { color: var(--ink); }

/* ── the lockup: the one place to swap the logo ─────────────────────────
   The home page's Mega Dimension band and this page's hero both draw the
   name from .md-lockup. The words stay in the markup for screen readers.
   lockup.webp is the Mega Dimension mark alone; lockup-wot.webp has the
   Wishes of Tomorrow logo above it, and heads this page's hero. */
.md-lockup { width: min(100%, var(--md-lockup-w, 560px)); aspect-ratio: 1200 / 346; margin: 0; background: url("lockup.webp") left center / contain no-repeat; }
.md-lockup > span { display: none; }
.md-hero .md-lockup { --md-lockup-w: 540px; aspect-ratio: 1200 / 756; background-image: url("lockup-wot.webp"); }

/* ── the home page: a flag in the hero and a band of its own ────────── */
.md-flag { display: inline-flex; align-items: center; gap: 10px; padding: 7px 12px 7px 7px; background: var(--ink); color: var(--paper); font-family: var(--font-display); font-size: 14px; line-height: 1; letter-spacing: .1em; text-transform: uppercase; box-shadow: 4px 4px 0 var(--violet); transition: transform .15s ease, box-shadow .15s ease; }
.md-flag b { padding: 4px 5px 3px; background: var(--gold); color: var(--ink); font-family: var(--font-pixel); font-weight: 400; font-size: 8px; letter-spacing: 0; }
.md-flag .ff-i { width: 11px; height: 11px; color: var(--violet-glow); }
.md-flag:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--violet); }

.md-band { z-index: 1; }
.md-band-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 56px; align-items: center; }
.md-band-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; min-width: 0; }
.md-band .md-lockup { --md-lockup-w: 520px; margin: 0; font-size: clamp(54px, 7.2vw, 100px); }
.md-band .md-hero-facts { margin-top: 0; }
/* the facts' labels wrap, so four of them fit beside the screenshot */
.md-hero-facts { grid-template-columns: repeat(4, minmax(0, max-content)); }
.md-hero-facts span { max-width: 13ch; }
.md-band-links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 2px 0 0; font-size: 15px; font-weight: 600; color: var(--ink-soft); }
.md-band-links a { color: var(--ink); box-shadow: inset 0 -2px 0 var(--violet); transition: box-shadow .15s ease; }
.md-band-links a:hover { box-shadow: inset 0 -1.2em 0 color-mix(in srgb, var(--violet) 22%, transparent); }
.md-band-shot { display: block; min-width: 0; transition: transform .15s ease; }
.md-band-shot .md-shot { transition: box-shadow .15s ease; }
.md-band-shot:hover { transform: translate(-3px, -3px); }
.md-band-shot:hover .md-shot { box-shadow: 17px 17px 0 var(--violet); }

/* ── the cards in the Megas band (assets/cards/ builds the carousel) ─── */
.md-megas.fc .fc-head { max-width: min(520px, 60%); pointer-events: none; }
.md-roads-band { padding-top: 64px; padding-bottom: 8px; }
.md-roads { margin-top: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.md-roads .md-rule b span { font-family: var(--font-pixel); font-size: 14px; color: var(--violet); margin-right: 8px; letter-spacing: 0; }
.md-roads-links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 22px; }

/* ── how to update: the rift tester guide's step cards and clock mark ── */
.g-head-block { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; margin-bottom: 34px; }
.g-head-block .ff-lede { max-width: 60ch; }
.g-mark.md-hud { position: static; font-size: 22px; padding: 12px 14px 10px; }
.g-lift { filter: drop-shadow(6px 6px 0 var(--ink)); min-width: 0; display: flex; }
.g-lift--violet { filter: drop-shadow(7px 7px 0 var(--violet)); }
.g-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.g-step { --n: var(--notch-md); flex: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 20px 20px 22px; background: var(--paper-card); color: var(--ink); }
.g-step-no { font: 400 46px/1 var(--font-display); color: var(--violet); }
.g-step h3 { margin: 0; font: 400 28px/1 var(--font-display); letter-spacing: .02em; text-transform: uppercase; }
.g-prose { margin: 0; font-size: 16px; line-height: 24px; color: var(--ink-soft); }
.g-prose b { color: var(--ink); }
.md-update-ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 36px; }

@media (max-width: 1100px) {
  .g-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .md-band-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .md-hero-facts { grid-template-columns: repeat(2, minmax(0, max-content)); }
  .md-hero-facts span { max-width: 20ch; }
  .md-roads { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 719px) {
  .md-megas.fc .fc-head { max-width: none; }
}
@media (max-width: 600px) {
  .g-steps { grid-template-columns: minmax(0, 1fr); }
  .g-step { padding: 18px; }
  .md-band-shot:hover .md-shot { box-shadow: 11px 11px 0 var(--violet); }
}

/* ── the drop strip: the release date across the top of the page ─────── */
.md-drop { z-index: 6; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 13px 18px 12px; font-family: var(--font-display); font-weight: 400; font-size: 17px; line-height: 1.3; letter-spacing: .12em; text-transform: uppercase; text-align: center; color: var(--on-night); }
.md-drop-date { display: inline-block; margin: 0 2px 0 4px; padding: 7px 9px 6px; vertical-align: 2px; background: var(--gold); color: var(--ink); font-family: var(--font-pixel); font-weight: 400; font-size: 12px; line-height: 1; letter-spacing: 0; }
.md-drop-dot { color: var(--on-night-faint); }
.md-drop .ff-i { width: 11px; height: 11px; color: var(--violet-glow); transition: transform .15s ease; }
a.md-drop:hover { color: var(--white); }
a.md-drop:hover .ff-i { transform: translateX(3px); }
.md-drop + main .ff-header { padding-top: 30px; }
@media (max-width: 600px) {
  .md-drop { font-size: 13px; letter-spacing: .08em; gap: 8px; }
  .md-drop-more { display: none; }
}
