/* Brickbrag landing page – dark, flat, square, like the game's UI; the screenshots bring the color. */

:root {
  --bg: #14161a;
  --panel: rgba(18, 20, 24, 0.78);
  --panel-strong: rgba(18, 20, 24, 0.92);
  --line: rgba(255, 255, 255, 0.14);
  --fg: #f2f2f2;
  --fg-soft: rgba(242, 242, 242, 0.74);
  --fg-mute: rgba(242, 242, 242, 0.52);
  --accent: #ff9a1f;          /* the game's orange */
  --accent-hi: #ffb04d;
  --accent-ink: #1a1208;
  --ok: #7bd389;
  --bad: #ff8a78;
  --gutter: clamp(16px, 4vw, 64px);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 400 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
p, h1, h2, dl, dd, figure { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
img { display: block; }
.nowrap { white-space: nowrap; }

.skip { position: absolute; left: 8px; top: -60px; z-index: 10; padding: 10px 14px; background: var(--accent); color: var(--accent-ink); font-weight: 700; text-decoration: none; }
.skip:focus { top: 8px; }

:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

/* ---------- layout: one screen on desktop ---------- */
.stage {
  position: relative; isolation: isolate;
  min-height: 100vh; min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 372px);
  grid-template-rows: 1fr auto auto;
  column-gap: clamp(24px, 4vw, 72px); row-gap: clamp(16px, 2.5vh, 28px);
  padding: clamp(20px, 5vh, 56px) var(--gutter) 14px;
}
.show { position: absolute; inset: 0; z-index: -1; overflow: hidden; background: #0d0e11; }
.hero { grid-column: 1; grid-row: 1; align-self: center; max-width: 640px; }
.caption { grid-column: 1; grid-row: 2; align-self: end; }
.info { grid-column: 2; grid-row: 1 / span 2; align-self: end; }
.foot { grid-column: 1 / -1; grid-row: 3; }

/* ---------- slideshow ---------- */
.slides, .slide { position: absolute; inset: 0; }
.slide { opacity: 0; transition: opacity 1.1s ease; }
.slide.is-active { opacity: 1; }
.slide picture, .slide img { width: 100%; height: 100%; }
.slide img { object-fit: cover; transform-origin: 60% 50%; }
.slide.is-active img { animation: drift 14s ease-out both; }
@keyframes drift { from { transform: scale(1.0); } to { transform: scale(1.07); } }

.shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(10, 11, 14, 0.88) 0%, rgba(10, 11, 14, 0.62) 30%, rgba(10, 11, 14, 0.12) 58%, rgba(10, 11, 14, 0) 70%),
    linear-gradient(0deg, rgba(10, 11, 14, 0.9) 0%, rgba(10, 11, 14, 0.35) 22%, rgba(10, 11, 14, 0) 42%),
    linear-gradient(180deg, rgba(10, 11, 14, 0.45) 0%, rgba(10, 11, 14, 0) 18%);
}

/* ---------- hero ---------- */
.wordmark picture { flex: none; display: block; }
.wordmark .icon { display: block; width: 0.95em; height: auto; margin-right: 0.04em; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.5)); }
.wordmark {
  display: flex; align-items: center; gap: 0.22em;
  font-size: clamp(46px, 7.4vw, 116px); font-weight: 900; line-height: 0.95; letter-spacing: -0.035em;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.45);
}
.lede {
  margin-top: clamp(12px, 2vh, 20px); max-width: 30em;
  font-size: clamp(17px, 1.55vw, 22px); line-height: 1.4; color: var(--fg-soft);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}
.join { margin-top: clamp(22px, 4.5vh, 44px); }

/* the one big button – flat and square */
.cta {
  position: relative; display: inline-flex; align-items: center; gap: 18px;
  min-height: 72px; padding: 0 30px 0 36px;
  background: var(--accent); color: var(--accent-ink); text-decoration: none;
  font-size: clamp(22px, 2.1vw, 30px); font-weight: 800; letter-spacing: -0.01em;
  box-shadow: 0 18px 50px rgba(255, 154, 31, 0.28);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}
.cta:hover { background: var(--accent-hi); box-shadow: 0 22px 60px rgba(255, 154, 31, 0.4); }
.cta:active { transform: scale(0.98); }
.cta:focus-visible { outline-offset: 6px; }
.cta-arrow { width: 1.05em; height: 1.05em; transition: transform 0.15s ease; }
.cta:hover .cta-arrow { transform: translateX(4px); }

.status { display: flex; align-items: center; gap: 9px; margin-top: 18px; font-size: 15px; color: var(--fg-soft); font-variant-numeric: tabular-nums; }
.status b { color: var(--fg); font-weight: 700; }
.dot { width: 9px; height: 9px; flex: none; background: var(--fg-mute); }
.status[data-state='online'] .dot { background: var(--ok); box-shadow: 0 0 0 0 rgba(123, 211, 137, 0.6); animation: pulse 2.4s ease-out infinite; }
.status[data-state='offline'] .dot { background: var(--bad); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(123, 211, 137, 0.55); } 70%, 100% { box-shadow: 0 0 0 9px rgba(123, 211, 137, 0); } }

.note { margin-top: 10px; font-size: 13px; color: var(--fg-mute); max-width: 36em; }

