:root {
  color-scheme: dark;
  --canvas: #130f12;
  --surface: #1d171b;
  --surface-raised: #261e22;
  --ink: #f6f0e8;
  --muted: #aa9da2;
  --line: rgba(246, 240, 232, 0.14);
  --accent: #e6ad4f;
  --accent-strong: #f1c46f;
  --danger: #ff8e88;
  --success: #8fd6ae;
  --radius: 26px;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: var(--canvas); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--canvas); }
button, a { font: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--accent-strong); outline-offset: 3px; }

.landing-shell {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
}

.story {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  padding: clamp(28px, 5vw, 72px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(circle at 20% 18%, rgba(179, 55, 43, 0.34), transparent 34%),
    linear-gradient(145deg, #241318 0%, #130f12 64%);
}

.story::after {
  content: "";
  position: absolute;
  inset: 18% -12% auto auto;
  width: min(48vw, 660px);
  aspect-ratio: 1;
  border: 1px solid rgba(230, 173, 79, 0.18);
  border-radius: 50%;
  box-shadow: 0 0 0 64px rgba(230, 173, 79, 0.035), 0 0 0 128px rgba(230, 173, 79, 0.02);
  pointer-events: none;
}

.brand { display: inline-flex; align-items: center; gap: 12px; width: fit-content; color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: .05em; z-index: 1; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; color: #21140c; background: var(--accent); border-radius: 10px 10px 10px 2px; font-weight: 900; }
.story-copy { position: relative; z-index: 1; max-width: 720px; margin: auto 0; }
.eyebrow, .kicker { margin: 0 0 16px; color: var(--accent-strong); font: 700 12px/1.2 ui-monospace, "SFMono-Regular", Menlo, monospace; letter-spacing: .22em; }
h1 { margin: 0; max-width: 9em; font-size: clamp(50px, 7.5vw, 112px); line-height: .98; letter-spacing: -.055em; text-wrap: balance; }
.intro { max-width: 520px; margin: 28px 0 0; color: var(--muted); font-size: clamp(16px, 1.5vw, 20px); line-height: 1.8; }
.film-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; width: min(460px, 70%); position: relative; z-index: 1; }
.film-strip span { height: 8px; border-radius: 2px; background: rgba(246, 240, 232, .16); }
.film-strip span:nth-child(2), .film-strip span:nth-child(5) { background: var(--accent); }

.invite-card {
  align-self: center;
  width: min(520px, calc(100% - 48px));
  margin: 48px auto;
  padding: clamp(26px, 4vw, 48px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .3);
}
.card-head { display: flex; align-items: flex-start; gap: 18px; }
.step { flex: 0 0 auto; display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); font: 700 12px/1 ui-monospace, monospace; }
.kicker { margin-bottom: 8px; letter-spacing: .12em; }
h2 { margin: 0; font-size: clamp(22px, 3vw, 32px); line-height: 1.25; letter-spacing: -.03em; }

.code-panel { margin-top: 34px; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-raised); }
.code-label { display: block; margin-bottom: 9px; color: var(--muted); font-size: 12px; }
#invite-code { display: block; overflow-wrap: anywhere; color: var(--accent-strong); font: 800 clamp(24px, 5vw, 38px)/1.2 ui-monospace, "SFMono-Regular", Menlo, monospace; letter-spacing: .12em; }
.text-button { min-height: 44px; margin: 12px 0 -10px; padding: 0; border: 0; color: var(--ink); background: transparent; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.text-button:disabled { color: var(--muted); cursor: not-allowed; text-decoration: none; }
.reward-copy { margin: 16px 0 0; color: var(--accent-strong); font-size: 14px; line-height: 1.6; }

.primary-button { width: 100%; min-height: 56px; margin-top: 26px; padding: 0 22px; display: flex; align-items: center; justify-content: space-between; border: 0; border-radius: 14px; color: #24170d; background: var(--accent); font-weight: 800; cursor: pointer; transition: transform .18s ease, background .18s ease; }
.primary-button:hover:not(:disabled) { transform: translateY(-2px); background: var(--accent-strong); }
.primary-button:disabled { opacity: .42; cursor: not-allowed; }
.secondary-link { display: block; min-height: 44px; padding-top: 14px; color: var(--ink); text-align: center; text-underline-offset: 4px; }
.status-message { min-height: 42px; margin: 18px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.status-message[data-state="ready"] { color: var(--success); }
.status-message[data-state="error"] { color: var(--danger); }
.privacy-note { display: flex; gap: 10px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.65; }
.privacy-note p { margin: 0; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 20; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 999px; color: var(--canvas); background: var(--ink); font-size: 14px; box-shadow: 0 10px 35px rgba(0,0,0,.35); }
noscript { display: block; padding: 16px; color: var(--danger); background: var(--surface); text-align: center; }

@media (max-width: 820px) {
  .landing-shell { grid-template-columns: 1fr; }
  .story { min-height: 42svh; padding: 24px; }
  .story-copy { margin: 64px 0 56px; }
  h1 { font-size: clamp(44px, 14vw, 74px); }
  .intro { margin-top: 20px; font-size: 15px; }
  .film-strip { width: 100%; }
  .invite-card { width: calc(100% - 24px); margin: -18px auto 18px; position: relative; z-index: 2; padding: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
