/* MonsterLink — public page + phone preview styles.
   Every colour comes from --pg-* variables set by themes.js applyTheme(). */

.ml-page {
  font-family: var(--pg-font, system-ui);
  background: var(--pg-bg, #FAF7F0);
  color: var(--pg-text, #191621);
  min-height: 100%;
  padding: 34px 18px 40px;
}
.ml-page > * { max-width: 640px; margin-left: auto; margin-right: auto; }

/* Desktop: identity rail left, blocks right. Container-query driven so the
   layout follows the width of the page's host, meaning live pages on a wide
   screen get the rail while phone previews always keep the mobile column. */
.ml-page-host { container-type: inline-size; }

@container (min-width: 940px) {
  .ml-page {
    display: grid;
    grid-template-columns: 1fr minmax(250px, 310px) clamp(560px, 56cqw, 690px) 1fr;
    column-gap: clamp(40px, 5cqw, 76px);
    align-content: start;
    padding: 76px 40px 90px;
  }
  .ml-page > * { max-width: none; margin-left: 0; margin-right: 0; }
  .ml-page .ml-header {
    grid-column: 2;
    /* pin point matches the page's top padding, so the rail never moves at all */
    position: sticky; top: 76px; align-self: start;
    text-align: left;
  }
  .ml-page .ml-header .ml-avatar { margin: 0 0 22px; }
  .ml-page .ml-header .ml-name { justify-content: flex-start; font-size: 34px; }
  .ml-page .ml-header .ml-bio { margin: 12px 0 0; max-width: none; font-size: 16.5px; line-height: 1.6; }
  .ml-page .ml-blocks { grid-column: 3; grid-row: 1; margin-top: 0; align-self: start; align-content: start; }
  .ml-page .ml-made-wrap { grid-column: 3; }
}

/* Two type roles: titles carry --pg-font-title, everything else inherits
   the body font from .ml-page. Pages without a body font pick set both
   to the same family in themes.js, so old data renders unchanged. */
.ml-page .ml-name, .ml-page .ml-h2, .ml-page .ml-panel-title, .ml-page .ml-card-title,
.ml-page .ml-carousel-title, .ml-page .ml-donate-title, .ml-page .ml-count-num,
.ml-page .ml-spot-title {
  font-family: var(--pg-font-title, var(--pg-font));
}

/* Header */
.ml-header { text-align: center; }
.ml-avatar {
  width: var(--pg-avatar-size, 96px); height: var(--pg-avatar-size, 96px);
  border-radius: 50%; object-fit: cover;
  margin: 0 auto 14px; box-shadow: var(--pg-avatar-shadow, 0 10px 30px rgba(0,0,0,.14));
}
.ml-avatar-mono {
  display: grid; place-items: center; font-size: calc(var(--pg-avatar-size, 96px) * 0.42); font-weight: 800;
  background: var(--pg-card); color: var(--pg-card-text);
}
.ml-name {
  font-size: 26px; font-weight: 800; letter-spacing: -0.01em;
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
.ml-verified { color: var(--pg-accent); flex: none; }
.ml-bio { margin: 8px auto 0; color: var(--pg-muted); max-width: 44ch; font-size: 15px; }

/* Socials (a block since 2026-07: sits wherever it is dragged in the column) */
.ml-socials { display: flex; flex-wrap: wrap; justify-content: center; }
.ml-socials a {
  display: grid; place-items: center; text-decoration: none;
  border-radius: 12px; color: var(--pg-text); transition: background .15s, transform .15s;
}
.ml-socials a:hover { background: var(--pg-card); transform: translateY(-2px); }
/* Placeholder social row: shown in a preview when a page has no socials yet, so
   people see the feature exists. Muted and non-interactive; never on a live page. */
.ml-socials-ph { opacity: .38; }
.ml-socials-ph a { pointer-events: none; }
/* size (box) and gap come inline from the block's sliders */
.ml-socials-counts a.ml-social-stacked { min-width: 0; padding: 6px 3px; gap: 4px; }
.ml-social-count { font-weight: 800; line-height: 1; }

/* Blocks column: two-column grid; full blocks span both, halves pair up */
.ml-blocks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--pg-gap, 14px); margin-top: 24px; }
.ml-blocks > * { grid-column: span 2; }
.ml-blocks > .ml-half { grid-column: span 1; }
/* Half-width adaptations: card links stack their image, form rows stack */
.ml-half.ml-card { flex-direction: column; }
.ml-half .ml-card-imgwrap { width: 100%; height: 118px; flex: none; }

/* Simple + tall buttons */
.ml-btn {
  display: block; text-align: center; text-decoration: none;
  padding: 16px 20px; font-weight: 700; font-size: 15.5px;
  background: var(--pg-btn-bg); color: var(--pg-btn-text);
  border: var(--pg-border-w) solid var(--pg-btn-border);
  border-radius: var(--pg-radius); box-shadow: var(--pg-btn-shadow);
  transition: transform .16s ease, box-shadow .16s ease;
}
.ml-btn:hover { transform: translateY(-2px); }
.ml-btn:active { transform: translateY(0) scale(.99); }
.ml-btn-tall { display: flex; flex-direction: column; gap: 3px; }
.ml-btn-desc { font-weight: 500; font-size: 13px; opacity: .72; }

/* Rich link card */
.ml-card {
  display: flex; align-items: stretch; overflow: hidden; text-decoration: none;
  min-height: 84px;
  background: var(--pg-card); color: var(--pg-card-text);
  border: var(--pg-border-w) solid var(--pg-card-border);
  border-radius: var(--pg-radius-card); box-shadow: var(--pg-btn-shadow);
  transition: transform .16s ease;
}
.ml-card:hover { transform: translateY(-2px); }
.ml-card-right { flex-direction: row-reverse; }
.ml-half.ml-card.ml-card-right { flex-direction: column-reverse; }
/* Image lives in a wrapper that stretches to the text height; the image fills it
   cropped, so a tall photo never forces the card taller than its text needs. */
.ml-card-imgwrap { position: relative; width: 96px; flex: none; overflow: hidden; }
.ml-card-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ml-card-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; justify-content: center; }
.ml-card-title { font-weight: 700; font-size: 15.5px; line-height: 1.25; }
.ml-card-desc { font-size: 13px; line-height: 1.4; color: var(--pg-muted); }
.ml-page .ml-card-desc { color: inherit; opacity: .68; }

