/* Rope Crew site. Palette from the game's own sky, hazard yellow and navy glass panels.
   Fonts: Dela Gothic One (display) + Readex Pro (body), both OFL 1.1, Latin subsets, served from /fonts. */
@font-face { font-family: "Dela Gothic One"; src: url("/fonts/DelaGothicOne-Latin.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Readex Pro"; src: url("/fonts/ReadexPro-Medium.ttf") format("truetype"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Readex Pro"; src: url("/fonts/ReadexPro-SemiBold.ttf") format("truetype"); font-weight: 600 700; font-style: normal; font-display: swap; }

:root {
  --cobalt: #1470c8;
  --cobalt-deep: #0f4f93;
  --hazard: #ffc812;
  --navy: #0f1c45;
  --cream: #fff8ea;
  --red: #ff3b4e;
  --green: #1fd68a;
  --blue: #2f7bff;

  --bg: #f4f9fe;
  --band: #dcefff;
  --panel: #ffffff;
  --text: #0f1c45;
  --muted: #44527a;
  --line: #cddff3;
  --link: #0f55b3;
  --link-hover: #0a3d86;
  --focus: #0f55b3;
  --head-bg: #1470c8;
  --head-text: #fff8ea;
  --head-link: #e9f3ff;
  --foot-bg: #0f1c45;
  --foot-text: #c4d3f5;

  --font-display: "Dela Gothic One", "Arial Black", Impact, sans-serif;
  --font-body: "Readex Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 18px;
  --gutter: clamp(16px, 5vw, 40px);
  --lap: clamp(36px, 7vw, 104px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1330;
    --band: #101d4a;
    --panel: #131f4d;
    --text: #eaf1ff;
    --muted: #b3c1e8;
    --line: #2a3a78;
    --link: #92c4ff;
    --link-hover: #c6e0ff;
    --focus: #ffc812;
    --head-bg: #0f4f93;
    --foot-bg: #070e26;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.62;
  overflow-wrap: break-word;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--hazard); color: var(--navy); padding: 10px 16px; z-index: 20; border-radius: 0 0 8px 0; font-weight: 600; }
.skip:focus { left: 0; }

.wrap { width: min(1120px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.prose-wrap { width: min(760px, 100% - 2 * var(--gutter)); margin-inline: auto; }

/* header */
.site-head { background: var(--head-bg); color: var(--head-text); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; padding-block: 14px; flex-wrap: wrap; }
.brand { font-family: var(--font-display); font-size: 1.3rem; color: var(--head-text); text-decoration: none; display: inline-flex; align-items: center; gap: 10px; }
.brand img { width: 36px; height: 36px; border-radius: 9px; box-shadow: 0 0 0 2px rgba(255, 248, 234, 0.5); }
.brand:hover { color: var(--head-text); }
.site-head nav { display: flex; gap: 4px 22px; flex-wrap: wrap; }
.site-head nav a { color: var(--head-link); text-decoration: none; font-weight: 600; font-size: 0.95rem; padding: 6px 2px; border-bottom: 2px solid transparent; }
.site-head nav a:hover, .site-head nav a[aria-current="page"] { color: #fff; border-bottom-color: var(--hazard); }

/* hero */
.hero { background: var(--head-bg); color: var(--head-text); padding-block: clamp(24px, 5vw, 64px) 0; position: relative; }
.hero-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px clamp(24px, 6vw, 80px); align-items: center; }
.hero-copy { max-width: 46rem; }
.app-icon { width: clamp(132px, 14vw, 180px); height: auto; border-radius: 22%; box-shadow: 0 0 0 5px var(--hazard), 0 26px 50px rgba(7, 24, 68, 0.4); transform: rotate(4deg); }
.hero h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(2.3rem, 6.4vw, 4.7rem); line-height: 1.04; margin: 0 0 20px; letter-spacing: -0.01em; text-wrap: balance; }
.hero .lead { font-size: clamp(1.05rem, 0.98rem + 0.6vw, 1.3rem); line-height: 1.55; max-width: 38em; margin: 0 0 26px; }
.status { display: inline-block; background: var(--hazard); color: var(--navy); font-weight: 600; padding: 12px 22px; border-radius: 999px; margin: 0; }
.hero .fine { margin: 14px 0 0; font-size: 0.95rem; max-width: 44em; }
.stage { margin: clamp(28px, 5vw, 56px) 0 calc(-1 * var(--lap)); position: relative; z-index: 2; }
.stage img { width: 100%; border-radius: var(--radius); box-shadow: 0 0 0 5px var(--hazard), 0 30px 60px rgba(7, 24, 68, 0.38); aspect-ratio: 16 / 9; object-fit: cover; }

/* invite banner (shown by site.js when the link carries ?r=CODE) */
.invite { background: var(--cream); color: var(--navy); border-radius: var(--radius); padding: 18px 22px 20px; margin: 0 0 clamp(22px, 4vw, 36px); max-width: 46rem; box-shadow: 0 0 0 4px var(--hazard); }
.invite[hidden] { display: none; }
.invite h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.25rem, 3.2vw, 1.7rem); line-height: 1.2; margin: 0 0 6px; }
.invite h2 b { font-weight: 400; background: var(--navy); color: var(--hazard); border-radius: 8px; padding: 0 10px; white-space: nowrap; display: inline-block; letter-spacing: 0.06em; }
.invite p { margin: 4px 0 0; }
.invite a { color: #0b3f8c; font-weight: 600; }

/* sections */
section { padding-block: clamp(36px, 6vw, 80px); }
.after-stage { padding-top: calc(var(--lap) + clamp(36px, 6vw, 80px)); }
h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.7rem, 4vw, 2.5rem); line-height: 1.12; margin: 0 0 18px; letter-spacing: -0.005em; text-wrap: balance; }
h3 { font-size: 1.1rem; font-weight: 600; margin: 28px 0 8px; line-height: 1.3; }
.intro { max-width: 60ch; color: var(--muted); margin: 0 0 8px; }
.band { background: var(--band); }

/* game modes: image and text, alternating widths */
.mode { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0 clamp(16px, 3vw, 40px); align-items: center; margin-top: clamp(36px, 6vw, 72px); }
.mode .media { grid-column: 1 / span 7; margin: 0; }
.mode .copy { grid-column: 8 / span 5; }
.mode.flip .media { grid-column: 7 / span 6; grid-row: 1; }
.mode.flip .copy { grid-column: 1 / span 5; grid-row: 1; }
.media img { width: 100%; border-radius: var(--radius); box-shadow: 0 18px 40px rgba(15, 28, 69, 0.22); background: var(--cobalt); }
.mode h3 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1.12; margin: 0 0 12px; }
.mode .copy p { margin: 0 0 12px; max-width: 34em; }
.mode .copy p.size { display: inline-block; margin: 0 0 14px; padding: 4px 14px; border-radius: 999px; background: var(--hazard); color: var(--navy); font-weight: 600; font-size: 0.92rem; line-height: 1.5; }