/* several servers: a compact list under the button */
.picker[hidden] { display: none; }
.picker { margin-top: 14px; display: flex; align-items: flex-start; gap: 12px; }
.picker-label { padding-top: 7px; font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-mute); }
.picker-list { display: flex; flex-wrap: wrap; gap: 6px; }
.server {
  display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 12px;
  background: var(--panel); border: 1px solid var(--line); cursor: pointer; font-size: 14px;
}
.server:hover { background: var(--panel-strong); }
.server[aria-checked='true'] { border-color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
.server .n { color: var(--fg-mute); font-variant-numeric: tabular-nums; }
.server[data-state='online'] .dot { background: var(--ok); }
.server[data-state='offline'] { opacity: 0.6; }
.server[data-state='offline'] .dot { background: var(--bad); }

/* ---------- caption + controls ---------- */
.caption { display: flex; flex-direction: column; gap: 12px; max-width: 640px; }
.caption-title { font-size: clamp(22px, 2.3vw, 34px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; text-shadow: 0 2px 16px rgba(0, 0, 0, 0.6); }
.caption-sub { margin-top: 4px; font-size: 15px; color: var(--fg-soft); text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7); }
.caption-text { transition: opacity 0.35s ease, transform 0.35s ease; }
.caption-text.is-out { opacity: 0; transform: translateY(6px); }
.progress { display: flex; gap: 6px; }
.progress[hidden] { display: none; }
.progress span { position: relative; width: 28px; height: 3px; background: rgba(255, 255, 255, 0.28); overflow: hidden; }
.progress span::after { content: ''; position: absolute; inset: 0 auto 0 0; width: 0; background: var(--accent); }
.progress span.is-current::after { width: 100%; }
.show.is-playing ~ .caption .progress span.is-current::after { width: 0; animation: fill var(--slide-ms, 6000ms) linear forwards; }
@keyframes fill { to { width: 100%; } }

/* ---------- info panel ---------- */
.info {
  background: var(--panel); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  padding: clamp(18px, 2.6vh, 26px) 24px; display: grid; gap: clamp(14px, 2.2vh, 22px);
  border-top: 2px solid var(--accent);
}
.info:focus { outline: none; }
.info h2 { font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.info p { font-size: 14px; line-height: 1.55; color: var(--fg-soft); }
.keys { display: grid; gap: 7px; font-size: 13.5px; }
.keys > div { display: grid; grid-template-columns: 76px 1fr; gap: 10px; align-items: baseline; }
.keys dt { font-weight: 600; color: var(--fg); white-space: nowrap; }
.keys dd { color: var(--fg-soft); }
kbd {
  display: inline-block; min-width: 22px; padding: 1px 5px; margin-right: 2px;
  font: 600 11.5px/18px var(--mono); text-align: center; color: var(--fg);
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.22); border-bottom-width: 2px;
}
dd kbd { margin: 0 1px; }

/* ---------- footer ---------- */
.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 24px;
  font-size: 12px; color: var(--fg-mute); padding-top: 10px; border-top: 1px solid var(--line);
}
.foot a { color: var(--fg-soft); text-underline-offset: 2px; }
.foot a:hover { color: var(--fg); }
.placeholder { padding: 2px 8px; border: 1px dashed #ffc857; color: #ffc857; }

/* ---------- phones and narrow windows: stacked, scrolls ---------- */
@media (max-width: 899px) {
  .stage {
    display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto;
    padding: 0; row-gap: 0;
  }
  .show { position: relative; inset: auto; z-index: 0; grid-row: 1; grid-column: 1; height: 54svh; min-height: 300px; max-height: 640px; }
  .shade {
    background:
      linear-gradient(0deg, var(--bg) 0%, rgba(20, 22, 26, 0.75) 18%, rgba(20, 22, 26, 0) 50%),
      linear-gradient(180deg, rgba(10, 11, 14, 0.4) 0%, rgba(10, 11, 14, 0) 22%);
  }
  .caption { grid-row: 1; grid-column: 1; z-index: 1; align-self: end; padding: 0 var(--gutter) 6px; gap: 8px; pointer-events: none; }
  .caption-title { font-size: 21px; }
  .caption-sub { font-size: 13.5px; }
  .progress span { width: 22px; }
  .hero { grid-row: 2; grid-column: 1; padding: 18px var(--gutter) 0; max-width: none; }
  .wordmark { font-size: clamp(40px, 12vw, 64px); }
  .lede { font-size: 16px; margin-top: 8px; }
  .join { margin-top: 20px; }
  .cta { display: flex; justify-content: center; min-height: 62px; font-size: 22px; padding: 0 24px; }
  .status { margin-top: 12px; justify-content: center; }
  .note { text-align: center; margin-inline: auto; }
  .picker { flex-direction: column; align-items: stretch; gap: 6px; }
  .picker-label { padding-top: 0; }
  .server { flex: 1 1 100%; justify-content: space-between; min-height: 42px; }
  .info { grid-row: 3; grid-column: 1; margin: 28px var(--gutter) 0; -webkit-backdrop-filter: none; backdrop-filter: none; background: #1a1d22; }
  .foot { grid-row: 4; grid-column: 1; margin: 22px var(--gutter) 0; padding: 14px 0 calc(18px + env(safe-area-inset-bottom)); flex-direction: column; align-items: flex-start; }
}

/* short but wide windows: tighten so it still fits one screen */
@media (min-width: 900px) and (max-height: 760px) {
  .wordmark { font-size: clamp(44px, 6vw, 84px); }
  .lede { font-size: 17px; }
  .cta { min-height: 62px; font-size: 22px; }
  .note { display: none; }
  .keys { gap: 4px; font-size: 13px; }
  .info p { font-size: 13px; line-height: 1.45; }
  .caption-title { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .slide.is-active img { transform: none; }
}
