/* =============================================================================
 * learn-editorial.css — the music-magazine layer for /learn/
 * -----------------------------------------------------------------------------
 * WHY (2026-09-11). The learn pages rendered every element at 752px inside an
 * 800px container on a 1511px viewport — 53% of the screen — with the first real
 * image 1,243px down the page and the app screenshots shown as 351px thumbnails
 * two-thirds of the way in. Measured against musci.io, which holds #1 for
 * `suno style tags`: they ship 18 images / 103 SVG / 10 embeds, we shipped 10
 * images and one SVG. The owner's note: "our monochrome website is fucking
 * boring... this should feel like a music magazine."
 *
 * GOVERNING IDEA — one sentence, and everything below serves it:
 *   A reference page should feel like the gatefold of a record: full-bleed image,
 *   oversized display type, and the data laid out like liner notes.
 *
 * BENCHMARKED FROM OUTSIDE THE CATEGORY (never other SEO blogs):
 *   · The FADER / Pitchfork — full-bleed photography, display type that commits
 *   · Apple product pages   — one idea per viewport, air, scroll-driven reveals
 *   · Monocle               — hairlines, small-caps eyebrows, numbered sections
 *
 * CONSTRAINTS THIS MUST NOT BREAK
 *   · LCP — the hero image is eager + fetchpriority=high, never lazy.
 *   · CLS — every band reserves its aspect-ratio; images carry width/height.
 *   · prefers-reduced-motion — all motion is opt-in and disabled under it.
 *   · The 800px measure stays for BODY PROSE. Long-form reading does not want
 *     1500px lines. Only imagery, bands and data break out.
 * ========================================================================== */

:root {
  --hg-ink: #0f172a;
  --hg-ink-2: #0a0e18;
  --hg-paper: #e2e8f0;
  --hg-dim: #94a3b8;
  --hg-rule: #1e293b;
  --hg-accent: #818cf8;        /* per-page overridable */
  --hg-accent-warm: #fcd34d;
  --hg-measure: 800px;
}

/* --- 1. FULL-BLEED BREAKOUT ------------------------------------------------
 * Escapes a centred max-width container without needing a DOM change.
 * The 100vw/-50vw pair is the only technique that survives nested padding. */
.hg-fb {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  max-width: 100vw;
}
/* A band that bleeds but keeps its contents on the reading measure. */
.hg-fb__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3.5rem);
}
.hg-fb__inner--narrow { max-width: var(--hg-measure); }

/* --- 2. THE HERO ----------------------------------------------------------
 * Full-bleed photograph, double scrim so type is legible over any image, and a
 * display title that actually commits to a size. This is the single biggest
 * change: it puts an image at y≈0 instead of y≈1243. */
.hg-hero {
  position: relative;
  min-height: clamp(420px, 56vh, 620px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  isolation: isolate;
  margin-bottom: clamp(2rem, 5vw, 4rem);
}
.hg-hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  /* Desaturate slightly so the type, not the photo, is the loudest thing. */
  filter: saturate(0.85) contrast(1.05);
  transform: scale(1.03);
}
.hg-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  /* Two scrims: a vertical one for type legibility, a tinted one for brand. */
  background:
    linear-gradient(180deg, rgba(10,14,24,0.35) 0%, rgba(10,14,24,0.72) 55%, rgba(15,23,42,0.97) 100%),
    radial-gradient(120% 90% at 12% 100%, color-mix(in srgb, var(--hg-accent) 26%, transparent) 0%, transparent 62%);
}
.hg-hero__inner {
  position: relative;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  /* Asymmetric: generous above, tighter below, so the stat row sits ON the
     bottom edge like a record sleeve credit rather than floating. */
  padding: clamp(2.5rem, 7vw, 5rem) clamp(1.25rem, 4vw, 3.5rem) clamp(1.75rem, 3vw, 2.5rem);
}
.hg-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--hg-accent);
  margin: 0 0 1rem;
}
.hg-hero__eyebrow::before {
  content: '';
  width: 28px;
  height: 2px;
  background: currentColor;
  display: inline-block;
}
.hg-hero h1,
.hg-hero__title {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 800;
  /* Commits. A 40px headline over a photograph reads as a blog; this reads as
     a cover. */
  font-size: clamp(2.3rem, 6.2vw, 4.75rem);
  line-height: 0.98;
  letter-spacing: -0.022em;
  color: #fff;
  /* ⚠️ The learn pages paint <h1> with an indigo gradient clipped to the text
     (`-webkit-text-fill-color: transparent` + `background-clip: text`). That
     reads fine on flat navy and is weak, low-contrast type over a photograph —
     and because text-fill-color beats `color`, setting `color:#fff` alone does
     NOTHING. All three properties have to be unwound here. Measured 2026-09-11:
     the hero title rendered indigo-on-image at roughly 2:1 contrast. */
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  -webkit-text-fill-color: #fff;
  margin: 0 0 1rem;
  max-width: 20ch;
  text-wrap: balance;
  text-shadow: 0 2px 40px rgba(0,0,0,0.55);
  border: 0;
  padding: 0;
}
.hg-hero__sub {
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  line-height: 1.55;
  color: #cbd5e1;
  max-width: 58ch;
  margin: 0;
}
/* Liner-note stat row under the hero title — the "record sleeve" detail. */
.hg-hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.25rem, 3vw, 2.75rem);
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.16);
}
.hg-stat { display: flex; flex-direction: column; gap: 0.15rem; }
.hg-stat__n {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  font-weight: 700;
  color: #fff;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.hg-stat__l {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #94a3b8;
  font-weight: 600;
}