/* friends and voice */
.split { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(24px, 4vw, 56px) clamp(16px, 3vw, 40px); align-items: center; }
.split .copy { grid-column: 1 / span 5; }
.split .pair { grid-column: 6 / span 7; position: relative; padding-bottom: clamp(36px, 9vw, 110px); }
.pair .big { width: 100%; border-radius: var(--radius); box-shadow: 0 18px 40px rgba(15, 28, 69, 0.25); }
.pair .small { position: absolute; width: 54%; right: 0; bottom: 0; border-radius: 14px; box-shadow: 0 0 0 4px var(--hazard), 0 18px 36px rgba(15, 28, 69, 0.3); }
.checks { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 14px; }
.checks li { padding-left: 22px; position: relative; max-width: 36em; }
.checks li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 10px; height: 10px; border-radius: 50%; background: var(--hazard); box-shadow: inset 0 0 0 2px var(--navy); }
.checks b { font-weight: 600; }

/* closing band */
.close { background: var(--head-bg); color: var(--head-text); text-align: left; }
.close h2 { margin-bottom: 10px; }
.close p { margin: 0 0 6px; max-width: 40em; }
.close a { color: #fff; }

/* document pages */
.doc-head { background: var(--head-bg); color: var(--head-text); padding-block: clamp(24px, 5vw, 56px); }
.doc-head h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(2rem, 5.5vw, 3.4rem); line-height: 1.06; margin: 0 0 12px; }
.doc-head p { margin: 0; max-width: 60ch; }
.doc { padding-block: clamp(28px, 5vw, 56px) clamp(40px, 7vw, 88px); }
.doc h2 { font-size: clamp(1.35rem, 3vw, 1.8rem); margin-top: 44px; scroll-margin-top: 16px; }
.doc p, .doc li { max-width: 68ch; }
.doc ul, .doc ol { padding-left: 1.25em; }
.doc li { margin: 6px 0; }
.doc .updated { color: var(--muted); font-size: 0.95rem; margin-top: 0; }
.box { background: var(--panel); border: 2px solid var(--navy); border-radius: var(--radius); padding: 20px 22px; margin: 22px 0; }
.box h2, .box h3 { margin-top: 0; }
.box p:last-child, .box ul:last-child { margin-bottom: 0; }
.box.hl { border-color: var(--hazard); box-shadow: 0 0 0 2px var(--hazard); }
@media (prefers-color-scheme: dark) { .box { border-color: var(--line); } }
.table-wrap { overflow-x: auto; margin: 18px 0; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
table { border-collapse: collapse; width: 100%; min-width: 640px; font-size: 0.95rem; }
th, td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--line); }
th { font-weight: 600; background: color-mix(in srgb, var(--hazard) 24%, var(--panel)); }
tr:last-child td { border-bottom: 0; }
details { border-bottom: 1px solid var(--line); padding: 14px 0; max-width: 68ch; }
details summary { cursor: pointer; font-weight: 600; list-style: none; padding-right: 28px; position: relative; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; position: absolute; right: 4px; top: 0; font-family: var(--font-display); }
details[open] summary::after { content: "\2212"; }
details p, details ol, details ul { margin: 10px 0 0; }

