/* ==========================================================================
   Michaelism Metaverse — standalone mobile main page (/m/)
   Hand-written replacement for the Tilda T396 zoom-scaled layout on phones.
   Mobile-first: designed at 360–430 px, fluid to 768 px, centred above that.
   Pairs with m/index.html · owner: Cuserob / Pixel Forge
   ========================================================================== */

/* Webfonts (Orbitron, Chakra Petch) live in fonts/fonts.css and are attached after the hero loads */
:root {
  /* Palette — sampled from the live Tilda records */
  --ink: #0a0a1a;            /* carousel / portal hall */
  --ink-2: #14141f;
  --gold: #d4a574;           /* Mechanicus Gold (badge, portals, explorer) */
  --gold-soft: #f0d080;
  --cream: #fdffd2;          /* body copy on the lore / plita records */
  --cream-2: #f9f2ce;
  --amber: #fdac0f;          /* reincarnation tagline */
  --green-deep: #27490a;     /* rec758740845 artboard */
  --green-chain: #206c1b;    /* rec763949130 artboard */
  --green-social: #0f6f13;   /* rec789636690 */
  --blood: #7f0b0b;
  --solomon: #241e20;        /* rec787081549 */
  --slate: #2a2626;          /* rec785027444 */
  --lighthouse: #ffd300;     /* plita records base colour under the image */

  --font-display: "Orbitron", "Chakra Petch", system-ui, sans-serif;
  --font-body: "Chakra Petch", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --gutter: 16px;
  --max: 768px;
  --radius: 14px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: #050508;
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;           /* belt and braces: the layout itself never overflows */
}

img { display: block; max-width: 100%; height: auto; }
/* First-band images wait for the hero (loader at the end of index.html);
   without JS their <noscript> copies render instead */
img[data-src] { visibility: hidden; }
html:not(.js) img[data-src] { display: none; }
a { color: var(--gold-soft); }
a:focus-visible,
button:focus-visible,
input:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.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;
}

/* Every band is full-bleed; its content column is capped at --max */
.band { position: relative; isolation: isolate; overflow: hidden; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 48px var(--gutter); }

/* A lazy <img> used as a section background (CSS backgrounds cannot lazy-load) */
.band__bg {
  position: absolute; inset: 0; z-index: -1;
  width: 100%; height: 100%; max-width: none;
  object-fit: cover;
}
.band__shade { position: absolute; inset: 0; z-index: -1; }

/* Off-screen bands skip style/layout/paint until they approach the viewport */
main > .band,
main > section,
.foot { content-visibility: auto; contain-intrinsic-size: auto 1100px; }

h2, h3 { font-family: var(--font-display); line-height: 1.25; margin: 0 0 16px; }
h2 { font-size: clamp(20px, 5.6vw, 28px); letter-spacing: .02em; text-align: center; }
p { margin: 0 0 14px; }

.center { text-align: center; }
.lines { white-space: pre-line; }        /* keeps the <br>-level line breaks of the source copy */

/* ---------- Top-bar link to the desktop page ---------- */
.to-desktop {
  position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 12px; z-index: 5;
  display: inline-flex; align-items: center; min-height: 36px; padding: 6px 14px;
  font: 600 12px/1 var(--font-body); letter-spacing: .06em; text-transform: uppercase;
  color: var(--gold); text-decoration: none;
  background: rgba(10, 10, 26, .72);
  border: 1px solid rgba(212, 165, 116, .45); border-radius: 999px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}

/* ==========================================================================
   1 · Hero (rec763455061) — coin-tunnel green, Astral figure, logo, badge
   ========================================================================== */