/* --- 3. SECTION MARKERS ---------------------------------------------------
 * Monocle move: a numeral and a hairline instead of a bare <h2>. Gives the page
 * a spine you can feel while scrolling 40,000px. */
.hg-mark {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin: clamp(3rem, 7vw, 5rem) 0 1.5rem;
}
.hg-mark__n {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--hg-accent);
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}
.hg-mark__rule { flex: 1; height: 1px; background: var(--hg-rule); }

/* --- 4. FULL-WIDTH BANDS --------------------------------------------------
 * Alternating colour so a long page has rhythm instead of one flat navy field. */
.hg-band { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.hg-band--deep { background: var(--hg-ink-2); }
.hg-band--tint {
  background:
    radial-gradient(90% 120% at 80% 0%, color-mix(in srgb, var(--hg-accent) 12%, transparent) 0%, transparent 60%),
    var(--hg-ink-2);
}
.hg-band__h {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.7rem, 3.4vw, 2.6rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.015em;
  color: #f8fafc;
  margin: 0 0 0.75rem;
  border: 0;
  padding: 0;
  text-wrap: balance;
}
.hg-band__sub { color: var(--hg-dim); max-width: 62ch; margin: 0 0 2rem; font-size: 1.02rem; line-height: 1.6; }

/* --- 5. APP SHOWCASE ------------------------------------------------------
 * The screenshots were 351px thumbnails. The app IS the product; show it at a
 * size where the UI is legible, which is what actually converts. */
.hg-shots { display: grid; gap: clamp(1rem, 2.4vw, 1.75rem); grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.hg-shot {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--hg-rule);
  background: var(--hg-ink);
  /* Reserve the box so the lazy image cannot shift layout. */
  aspect-ratio: 16 / 9;
  transition: transform 0.5s cubic-bezier(.2,.7,.3,1), border-color 0.4s, box-shadow 0.5s;
}
.hg-shot > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hg-shot:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--hg-accent) 55%, transparent); box-shadow: 0 18px 50px -18px rgba(0,0,0,0.8); }
.hg-shot__cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 2.25rem 1rem 0.9rem;
  background: linear-gradient(180deg, transparent, rgba(8,11,20,0.94));
  color: #e2e8f0; font-size: 0.85rem; line-height: 1.4;
}
.hg-shot--wide { grid-column: 1 / -1; aspect-ratio: 21 / 9; }

/* --- 6. SCROLL REVEAL -----------------------------------------------------
 * Motion that earns its place: it stages a very long page so each band arrives
 * rather than all existing at once. Opt-in per element, and fully disabled for
 * anyone who asked for less motion. */
 * ⚠️ The hidden state is gated behind `.hg-js`, which an inline script in <head>
 * sets BEFORE first paint. Without JS the class never lands, the rule never
 * applies, and the content is simply visible — so a crawler, a reader with
 * scripting off, or a failed script can never be shown a blank band. Writing
 * `.hg-reveal { opacity: 0 }` unconditionally is how a page hides its own
 * content from Google; do not "simplify" this selector. */
.hg-js .hg-reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(.2,.7,.3,1); }
.hg-js .hg-reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .hg-js .hg-reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .hg-shot { transition: none; }
  .hg-shot:hover { transform: none; }
  .hg-hero__img { transform: none; }
}