/* Affiliate links: compact rows, tap the text, copy the link */
.ml-aff-list { display: flex; flex-direction: column; }
.ml-aff-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.ml-aff-row + .ml-aff-row { border-top: 1px solid var(--pg-card-border); }
.ml-aff-link {
  flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600;
  color: var(--pg-card-text); text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ml-aff-link:hover { text-decoration: underline; }
.ml-aff-copy {
  flex: none; width: 28px; height: 28px; display: grid; place-items: center;
  border: var(--pg-border-w) solid var(--pg-card-border); border-radius: 9px;
  background: transparent; color: var(--pg-muted); cursor: pointer;
  transition: color .15s, border-color .15s;
}
.ml-aff-copy:hover { color: var(--pg-card-text); border-color: var(--pg-card-text); }
.ml-aff-copied { color: var(--pg-accent) !important; }

/* Divider: a hairline in the page's own border colour */
.ml-divider {
  border: 0; height: 0;
  border-top: var(--pg-border-w, 1px) solid var(--pg-card-border);
  margin: 6px 0; opacity: .9;
}

/* Heading */
.ml-h2 { text-align: center; font-size: 17px; font-weight: 800; margin-top: 14px; letter-spacing: .01em; }
.ml-h2:first-child { margin-top: 0; }

/* Panels (about, faq, forms, spotlight, grid…) */
.ml-panel {
  background: var(--pg-card); color: var(--pg-card-text);
  border: var(--pg-border-w) solid var(--pg-card-border);
  border-radius: var(--pg-radius-card); padding: 18px;
  box-shadow: var(--pg-btn-shadow);
}
.ml-panel-title { font-size: 16px; font-weight: 800; margin-bottom: 8px; }
.ml-panel-text { font-size: 14.5px; opacity: .85; white-space: pre-line; }

/* Video */
.ml-video {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: var(--pg-radius-card);
}
.ml-video img { width: 100%; height: 100%; object-fit: cover; }
.ml-video iframe { width: 100%; height: 100%; border: 0; }
.ml-video-playing { background: #000; }
.ml-play {
  position: absolute; inset: 0; margin: auto; width: 58px; height: 58px;
  border-radius: 50%; background: rgba(255,255,255,.94); color: #111;
  display: grid; place-items: center; padding-left: 4px;
  transition: transform .15s; box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.ml-play:hover { transform: scale(1.08); }
.ml-video-title {
  position: absolute; left: 12px; bottom: 10px; right: 12px;
  color: #fff; font-weight: 700; font-size: 14px; text-shadow: 0 1px 8px rgba(0,0,0,.7);
}
.ml-video-empty { display: grid; place-items: center; background: var(--pg-card); }

/* Photo grid */
.ml-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ml-grid-cell { padding: 0; border-radius: 10px; overflow: hidden; }
.ml-grid-cell img { width: 100%; aspect-ratio: 1; object-fit: cover; transition: transform .2s; }
.ml-grid-cell:hover img { transform: scale(1.05); }
.ml-grid-mock { display: block; aspect-ratio: 1; }

/* Carousel */
.ml-carousel-title { margin-bottom: 10px; color: var(--pg-text); }
.ml-carousel {
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.ml-carousel::-webkit-scrollbar { display: none; }
.ml-carousel-item {
  flex: 0 0 76%; scroll-snap-align: center; text-decoration: none;
  background: var(--pg-card); color: var(--pg-card-text);
  border: var(--pg-border-w) solid var(--pg-card-border);
  border-radius: var(--pg-radius-card); overflow: hidden;
}
.ml-carousel-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
/* The empty image slot, used by every surface that can hold a picture.
   Colours come from the theme rather than a fixed grey, so it reads as a gap on
   a dark theme as clearly as on a light one, and never fights the page. */
.ml-ph {
  display: grid; place-items: center;
  width: 100%; min-height: 0;
  background: var(--pg-card-border, rgba(0, 0, 0, .08));
  color: var(--pg-muted, rgba(0, 0, 0, .38));
  border-radius: inherit;
  overflow: hidden;
}
.ml-ph-glyph {
  /* Scales with the slot, but stops before it turns into wallpaper in a big
     spotlight or a smear in a small avatar. */
  width: clamp(22px, 26%, 64px); height: auto;
  opacity: .55;
}
.ml-carousel-ph { display: block; aspect-ratio: 4 / 3; }
span.ml-carousel-ph { display: grid; }
.ml-card-ph { height: 100%; }
.ml-spot-ph { border-radius: inherit; }

/* A social logo sitting in a link button or card title. */
.ml-btn-logo {
  display: inline-grid; place-items: center; vertical-align: -0.22em;
  width: 1.15em; height: 1.15em; margin-right: .5em; flex: none;
}
.ml-btn-logo svg { width: 100%; height: 100%; fill: currentColor; }
.ml-btn:has(.ml-btn-logo) { display: flex; align-items: center; justify-content: center; }
.ml-carousel-label { display: block; padding: 11px 14px; font-weight: 700; font-size: 14px; }

/* Spotlight */
.ml-spot { padding: 0; overflow: hidden; }
.ml-spot-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.ml-spot-body { padding: 18px; text-align: center; }
.ml-spot-title { font-size: 18px; font-weight: 800; }
.ml-spot-text { margin-top: 6px; font-size: 14.5px; opacity: .8; }
.ml-spot-btn { margin-top: 14px; }

/* Music embed */
.ml-music { border-radius: var(--pg-radius-card); overflow: hidden; }
.ml-music iframe { display: block; width: 100%; border: 0; }
.ml-music-ph { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 14.5px; }
.ml-music-ico {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--pg-accent) 16%, transparent);
  color: var(--pg-accent);
}

/* Social stats */
.ml-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: 8px; margin-top: 4px; }
.ml-stats-cell {
  text-align: center; padding: 14px 6px;
  border: var(--pg-border-w) solid var(--pg-card-border);
  border-radius: calc(var(--pg-radius-card) - 10px);
}
.ml-stats-ico { display: flex; justify-content: center; margin-bottom: 6px; opacity: .85; }
.ml-stats-val { display: block; font-weight: 800; font-size: 20px; }
.ml-stats-lab { display: block; font-size: 11.5px; font-weight: 600; opacity: .6; margin-top: 2px; }

/* Resume timeline */
.ml-rz { margin-top: 6px; }
.ml-rz-item { position: relative; padding: 0 0 16px 26px; }
.ml-rz-item:last-child { padding-bottom: 2px; }
.ml-rz-item::before { content: ''; position: absolute; left: 5.5px; top: 16px; bottom: 0; width: 1.5px; background: var(--pg-card-border); }
.ml-rz-item:last-child::before { display: none; }
.ml-rz-dot { position: absolute; left: 0; top: 3px; width: 13px; height: 13px; border-radius: 50%; background: var(--pg-accent); }
.ml-rz-period { display: block; font-size: 12.5px; font-weight: 600; opacity: .6; }
.ml-rz-role { display: block; font-weight: 800; font-size: 15px; margin-top: 2px; }
.ml-rz-place { display: block; font-size: 14px; opacity: .8; }

/* Countdown */
.ml-count-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.ml-count-cell { text-align: center; }
.ml-count-num {
  display: block; padding: 13px 4px; font-weight: 800; font-size: 22px;
  font-variant-numeric: tabular-nums;
  border: var(--pg-border-w) solid var(--pg-card-border);
  border-radius: calc(var(--pg-radius-card) - 10px);
}
.ml-count-lab { display: block; margin-top: 6px; font-size: 10.5px; letter-spacing: .08em; font-weight: 700; opacity: .55; text-transform: uppercase; }
.ml-count-btn { margin-top: 14px; }

/* Donate */
.ml-donate-head { display: flex; gap: 12px; align-items: center; }
.ml-donate-heart {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--pg-accent) 16%, transparent);
  color: var(--pg-accent);
}
.ml-donate-title { display: block; font-weight: 800; font-size: 16px; }
.ml-donate-text { display: block; font-size: 13.5px; opacity: .7; margin-top: 2px; }
.ml-donate-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ml-btn-sm { display: inline-flex; padding: 10px 18px; font-size: 14px; }

