/* ==========================================================================
   SCSJ 生存世界 — shared styles
   Light / dark themes are designed separately through CSS custom properties.
   ========================================================================== */

:root {
  color-scheme: light;

  --bg: #f4f2ea;
  --bg-deep: #eae7dc;
  --surface: #faf9f4;
  --surface-raised: #ffffff;
  --surface-soft: #eeebe0;
  --text: #1c221a;
  --text-soft: #465043;
  --muted: #677060;
  --line: #d8d4c7;
  --line-strong: #b9b4a4;
  --accent: #3e6c39;
  --accent-strong: #2f562c;
  --accent-text: #ffffff;
  --accent-soft: #e1ebd9;
  --accent-soft-text: #2d4c2a;
  --danger: #9a3b2f;
  --danger-soft: #f4dfda;
  --warning: #7a571b;
  --warning-soft: #f3e9cf;
  --success: #2f6b3b;
  --success-soft: #dfeeda;
  --hero-veil-top: rgba(11, 16, 11, 0.34);
  --hero-veil-bottom: rgba(9, 13, 9, 0.78);
  --hero-text: #f7f8f1;
  --hero-text-soft: rgba(242, 245, 234, 0.78);
  --shadow-soft: 0 1px 2px rgba(25, 32, 23, 0.06);
  --shadow-float: 0 18px 45px rgba(24, 32, 22, 0.13);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --nav-height: 72px;
  --container: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-sans: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Noto Sans SC", Arial, sans-serif;
  --font-display: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Noto Sans SC", Arial, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0d120e;
  --bg-deep: #090d0a;
  --surface: #131a14;
  --surface-raised: #182019;
  --surface-soft: #1b241b;
  --text: #edf0e7;
  --text-soft: #c4ccbe;
  --muted: #98a391;
  --line: #2a3429;
  --line-strong: #455242;
  --accent: #9ac87e;
  --accent-strong: #b6dc9c;
  --accent-text: #10200f;
  --accent-soft: #1e2d1d;
  --accent-soft-text: #c3e2ad;
  --danger: #e6a395;
  --danger-soft: #39231f;
  --warning: #e3c384;
  --warning-soft: #332b1b;
  --success: #a6d69b;
  --success-soft: #1c2f1d;
  --hero-veil-top: rgba(4, 7, 5, 0.38);
  --hero-veil-bottom: rgba(3, 6, 4, 0.86);
  --hero-text: #f5f7ef;
  --hero-text-soft: rgba(235, 241, 228, 0.74);
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-float: 0 22px 55px rgba(0, 0, 0, 0.38);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 20px);
}

