/* =============================================================
   Magically Yours — Soprano
   Sticker-book pop: each section owns a color.
     Stories = bubblegum   Artwork = splash   Videos = lemon
     Fashion = grape       Designs = lime
   ============================================================= */
:root {
  --ink: #1e1240;
  --ink-soft: #4b3d72;
  --paper: #fff5fb;
  --white: #ffffff;
  --pink: #ff3ea5;
  --pink-tint: #ffd6ec;
  --aqua: #00c2ff;
  --aqua-tint: #d4f4ff;
  --lemon: #ffd93d;
  --lemon-tint: #fff4bf;
  --grape: #8b3dff;
  --grape-tint: #eadcff;
  --lime: #7cf25b;
  --lime-tint: #dcffd0;
  --danger: #e0144c;

  --font-display: "Bagel Fat One", "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  --font-ui: "Fredoka", "Nunito", "Trebuchet MS", system-ui, sans-serif;

  --line: 3px solid var(--ink);
  --pop: 4px 4px 0 var(--ink);
  --pop-big: 7px 7px 0 var(--ink);
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 68px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(rgba(255, 62, 165, .13) 1.3px, transparent 1.6px);
  background-size: 15px 15px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.site-main { flex: 1 0 auto; }
img, video { max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--grape); }
h1, h2, h3 { line-height: 1.1; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--grape); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }
.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; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--lemon); padding: .5em 1em; border: var(--line); border-radius: 999px; }
.skip-link:focus { left: 8px; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.inline-form { display: inline; margin: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.muted { color: var(--ink-soft); }
.fine-print { font-size: .875rem; color: var(--ink-soft); }
code { background: var(--lemon-tint); padding: .1em .35em; border-radius: 4px; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--white);
  --btn-fg: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  padding: .7em 1.35em;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 1.02rem;
  line-height: 1.15;
  text-decoration: none;
  text-align: center;
  color: var(--btn-fg);
  background: var(--btn-bg);
  border: var(--line);
  border-radius: 999px;
  box-shadow: var(--pop);
  cursor: pointer;
  transition: transform .08s ease, box-shadow .08s ease;
}
.btn:hover { color: var(--btn-fg); transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn-pink  { --btn-bg: var(--pink); }
.btn-aqua  { --btn-bg: var(--aqua); }
.btn-lemon { --btn-bg: var(--lemon); }
.btn-lime  { --btn-bg: var(--lime); }
.btn-grape { --btn-bg: var(--grape); --btn-fg: var(--white); }
.btn-white { --btn-bg: var(--white); }
.btn-danger { --btn-bg: var(--white); --btn-fg: var(--danger); }
.btn-sm { padding: .4em .95em; font-size: .9rem; box-shadow: 2px 2px 0 var(--ink); border-width: 2px; }
.btn-sm:hover { box-shadow: 3px 3px 0 var(--ink); }
.btn-block { display: flex; width: 100%; }
.link-btn { background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--paper);
  border-bottom: var(--line);
}
.header-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 1rem;
}
.brand { display: flex; flex-direction: column; text-decoration: none; line-height: 1; margin-right: auto; }
.brand-name {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--pink);
  -webkit-text-stroke: 1.5px var(--ink);
  paint-order: stroke fill;
  text-shadow: 2px 2px 0 var(--ink);
  letter-spacing: .01em;
}
.brand-sub { font-weight: 600; font-size: .78rem; letter-spacing: .02em; margin-top: 3px; }
.brand:hover .brand-name { color: var(--pink); }

.site-nav { display: flex; align-items: center; gap: 1.25rem; }
.nav-list { display: flex; gap: .3rem; list-style: none; margin: 0; padding: 0; }
.nav-link {
  --c: var(--pink);
  display: block;
  padding: .35em .85em;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: 999px;
}
.nav-link:hover { color: var(--ink); background: color-mix(in srgb, var(--c) 30%, transparent); }
.nav-link.is-active { background: var(--c); border-color: var(--ink); }
.nav-link.c-grape.is-active { color: var(--white); }
.c-pink  { --c: var(--pink);  --c-tint: var(--pink-tint); }
.c-aqua  { --c: var(--aqua);  --c-tint: var(--aqua-tint); }
.c-lemon { --c: var(--lemon); --c-tint: var(--lemon-tint); }
.c-grape { --c: var(--grape); --c-tint: var(--grape-tint); }
.c-lime  { --c: var(--lime);  --c-tint: var(--lime-tint); }

.nav-account { display: flex; align-items: center; gap: .75rem; }
.nav-mini { font-weight: 500; text-decoration: none; background: none; border: 0; padding: .3em 0; cursor: pointer; }
.nav-mini:hover, .nav-mini.is-active { text-decoration: underline; text-decoration-thickness: 3px; text-decoration-color: var(--pink); }