/* --- 7. MOBILE ------------------------------------------------------------ */
@media (max-width: 640px) {
  .hg-hero { min-height: 380px; }
  .hg-hero h1, .hg-hero__title { max-width: 16ch; }
  .hg-hero__stats { gap: 1.1rem; }
  .hg-shots { grid-template-columns: 1fr; }
  .hg-shot--wide { aspect-ratio: 16 / 9; }
}

/* Never let a full-bleed element create a horizontal scrollbar. */
html, body { overflow-x: hidden; }

/* --- 8. HERO BACK-LINK ----------------------------------------------------
 * Lives inside the hero. The page's original `.back-link` sat in the container
 * above the full-bleed header and produced a 95px band of dead navy between the
 * masthead and the image; the applier removes it and renders this instead. */
.hg-hero__back {
  /* `display:block` — as inline-block it sat on the same line as the eyebrow
     and the two collided ("← Back to Learn Hub —— HOOKGENIUS · SUNO REFERENCE"). */
  display: block;
  width: fit-content;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(255,255,255,0.72);
  text-decoration: none;
  margin: 0 0 1.75rem;
  transition: color 0.25s;
}
.hg-hero__back:hover { color: #fff; }

/* Pull the hero up through the container's own top padding so the photograph
 * starts immediately under the masthead instead of after a navy gutter.
 *
 * SCOPED to a hero that is actually inside .container. Unscoped, it also fired
 * on pages where the hero sits directly under <body> (no container above it) and
 * dragged the photograph 32px off the top of the viewport — measured on
 * /es/suno-prompts/ and /ja/learn/suno-hip-hop-prompts/ at y=-32. A negative
 * margin that compensates for someone else's padding must name whose. */
.container > .hg-hero.hg-fb { margin-top: -2rem; }
@media (max-width: 640px) { .container > .hg-hero.hg-fb { margin-top: -1.5rem; } }

/* --- 9. DATA WANTS WIDTH --------------------------------------------------
 * A magazine alternates: full-bleed hero → narrow intro → full-width data →
 * narrow prose → full-width showcase. Prose keeps the 800px measure because
 * long lines hurt reading; TABLES do not read left-to-right for meaning, they
 * are scanned, and at 752px the four-column tag tables were cramped enough to
 * need horizontal scroll on a 1511px screen. */
.tg-reference {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  max-width: 100vw;
  padding: clamp(3rem, 6vw, 5rem) clamp(1.25rem, 4vw, 3.5rem);
  background:
    radial-gradient(80% 100% at 100% 0%, color-mix(in srgb, var(--hg-accent) 9%, transparent) 0%, transparent 55%),
    var(--hg-ink-2);
  border-top: 1px solid var(--hg-rule);
  border-bottom: 1px solid var(--hg-rule);
}
.tg-reference > * { max-width: 1180px; margin-left: auto; margin-right: auto; }
.tg-reference > h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.8rem, 3.6vw, 2.8rem);
  line-height: 1.05;
  letter-spacing: -0.018em;
  color: #f8fafc;
  border: 0;
  padding: 0;
  margin-bottom: 1rem;
  /* Same gradient-clip override as the hero h1 — the learn pages apply it to
     headings, and it makes a section title over a tinted band muddy. */
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  -webkit-text-fill-color: #f8fafc;
}
.tg-table { min-width: 0; }            /* width is no longer scarce */
@media (max-width: 900px) { .tg-table { min-width: 520px; } }

/* --- 10. APP SHOWCASE BAND ------------------------------------------------
 * The app gallery shipped as 351px thumbnails. The product IS the app; the
 * screenshots are the strongest conversion asset on a reference page, and at
 * thumbnail size the UI in them is unreadable, which makes them decoration
 * instead of evidence. */
.hg-appband {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  max-width: 100vw;
  padding: clamp(3.5rem, 7vw, 6rem) clamp(1.25rem, 4vw, 3.5rem);
  background:
    radial-gradient(100% 120% at 0% 0%, color-mix(in srgb, var(--hg-accent) 16%, transparent) 0%, transparent 58%),
    linear-gradient(180deg, #0b1020 0%, #0a0e18 100%);
  border-top: 1px solid var(--hg-rule);
}
.hg-appband__inner { max-width: 1280px; margin: 0 auto; }
.hg-appband__eyebrow {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--hg-accent); margin: 0 0 0.85rem;
}