html.theme-changing,
html.theme-changing * {
  transition:
    background-color 240ms ease,
    border-color 240ms ease,
    color 240ms ease,
    fill 240ms ease,
    stroke 240ms ease !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: clip;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.is-leaving {
  opacity: 0;
  transition: opacity 140ms ease;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

h1,
h2,
h3,
h4,
p,
figure,
ul,
ol {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

dl,
dd {
  margin: 0;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--accent);
  color: var(--accent-text);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: var(--bg);
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.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;
}

.container {
  width: min(100% - clamp(32px, 8vw, 96px), var(--container));
  margin-inline: auto;
}

.nowrap {
  white-space: nowrap;
}

.container--narrow {
  width: min(100% - clamp(32px, 8vw, 96px), 880px);
  margin-inline: auto;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  transition:
    background-color 240ms ease,
    border-color 240ms ease,
    box-shadow 240ms ease;
}

.site-header.is-scrolled {
  box-shadow: 0 8px 28px rgba(17, 24, 15, 0.07);
}

:root[data-theme="dark"] .site-header.is-scrolled {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.site-header__inner {
  min-height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  text-decoration: none;
  color: var(--text);
}

.brand__logo {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  object-fit: contain;
}

.brand__lockup {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  line-height: 1.1;
}

.brand__mark {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 750;
  letter-spacing: 0.16em;
  line-height: 1.1;
}

.brand__names {
  display: grid;
  width: max-content;
  max-width: 100%;
  font-size: 1.02rem;
  font-weight: 750;
  line-height: 1.18;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.brand__name {
  grid-area: 1 / 1;
  opacity: 0;
  transform: translateY(3px);
  transition:
    opacity 230ms ease,
    transform 230ms ease;
}

html[lang^="zh"] .brand__name--zh,
html[lang^="en"] .brand__name--en {
  opacity: 1;
  transform: translateY(0);
}

html[lang^="zh"] .brand:hover .brand__name--zh,
html[lang^="zh"] .brand:focus-visible .brand__name--zh,
html[lang^="en"] .brand:hover .brand__name--en,
html[lang^="en"] .brand:focus-visible .brand__name--en {
  opacity: 0;
  transform: translateY(-3px);
}

html[lang^="zh"] .brand:hover .brand__name--en,
html[lang^="zh"] .brand:focus-visible .brand__name--en,
html[lang^="en"] .brand:hover .brand__name--zh,
html[lang^="en"] .brand:focus-visible .brand__name--zh {
  opacity: 1;
  transform: translateY(0);
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav__link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition:
    color 160ms ease,
    background-color 160ms ease;
}

.nav__link:hover,
.nav__link[aria-current="page"] {
  color: var(--accent);
  background: var(--accent-soft);
}

.icon-button {
  width: 40px;
  height: 40px;
  min-width: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  text-decoration: none;
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease;
}

.icon-button:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lang-toggle {
  width: auto;
  min-width: 44px;
  padding: 0 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.theme-toggle__icon {
  display: none;
}

:root[data-theme="light"] .theme-toggle__icon--sun,
:root[data-theme="dark"] .theme-toggle__icon--moon {
  display: block;
}

/* --------------------------------------------------------------------------
   Buttons and shared elements
   -------------------------------------------------------------------------- */

.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.button--primary {
  background: var(--accent);
  color: var(--accent-text);
}

.button--primary:hover {
  background: var(--accent-strong);
}

.button--ghost {
  border-color: rgba(247, 248, 241, 0.36);
  color: var(--hero-text);
  background: rgba(244, 246, 236, 0.06);
}

.button--ghost:hover {
  border-color: rgba(247, 248, 241, 0.72);
  background: rgba(244, 246, 236, 0.13);
}

.button--outline {
  border-color: var(--line-strong);
  color: var(--text);
  background: transparent;
}

.button--outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--accent);
  font-size: 0.92rem;
  font-weight: 650;
  text-decoration: none;
}

.text-link::after {
  content: "\2192";
  font-size: 0.95em;
  transition: transform 160ms ease;
}

.text-link:hover::after {
  transform: translateX(3px);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  flex: 0 0 auto;
  background: currentColor;
}

.section {
  padding-block: clamp(68px, 9vw, 118px);
  border-top: 1px solid var(--line);
}

.section--soft {
  background: var(--bg-deep);
}

.section-head {
  max-width: 720px;
  margin-bottom: clamp(32px, 5vw, 56px);
}

.section-head__title {
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 750;
  line-height: 1.16;
  letter-spacing: -0.025em;
}

.section-head__lead {
  max-width: 640px;
  margin-top: 16px;
  color: var(--muted);
  font-size: clamp(0.98rem, 1.4vw, 1.06rem);
  line-height: 1.75;
}

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

.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: min(790px, calc(100svh - var(--nav-height)));
  overflow: hidden;
  background: #11170f;
  color: var(--hero-text);
  isolation: isolate;
}

.hero__slides,
.hero__slide {
  position: absolute;
  inset: 0;
}

.hero__slides {
  z-index: -3;
  background: #11170f;
}

.hero__slide {
  opacity: 0;
  transition: opacity 1600ms ease;
}

.hero__slide.is-active {
  opacity: 1;
}

.hero__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: blur(1.5px) saturate(1.04);
  transform: scale(1.045);
  user-select: none;
  pointer-events: none;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(
      to bottom,
      var(--hero-veil-top) 0%,
      rgba(9, 13, 9, 0.16) 34%,
      var(--hero-veil-bottom) 100%
    ),
    linear-gradient(
      to right,
      rgba(8, 12, 8, 0.46) 0%,
      rgba(8, 12, 8, 0.08) 62%,
      rgba(8, 12, 8, 0.2) 100%
    );
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  z-index: -1;
  height: 34%;
  background: linear-gradient(to bottom, transparent, var(--bg));
  opacity: 0.18;
  pointer-events: none;
}

.hero__inner {
  padding-block: clamp(90px, 13vh, 150px) clamp(54px, 8vh, 90px);
}

.hero__content {
  max-width: 800px;
}

.hero__eyebrow {
  color: #cde6b9;
}

.hero__title {
  max-width: 14ch;
  font-family: var(--font-display);
  font-size: clamp(2.55rem, 6.4vw, 5rem);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.035em;
  text-wrap: balance;
  text-shadow: 0 2px 26px rgba(4, 8, 4, 0.28);
}

html[lang^="en"] .hero__title {
  max-width: 16ch;
  font-size: clamp(2.5rem, 5.7vw, 4.5rem);
}

.hero__lead {
  max-width: 650px;
  margin-top: clamp(20px, 3vw, 28px);
  color: var(--hero-text-soft);
  font-size: clamp(0.98rem, 1.65vw, 1.12rem);
  line-height: 1.8;
  text-wrap: pretty;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: clamp(28px, 4vw, 38px);
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: clamp(34px, 5vw, 54px);
  padding-top: 18px;
  border-top: 1px solid rgba(240, 244, 232, 0.24);
  color: var(--hero-text-soft);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.hero__meta span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hero :focus-visible,
.page-hero :focus-visible {
  outline-color: var(--hero-text);
}

.hero__meta span::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #b7d69f;
}

/* --------------------------------------------------------------------------
   Server status
   -------------------------------------------------------------------------- */

.status-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.85fr);
  gap: clamp(20px, 3vw, 32px);
  align-items: start;
}