/* FAQ */
.ml-faq-item { border-top: 1px solid var(--pg-card-border); }
.ml-faq-item:first-of-type { border-top: 0; }
.ml-faq-item summary {
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 12px 2px; font-weight: 700; font-size: 14.5px; cursor: pointer;
}
.ml-faq-item summary::-webkit-details-marker { display: none; }
.ml-faq-item svg { flex: none; transition: transform .2s; opacity: .6; }
.ml-faq-item[open] svg { transform: rotate(180deg); }
.ml-faq-item p { padding: 0 2px 12px; font-size: 14px; opacity: .8; white-space: pre-line; }

/* Testimonials */
/* Testimonials: a deck of cards. The front one flicks away on swipe or tap
   and returns to the back, so the quotes loop. Cards behind peek out below. */
.ml-tst-wrap { display: flex; flex-direction: column; gap: 12px; }
.ml-deck { position: relative; padding: 30px 0 34px; }
.ml-deck-stack { position: relative; display: grid; touch-action: pan-y; }
.ml-tst {
  grid-area: 1 / 1; position: relative;
  background: var(--pg-card); color: var(--pg-card-text);
  border: var(--pg-border-w) solid var(--pg-card-border);
  border-radius: var(--pg-radius-card); box-shadow: var(--pg-btn-shadow);
  padding: 46px 24px 30px; text-align: center;
  transform-origin: 50% 120%;
  transition: transform .3s cubic-bezier(.3,.8,.4,1), opacity .3s ease;
  will-change: transform;
}
.ml-tst-front { cursor: grab; }
.ml-tst-front:active { cursor: grabbing; }
.ml-tst-face {
  position: absolute; top: -26px; left: 50%; transform: translateX(-50%);
  width: 62px; height: 62px; border-radius: 50%; object-fit: cover;
  box-shadow: 0 0 0 4px var(--pg-card), 0 6px 16px rgba(0,0,0,.16);
}
.ml-tst-name { font-size: 18px; font-weight: 700; }
.ml-tst-role { font-size: 14px; font-style: italic; opacity: .6; margin-top: 2px; }
.ml-tst blockquote { font-size: 14px; line-height: 1.65; opacity: .72; margin-top: 14px; }
.ml-tst-star {
  position: absolute; bottom: -17px; left: 50%; transform: translateX(-50%);
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--pg-accent); color: var(--pg-card);
  box-shadow: 0 4px 12px rgba(0,0,0,.18);
}
.ml-tst-star svg { width: 19px; height: 19px; fill: currentColor; }
.ml-deck-dots { display: flex; justify-content: center; gap: 6px; margin-top: 34px; }
.ml-deck-dots i {
  width: 6px; height: 6px; border-radius: 50%; background: currentColor;
  opacity: .22; transition: opacity .2s, width .2s;
}
.ml-deck-dots i.on { opacity: .75; width: 16px; border-radius: 3px; }