/* --- 11. PROMOTE THE EXISTING APP GALLERY ---------------------------------
 * `.hg-toolgallery` (app-gallery rollout 2026-06-30) carries an INLINE
 * `max-width:1120px` with a `minmax(330px,1fr)` grid, so on a 1440px screen the
 * eight app screenshots rendered three-across at 351px each — too small to read
 * the UI in them, which turns the strongest conversion asset on the page into
 * decoration.
 *
 * `!important` is load-bearing here and is not laziness: an inline style cannot
 * be overridden by a class selector at any specificity. The alternative is
 * rewriting the markup on 300+ pages; overriding two properties is the smaller,
 * more reversible change. If the gallery markup is ever regenerated without the
 * inline cap, these two !importants should be dropped.
 */
.hg-toolgallery {
  max-width: 100vw !important;
  width: 100vw;
  margin-left: calc(50% - 50vw) !important;
  margin-right: calc(50% - 50vw);
  padding: clamp(3.5rem, 7vw, 6rem) clamp(1.25rem, 4vw, 3.5rem) !important;
  background:
    radial-gradient(100% 130% at 0% 0%, color-mix(in srgb, var(--hg-accent) 15%, transparent) 0%, transparent 56%),
    linear-gradient(180deg, #0b1020 0%, #0a0e18 100%);
  border-top: 1px solid var(--hg-rule);
  border-bottom: 1px solid var(--hg-rule);
}
/* Two-across instead of three: ~600px per shot at 1440px, where the app's own
   type is actually legible. */
.hg-toolgallery > div[style*="grid"] {
  max-width: 1280px;
  margin: 0 auto;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)) !important;
  gap: clamp(1rem, 2.2vw, 1.6rem) !important;
}
.hg-toolgallery > div[style*="text-align:center"] { max-width: 760px !important; }
.hg-toolgallery img {
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--hg-rule);
  background: var(--hg-ink);
  transition: transform 0.5s cubic-bezier(.2,.7,.3,1), border-color 0.4s, box-shadow 0.5s;
}
.hg-toolgallery img:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--hg-accent) 55%, transparent);
  box-shadow: 0 20px 55px -20px rgba(0,0,0,0.85);
}
.hg-toolgallery h2 { font-size: clamp(1.7rem, 3.2vw, 2.5rem) !important; }
@media (prefers-reduced-motion: reduce) {
  .hg-toolgallery img, .hg-toolgallery img:hover { transition: none; transform: none; }
}

/* <picture> wraps the hero image (WebP with a JPEG fallback: 182 KB → 45 KB
 * average, 75% lighter, measured 2026-09-11). The wrapper is a block element in
 * normal flow, so without this the absolutely-positioned img inside it would be
 * positioned against the wrong containing block and the scrim would sit over a
 * blank area. `display: contents` makes the wrapper vanish from layout entirely,
 * leaving the img positioned against .hg-hero exactly as before. */
.hg-hero > picture { display: contents; }

/* --- 12. TOOL-PAGE HERO ---------------------------------------------------
 * A page whose job is to RUN something gets a shorter hero. On
 * /learn/suno-prompt-generator/ the working builder's first control sat at
 * y=1240 — below the fold, behind the hero and four paragraphs that restate one
 * another — while every competitor holding the top 4 for that query puts the
 * tool at the top with "no sign-up" next to it. The photograph still sets the
 * tone; it just stops being the whole first screen. */
.hg-hero--tool { min-height: clamp(280px, 34vh, 380px); }
.hg-hero--tool h1 { font-size: clamp(2rem, 4.4vw, 3.1rem); max-width: 26ch; }
.hg-hero--tool .hg-hero__inner { padding-top: clamp(1.75rem, 4vw, 2.75rem); }

/* The hoisted builder sits immediately under the BLUF. Give it the weight of a
 * band so it reads as the page's main event rather than an inline widget. */
section.hgb {
  scroll-margin-top: 80px;
  border: 1px solid color-mix(in srgb, var(--hg-accent) 28%, transparent);
  border-radius: 18px;
  background:
    radial-gradient(90% 130% at 100% 0%, color-mix(in srgb, var(--hg-accent) 13%, transparent) 0%, transparent 58%),
    linear-gradient(180deg, #101728 0%, #0b1020 100%);
  box-shadow: 0 24px 60px -28px rgba(0,0,0,0.85);
}