.status-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.status-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 4px 11px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.3;
}

.status-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
}

.status-badge--online {
  background: var(--success-soft);
  border-color: color-mix(in srgb, var(--success) 28%, transparent);
  color: var(--success);
}

.status-badge--offline {
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 28%, transparent);
  color: var(--danger);
}

.status-badge--error {
  background: var(--warning-soft);
  border-color: color-mix(in srgb, var(--warning) 28%, transparent);
  color: var(--warning);
}

.status-badge--loading::before {
  background: transparent;
  border: 1.5px solid currentColor;
  border-top-color: transparent;
  animation: spin 900ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.status-refresh {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  cursor: pointer;
  transition:
    color 160ms ease,
    background-color 160ms ease;
}

.status-refresh:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.status-refresh:disabled {
  cursor: wait;
  opacity: 0.65;
}

.status-refresh svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.status-refresh.is-loading svg {
  animation: spin 900ms linear infinite;
}

.status-card__body {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
}

.status-stat {
  min-width: 0;
  padding: 22px 20px;
  border-bottom: 1px solid var(--line);
}

.status-stat:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.status-stat__label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.status-stat__value {
  display: block;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.45;
}

.status-motd {
  grid-column: 1 / -1;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.status-motd__text {
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.status-inline {
  grid-column: 1 / -1;
  padding: 20px;
  border-bottom: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.status-inline--warning {
  color: var(--warning);
}

.status-inline--info {
  color: var(--text-soft);
}

.status-card__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 14px 20px;
  color: var(--muted);
  font-size: 0.76rem;
}

.status-message {
  color: var(--warning);
  font-weight: 600;
}

.status-side {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  padding: clamp(22px, 3vw, 30px);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: transparent;
}

.status-side__title {
  margin-bottom: 12px;
  font-size: 1.15rem;
  font-weight: 750;
  line-height: 1.35;
}

.status-side p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.75;
}

.status-side p + p {
  margin-top: 12px;
}

.status-side .text-link {
  margin-top: 22px;
}

/* --------------------------------------------------------------------------
   Connection addresses
   -------------------------------------------------------------------------- */

.connect-list {
  display: grid;
  gap: 14px;
}

.connect-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: clamp(22px, 3.2vw, 32px);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.connect-item--primary {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: var(--accent-soft);
}

.connect-item__label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.connect-item--primary .connect-item__label {
  color: var(--accent-soft-text);
}

.connect-item__address {
  display: block;
  color: var(--text);
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono",
    monospace;
  font-size: clamp(1.4rem, 3.6vw, 2.35rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
  user-select: all;
}

.connect-item--primary .connect-item__address {
  color: var(--accent-soft-text);
}

.connect-item__address.is-copyable {
  cursor: pointer;
}

.connect-item__address.is-copyable:hover {
  opacity: 0.82;
}

.connect-item__hint {
  max-width: 580px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 0.87rem;
  line-height: 1.65;
}

.connect-item--primary .connect-item__hint {
  color: color-mix(in srgb, var(--accent-soft-text) 76%, transparent);
}

.copy-button {
  min-width: 96px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.copy-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.copy-button.is-copied {
  border-color: var(--success);
  background: var(--success-soft);
  color: var(--success);
}

.copy-button.is-error {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

.copy-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.connect-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.6;
}

.connect-note::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  margin-top: 0.58em;
  border-radius: 50%;
  background: var(--accent);
}

.connect-note a {
  color: var(--text);
  text-decoration: none;
}

.connect-note a:hover {
  color: var(--accent);
}

.connect-note strong {
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.02em;
  user-select: all;
}

.copy-announcer {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   World gallery
   -------------------------------------------------------------------------- */

.world-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 2.6vw, 28px);
}

.world-card {
  margin: 0;
}

.world-card__media {
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.world-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms var(--ease);
}

.world-card:hover .world-card__media img {
  transform: scale(1.025);
}

.world-card figcaption {
  margin-top: 11px;
  color: var(--muted);
  font-size: 0.82rem;
}

/* --------------------------------------------------------------------------
   Announcements
   -------------------------------------------------------------------------- */

.announcements-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.3fr);
  gap: clamp(30px, 6vw, 80px);
  align-items: start;
}