.menu-btn {
  display: none;
  align-items: center;
  gap: .5em;
  padding: .45em .9em;
  font-weight: 600;
  background: var(--lemon);
  border: var(--line);
  border-radius: 999px;
  box-shadow: 2px 2px 0 var(--ink);
  cursor: pointer;
}
.menu-icon, .menu-icon::before, .menu-icon::after {
  display: block; width: 18px; height: 3px; background: var(--ink); border-radius: 2px; position: relative;
}
.menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
.menu-icon::before { top: -6px; }
.menu-icon::after { top: 6px; }

@media (max-width: 940px) {
  .menu-btn { display: inline-flex; }
  .site-nav {
    display: none;
    position: absolute;
    left: 0; right: 0; top: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--paper);
    border-bottom: var(--line);
    padding: 12px var(--gutter) 20px;
  }
  .site-nav.is-open { display: flex; }
  .nav-list { flex-direction: column; gap: 8px; }
  .nav-link {
    padding: .6em 1em;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 1.5rem;
    background: var(--c);
    border: var(--line);
    border-radius: 16px;
  }
  .nav-link.c-grape { color: var(--white); }
  .nav-link.is-active { box-shadow: 5px 5px 0 var(--ink); transform: translate(-2px, -2px); }
  .nav-account { justify-content: space-between; margin-top: 16px; flex-wrap: wrap; }
}

/* ---------- Flash messages ---------- */
.flashes { max-width: var(--wrap); margin: 16px auto 0; padding: 0 var(--gutter); display: grid; gap: 8px; }
.flash {
  display: flex; align-items: flex-start; gap: 1rem;
  padding: .75em 1em;
  background: var(--lime-tint);
  border: var(--line);
  border-radius: 14px;
  box-shadow: 3px 3px 0 var(--ink);
}
.flash p { margin: 0; flex: 1; font-weight: 500; }
.flash-error { background: #ffd9e2; }
.flash-info  { background: var(--aqua-tint); }
.flash-close { background: none; border: 0; font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 0 .2em; }

/* ---------- Homepage hero ---------- */
.hero { padding: clamp(28px, 6vw, 72px) 0 clamp(32px, 6vw, 64px); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: clamp(24px, 5vw, 64px); align-items: center; }
.wordmark {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(4.4rem, 21.5vw, 11rem);
  line-height: .9;
  letter-spacing: -.01em;
  color: var(--pink);
  -webkit-text-stroke: .035em var(--ink);
  paint-order: stroke fill;
  text-shadow: .045em .045em 0 var(--aqua), .09em .09em 0 var(--ink);
  white-space: nowrap;
}
.wordmark span { display: inline-block; }
.wordmark span:nth-child(3n+2) { color: var(--lemon); }
.wordmark span:nth-child(3n)   { color: var(--lime); }
@media (prefers-reduced-motion: no-preference) {
  .wordmark span {
    animation: slap .55s cubic-bezier(.2, 1.6, .4, 1) both;
    animation-delay: calc(var(--i) * 70ms + 120ms);
  }
  @keyframes slap {
    from { opacity: 0; transform: translateY(-.35em) rotate(-14deg) scale(1.35); }
    to   { opacity: 1; transform: none; }
  }
}
.ribbon {
  display: inline-block;
  margin: 1.1rem 0 0;
  padding: .3em .9em;
  font-weight: 700;
  font-size: clamp(1.05rem, 2.6vw, 1.45rem);
  background: var(--lemon);
  border: var(--line);
  border-radius: 6px;
  transform: rotate(-3deg);
  box-shadow: 3px 3px 0 var(--ink);
}
.hero-tagline { max-width: 32ch; margin: 1.4rem 0 1.6rem; font-size: clamp(1.1rem, 2.4vw, 1.4rem); line-height: 1.45; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-sticker {
  position: relative;
  display: block;
  justify-self: center;
  width: min(100%, 340px);
  padding: 12px 12px 0;
  background: var(--white);
  border: var(--line);
  border-radius: 22px;
  box-shadow: var(--pop-big);
  text-decoration: none;
  transform: rotate(3.5deg);
  transition: transform .2s ease;
}
.hero-sticker:hover { color: var(--ink); transform: rotate(1deg) translateY(-4px); }
.hero-sticker img, .hero-sticker .cover-fallback { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border: 2px solid var(--ink); border-radius: 12px; }
.sticker-badge {
  position: absolute; top: -18px; left: -18px; z-index: 2;
  display: grid; place-items: center;
  width: 64px; height: 64px;
  font-family: var(--font-display); font-size: 1.1rem;
  background: var(--lime);
  border: var(--line);
  border-radius: 50%;
  transform: rotate(-12deg);
}
.sticker-caption { display: block; padding: .7em .3em .9em; font-size: .95rem; }
.sticker-caption strong { display: block; font-size: 1.15rem; }

@media (max-width: 760px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-sticker { width: min(64%, 250px); margin-top: 12px; }
}

/* ---------- Sections ---------- */
.section { padding: clamp(28px, 5vw, 56px) 0; }
.section-tight { padding-top: 8px; padding-bottom: clamp(28px, 5vw, 56px); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.section-head h2, .page-title, .section-title {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: .005em;
}
.section-head h2 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3rem);
  padding-bottom: .1em;
  background: linear-gradient(var(--c), var(--c)) no-repeat left 92% / 100% .32em;
}
.see-all { font-weight: 600; white-space: nowrap; text-decoration-color: var(--c); }
.page-head { padding-top: clamp(24px, 5vw, 48px); padding-bottom: 20px; }
.page-title { font-size: clamp(2.3rem, 7vw, 4rem); margin-bottom: .25em; }
.page-head .page-title { display: inline; background: linear-gradient(var(--c), var(--c)) no-repeat left 88% / 100% .3em; }
.page-lede { max-width: 40ch; margin-top: .9em; font-size: 1.15rem; }
.section-title { font-size: clamp(1.6rem, 4vw, 2.1rem); }
.empty-note { padding: 1.2em 1.4em; background: var(--white); border: 2px dashed var(--ink); border-radius: 16px; max-width: 46ch; }
.empty-page { padding-top: 64px; padding-bottom: 80px; }

/* ---------- Chips ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 1em; }
.chip {
  display: inline-block;
  padding: .15em .7em;
  font-size: .85rem;
  font-weight: 600;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 999px;
}
.chip-pink { background: var(--pink-tint); }
.chip-link { text-decoration: none; }
.chip-link:hover { background: var(--pink-tint); color: var(--ink); }
.chip-link.is-on { background: var(--pink); }

/* ---------- Story cards ---------- */
.story-row, .story-grid { list-style: none; margin: 0; padding: 0; }
.story-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(150px, 210px);
  gap: 20px;
  overflow-x: auto;
  padding: 6px 6px 18px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}