.hero {
  background:
    radial-gradient(ellipse at 50% 42%, #b6ff4a 0%, #58c21a 14%, #1f7a0c 38%, #0b3a06 68%, #031602 100%);
  padding-top: calc(52px + env(safe-area-inset-top));
}
/* Lightweight CSS stand-in for the MP4 tunnel + particles.js: slow light streaks */
.hero::before {
  content: ""; position: absolute; z-index: -1;
  left: 50%; top: 42%; width: 220vmax; height: 220vmax; margin: -110vmax 0 0 -110vmax;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 190, .10) 0deg 1.2deg, transparent 1.2deg 9deg);
  -webkit-mask: radial-gradient(circle, transparent 6%, #000 22%, transparent 62%);
  mask: radial-gradient(circle, transparent 6%, #000 22%, transparent 62%);
  animation: tunnel 90s linear infinite;
}
@keyframes tunnel { to { transform: rotate(360deg); } }

/* Near-full first screen like the desktop 100vh artboard; the next band peeks in as a scroll cue
   but stays too small to become the LCP element */
.hero { min-height: 86vh; min-height: 86svh; display: flex; flex-direction: column; justify-content: center; }
.hero .wrap { padding-top: 0; padding-bottom: 28px; }
.hero__stage { position: relative; }
.hero__figure {
  width: 100%; aspect-ratio: 1.37;
  object-fit: cover; object-position: 51% 50%;
}
/* The logo PNG is 1920×1080 with the lettering in its lower-middle; crop to it */
.hero__logo {
  position: absolute; left: 0; right: 0; bottom: -2%;
  aspect-ratio: 2.59; overflow: hidden;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, .55));
}
.hero__logo img { width: 170%; max-width: none; margin: -51.9% 0 0 -33.05%; }

.badge {
  width: fit-content; max-width: 100%; margin: 26px auto 0; padding: 8px 14px;
  font: 500 10px/1.6 var(--font-display); letter-spacing: .12em; text-transform: uppercase;
  color: rgba(212, 165, 116, .9); text-align: center;
  background: linear-gradient(135deg, rgba(10, 10, 26, .78), rgba(20, 15, 35, .88));
  border: 1px solid rgba(212, 165, 116, .35); border-radius: 6px;
  text-shadow: 0 0 8px rgba(212, 165, 116, .3);
}
.badge .sep { opacity: .45; margin: 0 5px; }
.badge b { font-weight: inherit; white-space: nowrap; }

/* ==========================================================================
   2 · Reincarnations (rec763948034 + rec758740845)
   ========================================================================== */
