:root {
  --ink: #111111;
  --muted: #686868;
  --paper: #f4f1eb;
  --card: #ffffff;
  --line: #d8d4cc;
  --ted: #e62b1e;
  --ted-dark: #b91f15;
  --shadow: 0 24px 70px rgba(27, 21, 14, 0.11);
  --radius: 22px;
  font-family: "Times New Roman", "KaiTi", "STKaiti", "楷体", serif;
  color: var(--ink);
  background: #111;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: #111; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }

.cinema-backdrop {
  position: fixed;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  background: #111;
  pointer-events: none;
}
.cinema-slide {
  position: absolute;
  inset: -5%;
  opacity: 0;
  background-position: center;
  background-size: cover;
  filter: saturate(.72) contrast(.92) brightness(.7);
  animation: cinemaCycle 40s infinite, cinemaDrift 12s ease-in-out infinite alternate;
  will-change: opacity, transform;
}
.slide-dead-poets { background-image: url("assets/dead-poets-society.jpg"); animation-delay: -2s, 0s; }
.slide-choristes { background-image: url("assets/les-choristes.jpg"); animation-delay: 6s, -3s; }
.slide-kings-speech { background-image: url("assets/kings-speech.jpg"); animation-delay: 14s, -6s; }
.slide-city-of-sadness { background-image: url("assets/a-city-of-sadness.jpg"); animation-delay: 22s, -9s; }
.slide-yi-yi { background-image: url("assets/yi-yi.jpg"); animation-delay: 30s, -12s; }
.cinema-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 8, 10, .38) 0%, rgba(8, 8, 10, .2) 56%, rgba(8, 8, 10, .32) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, .12), rgba(0, 0, 0, .34));
}
@keyframes cinemaCycle {
  0% { opacity: 0; }
  4%, 18% { opacity: 1; }
  22%, 100% { opacity: 0; }
}
@keyframes cinemaDrift {
  from { transform: scale(1.02) translate3d(-.6%, -.4%, 0); }
  to { transform: scale(1.09) translate3d(.8%, .6%, 0); }
}

.topbar, main, footer { position: relative; z-index: 1; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 72px;
  padding: 0 clamp(22px, 5vw, 78px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  background: rgba(10, 10, 12, 0.72);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand { display: flex; align-items: baseline; gap: 10px; }
.brand-mark { color: var(--ted); font: 900 29px/1 "Times New Roman", "KaiTi", "STKaiti", "楷体", serif; letter-spacing: -2px; }
.brand-copy { font-size: 13px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.topbar nav { display: flex; align-items: center; gap: 28px; font-size: 14px; font-weight: 700; }
.topbar nav a:hover, .nav-button:hover { color: var(--ted); }
.nav-button { padding: 0; border: 0; background: none; cursor: pointer; font-weight: 700; }

main { overflow: hidden; }
.hero {
  position: relative;
  min-height: calc(100vh - 72px);
  padding: clamp(56px, 8vw, 105px) clamp(22px, 7vw, 110px);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(330px, 0.72fr);
  align-items: center;
  gap: clamp(50px, 8vw, 120px);
  color: #fff;
}
.hero::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 8, 10, .76) 0%, rgba(8, 8, 10, .46) 56%, rgba(8, 8, 10, .62) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, .18), rgba(0, 0, 0, .64));
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }

.eyebrow { margin: 0 0 18px; color: var(--ted); font-size: 12px; font-weight: 900; letter-spacing: 0.18em; }
.hero h1 { margin: 0; font-size: clamp(48px, 6.5vw, 98px); line-height: 0.98; letter-spacing: -0.07em; }
.hero h1 span { color: var(--ted); }
.hero-intro { max-width: 630px; margin: 32px 0 0; color: rgba(255,255,255,.78); font-size: 17px; line-height: 1.9; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

.button {
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.button:hover { transform: translateY(-2px); }
.button.primary { color: #fff; background: var(--ted); box-shadow: 0 12px 30px rgba(230, 43, 30, .2); }
.button.primary:hover { background: var(--ted-dark); }
.button.secondary { background: transparent; border-color: #aaa59d; }
.button.secondary:hover { border-color: var(--ink); background: rgba(255,255,255,.55); }
.hero .button.secondary { color: #fff; border-color: rgba(255,255,255,.52); background: rgba(12,12,14,.22); }
.hero .button.secondary:hover { border-color: #fff; background: rgba(255,255,255,.14); }
.button.ghost { background: #ebe7df; color: #3e3c39; }
.button.small { min-height: 40px; padding: 0 16px; font-size: 13px; }

.hero-stats { margin-top: 46px; display: flex; gap: 34px; }
.hero-stats div { display: grid; gap: 3px; }
.hero-stats strong { font-size: 27px; }
.hero-stats span { color: rgba(255,255,255,.62); font-size: 12px; }

.hero-note {
  width: min(100%, 430px);
  justify-self: center;
  padding: clamp(28px, 4vw, 48px);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 22px;
  background: rgba(12, 12, 14, .48);
  box-shadow: 0 28px 80px rgba(0,0,0,.3);
  backdrop-filter: blur(18px);
}
.hero-note small { color: #ff6c63; font-size: 10px; font-weight: 900; letter-spacing: .18em; }
.hero-note strong { display: block; margin-top: 14px; font-size: clamp(25px, 3vw, 38px); letter-spacing: -.04em; }
.hero-note p { margin: 17px 0 0; color: rgba(255,255,255,.72); font-size: 14px; line-height: 1.85; }
.film-ticker { margin-top: 28px; padding-top: 20px; display: flex; flex-wrap: wrap; gap: 8px; border-top: 1px solid rgba(255,255,255,.16); }
.film-ticker span { padding: 7px 10px; border-radius: 999px; color: rgba(255,255,255,.8); background: rgba(255,255,255,.1); font-size: 11px; }

.topic-strip {
  padding: 20px clamp(22px, 7vw, 110px);
  display: flex;
  gap: 16px 32px;
  flex-wrap: wrap;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.topic-strip span:not(:last-child)::after { content: " /"; color: var(--ted); margin-left: 25px; }

.group-guide-section {
  padding: 92px clamp(22px, 7vw, 110px);
  background: rgba(244,241,235,.7);
  backdrop-filter: blur(2px) saturate(.82);
}
.group-guide-heading { max-width: 760px; }
.group-guide-heading h2 { margin: 0; font-size: clamp(38px, 4.5vw, 64px); line-height: 1.05; letter-spacing: -.05em; }
.group-guide { margin-top: 42px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.guide-card {
  grid-column: span 2;
  min-height: 390px;
  padding: 24px;
  border-top: 4px solid var(--ink);
  background: #fff;
  box-shadow: 0 14px 38px rgba(40,30,18,.065);
}
.guide-card:nth-child(4) { grid-column: 2 / span 2; }
.guide-card:nth-child(5) { grid-column: 4 / span 2; }
.guide-card.open { min-height: 245px; }
.guide-card-head { display: flex; align-items: start; gap: 14px; }
.guide-card-head > span { color: var(--ted); font: 900 32px/1 "Times New Roman", "KaiTi", "STKaiti", "楷体", serif; letter-spacing: -.08em; }
.guide-card-head small { color: #8a857d; font-size: 9px; font-weight: 900; letter-spacing: .14em; }
.guide-card h3 { margin: 5px 0 0; font-size: 18px; line-height: 1.25; }
.guide-card > p { margin: 22px 0 0; color: var(--ted-dark); font-size: 13px; font-weight: 900; }
.guide-card ul { margin: 18px 0 0; padding: 0; display: grid; gap: 9px; list-style: none; }
.guide-card li { border-bottom: 1px solid #ebe7df; color: #5f5b54; font-size: 12px; line-height: 1.35; }
.guide-card li a { padding: 0 0 9px; display: flex; align-items: start; justify-content: space-between; gap: 10px; transition: color .18s ease; }
.guide-card li a::before { content: "→"; flex: 0 0 auto; color: var(--ted); font-weight: 900; }
.guide-card li a:hover { color: var(--ted-dark); }
.guide-card li a span { margin-left: auto; flex: 0 0 auto; color: #9a958d; font-size: 9px; font-weight: 800; }
.open-topic-note { margin-top: 24px; padding: 18px; border-radius: 12px; color: #69645d; background: #f5f2ec; font-size: 13px; font-weight: 800; }

.signup-section, .groups-section { padding: 105px clamp(22px, 7vw, 110px); }
.signup-section { display: grid; grid-template-columns: minmax(240px, .58fr) minmax(0, 1fr); gap: clamp(55px, 9vw, 150px); background: rgba(255,255,255,.76); backdrop-filter: blur(2px) saturate(.82); }
.section-heading { max-width: 500px; }
.section-heading h2 { margin: 0; font-size: clamp(38px, 4.5vw, 64px); line-height: 1.05; letter-spacing: -.05em; }
.section-heading > p:last-child { margin-top: 22px; color: var(--muted); line-height: 1.9; }

.signup-form { max-width: 760px; display: grid; gap: 28px; }
.form-row.two-cols { display: grid; grid-template-columns: 150px 1fr; gap: 18px; }
.field { position: relative; display: grid; gap: 9px; }
.field > span, .field-group legend { font-size: 14px; font-weight: 800; }
.field-note { margin: -2px 0 2px; color: #77726a; font-size: 12px; line-height: 1.6; }
em { color: var(--ted); font-style: normal; }
.field input, .field textarea, .search-box input {
  width: 100%;
  border: 1px solid #cfcac1;
  border-radius: 12px;
  outline: none;
  background: #fbfaf8;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.field input { height: 52px; padding: 0 15px; }
.field textarea { min-height: 140px; padding: 15px; resize: vertical; line-height: 1.7; }
.field input:focus, .field textarea:focus, .search-box input:focus { border-color: var(--ted); box-shadow: 0 0 0 4px rgba(230,43,30,.09); }
.counter { position: absolute; right: 13px; bottom: 11px; color: #9a958d; font-size: 11px; }

.field-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.field-group legend { margin-bottom: 12px; }
.group-options { display: grid; grid-template-columns: repeat(5, 1fr); gap: 9px; }
.group-option input { position: absolute; opacity: 0; pointer-events: none; }
.group-option span {
  min-height: 112px;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid #ccc7be;
  border-radius: 14px;
  background: #fbfaf8;
  cursor: pointer;
  transition: .18s ease;
}
.group-option b { font-size: 12px; color: var(--ted); }
.group-option i { font-size: 12px; font-style: normal; font-weight: 800; line-height: 1.45; }
.group-option small { color: #8b877f; font-size: 10px; }
.group-option input:checked + span { color: #fff; border-color: var(--ink); background: var(--ink); box-shadow: 0 12px 28px rgba(0,0,0,.13); transform: translateY(-3px); }
.group-option input:focus-visible + span { outline: 3px solid rgba(230,43,30,.3); outline-offset: 2px; }

.segmented { display: inline-grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 12px; background: #edeae4; }
.segmented label { cursor: pointer; }
.segmented input { position: absolute; opacity: 0; }
.segmented span { min-width: 126px; height: 42px; padding: 0 17px; display: grid; place-items: center; border-radius: 9px; font-size: 13px; font-weight: 800; }
.segmented input:checked + span { color: #fff; background: var(--ink); box-shadow: 0 4px 14px rgba(0,0,0,.14); }
.form-actions { display: flex; gap: 10px; }
.form-message { min-height: 0; color: #b42318; font-size: 13px; font-weight: 700; }
.form-message:not(:empty) { padding: 11px 14px; border-radius: 10px; background: #fff0ef; }

.groups-section { background: rgba(244,241,235,.7); backdrop-filter: blur(2px) saturate(.82); }
.section-heading.horizontal { max-width: none; display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.section-heading.horizontal > div:first-child { max-width: 590px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; justify-content: flex-end; }
.search-box input { width: 210px; height: 40px; padding: 0 14px; background: #fff; font-size: 13px; }
.group-board { margin-top: 52px; display: grid; gap: 22px; }

.group-panel { border-top: 4px solid var(--ink); background: var(--card); box-shadow: 0 13px 38px rgba(40,30,18,.055); }
.group-panel-header { padding: 22px 24px; display: flex; justify-content: space-between; gap: 20px; border-bottom: 1px solid #e3dfd7; }
.group-panel-title { display: flex; align-items: start; gap: 17px; }
.group-number { color: var(--ted); font: 900 34px/1 "Times New Roman", "KaiTi", "STKaiti", "楷体", serif; letter-spacing: -.08em; }
.group-panel h3 { margin: 0; font-size: 20px; }
.group-panel-header p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.member-count { flex: 0 0 auto; color: #77736c; font-size: 12px; font-weight: 800; }
.member-grid { padding: 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 12px; }
.member-card { min-height: 92px; padding: 16px; border: 1px solid #e1ddd5; border-radius: 13px; background: #fcfbf9; display: flex; flex-direction: column; }
.member-head { display: flex; align-items: center; gap: 11px; }
.member-no { width: 37px; height: 37px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--ink); font-weight: 900; font-size: 13px; }
.member-name { font-weight: 900; }
.leader-badge { margin-left: auto; padding: 4px 7px; border-radius: 999px; color: #a52218; background: #ffe3df; font-size: 10px; font-weight: 900; }
.member-actions { margin-top: 18px; display: flex; gap: 13px; }
.text-button { padding: 0; border: 0; color: #706c65; background: none; font-size: 11px; font-weight: 800; cursor: pointer; }
.text-button:hover { color: var(--ted); }
.empty-group { padding: 36px 24px; color: #9a958d; text-align: center; font-size: 13px; }
.connection-note { margin-top: 28px; padding: 15px 18px; color: #7b271f; background: #ffe7e3; border-left: 4px solid var(--ted); line-height: 1.7; }

footer { padding: 28px clamp(22px, 7vw, 110px); display: flex; justify-content: space-between; gap: 20px; color: #aaa; background: rgba(17,17,17,.97); font-size: 11px; }
.toast { position: fixed; z-index: 50; left: 50%; bottom: 26px; transform: translate(-50%, 120px); padding: 13px 19px; border-radius: 999px; color: #fff; background: #111; font-size: 13px; font-weight: 800; box-shadow: 0 12px 40px rgba(0,0,0,.25); opacity: 0; transition: .28s ease; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.hidden { display: none !important; }
.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; }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-note { width: 100%; max-width: 650px; justify-self: start; }
  .signup-section { grid-template-columns: 1fr; }
  .signup-section .section-heading { max-width: 650px; }
  .group-options { grid-template-columns: repeat(3, 1fr); }
  .group-guide { grid-template-columns: repeat(2, 1fr); }
  .guide-card, .guide-card:nth-child(4), .guide-card:nth-child(5) { grid-column: auto; }
  .guide-card:last-child { grid-column: 1 / -1; }
  .section-heading.horizontal { align-items: start; flex-direction: column; }
  .toolbar { justify-content: start; }
}

@media (max-width: 680px) {
  .topbar { height: 62px; }
  .brand-copy { display: none; }
  .topbar nav { gap: 14px; font-size: 12px; }
  .topbar nav a:nth-child(2) { display: none; }
  .hero { padding-top: 54px; }
  .hero h1 { font-size: 48px; }
  .hero-stats { gap: 22px; }
  .topic-strip span::after { display: none; }
  .signup-section, .groups-section { padding-top: 75px; padding-bottom: 75px; }
  .form-row.two-cols { grid-template-columns: 1fr; }
  .group-options { grid-template-columns: repeat(2, 1fr); }
  .group-guide { grid-template-columns: 1fr; }
  .guide-card, .guide-card:last-child { grid-column: auto; min-height: auto; }
  .segmented { width: 100%; }
  .segmented span { min-width: 0; }
  .toolbar, .search-box, .search-box input { width: 100%; }
  .toolbar .button { flex: 1; }
  footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cinema-slide { animation: none; }
  .slide-dead-poets { opacity: 1; }
  .button { transition: none; }
}