.announcements-head {
  position: sticky;
  top: calc(var(--nav-height) + 30px);
}

.announcements-list {
  border-top: 1px solid var(--line);
}

.announcement {
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.announcement__date {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.announcement__title {
  font-size: 1.15rem;
  font-weight: 750;
  line-height: 1.45;
}

.announcement__body {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.75;
}

.announcement__link {
  display: inline-block;
  margin-top: 10px;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 650;
}

.empty-state {
  padding: 34px 0 26px;
  border-bottom: 1px solid var(--line);
}

.empty-state__title {
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 700;
}

.empty-state__text {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* --------------------------------------------------------------------------
   Join guide
   -------------------------------------------------------------------------- */

.join-layout {
  display: grid;
  grid-template-columns: minmax(250px, 0.75fr) minmax(0, 1.25fr);
  gap: clamp(30px, 6vw, 86px);
  align-items: start;
}

.join-aside {
  position: static;
}

.join-aside__contact {
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.join-aside__contact h3 {
  font-size: 0.98rem;
  font-weight: 750;
}

.join-aside__contact p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.9rem;
}

.qq-number {
  display: inline-block;
  margin-top: 10px;
  color: var(--text);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  user-select: all;
}

.steps {
  counter-reset: step;
  border-top: 1px solid var(--line);
}

.step {
  counter-increment: step;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 16px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.step::before {
  content: counter(step, decimal-leading-zero);
  color: var(--accent);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.75;
}

.step__title {
  font-size: 1.02rem;
  font-weight: 750;
  line-height: 1.5;
}

.step__text {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.91rem;
  line-height: 1.7;
}

.step__text code {
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--surface-soft);
  color: var(--text);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.87em;
  overflow-wrap: anywhere;
  user-select: all;
}

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

.site-footer {
  padding-block: 46px 30px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(140px, 0.6fr));
  gap: 36px;
  align-items: start;
}

.footer-brand {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-decoration: none;
}

.footer-brand__logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.footer-brand__name {
  font-size: 0.95rem;
  font-weight: 750;
}

.footer-brand__tagline {
  max-width: 330px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.65;
}

.footer-col__title {
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.footer-col a,
.footer-col span {
  display: block;
  padding: 3px 0;
  color: var(--text-soft);
  font-size: 0.86rem;
  text-decoration: none;
}

.footer-col a:hover {
  color: var(--accent);
}

.footer-copy {
  display: block;
  width: 100%;
  padding: 3px 0;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  font-family: inherit;
  font-size: 0.86rem;
  line-height: inherit;
  text-align: left;
  cursor: pointer;
}

.footer-copy:hover {
  color: var(--accent);
}

.footer-copy.is-copied {
  color: var(--success);
}

.footer-copy.is-error {
  color: var(--danger);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.76rem;
}

.footer-bottom p {
  max-width: 720px;
}

.footer-credit {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.76rem;
  text-align: right;
}

.footer-credit a {
  color: var(--text-soft);
  text-decoration: none;
}

.footer-credit a:hover {
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   About page
   -------------------------------------------------------------------------- */

.page-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: clamp(340px, 46vw, 480px);
  overflow: hidden;
  background: #10160f;
  color: var(--hero-text);
  isolation: isolate;
}

.page-hero__image {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  filter: saturate(0.94);
}

.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    to bottom,
    rgba(8, 12, 8, 0.3) 0%,
    rgba(8, 12, 8, 0.5) 45%,
    rgba(7, 11, 7, 0.86) 100%
  );
}

.page-hero__inner {
  padding-block: clamp(70px, 11vw, 110px) clamp(38px, 5vw, 56px);
}

.page-hero .eyebrow {
  color: #cde6b9;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: clamp(24px, 4vw, 42px);
  color: var(--hero-text-soft);
  font-size: 0.78rem;
}

.breadcrumb a {
  color: inherit;
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--hero-text);
}