.reinc { background: #010101; }
.reinc .band__shade { background: linear-gradient(#010101cc, #010101 92%); }
.reinc .wrap { padding-left: 0; padding-right: 0; }

/* Swipeable row with a peek of the next card as the affordance */
.swipe {
  display: flex; gap: 12px;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter);
  padding: 4px var(--gutter) 14px;
  scrollbar-width: thin; scrollbar-color: rgba(212, 165, 116, .5) transparent;
}
.swipe > * { flex: 0 0 74%; scroll-snap-align: start; margin: 0; }
/* The card shell is on the figure, so it shows while the portrait is still waiting to load */
.portrait {
  overflow: hidden; border-radius: var(--radius);
  background: radial-gradient(circle at 50% 30%, #2b3a1a, #0d0d0d 70%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .6), 0 0 0 1px rgba(212, 165, 116, .18);
}
.portrait img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; object-position: 50% 12%; }

.plaques {
  list-style: none; margin: 22px 0 0; padding: 0 var(--gutter);
  display: grid; gap: 12px; grid-template-columns: 1fr;
}
.plaques img { width: 100%; border-radius: 10px; }

.reinc-caption { background: var(--green-deep); }
.reinc-caption h2 { color: #fff; }
.reinc-caption p { color: #fff; text-align: center; }
.reinc-caption .tagline {
  color: var(--amber); font-family: var(--font-display); font-weight: 600;
  font-size: clamp(16px, 4.4vw, 20px); line-height: 1.45; margin: 22px 0 0;
}

/* ==========================================================================
   3 · Portal hall — the 11 subdomains (replaces the 3D carousel)
   ========================================================================== */
.portals { background: var(--ink); color: #e2e8f0; }
.portals h2 { color: var(--gold); margin-bottom: 6px; }
.portals .sub { color: #cbd5e1; text-align: center; margin-bottom: 26px; }

.portal-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.portal {
  --accent: var(--gold);
  position: relative;
  display: grid; grid-template-columns: 52px 1fr; column-gap: 14px; align-items: start;
  padding: 16px 16px 16px 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .015));
  border: 1px solid rgba(255, 255, 255, .08);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: 0 0 0 0 transparent;
  transition: box-shadow .25s, border-color .25s;
}
.portal:hover,
.portal:focus-within { box-shadow: 0 0 22px -4px var(--accent); border-color: var(--accent); }
.portal > :not(.portal__icon) { grid-column: 2; }
.portal__icon {
  grid-row: 1 / span 5;
  display: grid; place-items: center; width: 52px; height: 52px;
  font-size: 26px; line-height: 1; color: #fff;
  background: radial-gradient(circle at 35% 30%, var(--accent), rgba(0, 0, 0, .3) 75%);
  border-radius: 12px;
}
.portal__name { margin: 0; font: 700 17px/1.25 var(--font-display); color: #fff; letter-spacing: .03em; }
.portal__tag { margin: 2px 0 8px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.portal__title { margin: 0 0 4px; font-weight: 600; color: #f1f5f9; }
.portal__desc { margin: 0 0 10px; font-size: 15px; color: #cbd5e1; }
.portal__cta {
  justify-self: start;
  font: 600 13px/1 var(--font-display); letter-spacing: .06em; text-transform: uppercase;
  color: var(--gold); text-decoration: none;
}
.portal__cta::after { content: " \2192"; }
/* Stretched link: the whole card is the tap target, the CTA stays the accessible name */
.portal__cta::before { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }

.avatar { margin: 34px auto 0; max-width: 1500px; }
.avatar img { width: 100%; border-radius: 16px; filter: drop-shadow(0 0 40px rgba(212, 165, 116, .35)); }

.explorer {
  display: block; max-width: 340px; margin: 34px auto 0; padding: 26px 22px;
  text-align: center; text-decoration: none; color: #e2e8f0;
  background: rgba(10, 10, 26, .85);
  border: 1px solid rgba(212, 165, 116, .3); border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, .4);
}
.explorer__icon { font-size: 40px; line-height: 1; margin-bottom: 10px; }
.explorer__title { font: 700 17px/1.3 var(--font-display); color: var(--gold); margin-bottom: 8px; }
.explorer__desc { font-size: 14px; opacity: .78; line-height: 1.5; }
.explorer__go { margin-top: 14px; font: 500 13px/1 var(--font-display); color: var(--gold); }

/* ==========================================================================
   4 · Roadmap · Lore · Chains
   ========================================================================== */
.roadmap { background: var(--ink); }
.roadmap h2 { color: var(--cream); }
.roadmap a { display: block; }
.roadmap img { width: 100%; border-radius: 12px; box-shadow: 0 0 0 1px rgba(212, 165, 116, .18); }

.lore { background: #000; }
.lore .band__bg { object-position: 50% 0; }
.lore .band__shade { background: linear-gradient(rgba(0, 0, 0, .35), rgba(0, 0, 0, .78) 45%, #000); }
.lore h2 { margin-bottom: 22px; }
.lore__text { text-align: center; color: var(--cream); }

.communities { background: var(--slate); }
.communities__banner { position: relative; }
.communities__banner img { width: 100%; min-height: 120px; object-fit: cover; }
.communities__banner h2 {
  position: absolute; inset: 0; margin: 0; padding: 0 var(--gutter);
  display: grid; place-items: center;
  color: var(--cream-2); text-shadow: 0 2px 12px #000, 0 0 2px #000;
}

.chains { background: var(--green-chain); color: #fff; }
.chains__banner img { width: 100%; }
.chain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.chain {
  position: relative; isolation: isolate; overflow: hidden;
  padding: 22px 18px 20px; border-radius: var(--radius);
  background: #0b1a0a;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .08);
}
.chain .band__shade { background: linear-gradient(rgba(0, 0, 0, .45), rgba(0, 0, 0, .82) 55%); }
.chain__logo { width: 132px; margin: 0 auto 14px; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .6)); }
.specs { list-style: none; margin: 0; padding: 0; font-size: 15px; line-height: 1.55; }
.specs li + li { margin-top: 2px; }
.specs .gap { margin-top: 12px; }
.summary { text-align: center; padding: 30px 18px; }
.summary__big { display: block; font: 700 clamp(16px, 4.6vw, 30px)/1.3 var(--font-display); color: var(--gold-soft); margin: 8px 0; white-space: nowrap; }

.examples { background: #9d9e9c; }
.examples .band__shade { background: rgba(0, 0, 0, .45); }
.examples .wrap { padding-top: 34px; padding-bottom: 34px; }
.examples p { margin: 0; text-align: center; color: #fff9e5; font: 600 16px/1.4 var(--font-display); }

/* ==========================================================================
   5 · Plita records — series, enchantments, crypto religion, cooperation
   ========================================================================== */
.plita { background: var(--lighthouse); }
.plita .band__shade { background: linear-gradient(rgba(0, 10, 20, .55), rgba(0, 10, 20, .8)); }
.plita h2 { margin: 0 0 18px; }
/* Source PNGs are 1680×945 with the plaque in the top 39 % — crop to the plaque */
.plita h2 img { width: 100%; aspect-ratio: 4.42; object-fit: cover; object-position: 50% 0; }
.panel {
  padding: 18px 16px; border-radius: var(--radius);
  background: rgba(3, 12, 22, .62);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  border: 1px solid rgba(253, 255, 210, .14);
}
.panel p { text-align: center; color: var(--cream); }
.panel p:last-child, .panel ol:last-child { margin-bottom: 0; }
.panel ol { margin: 0; padding-left: 1.4em; color: var(--cream); }
.panel ol li + li { margin-top: 6px; }

/* ==========================================================================
   6 · King Solomon (rec787081549)
   ========================================================================== */
.solomon { background: var(--solomon); color: #fff; }
.solomon h2 { color: #fff; }
.solomon figure { margin: 0 0 22px; }
.solomon figure img { width: 100%; border-radius: 12px; }
.solomon .king img { box-shadow: 0 12px 34px rgba(0, 0, 0, .6); }
.solomon p { text-align: center; }

/* ==========================================================================
   7 · Partners & contacts · social · newsletter · footer
   ========================================================================== */
.partners { background: #fff; color: #000; }
.partners h2 { color: #000; }
.partners .invite { text-align: center; }
.logos {
  list-style: none; margin: 24px 0 28px; padding: 0;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; align-items: center;
}
.logos li { display: grid; place-items: center; min-height: 86px; padding: 8px; border-radius: 10px; background: #f6f6f6; }
.logos .wide { grid-column: 1 / -1; }
.logos img { max-height: 110px; width: auto; object-fit: contain; }
.contacts { margin: 0; font-size: 15px; }
.contacts p { margin: 0 0 10px; font-weight: 600; }
.contacts dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 10px; }
.contacts dt { font-weight: 600; }
.contacts dd { margin: 0; overflow-wrap: anywhere; }
.contacts a { color: #0b4fa8; }

.social { background: var(--green-social); }
.social ul {
  list-style: none; margin: 0 auto; padding: 0; max-width: 420px;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px;
}
.social a {
  display: grid; place-items: center; aspect-ratio: 1; min-height: 48px;
  border-radius: 10px; background: var(--c, #000);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .3);
}
.social svg { width: 28px; height: 28px; }

.news { background: #111; }
.news .band__shade { background: linear-gradient(rgba(5, 5, 12, .82), rgba(10, 10, 20, .7) 55%, rgba(10, 10, 20, .88)); }
.news h2 { color: var(--gold); }
.news p { text-align: center; color: #f1f5f9; }
.news form { display: grid; gap: 10px; max-width: 420px; margin: 20px auto 0; }
.news input {
  width: 100%; min-height: 50px; padding: 0 16px;
  font: 16px var(--font-body); color: #000; background: #fff;
  border: 0; border-radius: 10px;
}
.news button {
  min-height: 50px; padding: 0 20px; border: 0; border-radius: 10px;
  font: 700 15px/1 var(--font-display); letter-spacing: .06em; color: #fff;
  background: #1f5bff; cursor: pointer;
}

.foot { background: #050508; }
.foot .wrap { padding-top: 26px; padding-bottom: calc(26px + env(safe-area-inset-bottom)); text-align: center; }
.foot a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px;
  font: 600 13px/1 var(--font-body); letter-spacing: .06em; text-transform: uppercase;
  color: var(--gold); text-decoration: none;
  border: 1px solid rgba(212, 165, 116, .45); border-radius: 999px;
}

/* ==========================================================================
   Wider phones / small tablets (fluid up to 768 px)
   ========================================================================== */
@media (min-width: 560px) {
  .swipe > * { flex-basis: 46%; }
  .plaques { grid-template-columns: 1fr 1fr; }
  .plaques li:last-child:nth-child(odd) { grid-column: 1 / -1; justify-self: center; width: 50%; }
  .chain-list { grid-template-columns: 1fr 1fr; }
  .chain-list .summary { grid-column: 1 / -1; }
  .logos { grid-template-columns: repeat(3, 1fr); }
  .news form { grid-template-columns: 1fr auto; }
}

@media (prefers-reduced-motion: reduce) {
  .hero::before { animation: none; }
  .portal { transition: none; }
}