.story-row > li { scroll-snap-align: start; }
.story-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(160px, 42vw), 1fr)); gap: 24px 20px; }
.story-card { display: flex; flex-direction: column; gap: 8px; text-decoration: none; }
.story-cover {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--pink-tint);
  border: var(--line);
  border-radius: 16px;
  transition: transform .12s ease, box-shadow .12s ease;
}
.story-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.story-card:hover { color: var(--ink); }
.story-card:hover .story-cover { transform: translate(-2px, -2px) rotate(-1deg); box-shadow: 6px 6px 0 var(--pink); }
.cover-fallback {
  display: grid; place-items: center;
  width: 100%; height: 100%;
  padding: 1rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
  text-align: center;
  background: repeating-linear-gradient(-45deg, var(--pink-tint) 0 14px, var(--lemon-tint) 14px 28px);
}
.cover-tag { position: absolute; right: 8px; bottom: 8px; padding: .1em .6em; font-size: .78rem; font-weight: 700; background: var(--lime); border: 2px solid var(--ink); border-radius: 999px; }
.story-card-title { font-weight: 700; font-size: 1.08rem; line-height: 1.2; }
.story-card-meta { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--ink-soft); }

/* ---------- Gallery peeks (homepage) ---------- */
.peek-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 760px) { .peek-grid { grid-template-columns: repeat(2, 1fr); } }
.peek {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--c-tint);
  border: var(--line);
  border-radius: 14px;
  text-decoration: none;
}
.peek img, .peek video { width: 100%; height: 100%; object-fit: cover; display: block; }
.peek-title {
  position: absolute; left: 8px; right: 8px; bottom: 8px;
  padding: .2em .6em;
  font-size: .85rem; font-weight: 600;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 999px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.peek:hover { color: var(--ink); box-shadow: 5px 5px 0 var(--c); }
.play-dot {
  position: absolute; top: 50%; left: 50%;
  width: 54px; height: 54px; margin: -27px 0 0 -27px;
  background: var(--lemon);
  border: var(--line);
  border-radius: 50%;
}
.play-dot::after {
  content: ""; position: absolute; left: 20px; top: 14px;
  border-style: solid; border-width: 10px 0 10px 16px;
  border-color: transparent transparent transparent var(--ink);
}

/* ---------- About bubble ---------- */
.about-bubble {
  position: relative;
  max-width: 760px;
  padding: clamp(24px, 5vw, 44px);
  background: var(--white);
  border: var(--line);
  border-radius: 48px;
  box-shadow: var(--pop-big);
}
.about-bubble::after {
  content: "";
  position: absolute; left: 70px; bottom: -26px;
  width: 44px; height: 44px;
  background: var(--white);
  border-right: var(--line); border-bottom: var(--line);
  transform: rotate(50deg) skew(16deg, 16deg);
}
.about-bubble h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.8rem, 5vw, 2.6rem); }
.about-bubble p { font-size: 1.15rem; max-width: 52ch; }
.about-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 1.4rem 0 0; }
.section-about { padding-bottom: 80px; }

