/* chunk3d.com - shared stylesheet (all pages). Light theme only. */

/* Fonts are self-hosted (latin subset, variable weights) so visitors never contact Google. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/inter-latin.woff2) format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url(../fonts/jetbrains-mono-latin.woff2) format('woff2');
}

:root {
  /* Palette taken from the GitBook wiki (chunkedworld.gitbook.io) */
  --ground: #FFFFFF;
  --ground-soft: #F6F7FA;
  --text: #1C1D1F;
  --text-muted: #5A5E66;
  --border: #E2E6EC;
  --border-strong: #C8CDD5;
  --chip-border: #D5D9E0;
  --accent: #346DDB;
  --accent-hover: #2B5DBF;
  --accent-soft: #E9F3FF;
  --link: #346DDB;
  --link-hover: #2556B5;
  --placeholder-text: #5A5E66;
  /* "Opened" state on the Vote page */
  --done: #1F8A4C;
  --done-soft: #EDF8F1;
  --done-border: #A8D8BC;
  --done-text: #17663A;
  --font-text: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --wrap: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--font-text);
  font-size: 17px;
  line-height: 1.6;
}

a { color: var(--link); }
a:hover { color: var(--link-hover); }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

h1, h2, h3, p { margin: 0; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: 32px;
  padding-right: 32px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--ground);
  color: var(--text);
  font-family: var(--font-text);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { color: var(--text); border-color: var(--text-muted); }

.btn-primary {
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  background: var(--accent);
  color: #FFFFFF;
  font-size: 16px;
}
.btn-primary:hover { color: #FFFFFF; background: var(--accent-hover); }

.btn-lg { min-height: 48px; padding: 0 22px; font-size: 16px; }

/* ---------- Header ---------- */

.site-header { border-bottom: 1px solid var(--border); }
.site-header .wrap {
  padding-top: 14px;
  padding-bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { color: var(--text); }
.brand-mark {
  display: block;
  width: 30px;
  height: 30px;
  border-radius: 6px;
}
.brand-name { font-weight: 700; font-size: 19px; letter-spacing: -0.01em; }

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 24px;
  font-size: 16px;
}
.nav a {
  padding: 12px 0;
  color: var(--text-muted);
  font-weight: 500;
  text-decoration: none;
}
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); }
.nav a.nav-cta {
  padding: 9px 18px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--text);
  font-weight: 600;
}

/* ---------- Hero ---------- */

.hero {
  padding-top: 32px;
  padding-bottom: 56px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 48px;
}
.hero-main {
  flex: 1 1 440px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.hero-eyebrow {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  line-height: 1.4;
}
.hero-tagline {
  font-weight: 700;
  font-size: clamp(32px, 4.4vw, 50px);
  line-height: 1.08;
  letter-spacing: -0.03em;
}
.hero-intro { font-size: 17px; color: var(--text-muted); max-width: 540px; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}
.hero-actions .text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
  font-size: 15px;
}

/* ---------- Join box ---------- */

.join-box {
  max-width: 540px;
  padding: 18px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--ground);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.join-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.join-title { font-weight: 700; font-size: 16px; }