/* Forms */
.ml-input {
  padding: 12px 14px; border-radius: calc(var(--pg-radius-card) - 8px);
  border: var(--pg-border-w) solid var(--pg-card-border);
  background: transparent; color: inherit; width: 100%;
}
.ml-input::placeholder { color: inherit; opacity: .45; }

/* Lightbox */
.ml-lightbox {
  position: fixed; inset: 0; z-index: 200; background: rgba(10, 8, 14, .92);
  display: grid; place-items: center; padding: 24px;
}
.ml-lightbox img { max-width: 92vw; max-height: 84vh; border-radius: 12px; object-fit: contain; }
.ml-lightbox-x { position: absolute; top: 14px; right: 16px; color: #fff; font-size: 22px; padding: 8px; }
.ml-lightbox-nav button {
  position: absolute; top: 50%; transform: translateY(-50%);
  color: #fff; font-size: 42px; padding: 10px 16px; line-height: 1;
}
.ml-lightbox-nav button:first-child { left: 6px; }
.ml-lightbox-nav button:last-child { right: 6px; }

/* Made with badge + share chip (live page chrome) */
.ml-made {
  display: inline-flex; align-items: center; gap: 7px; margin: 34px auto 0;
  padding: 8px 15px; border-radius: 999px; text-decoration: none;
  background: var(--pg-card); color: var(--pg-card-text);
  border: var(--pg-border-w) solid var(--pg-card-border);
  font-size: 12.5px; font-weight: 700;
}
.ml-made-wrap { text-align: center; }
.ml-made svg { width: 16px; height: 16px; }
/* Quiet on purpose. It has to be findable on every page without competing
   with the page itself, which belongs to somebody else. */
.ml-report {
  display: block; margin: 10px auto 0; text-decoration: none;
  color: var(--pg-text); opacity: .45; font-size: 11.5px; font-weight: 600;
}
.ml-report:hover { opacity: .8; text-decoration: underline; }
.ml-share {
  position: fixed; top: 14px; right: 14px; z-index: 50;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--pg-card); color: var(--pg-card-text);
  border: var(--pg-border-w) solid var(--pg-card-border);
  display: grid; place-items: center; box-shadow: 0 6px 20px rgba(0,0,0,.12);
}

