.home-shell {
  width: min(100% - 48px, 1120px);
  margin: 0 auto;
}
.home-header {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}
.home-brand, .home-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}
.home-brand { gap: 8px; font-weight: 700; text-decoration: none; }
.home-brand img { display: block; object-fit: contain; }
.home-nav { font-size: 14px; }
.home-nav a { text-decoration: none; }
.home-nav a:not(.button-link):hover { color: var(--link); }
.home-intro {
  padding-block: clamp(48px, 10vw, 112px) 48px;
}
.home-intro h1 {
  max-width: 15ch;
  margin: 0;
  font-size: clamp(2.25rem, 1.25rem + 5vw, 5.5rem);
  line-height: 1.02;
  letter-spacing: -.055em;
  text-wrap: balance;
}
.home-intro p {
  max-width: 51ch;
  margin: 24px 0 0;
  font-size: clamp(1rem, .875rem + .5vw, 1.25rem);
  line-height: 1.55;
}
.home-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  padding-block: clamp(32px, 7vw, 112px) 48px;
}
.home-intro-copy { position: relative; z-index: 1; }
.home-intro-copy .button-link { margin-block-start: 24px; }
.home-register { display: inline-block; margin-inline-start: 12px; }
.meruna-hero-mark { position: relative; isolation: isolate; overflow: hidden; }
.meruna-hero-mark::before {
  content: "";
  position: absolute;
  inset: 12%;
  z-index: -1;
  background: radial-gradient(ellipse, rgb(17 26 41 / .055), transparent 68%);
  opacity: .45;
}
.meruna-hero-mark svg { display: block; inline-size: 100%; block-size: auto; }
.meruna-hero-chip, .meruna-hero-star { transform-origin: center; transform-box: view-box; }
@media (prefers-reduced-motion: no-preference) {
  .meruna-mark-shine { animation: meruna-mark-light 3.1s 2.55s cubic-bezier(.37,0,.63,1) both; }
  .meruna-hero-chip { animation: meruna-chip-arrival 550ms ease-out both; }
  .meruna-hero-star {
    /* Match the swept path used by the SVG trail mask. */
    offset-path: path("M4 128C27 177 73 190 114 173C182 145 204 78 151 26");
    offset-position: 0 0;
    offset-anchor: 0 0;
    offset-rotate: 0deg;
    animation: meruna-star-motion 1.9s 420ms cubic-bezier(.32,.04,.26,1) both,
               meruna-star-in 220ms 420ms ease-out both;
  }
  .meruna-comet-trail { animation: meruna-trail-draw 1.9s 420ms cubic-bezier(.32,.04,.26,1) both; stroke-dasharray: 1; }
}
@keyframes meruna-chip-arrival { from { opacity: 0; transform: scale(.88); } to { opacity: 1; transform: scale(1); } }
@keyframes meruna-trail-draw { from { stroke-dashoffset: .72; opacity: 0; } to { stroke-dashoffset: 0; opacity: 1; } }
@media (max-width: 760px) {
  .home-intro { grid-template-columns: minmax(0, 1fr); gap: 16px; padding-block: 32px; }
  .meruna-hero-mark { inline-size: min(100%, 360px); justify-self: center; }
}

/* The public home is one viewport. Its composition fits before the artwork is shown. */
.home-shell {
  block-size: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}
.home-shell > main { min-block-size: 0; display: grid; }
.home-intro {
  min-block-size: 0;
  padding-block: clamp(8px, 3dvh, 32px);
}
.home-intro h1 { font-size: clamp(1.75rem, min(6vw, 12dvh), 5rem); }
.meruna-hero-mark { inline-size: min(100%, 64dvh); justify-self: center; }
@media (max-width: 760px) {
  .home-shell { inline-size: calc(100% - 32px); }
  .home-header { min-block-size: 56px; min-height: 0; padding-block: 8px; flex-wrap: wrap; }
  .home-nav { gap: 8px; }
  .home-intro { grid-template-rows: auto minmax(0, 1fr); align-content: center; }
  .home-intro h1 { max-inline-size: 22ch; font-size: clamp(1.65rem, min(8vw, 7dvh), 2.75rem); }
  .home-intro p { margin-block-start: 12px; }
  .home-intro-copy .button-link { margin-block-start: 12px; }
  .meruna-hero-mark { inline-size: min(100%, 36dvh, 320px); align-self: center; }
}
@media (max-height: 520px) {
  .home-header { min-height: 48px; }
  .home-intro { gap: 8px; }
  .home-intro p { margin-block-start: 8px; font-size: .9375rem; }
  .home-intro-copy .button-link { margin-block-start: 8px; }
}
@media (max-width: 760px) and (max-height: 520px) {
  .home-intro { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); grid-template-rows: minmax(0, 1fr); }
  .home-intro h1 { font-size: clamp(1.25rem, 5vw, 2rem); }
  .meruna-hero-mark { inline-size: min(100%, 42dvh); }
}