.status-badge {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

.join-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}
.join-row + .join-row { padding-top: 12px; border-top: 1px solid var(--border); }
.join-info {
  flex: 1 1 220px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.join-label { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.join-ip {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 16px;
  overflow-wrap: anywhere;
}
.join-ip-java { font-weight: 700; font-size: 22px; }
.join-row .btn { flex: 0 0 auto; }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tags li {
  padding: 4px 12px;
  border: 1px solid var(--chip-border);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
}

/* ---------- Picture placeholders ---------- */
/* Replace each .placeholder element with an <img> (or a <picture>) when the
   owner supplies the pictures. Keep the aspect-ratio on the replacement. */

.placeholder {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border: 2px dashed var(--border-strong);
  border-radius: 14px;
  background: var(--ground-soft);
  color: var(--placeholder-text);
  font-size: 15px;
  text-align: center;
}
.placeholder-shot { flex: 1 1 300px; aspect-ratio: 16 / 10; }

.shot {
  flex: 1 1 300px;
  min-width: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.shot img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 14px;
}
.zoom { display: block; cursor: zoom-in; border-radius: 14px; }

/* Zoom view (opened by js/site.js) */
.lightbox {
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #FFFFFF;
}
.lightbox::backdrop { background: rgba(20, 22, 26, 0.88); }
.lightbox-stage {
  position: absolute;
  inset: 0;
  padding: 56px 16px 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.lightbox-img {
  display: block;
  max-width: 100%;
  min-height: 0;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  background: var(--ground-soft);
}
.lightbox-caption { font-size: 16px; text-align: center; }
.lightbox-btn {
  position: absolute;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
  font-family: var(--font-text);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.lightbox-btn:hover { background: rgba(255, 255, 255, 0.3); }
.lightbox-btn:focus-visible { outline-color: #FFFFFF; }
.lightbox-close { top: 8px; right: 8px; }
.lightbox-prev { left: 8px; top: 50%; margin-top: -24px; }
.lightbox-next { right: 8px; top: 50%; margin-top: -24px; }
@media (max-width: 600px) {
  .lightbox-prev, .lightbox-next { top: auto; bottom: 8px; margin-top: 0; }
  .lightbox-prev { left: calc(50% - 56px); }
  .lightbox-next { right: calc(50% - 56px); }
}

.shot figcaption { color: var(--text-muted); font-size: 15px; font-weight: 500; }

/* ---------- Hero video (vertical 9:16 Short) ---------- */

.hero-video {
  flex: 1 1 300px;
  min-width: 0;
  display: flex;
  justify-content: center;
}
.hero-video iframe {
  display: block;
  width: 100%;
  max-width: 300px;
  aspect-ratio: 9 / 16;
  border-radius: 14px;
  border: 0;
}

/* ---------- Sections ---------- */

.section-title {
  font-weight: 700;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.loop {
  background: var(--ground-soft);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.loop .wrap {
  padding-top: 72px;
  padding-bottom: 72px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}
.loop .section-title { max-width: 640px; }

.cards { display: flex; flex-wrap: wrap; gap: 16px; }
.card {
  flex: 1 1 230px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--ground);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.card-num {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  color: var(--accent);
}
.card h3 { font-size: 20px; line-height: 1.3; }
.card p { color: var(--text-muted); font-size: 16px; }

.pictures .wrap {
  padding-top: 72px;
  padding-bottom: 72px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.pictures-row { display: flex; flex-wrap: wrap; gap: 16px; }

.next .wrap {
  padding-bottom: 88px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.link-grid { display: flex; flex-wrap: wrap; gap: 16px; }
.link-card {
  flex: 1 1 300px;
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.link-card:hover { color: var(--text); border-color: var(--border-strong); }
.link-card-icon { flex-direction: row; align-items: center; gap: 16px; }
.link-card-icon img { flex: 0 0 auto; width: 48px; height: 48px; image-rendering: pixelated; }
.link-card-body { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.link-card-title { font-weight: 700; font-size: 18px; }
.link-card-text { color: var(--text-muted); font-size: 16px; }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--border); background: var(--ground-soft); }
.site-footer .wrap {
  padding-top: 36px;
  padding-bottom: 48px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 14px;
  color: var(--text-muted);
}
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.footer-links a {
  padding: 10px 0;
  color: var(--text-muted);
  font-weight: 500;
  text-decoration: none;
}
.footer-links a:hover { color: var(--text); }
.disclaimer { max-width: 760px; }

/* ---------- Inner pages (Vote, Rules, Legal) ---------- */

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.link-button {
  padding: 8px 0;
  border: 0;
  background: none;
  color: var(--link);
  font-family: var(--font-text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}
.link-button:hover { color: var(--link-hover); }

.page-head {
  padding-top: 48px;
  padding-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.page-head-icon { flex: 0 0 auto; width: 64px; height: 64px; image-rendering: pixelated; }
.page-title {
  font-weight: 700;
  font-size: clamp(32px, 4.4vw, 46px);
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.page-lead { margin-top: 10px; max-width: 640px; color: var(--text-muted); font-size: 17px; }

/* Legal / long-form text */
.legal { padding-bottom: 72px; }
.legal > * { max-width: 760px; }
.legal h2 {
  margin-top: 36px;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.legal h2:first-child { margin-top: 0; }
.legal p, .legal ul, .legal ol { margin-top: 10px; }
.legal ul, .legal ol { padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.legal a { color: var(--link); text-decoration: underline; }
.legal a:hover { color: var(--link-hover); }

/* Vote cards. data-state is set by js/vote.js: ready (default) or done. */
.vote-section { padding-bottom: 56px; display: flex; flex-direction: column; gap: 20px; }

.vote-progress { display: flex; flex-direction: column; gap: 6px; }
.vote-progress-text {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 16px;
  font-size: 15px;
  font-weight: 600;
}
.progress-bar { height: 8px; border-radius: 999px; background: var(--border); overflow: hidden; }
.progress-fill { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--done); }

.vote-grid {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  /* Numbers run down each column: 1-5 on the left, 6-9 on the right. */
  grid-auto-flow: column;
  grid-template-rows: repeat(5, auto);
  gap: 16px;
}
.vote-card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--ground);
  display: flex;
  align-items: center;
  gap: 14px;
}
.vote-num {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vote-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.vote-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  font-weight: 700;
  font-size: 17px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.vote-status { color: var(--text-muted); font-size: 14px; line-height: 1.35; }
.vote-btn { flex: 0 0 auto; }

/* Whole card is the click target: the button's link is stretched over the card. */
.vote-card { position: relative; cursor: pointer; }
.vote-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
}
.vote-card:hover { border-color: var(--border-strong); box-shadow: 0 2px 10px rgba(28, 29, 31, 0.07); }
.vote-card:hover .vote-btn { border-color: var(--accent); color: var(--accent); }
.vote-card:has(.vote-btn:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.vote-btn:focus-visible { outline: none; }

.vote-last {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--done);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.vote-card[data-state="done"] { border-color: var(--done-border); background: var(--done-soft); }
.vote-card[data-state="done"]:hover { border-color: var(--done); }
.vote-card[data-state="done"] .vote-num { background: var(--done); color: #FFFFFF; }
.vote-card[data-state="done"] .vote-status { color: var(--done-text); font-weight: 600; }
.vote-card[data-state="done"] .vote-btn { background: var(--ground); }

.vote-note { max-width: 760px; color: var(--text-muted); font-size: 14px; }

.rewards { background: var(--ground-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.rewards .wrap { padding-top: 56px; padding-bottom: 56px; display: flex; flex-direction: column; gap: 28px; }
.rewards .card { flex: 1 1 320px; align-items: flex-start; }
.party-badge { align-self: flex-start; margin-top: 4px; }

.join-strip { padding-top: 40px; padding-bottom: 72px; }
.join-strip-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}
.join-strip-inner .join-info { flex: 0 1 auto; }
.join-strip-inner .text-link { font-weight: 600; font-size: 15px; }

/* ---------- Phones ---------- */
/* Tightened so the Java IP and Copy IP button stay on the first screen at
   390x844. */

@media (max-width: 600px) {
  body { font-size: 16px; }
  .wrap { padding-left: 16px; padding-right: 16px; }

  .site-header .wrap { padding-top: 6px; padding-bottom: 6px; gap: 0 16px; }
  .brand { padding: 4px 0; }
  .nav { gap: 0 16px; font-size: 15px; }
  .nav a { padding: 10px 0; }
  .nav a.nav-cta { padding: 8px 14px; }

  .hero { padding-top: 16px; padding-bottom: 40px; gap: 32px; }
  .hero-main { gap: 12px; }
  .hero-eyebrow { font-size: 13px; }
  .hero-tagline { font-size: 30px; }
  /* Join box moves above the intro text so the IP is on the first screen. */
  .join-box { order: 1; padding: 14px; gap: 12px; }
  .hero-intro { order: 2; }
  .hero-actions, .tags { order: 3; }
  .join-ip-java { font-size: 20px; }

  .loop .wrap { padding-top: 48px; padding-bottom: 48px; gap: 28px; }
  .pictures .wrap { padding-top: 48px; padding-bottom: 48px; }
  .next .wrap { padding-bottom: 56px; }
}

@media (max-width: 600px) {
  .vote-grid { grid-template-columns: minmax(0, 1fr); grid-auto-flow: row; grid-template-rows: none; gap: 12px; }
  .page-head { padding-top: 28px; padding-bottom: 20px; gap: 14px; }
  .page-head-icon { width: 48px; height: 48px; }
  .rewards .wrap { padding-top: 40px; padding-bottom: 40px; }
  .join-strip { padding-bottom: 48px; }
}

@media (prefers-reduced-motion: no-preference) {
  .btn { transition: background-color 0.12s, border-color 0.12s; }
}