/* contact: the address as text, with a button that copies it */
.contact { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 14px 0 0; }
.contact .addr { font-family: var(--font-display); font-size: clamp(1.1rem, 3.4vw, 1.5rem); color: var(--text); overflow-wrap: anywhere; }
.btn { display: inline-block; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; padding: 11px 20px; border-radius: 999px; border: 2px solid var(--navy); background: var(--hazard); color: var(--navy); line-height: 1.3; }
.btn:hover { background: #ffd84d; color: var(--navy); }
.btn.quiet { background: transparent; color: var(--text); border-color: var(--text); }
.btn.quiet:hover { background: color-mix(in srgb, var(--hazard) 30%, transparent); color: var(--text); }
.copy-note { min-height: 1.5em; margin: 8px 0 0; color: var(--muted); font-size: 0.95rem; }

/* footer */
.site-foot { background: var(--foot-bg); color: var(--foot-text); padding-block: 34px 44px; font-size: 0.95rem; }
.site-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px 40px; }
.site-foot a { color: #fff8ea; }
.site-foot ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px 22px; flex-wrap: wrap; }
.site-foot p { margin: 0 0 4px; }

@media (max-width: 860px) {
  .mode { grid-template-columns: 1fr; }
  .mode .media, .mode .copy, .mode.flip .media, .mode.flip .copy { grid-column: 1; grid-row: auto; }
  .mode .media { margin-bottom: 20px; }
  .split { grid-template-columns: 1fr; }
  .split .copy, .split .pair { grid-column: 1; }
  .hero-top { grid-template-columns: 1fr; }
  .app-icon { display: none; }
}
@media (max-width: 520px) {
  .stage img { box-shadow: 0 0 0 4px var(--hazard), 0 20px 40px rgba(7, 24, 68, 0.35); border-radius: 14px; }
  .pair .small { width: 58%; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media print { .site-head, .site-foot, .hero, .close { display: none; } body { background: #fff; color: #000; } }
