:root {
  --bg: #070b14;
  --bg-raise: #101624;
  --ink: #f6f1e6;
  --muted: #c4bbaa;
  --gold: #f0d48a;
  --gold-deep: #c4923e;
  --line: rgba(240, 212, 138, 0.28);
  --sans: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei",
    sans-serif;
  --mono: "SF Mono", "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  --wrap: 1120px;
  --header: 76px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.85;
  background:
    radial-gradient(ellipse 70% 42% at 50% -8%, rgba(212, 168, 74, 0.16), transparent 58%),
    radial-gradient(ellipse 36% 28% at 92% 18%, rgba(18, 150, 78, 0.12), transparent 70%),
    var(--bg);
  color-scheme: dark;
  overflow-x: clip;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(240, 212, 138, 0.18) 0.6px, transparent 0.6px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 12%, transparent 72%);
  opacity: 0.28;
}

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

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

button,
input {
  font: inherit;
}

code {
  font-family: var(--mono);
}

.skip {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 40;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--gold);
  color: #1a1408;
}

.skip:focus {
  top: 12px;
}

.wrap {
  width: min(var(--wrap), calc(100% - 40px));
  margin: 0 auto;
}

.kicker {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.28em;
}

.kicker::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 10px;
  background: var(--gold);
  transform: rotate(45deg) translateY(-1px);
}

.gold {
  background-image: linear-gradient(100deg, #8d5e22 0%, #f8e7b8 38%, #fff8df 50%, #e4b45c 68%, #8d5e22 100%);
  background-size: 180% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

h1,
h2,
h3 {
  font-weight: 650;
  letter-spacing: 0.04em;
  line-height: 1.25;
}

h1 {
  margin: 0;
  font-size: clamp(44px, 14vw, 92px);
}

h2 {
  margin: 0 0 18px;
  font-size: clamp(24px, 6.6vw, 40px);
}

h3 {
  margin: 8px 0 6px;
  font-size: 22px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: env(safe-area-inset-top);
  height: calc(var(--header) + env(safe-area-inset-top));
  background: rgba(7, 11, 20, 0.94);
  border-bottom: 1px solid rgba(240, 212, 138, 0.16);
}

.header-inner,
.nav,
.hero-actions,
.contract,
.brand {
  display: flex;
  align-items: center;
}

.header-inner {
  height: 100%;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  gap: 12px;
  min-width: 0;
}

.brand img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(240, 212, 138, 0.45);
}

.brand strong {
  display: block;
  font-size: 18px;
  letter-spacing: 0.12em;
  line-height: 1.2;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
}

.nav {
  gap: 26px;
  color: var(--muted);
  font-size: 15px;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--gold);
}

.hero {
  position: relative;
  padding: 64px 0 28px;
}

.hero::before {
  content: "";
  position: absolute;
  right: 4%;
  top: 10px;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(16, 150, 78, 0.18), transparent 68%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.75fr);
  align-items: center;
  gap: 36px;
}

.h1-line {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: clamp(22px, 5.8vw, 42px);
  font-weight: 600;
}

.lead {
  margin: 22px 0 0;
  font-size: clamp(17px, 4.6vw, 28px);
  letter-spacing: 0.08em;
}

.motto {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 14px 0 0;
  color: var(--gold);
  font-size: 18px;
  letter-spacing: 0.14em;
}

.motto::before,
.motto::after {
  content: "";
  width: 42px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-deep));
}

.motto::after {
  background: linear-gradient(90deg, var(--gold-deep), transparent);
}

.hero-actions {
  gap: 12px;
  margin-top: 32px;
}

.btn {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #24180a;
  background: linear-gradient(180deg, #f8e7b8 0%, #e0b45c 55%, #c4923e 100%);
  font-weight: 650;
  letter-spacing: 0.08em;
  cursor: pointer;
  touch-action: manipulation;
  appearance: none;
  -webkit-appearance: none;
}

.btn:hover {
  filter: brightness(1.06);
}

.btn.ghost {
  color: var(--gold);
  background: transparent;
  border-color: rgba(240, 212, 138, 0.55);
}

.hero-visual {
  display: flex;
  justify-content: center;
}

.hero-logo {
  width: min(280px, 100%);
  height: auto;
  border-radius: 36px;
  box-shadow:
    0 0 0 1px rgba(248, 231, 184, 0.55),
    0 0 0 10px rgba(240, 212, 138, 0.08),
    0 28px 70px rgba(0, 0, 0, 0.45);
}

.rule {
  display: flex;
  justify-content: center;
  padding: 12px 0 8px;
}

.rule span {
  width: min(240px, 46%);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.section {
  padding: 42px 0;
  scroll-margin-top: 92px;
}

.prose {
  max-width: 760px;
}

.prose p,
.panel p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(16, 22, 36, 0.72);
  overflow: hidden;
}

.stats li {
  padding: 26px 16px 22px;
  text-align: center;
  border-right: 1px solid var(--line);
}

.stats li:last-child {
  border-right: 0;
}

.stats b {
  display: block;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.15;
  background-image: linear-gradient(180deg, #fff6d8, #e0b45c 55%, #a87428);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stats span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.panel {
  margin-top: 22px;
  padding: 28px 32px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 244, 214, 0.04), transparent 30%),
    rgba(12, 17, 30, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 236, 190, 0.12);
}