/* ---------- Story page ---------- */
.story-page { padding-top: clamp(24px, 5vw, 48px); padding-bottom: 64px; }
.story-hero { display: grid; grid-template-columns: minmax(200px, 340px) minmax(0, 1fr); gap: clamp(24px, 5vw, 56px); align-items: start; }
@media (max-width: 720px) { .story-hero { grid-template-columns: 1fr; } .story-cover-big { max-width: 210px; } }
.story-cover-big {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: var(--line);
  border-radius: 20px;
  box-shadow: var(--pop-big);
  background: var(--pink-tint);
  transform: rotate(-1.5deg);
}
.story-cover-big img { width: 100%; height: 100%; object-fit: cover; display: block; }
.story-info .page-title { font-size: clamp(2.2rem, 6vw, 3.6rem); }
.synopsis { max-width: 60ch; font-size: 1.12rem; margin-bottom: 1.4rem; }
.story-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: .6rem; }
.author-note {
  margin-top: 1.6rem;
  max-width: 60ch;
  padding: 1em 1.2em;
  background: var(--lemon-tint);
  border: var(--line);
  border-radius: 6px;
  box-shadow: 4px 4px 0 var(--ink);
}
.author-note h2 { font-size: 1.05rem; margin-bottom: .4em; }
.author-note p { margin: 0; }

.heart { width: 1em; height: 1em; display: inline-block; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-7.5-4.6-9.6-9.2C.9 8.4 3 4.5 6.7 4.5c2.1 0 3.6 1.2 4.3 2.4h2c.7-1.2 2.2-2.4 4.3-2.4 3.7 0 5.8 3.9 4.3 7.3C19.5 16.4 12 21 12 21z' fill='none' stroke='black' stroke-width='2.4'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-7.5-4.6-9.6-9.2C.9 8.4 3 4.5 6.7 4.5c2.1 0 3.6 1.2 4.3 2.4h2c.7-1.2 2.2-2.4 4.3-2.4 3.7 0 5.8 3.9 4.3 7.3C19.5 16.4 12 21 12 21z' fill='none' stroke='black' stroke-width='2.4'/%3E%3C/svg%3E") center / contain no-repeat;
}
[aria-pressed="true"] .heart {
  color: var(--pink);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-7.5-4.6-9.6-9.2C.9 8.4 3 4.5 6.7 4.5c2.1 0 3.6 1.2 4.3 2.4h2c.7-1.2 2.2-2.4 4.3-2.4 3.7 0 5.8 3.9 4.3 7.3C19.5 16.4 12 21 12 21z'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-7.5-4.6-9.6-9.2C.9 8.4 3 4.5 6.7 4.5c2.1 0 3.6 1.2 4.3 2.4h2c.7-1.2 2.2-2.4 4.3-2.4 3.7 0 5.8 3.9 4.3 7.3C19.5 16.4 12 21 12 21z'/%3E%3C/svg%3E");
}
.fav-btn[aria-pressed="true"] { --btn-bg: var(--pink-tint); }
@media (prefers-reduced-motion: no-preference) {
  .is-popping .heart { animation: heart-pop .35s ease; }
  @keyframes heart-pop { 50% { transform: scale(1.5); } }
}

.chapter-list { margin-top: clamp(32px, 6vw, 56px); max-width: 760px; }
.chapters { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.chapter-row a {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 16px 10px 10px;
  background: var(--white);
  border: var(--line);
  border-radius: 16px;
  text-decoration: none;
}
.chapter-row a:hover { color: var(--ink); background: var(--pink-tint); }
.chapter-row.is-current a { box-shadow: 4px 4px 0 var(--pink); }
.chapter-row.is-draft a { border-style: dashed; background: transparent; }
.ch-num {
  flex: none;
  display: grid; place-items: center;
  width: 46px; height: 46px;
  font-family: var(--font-display); font-size: 1.25rem;
  background: var(--pink);
  border: var(--line);
  border-radius: 50%;
}
.ch-text { display: flex; flex-direction: column; min-width: 0; }
.ch-title { font-weight: 600; }
.ch-meta { font-size: .88rem; color: var(--ink-soft); display: flex; gap: 12px; }
.ch-likes::before { content: "♥ "; color: var(--pink); }

.preview-banner {
  padding: .6em var(--gutter);
  text-align: center;
  font-weight: 600;
  background: repeating-linear-gradient(-45deg, var(--lemon) 0 12px, var(--lemon-tint) 12px 24px);
  border-bottom: var(--line);
}

/* ---------- Gallery ---------- */
.cat-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 1.2rem; }
.cat-tab {
  padding: .35em 1em;
  font-weight: 600;
  text-decoration: none;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 999px;
}
.cat-tab:hover { color: var(--ink); background: var(--c-tint); }
.cat-tab.is-active { background: var(--c); border-width: 3px; }
.cat-tab.c-grape.is-active { color: var(--white); }