/* Phone frame (editor preview, onboarding, landing) */
.phone {
  width: 330px; height: 660px; flex: none;
  border-radius: 44px; border: 3px solid var(--ink);
  background: var(--ink); padding: 4px;
  box-shadow: 0 30px 70px rgba(25, 22, 33, .28);
}
.phone-screen {
  width: 100%; height: 100%; border-radius: 37px; overflow: hidden auto;
  background: #fff; scrollbar-width: none;
}
.phone-screen.ml-page { background: var(--pg-bg); }
.phone-screen::-webkit-scrollbar { display: none; }

/* Profile socials placement + desktop-only About (kept late in the file so
   these rules win their cascade fights) */
.ml-header .ml-socials { margin-top: 16px; }
.ml-socials-head.ml-so-foot-mode { display: none; }  /* footer mode hides the top row on phones */
.ml-socials-foot { margin-top: 28px; }
.ml-about-rail { display: none; }                    /* desktop rail only */

@container (min-width: 940px) {
  .ml-page .ml-socials-head { display: flex; justify-content: flex-start; }
  .ml-page .ml-socials-foot { display: none; }
  .ml-page .ml-about-rail {
    display: block; margin: 26px 0 0; padding-top: 22px;
    border-top: var(--pg-border-w) solid var(--pg-card-border);
  }
  /* The copy itself, not a button that hides it. pre-line so the paragraph
     breaks somebody typed are the paragraph breaks a visitor reads. */
  .ml-page .ml-about-title {
    font-size: 14.5px; font-weight: 700; color: var(--pg-muted);
    margin-bottom: 9px; letter-spacing: .01em;
  }
  .ml-page .ml-about-text {
    font-size: 14.5px; line-height: 1.75; color: var(--pg-text);
    white-space: pre-line;
  }
}

/* 404 monster */
.ml-404 { min-height: 100dvh; display: grid; place-items: center; text-align: center; padding: 24px; background: var(--paper); }
.ml-404 h1 { font-family: var(--font-display); font-size: 30px; letter-spacing: -0.02em; }
.ml-404 p { color: var(--muted); margin-top: 8px; }
.ml-404 .ml-404-cta {
  display: inline-block; margin-top: 18px; padding: 13px 26px; border-radius: 999px;
  background: var(--ink); color: var(--slime); font-weight: 800; text-decoration: none;
}
.ml-404 .logo-mark { width: 74px; height: 74px; margin: 0 auto 18px; animation: bob 2.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-3deg); } }