.home-shell > main { grid-template-rows: minmax(0, 1fr) auto; gap: clamp(8px, 2dvh, 24px); }
.home-intro h1 { max-inline-size: 17ch; font-size: clamp(1.75rem, min(5.5vw, 9dvh), 4.75rem); font-weight: 700; }
.home-intro h1 strong, .home-copy-accent { color: var(--link); font-weight: 700; }
.meruna-hero-mark { inline-size: min(100%, 48dvh, 460px); }
.meruna-mark-animation { display: none; }
.meruna-mark-shine { opacity: 0; }
@keyframes meruna-mark-light {
  from { transform: translateX(0) skewX(-17deg); opacity: 0; }
  18%, 82% { opacity: 1; }
  to { transform: translateX(320px) skewX(-17deg); opacity: 0; }
}
.home-stories { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding-block-end: clamp(8px, 2dvh, 24px); }
.home-story { padding: clamp(12px, 2.2dvh, 24px); }
.home-story h2 { font-size: clamp(1rem, 1.5vw, 1.25rem); }
.home-story p { margin-block-start: 8px; font-size: .9375rem; line-height: 1.45; }
.home-story-choice, .home-story-picker { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .meruna-mark-animation { display: inline; animation: meruna-animation-out 180ms 2.32s both; }
  .meruna-mark-poster { animation: meruna-poster-in 180ms 2.32s both; }
}
@keyframes meruna-star-motion { from { offset-distance: 28%; } to { offset-distance: 100%; } }
@keyframes meruna-star-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes meruna-animation-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes meruna-poster-in { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 760px) {
  .home-intro { gap: 8px; }
  .home-intro h1 { max-inline-size: 22ch; font-size: clamp(1.5rem, 6.5vw, 2.5rem); }
  .meruna-hero-mark { inline-size: min(100%, 25dvh, 260px); }
  .home-stories { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .home-story-choice { display: block; position: absolute; inline-size: 1px; block-size: 1px; clip-path: inset(50%); overflow: hidden; }
  .home-story-picker { display: flex; flex-wrap: wrap; gap: 4px; }
  .home-story-picker label { cursor: pointer; font-size: .875rem; padding: 4px 8px; border-radius: var(--radius-button); color: var(--link); }
  .home-story { grid-row: 2; grid-column: 1; visibility: hidden; }
  #home-story-1:checked ~ .home-story:nth-of-type(1),
  #home-story-2:checked ~ .home-story:nth-of-type(2),
  #home-story-3:checked ~ .home-story:nth-of-type(3) { visibility: visible; }
  #home-story-1:checked ~ .home-story-picker label[for="home-story-1"],
  #home-story-2:checked ~ .home-story-picker label[for="home-story-2"],
  #home-story-3:checked ~ .home-story-picker label[for="home-story-3"] { background: var(--elevated); color: var(--ink); font-weight: 700; }
  #home-story-1:focus-visible ~ .home-story-picker label[for="home-story-1"],
  #home-story-2:focus-visible ~ .home-story-picker label[for="home-story-2"],
  #home-story-3:focus-visible ~ .home-story-picker label[for="home-story-3"] { outline: 2px solid var(--link); }
}
@media (max-height: 520px) {
  .home-intro h1 { font-size: clamp(1.25rem, 4.5vw, 2.5rem); }
  .meruna-hero-mark { inline-size: min(100%, 26dvh, 160px); }
  .home-story { padding: 8px 12px; }
  .home-story p { margin-block-start: 4px; font-size: .875rem; }
}
@media (max-width: 460px) and (max-height: 650px) {
  .home-intro { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .home-intro h1 { font-size: clamp(1.25rem, 6vw, 1.75rem); }
  .meruna-hero-mark { inline-size: min(100%, 20dvh, 160px); }
}


/* Broad, low-contrast light on the paper surface. */
.meruna-home { isolation: isolate; }
@media (prefers-reduced-motion: no-preference) {
  .meruna-home::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
      radial-gradient(ellipse at 32% 36%, rgb(255 254 250 / .58), transparent 56%),
      radial-gradient(ellipse at 72% 68%, rgb(21 32 51 / .052), transparent 62%);
    animation: meruna-paper-drift 27s ease-in-out infinite alternate;
  }
}
@keyframes meruna-paper-drift {
  from { transform: translate(-5%, 2%) scale(1.1); opacity: .64; }
  to { transform: translate(5%, -2%) scale(1.16); opacity: .98; }
}