.masonry { list-style: none; margin: 0; padding: 0; columns: 3 260px; column-gap: 18px; }
.masonry > li { break-inside: avoid; margin-bottom: 18px; }
@media (max-width: 600px) {
  .masonry { columns: 2; column-gap: 12px; }
  .masonry > li { margin-bottom: 12px; }
  .tile { padding: 5px 5px 0; border-width: 2px; border-radius: 12px; }
  .tile img, .tile video { border-radius: 8px; }
  .tile-caption { font-size: .88rem; padding: .4em .2em .55em; }
  .tile .play-dot { transform: scale(.75); }
}
.tile {
  position: relative;
  display: block;
  width: 100%;
  padding: 8px 8px 0;
  text-align: left;
  background: var(--white);
  border: var(--line);
  border-radius: 16px;
  cursor: zoom-in;
}
.tile:hover { box-shadow: 5px 5px 0 var(--c); }
.tile img, .tile video { display: block; width: 100%; border-radius: 10px; border: 2px solid var(--ink); background: var(--c-tint); }
.tile-fallback { display: grid; place-items: center; aspect-ratio: 16 / 9; border-radius: 10px; background: var(--c-tint); font-weight: 700; }
.tile .play-dot { top: calc(50% - 18px); }
.tile-caption { display: block; padding: .55em .3em .7em; font-weight: 600; }

.lightbox {
  width: min(96vw, 980px);
  max-height: 94vh;
  padding: 0;
  background: var(--white);
  border: var(--line);
  border-radius: 20px;
  box-shadow: var(--pop-big);
}
.lightbox::backdrop { background: rgba(30, 18, 64, .82); }
.lightbox-inner { position: relative; display: flex; flex-direction: column; max-height: 94vh; }
.lightbox-media { display: grid; place-items: center; background: var(--ink); min-height: 200px; }
.lightbox-media img, .lightbox-media video { max-height: 72vh; width: auto; max-width: 100%; display: block; }
.lightbox-media iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; display: block; }
.lightbox-media.is-vertical iframe { aspect-ratio: 9 / 16; max-height: 72vh; width: auto; height: 72vh; }
.lightbox-text { padding: 14px 20px 18px; overflow-y: auto; }
.lightbox-title { font-family: var(--font-display); font-weight: 400; font-size: 1.5rem; margin: 0 0 .3em; }
.lightbox-desc { margin: 0; white-space: pre-line; }
.lightbox-close {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 44px; height: 44px;
  font-size: 1.6rem; line-height: 1;
  background: var(--lemon);
  border: var(--line);
  border-radius: 50%;
  cursor: pointer;
}

