/* Home page content sections. Tokens, .shell, .ink-btn and the reveal transition come from home-ink.css. */
body.ink-home .home-page-main > section {
  display: block; min-height: 0; background: #fff; color: var(--j-ink-soft);
  border: 0; scroll-snap-align: none; padding-block: clamp(72px, 10vw, 140px);
}
body.ink-home .home-page-main > .ink-hero { padding-block: calc(92px + env(safe-area-inset-top, 0px)) clamp(64px, 11svh, 120px); }
body.ink-home .home-page-main :is(h2, h3, p, strong, span, li) { text-shadow: none; animation: none; }
html body.ink-home .home-page-main h2:not(.scene-title) { margin: 0; color: var(--j-ink); font: 700 clamp(30px, 4.4vw, 54px) / 1.3 var(--tc-display); letter-spacing: .07em; }
html body.ink-home .home-page-main h3:not(.scene-list h3):not(.journey-steps h3) { margin: 0; color: var(--j-ink); font: 700 clamp(18px, 1.7vw, 23px) / 1.55 var(--tc-display); letter-spacing: .04em; }
body.ink-home .eyebrow { margin: 0 0 18px; font: 700 13px / 1 system-ui, sans-serif; letter-spacing: .24em; text-transform: uppercase; color: var(--j-ink-soft); }
/* styles.css already defines .section-head as a flex row; the home page stacks it instead. */
body.ink-home .section-head { display: block; max-width: 46em; margin-bottom: clamp(32px, 4vw, 56px); }
body.ink-home .section-head > p { margin: 14px 0 0; color: var(--j-ink-soft); font-size: clamp(15px, 1.4vw, 18px); line-height: 1.75; }
body.ink-home .section-head-row { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 20px; max-width: none; }
body.ink-home .section-head-row > div { max-width: 46em; }
body.ink-home code { font: 600 .92em / 1 ui-monospace, Menlo, monospace; background: var(--j-paper-deep); border: 1px solid var(--j-hair); border-radius: 6px; padding: .18em .45em; color: var(--j-ink); }
body.ink-home .state-note { margin: 0; padding: 28px; border: 1px dashed var(--j-hair); border-radius: 6px; color: var(--j-ink-soft); background: var(--j-paper); text-align: center; }