.principles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.principles li {
  padding: 26px 24px 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(16, 22, 36, 0.76);
}

.principles .index {
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 0.18em;
}

.principles p {
  margin: 0;
  color: var(--muted);
}

.invite {
  margin-top: 28px;
  padding: 36px 24px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(ellipse at center, rgba(212, 168, 74, 0.16), transparent 68%),
    var(--bg-raise);
}

.invite p {
  margin: 0;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.invite strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.contract {
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(16, 22, 36, 0.8);
}

.contract .kicker {
  margin-bottom: 6px;
}

.contract code {
  display: block;
  color: var(--ink);
  font-size: clamp(12px, 3.4vw, 16px);
  line-height: 1.6;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
  word-break: break-all;
  cursor: pointer;
  user-select: all;
  -webkit-user-select: all;
}

.site-footer {
  padding: 28px 0 48px;
  scroll-margin-top: 92px;
}

.site-footer h2 {
  text-align: center;
}

.site-footer .kicker {
  text-align: center;
}

.community {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 8px;
}

.community figure {
  margin: 0;
  padding: 16px 16px 14px;
  border-radius: 18px;
  background: #fff;
  text-align: center;
}

.community img {
  width: 100%;
  height: 240px;
  object-fit: contain;
  background: #fff;
}

.community figcaption {
  margin-top: 10px;
  color: #1c1c1c;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: 0.08em;
}

.foot-note {
  margin: 28px 0 0;
  color: var(--muted);
  text-align: center;
  letter-spacing: 0.12em;
}

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

@media (max-width: 860px) {
  .hero-grid,
  .stats,
  .principles,
  .community {
    grid-template-columns: 1fr 1fr;
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    order: -1;
  }

  .hero-logo {
    width: min(220px, 64vw);
    border-radius: 28px;
  }

  .stats li:nth-child(2) {
    border-right: 0;
  }

  .stats li:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .principles {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  :root {
    --header: 56px;
  }

  body {
    padding-bottom: calc(64px + env(safe-area-inset-bottom));
  }

  .section,
  .site-footer {
    scroll-margin-top: 72px;
    padding: 28px 0;
  }

  h2 span {
    display: block;
  }

  .site-header {
    height: calc(var(--header) + env(safe-area-inset-top));
  }

  .header-inner {
    height: var(--header);
    flex-wrap: nowrap;
    padding: 0;
  }

  .brand img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .brand small {
    display: none;
  }

  .nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    justify-content: space-around;
    gap: 0;
    width: auto;
    margin: 0;
    padding: 2px 4px calc(2px + env(safe-area-inset-bottom));
    background: rgba(7, 11, 20, 0.96);
    border-top: 1px solid rgba(240, 212, 138, 0.22);
    font-size: 13px;
  }

  .nav a {
    flex: 1;
    justify-content: center;
    min-height: 48px;
    color: #e6dcc8;
  }

  .hero {
    padding: 24px 0 8px;
  }

  .hero-copy,
  .hero .kicker {
    text-align: center;
  }

  .hero .kicker {
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-actions .btn {
    flex: 1;
    min-width: 0;
    padding: 0 12px;
  }

  .motto {
    justify-content: center;
    font-size: 15px;
    letter-spacing: 0.06em;
  }

  .motto::before,
  .motto::after {
    width: 18px;
    flex: 0 0 18px;
  }

  .hero-logo {
    width: min(168px, 46vw);
    border-radius: 24px;
  }

  .stats b {
    font-size: 28px;
  }

  .stats li {
    padding: 18px 8px 16px;
  }

  .stats span {
    font-size: 12px;
    line-height: 1.45;
  }

  .panel {
    padding: 18px 16px;
  }

  .prose p,
  .panel p {
    font-size: 16px;
  }

  .invite {
    padding: 28px 16px;
  }

  .invite strong {
    font-size: 26px;
    letter-spacing: 0.04em;
  }

  .contract {
    align-items: stretch;
    flex-direction: column;
    padding: 18px 16px;
  }

  .contract .btn {
    width: 100%;
    min-height: 48px;
  }

  .contract code span {
    display: block;
  }

  .community {
    grid-template-columns: 1fr;
    max-width: none;
    margin-right: 0;
    margin-left: 0;
  }

  .community img {
    height: auto;
  }

  .foot-note {
    font-size: 13px;
    letter-spacing: 0.04em;
  }

  .wrap {
    width: min(var(--wrap), calc(100% - 32px));
  }
}

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

  .btn {
    transition: none;
  }
}