/* ---------- Forms ---------- */
.auth-wrap { padding-top: clamp(28px, 6vw, 64px); padding-bottom: 80px; }
.form-card {
  max-width: 460px;
  margin: 0 auto;
  padding: clamp(22px, 5vw, 36px);
  background: var(--white);
  border: var(--line);
  border-radius: 24px;
  box-shadow: var(--pop-big);
}
.form-wide { max-width: 720px; }
.stack-form { display: grid; gap: 16px; margin-top: 1rem; }
.field { display: grid; gap: 6px; font-weight: 600; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.hint { font-weight: 400; font-size: .86rem; color: var(--ink-soft); }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], select, textarea {
  width: 100%;
  padding: .65em .85em;
  font-weight: 400;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 12px;
}
textarea { resize: vertical; line-height: 1.45; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--aqua); }
.check { display: inline-flex; align-items: center; gap: .5em; font-weight: 500; cursor: pointer; }
.check input { width: 1.15em; height: 1.15em; accent-color: var(--pink); }
.form-errors { padding: .8em 1.1em; margin: 1rem 0; background: #ffd9e2; border: var(--line); border-radius: 14px; }
.form-errors ul { margin: 0; padding-left: 1.1em; }
.form-errors p { margin: 0; }
.form-switch { margin: 1.3rem 0 0; text-align: center; }
.checklist { list-style: none; padding: 0; display: grid; gap: 6px; margin-bottom: 1.6rem; }
.checklist li { padding: .4em .8em; border: 2px solid var(--ink); border-radius: 10px; }
.checklist .is-ok { background: var(--lime-tint); }
.checklist .is-ok strong::before { content: "✓ "; }
.checklist .is-bad { background: #ffd9e2; }
.checklist .is-bad strong::before { content: "✗ "; }

/* ---------- Account ---------- */
.continue-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.continue-item { display: flex; align-items: center; gap: 12px; padding: 10px; background: var(--white); border: var(--line); border-radius: 16px; text-decoration: none; }
.continue-item:hover { color: var(--ink); box-shadow: 4px 4px 0 var(--pink); }
.continue-item img { width: 56px; aspect-ratio: 3 / 4; object-fit: cover; border: 2px solid var(--ink); border-radius: 8px; }
.continue-item strong { display: block; }

/* ---------- Footer ---------- */
.site-footer { margin-top: auto; background: var(--ink); color: var(--white); border-top: 6px solid var(--pink); }
.footer-inner { max-width: var(--wrap); margin: 0 auto; padding: 40px var(--gutter) 48px; display: grid; gap: 20px; }
.footer-brand .brand-name { font-size: 2.2rem; text-shadow: 3px 3px 0 var(--aqua); -webkit-text-stroke: 0; }
.footer-brand p { margin: 4px 0 0; font-weight: 600; }
.footer-social, .footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.footer-social a { display: inline-block; padding: .35em 1em; font-weight: 600; color: var(--ink); text-decoration: none; background: var(--lemon); border-radius: 999px; }
.footer-social li:nth-child(2) a { background: var(--aqua); }
.footer-social li:nth-child(3) a { background: var(--lime); }
.footer-links a { color: var(--white); }
.footer-links a:hover { color: var(--lemon); }
.footer-legal { margin: 0; font-size: .88rem; opacity: .85; max-width: 60ch; }

/* =============================================================
   Phone reader (vertical scrolling)
   ============================================================= */
body.reader {
  background: var(--ink);
  background-image: radial-gradient(rgba(255, 255, 255, .06) 1.3px, transparent 1.6px);
  background-size: 15px 15px;
  color: var(--white);
}
.reader-progress { position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 60; }
.reader-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--pink), var(--lemon), var(--lime)); }
.reader-bar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(30, 18, 64, .94);
  border-bottom: 2px solid var(--pink);
  transition: transform .25s ease;
}
.reader-bar.is-hidden { transform: translateY(-110%); }
.reader-back {
  flex: none;
  display: grid; place-items: center;
  width: 40px; height: 40px;
  font-size: 1.8rem; line-height: 1;
  color: var(--ink);
  text-decoration: none;
  background: var(--pink);
  border-radius: 50%;
}
.reader-back:hover { color: var(--ink); }
.reader-titles { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.2; }
.reader-story { font-size: .8rem; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-chapter { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-home { font-family: var(--font-display); color: var(--pink); text-decoration: none; font-size: 1.15rem; }
.reader-home:hover { color: var(--lemon); }
body.reader .preview-banner { color: var(--ink); }

.strip {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  background: var(--white);
  color: var(--ink);
}
.strip .panel > img { width: 100%; }
.strip-empty { padding: 4rem 1.5rem; text-align: center; margin: 0; }

.chapter-end {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 20px calc(56px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  text-align: center;
}
.end-mark { margin: 0; font-family: var(--font-display); font-size: clamp(1.6rem, 6vw, 2.2rem); color: var(--lemon); }
.like-btn {
  display: inline-flex; align-items: center; gap: .6em;
  padding: .75em 1.4em;
  font-weight: 600; font-size: 1.05rem;
  color: var(--ink); text-decoration: none;
  background: var(--white);
  border: var(--line);
  border-radius: 999px;
  box-shadow: 4px 4px 0 var(--pink);
  cursor: pointer;
}
.like-btn:hover { color: var(--ink); }
.like-btn[aria-pressed="true"] { background: var(--pink-tint); }
.like-count { padding: 0 .5em; background: var(--pink); border-radius: 999px; font-size: .9rem; }
.chapter-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.end-note { margin: 0; font-weight: 600; }
.end-link { color: var(--white); }
.end-link:hover { color: var(--lemon); }

/* =============================================================
   Profile pictures + the admin-verified glowing heart
   ============================================================= */
.avatar {
  --av: 48px;
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--av);
  height: var(--av);
  border-radius: 50%;
  background: var(--c, var(--pink));
  border: max(2px, calc(var(--av) * .045)) solid var(--ink);
  vertical-align: middle;
  line-height: 1;
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar-initial { font-family: var(--font-display); font-size: calc(var(--av) * .46); color: var(--ink); }
.avatar.c-grape .avatar-initial { color: var(--white); }
.avatar-xs { --av: 28px; }
.avatar-sm { --av: 40px; }
.avatar-md { --av: 48px; }
.avatar-lg { --av: 132px; }
.avatar.is-verified { box-shadow: 0 0 calc(var(--av) * .22) rgba(255, 62, 165, .45); }

.verified-heart {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: calc(var(--av) * -.2);
  width: max(15px, calc(var(--av) * .42));
  aspect-ratio: 1;
  transform: translateX(-50%);
  filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 3px #ff3ea5) drop-shadow(0 0 7px rgba(255, 62, 165, .8));
}
.verified-heart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.vh-body { fill: #ff3ea5; stroke: #fff; stroke-width: 2.4; stroke-linejoin: round; paint-order: stroke; }
.vh-shine { fill: none; stroke: #fff; stroke-width: 1.9; stroke-linecap: round; }
@media (prefers-reduced-motion: no-preference) {
  .verified-heart { animation: heart-glow 2.2s ease-in-out infinite; }
  @keyframes heart-glow {
    0%, 100% { filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 3px #ff3ea5) drop-shadow(0 0 6px rgba(255, 62, 165, .7)); }
    50%      { filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 6px #ff8cd0) drop-shadow(0 0 13px rgba(255, 217, 61, .95)); }
  }
}

/* Header link */
.nav-me { display: inline-flex; align-items: center; gap: 8px; padding-bottom: 6px; }

/* "Liked by" / "On these readers' shelves" rows */
.reader-stack { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.reader-stack[hidden] { display: none; }
.reader-stack-label { margin: 0; font-weight: 600; font-size: .95rem; }
.reader-stack ul { list-style: none; margin: 0; padding: 0 0 12px 10px; display: flex; flex-wrap: wrap; justify-content: center; row-gap: 14px; }
.reader-stack li { margin-left: -10px; }
.reader-stack-more { font-size: .9rem; font-weight: 600; margin-top: -6px; }
.story-info .reader-stack { align-items: flex-start; margin: .4rem 0 0; }
.story-info .reader-stack ul { justify-content: flex-start; }
.chapter-end .avatar { outline: 2px solid var(--white); }

/* My shelf: profile card */
.profile-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 32px;
  max-width: 820px;
  padding: clamp(18px, 4vw, 30px);
  background: var(--white);
  border: var(--line);
  border-radius: 24px;
}
.profile-pic { padding-bottom: 22px; }
.profile-body { flex: 1 1 280px; }
.profile-body .section-title { margin-bottom: .3em; }
.verified-note { font-weight: 600; }
.profile-form { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 10px; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-btn:focus-within { outline: 3px solid var(--grape); outline-offset: 3px; }

/* Shared feedback for stories, chapters, and gallery work */
.work-feedback{max-width:860px;margin:3rem auto;padding:2rem 1.25rem;background:#fff;border:2px solid #25163e;border-radius:24px;box-shadow:5px 5px 0 #25163e;color:#25163e}
.work-feedback .section-title{margin-top:0}.rating-summary{font-size:1.1rem;margin:.7rem 0 1.4rem}
.feedback-rating-form{display:flex;gap:1rem;align-items:end;flex-wrap:wrap;margin-bottom:1.5rem}
.feedback-stars{border:0;padding:0;margin:0;display:flex;gap:.3rem;align-items:center;flex-wrap:wrap}
.feedback-stars legend{font-weight:700;margin-bottom:.4rem;width:100%}
.feedback-stars label{display:inline-flex;align-items:center;gap:.2rem;cursor:pointer;font-size:1.8rem;color:#d0c6d4}
.feedback-stars label:has(input:checked){color:#f4a900}
.feedback-stars input{width:1rem;height:1rem;accent-color:#de2488}
.feedback-comment-form{margin:1.2rem 0 2rem;max-width:100%}
.feedback-comment-form textarea{width:100%;min-height:90px}
.feedback-comments{list-style:none;padding:0;margin:1rem 0 0;display:grid;gap:.8rem}
.feedback-comments li{border-top:1px solid #e5dce9;padding:1rem 0 0;overflow-wrap:anywhere}
.feedback-comment-top{display:flex;justify-content:space-between;gap:1rem;flex-wrap:wrap}
.feedback-comment-top time{font-size:.85rem;opacity:.7}.feedback-comments p{white-space:normal;margin:.5rem 0}
.feedback-delete{background:none;border:none;color:#9e326a;text-decoration:underline;cursor:pointer;padding:.3rem 0}
.gallery-feedback-link{display:block;text-align:center;margin:.45rem 0 1rem;font-weight:700;color:#742667}
.work-detail{max-width:950px;padding-top:2rem}.work-detail-media{margin:1.5rem 0;display:flex;justify-content:center}
.work-detail-media img,.work-detail-media video{display:block;max-width:100%;max-height:80vh;object-fit:contain;border-radius:12px}
.work-detail-media iframe{width:100%;aspect-ratio:16/9;border:0;border-radius:12px}

/* Inline artwork feedback and intuitive interactive stars */
.work-feedback-inline{width:100%;max-width:none;margin:.6rem 0 1.4rem;padding:1rem .85rem;border-width:1px;border-radius:14px;box-shadow:none;font-size:.9rem}
.feedback-inline-title{font-size:1rem;margin:0 0 .4rem;font-weight:800}
.work-feedback-inline .rating-summary{font-size:.9rem;margin:.4rem 0 .8rem}
.work-feedback-inline .feedback-rating-form{gap:.5rem;margin-bottom:.8rem}
.work-feedback-inline .feedback-comment-form{margin:.7rem 0 1rem}
.work-feedback-inline .feedback-comments{gap:.4rem}
.work-feedback-inline .feedback-comments li{padding-top:.6rem}
.work-feedback-inline .feedback-comment-top{gap:.4rem}
.work-feedback-inline h3{font-size:.95rem;margin:.8rem 0}
.feedback-stars{display:flex;flex-direction:row-reverse;justify-content:flex-end;gap:.12rem}
.feedback-stars legend{float:none}
.feedback-stars label{position:relative;display:inline-flex;cursor:pointer;font-size:2rem;line-height:1.2;color:#b8adb9}
.feedback-stars input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}
.feedback-stars label:has(input:checked),.feedback-stars label:has(input:checked) ~ label{color:#e8a100}
.feedback-stars:has(label:hover) label{color:#b8adb9}
.feedback-stars label:hover,.feedback-stars label:hover ~ label{color:#e8a100 !important}
.feedback-stars label:has(input:focus-visible){outline:2px solid #25163e;outline-offset:2px;border-radius:4px}
.work-feedback{scroll-margin-top:2rem}
@media(max-width:650px){.masonry{columns:1}.work-feedback-inline{padding:.85rem}.feedback-stars label{font-size:2.1rem}}

/* Rating-only thumbnail summaries; full feedback belongs on work detail pages. */
.tile-rating{margin:.35rem .4rem 1rem;text-align:center;font-weight:700;font-size:.88rem;color:#71305e}
.peek-grid .tile-rating,.story-row .tile-rating{margin:.4rem .25rem 0}

/* Feedback messages sit immediately beneath their respective controls. */
.feedback-comment-error{color:#9d163e;font-weight:700;margin:.55rem 0 0}
.feedback-comment-error[hidden]{display:none}
.feedback-rating-status{font-size:.9rem;margin:0;min-height:1.2em}

/* Members-only chat */
.chat-wrap{max-width:900px;padding-bottom:3rem}.chat-history{display:flex;flex-direction:column;gap:1rem;padding:1rem;border:2px solid #eadde7;border-radius:20px;max-height:650px;overflow-y:auto;background:#fffdfd}.chat-message{padding:1rem;border-radius:14px;background:#f8f4fc;overflow-wrap:anywhere}.chat-message-head{display:flex;gap:1rem;flex-wrap:wrap;justify-content:space-between}.chat-message-head time{font-size:.8rem;opacity:.7}.chat-message-text{white-space:normal;margin:.5rem 0}.chat-gif{width:128px;height:96px;object-fit:contain}.chat-compose{display:flex;flex-direction:column;gap:.6rem;margin-top:1rem;padding:1.2rem;border:2px solid #eadde7;border-radius:20px;background:#fff}.chat-compose textarea{width:100%;min-height:90px;padding:.8rem;border:1px solid #9b8498;border-radius:10px;font:inherit}.chat-gif-options{display:flex;flex-wrap:wrap;gap:.65rem;border:1px solid #eadde7;border-radius:12px;padding:1rem}.chat-gif-options legend{padding:0 .3rem;font-weight:700}.chat-gif-choice{display:flex;flex-direction:column;align-items:center;gap:.25rem;padding:.5rem;border:1px solid #eadde7;border-radius:10px;cursor:pointer}.chat-gif-choice img{object-fit:contain;width:96px;height:72px}.chat-help{font-size:.9rem}.chat-error{color:#991b1b;font-weight:700;min-height:1rem;margin:0}.chat-mod-form{margin-top:.4rem}

/* G-rated GIPHY search, enabled only for age-eligible members */
.giphy-picker{border:1px solid #eadde7;border-radius:12px;padding:1rem}
.giphy-search-row{display:flex;flex-wrap:wrap;gap:.5rem;margin:.5rem 0}
.giphy-search-row input{flex:1 1 170px;min-width:0;padding:.6rem;border:1px solid #9b8498;border-radius:8px}
.giphy-results{display:grid;grid-template-columns:repeat(auto-fill,minmax(105px,1fr));gap:.5rem;max-height:270px;overflow:auto}
.giphy-result{background:#fff;border:2px solid #eadde7;padding:.25rem;border-radius:8px;cursor:pointer}
.giphy-result:focus-visible,.giphy-result:hover{border-color:#9b327c}
.giphy-result img{display:block;width:100%;height:90px;object-fit:contain}
.giphy-selection img{height:90px;max-width:180px;vertical-align:middle;margin:.5rem}