/* ---------- Live status strip ---------- */
body.ink-home .home-strip { padding-block: 0; }
.home-strip .strip-row {
  /* Six cells exactly: status, players, version, uptime (spans 2), address. */
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px;
  background: var(--j-hair); border: 1px solid var(--j-hair); border-radius: 6px; overflow: hidden;
}
.home-strip .strip-item { background: var(--j-paper); padding: 18px 20px; min-width: 0; }
.home-strip .strip-wide { grid-column: span 2; }
.home-strip .strip-label { display: block; margin-bottom: 7px; color: var(--j-ink-soft); font-size: 13px; font-weight: 600; letter-spacing: .02em; }
body.ink-home .home-strip strong,
body.ink-home .home-strip .server-uptime {
  display: block; color: var(--j-ink); white-space: normal !important; overflow: visible !important; text-overflow: clip !important;
  overflow-wrap: anywhere !important; letter-spacing: 0 !important; font-variant-numeric: tabular-nums;
  font: 800 clamp(17px, 1.6vw, 22px) / 1.35 var(--tc-sans) !important;
}
body.ink-home .home-strip .strip-ip strong { font-family: ui-monospace, Menlo, monospace !important; font-size: clamp(15px, 1.3vw, 19px) !important; }
body.ink-home .home-strip .status-online { color: var(--tc-green); }
body.ink-home .home-strip .status-offline { color: #b3261e; }
body.ink-home .home-strip .status-loading { color: #8a6a00; }
body.ink-home .server-player-board { margin-top: 14px; padding: 16px 20px; background: var(--j-paper); border: 1px solid var(--j-hair); border-radius: 6px; }
body.ink-home .online-player-heads { display: flex; flex-wrap: wrap; gap: 6px; }
body.ink-home .online-player-head { width: 36px; height: 36px; border: 1px solid var(--j-hair); background: var(--j-paper-deep); box-shadow: none; padding: 2px; }

/* ---------- Statement ---------- */
.home-statement .statement { max-width: 18em; }
.home-statement .statement em { font-style: normal; background: linear-gradient(100deg, #0a1fb4, #6b2cff 34%, #ff2e92 68%, #ff7a18); -webkit-background-clip: text; background-clip: text; color: transparent; }
.home-statement .statement-aside { margin-top: clamp(28px, 4vw, 44px); max-width: 44em; }
.home-statement .statement-aside p { margin: 0 0 18px; font-size: clamp(16px, 1.5vw, 19px); line-height: 1.85; color: var(--j-ink-soft); }

/* ---------- Features: one lead card, then smaller ones ---------- */
.feature-grid { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.feature { background: var(--j-paper); border: 1px solid var(--j-hair); border-radius: 6px; padding: clamp(22px, 2.4vw, 32px); min-width: 0; }
.feature-lead { grid-column: span 2; grid-row: span 2; background: var(--j-paper-deep); display: flex; flex-direction: column; justify-content: flex-end; }
.feature-lead h3 { font-size: clamp(24px, 2.6vw, 34px); }
.feature-mark { display: block; font-size: 26px; margin-bottom: 14px; line-height: 1; }
.feature-lead .feature-mark { font-size: 40px; margin-bottom: auto; }
.feature h3 { margin-bottom: 10px; }
.feature p { margin: 0; color: var(--j-ink-soft); line-height: 1.75; font-size: 15px; }
.feature-lead p { font-size: clamp(15px, 1.4vw, 17px); }

/* ---------- Join steps ---------- */
.step-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.step { display: grid; gap: 16px; align-content: start; background: var(--j-paper); border: 1px solid var(--j-hair); border-radius: 6px; padding: clamp(22px, 2.4vw, 32px); min-width: 0; }
.step-no { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; background: var(--j-ink); color: #fff; font: 800 18px / 1 system-ui, sans-serif; }
.step h3 { margin-bottom: 10px; }
.step p { margin: 0 0 14px; color: var(--j-ink-soft); line-height: 1.75; font-size: 15px; }
.chip-copy {
  display: inline-flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 8px 0 16px;
  border: 1px solid var(--j-hair); border-radius: 999px; background: #fff; cursor: pointer;
  font: 700 15px / 1 ui-monospace, Menlo, monospace; color: var(--j-ink); max-width: 100%; overflow-wrap: anywhere;
}
.chip-copy span { padding: 7px 13px; border-radius: 999px; background: var(--j-ink); color: #fff; font: 700 12px / 1 var(--tc-sans); flex: none; }
.chip-copy:hover { border-color: var(--j-ink); }
.chip-copy:focus-visible { outline: 3px solid var(--j-seal); outline-offset: 3px; }

/* ---------- Gameplay: sticky intro beside a scrolling list ---------- */
.play-shell { display: grid; gap: clamp(28px, 4vw, 64px); grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: start; }
.play-sticky { position: sticky; top: clamp(92px, 12vh, 132px); }
.play-sticky .section-head { margin-bottom: 24px; }
.play-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.play-item { background: var(--j-paper); border: 1px solid var(--j-hair); border-radius: 6px; padding: clamp(20px, 2.2vw, 28px); }
.play-item h3 { margin-bottom: 8px; }
.play-item p { margin: 0; color: var(--j-ink-soft); line-height: 1.75; font-size: 15px; }

/* ---------- News (markup comes from app.js loadNews) ---------- */
.news-list { display: grid; gap: 12px; }
body.ink-home .news-list .notice-row {
  display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr) auto; align-items: center;
  background: var(--j-paper); border: 1px solid var(--j-hair); border-radius: 6px;
  padding: clamp(20px, 2.2vw, 28px); width: auto; margin: 0;
}
body.ink-home .news-list .notice-row > time { grid-column: 1 / -1; color: var(--j-ink-soft); font: 600 13px / 1 ui-monospace, Menlo, monospace; letter-spacing: .04em; }
body.ink-home .news-list .notice-row > div { min-width: 0; }
body.ink-home .news-list .notice-row h3 { margin: 0 0 6px; }
body.ink-home .news-list .notice-row p { margin: 0; color: var(--j-ink-soft); line-height: 1.75; font-size: 15px; }
body.ink-home .news-list .notice-row .mc-button {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px; border: 2px solid var(--j-ink); border-radius: 999px;
  background: #fff; color: var(--j-ink); box-shadow: none; text-shadow: none; font-weight: 700; font-size: 15px; text-decoration: none; white-space: nowrap;
}
body.ink-home .news-list .notice-row .mc-button:hover { background: var(--j-ink); color: #fff; }

/* ---------- Gallery preview ---------- */
.gallery-preview { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gallery-preview .state-note { grid-column: 1 / -1; }
.gal-tile { position: relative; display: block; overflow: hidden; border-radius: 6px; border: 1px solid var(--j-hair); background: var(--j-paper-deep); text-decoration: none; }
.gal-tile > img, .gal-tile > video { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--j-paper-deep); transition: transform .4s cubic-bezier(.2,.7,.2,1); }
.gal-tile:hover > img, .gal-tile:hover > video { transform: scale(1.04); }
.gal-meta { position: absolute; inset: auto 0 0 0; display: grid; gap: 2px; padding: 34px 16px 14px; color: #fff; background: linear-gradient(transparent, rgb(0 0 0 / 78%)); }
.gal-meta b { font-size: 15px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gal-meta i { font-style: normal; font-size: 13px; opacity: .85; }
.gal-tile:focus-visible { outline: 3px solid var(--j-seal); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .gal-tile > img, .gal-tile > video { transition: none } .gal-tile:hover > img, .gal-tile:hover > video { transform: none } }

/* ---------- FAQ ---------- */
.faq-shell { max-width: 900px; }
.faq-list { border-top: 1px solid var(--j-hair); }
.faq-item { border-bottom: 1px solid var(--j-hair); }
.faq-item > summary {
  list-style: none; cursor: pointer; padding: 22px 44px 22px 0; position: relative;
  font: 800 clamp(16px, 1.6vw, 19px) / 1.5 var(--tc-sans); color: var(--j-ink);
}
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::after { content: ""; position: absolute; right: 8px; top: 50%; width: 12px; height: 12px; margin-top: -8px; border-right: 2px solid var(--j-ink); border-bottom: 2px solid var(--j-ink); rotate: 45deg; transition: rotate .25s ease; }
.faq-item[open] > summary::after { rotate: -135deg; margin-top: -3px; }
.faq-item > summary:focus-visible { outline: 3px solid var(--j-seal); outline-offset: -3px; border-radius: 8px; }
.faq-item > div { padding: 0 0 24px; }
.faq-item p { margin: 0; color: var(--j-ink-soft); line-height: 1.85; font-size: 15px; }
@media (prefers-reduced-motion: reduce) { .faq-item > summary::after { transition: none } }

/* ---------- Closing CTA ---------- */
.home-cta .cta-inner { background: var(--j-paper-deep); border: 1px solid var(--j-hair); border-radius: clamp(20px, 3vw, 32px); padding: clamp(40px, 6vw, 80px) clamp(24px, 4vw, 64px); text-align: center; display: grid; justify-items: center; gap: 18px; }
.home-cta .cta-inner p { margin: 0; max-width: 40em; color: var(--j-ink-soft); font-size: clamp(16px, 1.5vw, 19px); line-height: 1.8; }
.home-cta .ink-actions { justify-content: center; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-lead { grid-column: span 2; grid-row: auto; }
  .play-shell { grid-template-columns: 1fr; }
  .play-sticky { position: static; }
  .gallery-preview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .home-strip .strip-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .step-list { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .feature-grid, .gallery-preview { grid-template-columns: 1fr; }
  /* A span-2 item in a 1-column grid would add an implicit column and squeeze the rest. */
  .feature-lead { grid-column: auto; }
  .home-strip .strip-row { grid-template-columns: 1fr 1fr; }
  .home-strip .strip-wide, .home-strip .strip-ip { grid-column: 1 / -1; }
  body.ink-home .news-list .notice-row { grid-template-columns: 1fr; align-items: start; }
  body.ink-home .news-list .notice-row .mc-button { justify-self: start; }
  body.ink-home .section-head-row { align-items: start; }
}

/* ---------- Featured wall: tilted 3-column waterfall of admin-picked photos ---------- */
body.ink-home .home-featured { padding-bottom: 0; overflow: hidden; }
.featured-stage { perspective: 1000px; margin-top: clamp(8px, 2vw, 24px); }
.featured-push { animation: feat-push 18s ease-in-out infinite alternate; }
.featured-wall {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 clamp(12px, 1.6vw, 22px);
  height: clamp(400px, 56vh, 620px); overflow: hidden;
  width: min(1240px, calc(100% - 2 * var(--tc-gutter))); margin-inline: auto;
  transform: rotateX(16deg) scale(1.07); transform-origin: 50% 50%;
  -webkit-mask-image: linear-gradient(transparent, #000 160px, #000 calc(100% - 160px), transparent);
  mask-image: linear-gradient(transparent, #000 160px, #000 calc(100% - 160px), transparent);
}
.feat-col { display: block; will-change: transform; animation: feat-scroll var(--feat-dur, 24s) linear infinite; }
.feat-col.rev { animation-direction: reverse; }
.feat-item { display: block; position: relative; margin-bottom: clamp(12px, 1.6vw, 22px); border-radius: 14px; overflow: hidden; background: var(--j-paper-deep); border: 1px solid var(--j-hair); }
.feat-item img { display: block; width: 100%; aspect-ratio: var(--feat-ratio, 4 / 3); object-fit: cover; }
.feat-item figcaption {
  position: absolute; inset: auto 0 0 0; padding: 26px 14px 11px; color: #fff; font: 700 13.5px/1.4 var(--tc-sans);
  background: linear-gradient(transparent, rgb(0 0 0 / 72%)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
@keyframes feat-scroll { to { transform: translateY(-50%); } }
@keyframes feat-push { from { transform: scale(1); } to { transform: scale(1.04); } }
/* Few photos: a calm static strip instead of the wall. */
.featured-wall.feat-static { height: auto; transform: none; mask-image: none; -webkit-mask-image: none; overflow: visible; padding-bottom: clamp(48px, 6vw, 80px); }
.featured-wall.feat-static .feat-col { animation: none; }
@media (max-width: 760px) {
  .featured-wall { grid-template-columns: repeat(2, minmax(0, 1fr)); height: clamp(360px, 52vh, 520px); }
  .featured-wall .feat-col:nth-child(3) { display: none; }
  .featured-wall.feat-static { grid-template-columns: 1fr 1fr; }
  .featured-wall.feat-static .feat-col:nth-child(3) { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  .featured-push, .feat-col { animation: none !important; }
  .featured-wall { transform: none; height: auto; mask-image: none; -webkit-mask-image: none; padding-bottom: clamp(48px, 6vw, 80px); }
  .feat-col > a[aria-hidden="true"], .feat-col > .feat-copy { display: none; }
}
html[data-motion='reduced'] .featured-push, html[data-motion='reduced'] .feat-col { animation: none !important; }
html[data-motion='reduced'] .featured-wall { transform: none; height: auto; mask-image: none; -webkit-mask-image: none; padding-bottom: clamp(48px, 6vw, 80px); }