.breadcrumb__sep {
  opacity: 0.5;
}

.page-hero__title {
  max-width: 900px;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.6rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.page-hero__lead {
  max-width: 650px;
  margin-top: 16px;
  color: var(--hero-text-soft);
  font-size: clamp(0.98rem, 1.6vw, 1.12rem);
  line-height: 1.8;
}

.about-intro {
  display: grid;
  grid-template-columns: minmax(240px, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(34px, 7vw, 100px);
  align-items: start;
}

.about-intro__title {
  font-size: clamp(1.65rem, 3.3vw, 2.55rem);
  font-weight: 750;
  line-height: 1.22;
  letter-spacing: -0.025em;
}



.about-prose {
  color: var(--text-soft);
  font-size: 0.98rem;
  line-height: 1.85;
}

.about-prose p + p {
  margin-top: 16px;
}

.values-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.value {
  padding: clamp(22px, 3.4vw, 34px);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.value__index {
  display: block;
  margin-bottom: 16px;
  color: var(--accent);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.8rem;
  font-weight: 700;
}

.value__title {
  font-size: 1.05rem;
  font-weight: 750;
}

.value__text {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.75;
}

.facts {
  display: grid;
  grid-template-columns: minmax(240px, 0.75fr) minmax(0, 1.25fr);
  gap: clamp(30px, 6vw, 80px);
  align-items: start;
}

.fact-list {
  border-top: 1px solid var(--line);
}

.fact {
  display: grid;
  grid-template-columns: minmax(120px, 0.75fr) minmax(0, 1.25fr);
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}

.fact__label {
  color: var(--muted);
}

.fact__value {
  color: var(--text);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.fact__value code {
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.93em;
  user-select: all;
}

.fact__value a {
  color: var(--accent);
  text-decoration: none;
}

.fact__value a:hover {
  color: var(--accent-strong);
}

.team-section {
  border-top: 1px solid var(--line);
  background: var(--bg-deep);
}

.team-owner {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 26px);
  padding: clamp(20px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.team-owner__avatar {
  width: clamp(84px, 12vw, 112px);
  height: clamp(84px, 12vw, 112px);
  flex: 0 0 auto;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--surface-soft);
}

.team-owner__label,
.team-member__role {
  display: inline-block;
  margin-bottom: 8px;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent-soft-text);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.team-owner__name {
  font-size: clamp(1.45rem, 3vw, 1.95rem);
  font-weight: 750;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.team-owner__note {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.87rem;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(18px, 3vw, 28px);
  margin-top: clamp(26px, 4vw, 38px);
}

.team-member {
  min-width: 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.team-member__avatar {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--surface-soft);
}

.team-member__name {
  margin-top: 11px;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.team-member__role {
  margin-top: 6px;
  margin-bottom: 0;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
}

.team-summary {
  max-width: 760px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.75;
}

.cta-band {
  padding-block: clamp(56px, 8vw, 92px);
  border-top: 1px solid var(--line);
}

.cta-band__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
}

.cta-band__title {
  font-size: clamp(2rem, 4.2vw, 3.2rem);
  font-weight: 750;
  line-height: 1.18;
  letter-spacing: -0.025em;
}

.cta-band__text {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.94rem;
}

.cta-band__text code {
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.93em;
  user-select: all;
}

.cta-band__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* --------------------------------------------------------------------------
   404 / utility page
   -------------------------------------------------------------------------- */

.utility-page {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 32px;
  background: var(--bg);
}

.utility-card {
  width: min(100%, 600px);
  padding: clamp(28px, 6vw, 52px);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.utility-card__code {
  color: var(--accent);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.utility-card h1 {
  margin-top: 10px;
  font-size: clamp(1.8rem, 5vw, 2.7rem);
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.utility-card p {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.95rem;
}

.utility-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

/* Language entry */

.entry-page {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 28px;
  background: var(--bg);
}

.entry-card {
  width: min(100%, 540px);
  padding: clamp(30px, 7vw, 56px);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  text-align: center;
}

.entry-card img {
  width: 86px;
  height: 86px;
  margin: 0 auto 20px;
  object-fit: contain;
}

.entry-card h1 {
  font-size: 1.35rem;
  line-height: 1.4;
}

.entry-card p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.entry-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 26px;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .status-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .status-side {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
  }

  .status-side__content {
    max-width: 620px;
  }

  .status-side .text-link {
    margin-top: 0;
    flex: 0 0 auto;
  }

  .announcements-layout,
  .join-layout,
  .about-intro,
  .facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .announcements-head,
  .join-aside {
    position: static;
  }

  .join-aside__contact {
    max-width: 480px;
  }

  .about-intro__title {
    max-width: 620px;
  }

  .team-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .footer-top {
    grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(120px, 0.6fr));
  }
}

@media (max-width: 720px) {
  :root {
    --nav-height: 64px;
  }

  .site-header__inner {
    gap: 10px;
  }

  .brand {
    gap: 8px;
  }

  .brand__logo {
    width: 36px;
    height: 36px;
  }

  .brand__lockup {
    gap: 0;
  }

  .brand__mark {
    font-size: 0.58rem;
    letter-spacing: 0.14em;
  }

  .brand__names {
    font-size: 0.9rem;
    letter-spacing: 0.02em;
  }

  .nav {
    gap: 4px;
  }

  .nav__link {
    min-height: 38px;
    padding: 0 8px;
    font-size: 0.84rem;
  }

  .icon-button {
    width: 44px;
    height: 44px;
    min-width: 44px;
  }

  .lang-toggle {
    min-width: 44px;
    padding: 0 7px;
    font-size: 0.74rem;
  }

  .hero {
    min-height: max(540px, calc(100svh - var(--nav-height)));
  }

  .hero__title {
    max-width: 15ch;
    font-size: clamp(2.25rem, 10.5vw, 3.4rem);
  }

  .hero__lead {
    font-size: 0.97rem;
  }

  .hero__meta {
    gap: 6px 16px;
    font-size: 0.76rem;
  }

  .status-side {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .status-side .text-link {
    margin-top: 0;
  }

  .world-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .values-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-top {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 28px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .footer-bottom {
    flex-direction: column;
  }

  .footer-credit {
    text-align: left;
  }

  .team-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .brand__names {
    font-size: 0.88rem;
  }

  .team-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav__link {
    padding-inline: 7px;
  }

  .connect-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .copy-button {
    width: 100%;
    min-height: 46px;
  }

  .connect-item__address {
    font-size: clamp(1.22rem, 6vw, 1.65rem);
  }

  .status-card__body {
    grid-template-columns: minmax(0, 1fr);
  }

  .status-stat:nth-child(odd) {
    border-right: 0;
  }

  .status-stat {
    border-bottom: 1px solid var(--line);
  }

  .cta-band__actions {
    width: 100%;
  }

  .cta-band__actions .button {
    flex: 1 1 190px;
  }

  .team-owner {
    align-items: flex-start;
  }
}

@media (max-width: 380px) {
  .brand__lockup {
    gap: 0;
  }

  .brand__mark {
    font-size: 0.54rem;
    letter-spacing: 0.12em;
  }

  .brand__names {
    font-size: 0.8rem;
    letter-spacing: 0.015em;
  }

  .site-header__inner {
    gap: 6px;
  }

  .nav__link {
    padding-inline: 6px;
    font-size: 0.8rem;
  }

  .icon-button {
    width: 44px;
    height: 44px;
    min-width: 44px;
  }

  .lang-toggle {
    min-width: 44px;
  }
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }


  .hero__slide {
    transition: none;
  }

  .world-card:hover .world-card__media img {
    transform: none;
  }

  .status-badge--loading::before,
  .status-refresh.is-loading svg {
    animation: none;
  }

  ::view-transition-group(root),
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none !important;
  }
}

@supports not (color: color-mix(in srgb, white, black)) {
  .status-badge--online,
  .status-badge--offline,
  .status-badge--error,
  .connect-item--primary,
  .connect-item__hint {
    border-color: var(--line);
  }
}

@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 180ms;
}

