/* ============================================================
   M1more — 통합 커뮤니티 규정 웹사이트
   디자인 기준: m1more_banner.png (스틸 블루 그라데이션,
   페리윙클/틸 포인트, 홀로그램 오브젝트, 화이트 알약 배지)
   ============================================================ */

:root {
  --bg: #eef1f5;
  --bg-soft: #e6eaf1;
  --ink: #232a37;
  --muted: #5d697c;
  --surface: #ffffff;
  --border: rgba(35, 42, 55, 0.10);
  --peri: #86a2f4;
  --peri-deep: #5b7ce0;
  --teal: #0ccbc0;
  --teal-deep: #0a9e96;
  --hero-grad: linear-gradient(160deg, #a3b1bd 0%, #8fa1b3 48%, #7a8ea8 100%);
  --radius: 22px;
  --shadow: 0 18px 50px rgba(35, 42, 55, 0.10);
  --shadow-lg: 0 30px 80px rgba(20, 30, 50, 0.28);
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  --mono: "Cascadia Code", Consolas, "D2Coding", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

.container { width: min(1120px, 92vw); margin: 0 auto; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.grad {
  background: linear-gradient(120deg, #5b7ce0, #0ccbc0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- 내비게이션 ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(238, 241, 245, 0.82);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top, 0);
}
.nav-inner {
  width: min(1120px, 92vw);
  margin: 0 auto;
  height: 80px;
  display: flex;
  align-items: center;
  gap: 28px;
}
/* 배너 비례: 로고 높이 : 글자 크기 ≈ 1.77 : 1 */
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-mark-img { height: 35px; width: auto; object-fit: contain; }
.brand-text { font-weight: 800; font-size: 20px; letter-spacing: -0.2px; }
.nav-links { display: flex; gap: 26px; margin-left: auto; }
.nav-links a {
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--ink); }

/* 햄버거 토글 (모바일 전용) */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform 0.25s ease, opacity 0.2s ease;
}
/* 모바일 메뉴 내 관리자 항목 (데스크톱에서는 숨김) */
.menu-admin { display: none; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  background: var(--surface);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 14px 34px rgba(35, 42, 55, 0.28);
}
.btn-primary:hover { box-shadow: 0 18px 44px rgba(35, 42, 55, 0.36); }
.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: 0 8px 22px rgba(35, 42, 55, 0.07);
}
.btn-ghost:hover { border-color: rgba(91, 124, 224, 0.45); }
.btn-sm { padding: 9px 18px; font-size: 13.5px; }
.btn-onhero {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff;
}
.btn-onhero:hover { background: rgba(255, 255, 255, 0.26); }

/* ---------- 칩 ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.chip b { color: var(--ink); font-family: var(--mono); letter-spacing: 0.5px; }
.chip-accent {
  border-color: rgba(91, 124, 224, 0.35);
  background: #eef2fe;
  color: #3f61c9;
}
.chip-onhero {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}
.chip-onhero b { color: #fff; }

/* ---------- 히어로 ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 150px 0 110px;
  overflow: hidden;
  background: var(--hero-grad);
}
.hero-bg { position: absolute; inset: 0; pointer-events: none; }

.hero-vignette {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 70% at 30% 40%, transparent 55%, rgba(40, 55, 85, 0.18));
}

.hero-inner {
  position: relative;
  width: min(1120px, 92vw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
}

/* 프로젝트 로고 로커 (배너 좌상단과 동일) */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 30px;
  color: #fff;
  font-size: 24px;
  font-weight: 700;
}
.kicker-mark { height: 42px; width: auto; object-fit: contain; }

.hero-en {
  font-size: clamp(1.6rem, 3.4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: 6px;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 10px;
}
.hero h1 {
  font-size: clamp(2.5rem, 5.4vw, 4.1rem);
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -1.5px;
  color: #fff;
  margin-bottom: 38px;
}
/* 버블이 뒤를 지나가도 읽히도록 가벼운 그림자 */
.hero h1, .hero-en, .kicker {
  text-shadow: 0 2px 22px rgba(40, 55, 85, 0.35);
}
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }

/* 히어로 비주얼 — 디바이스 목업 + 홀로그램 오브젝트 */
.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 460px;
}
.hero-device {
  position: relative;
  width: min(340px, 80%);
  aspect-ratio: 281 / 308;
  border-radius: 38px;
  background: #0c0d10;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  overflow: hidden;
  z-index: 2;
}
.hero-device img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 13%;
}
.device-sheen {
  position: absolute;
  inset: 0;
  background: linear-gradient(122deg, rgba(255, 255, 255, 0.22) 0%, transparent 34%, transparent 66%, rgba(255, 255, 255, 0.1) 100%);
  pointer-events: none;
}
.hero-mini-card {
  position: absolute;
  left: -6px;
  bottom: 44px;
  z-index: 3;
  width: 218px;
  padding: 18px 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 24px 60px rgba(20, 30, 50, 0.32);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.mini-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--teal-deep);
  margin-bottom: 12px;
}
.mini-lines { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.mini-lines i {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: #e3e8f2;
}
.mini-lines i:nth-child(1) { width: 100%; }
.mini-lines i:nth-child(2) { width: 82%; }
.mini-lines i:nth-child(3) { width: 58%; }
.mini-row { display: flex; align-items: center; gap: 8px; }
.mini-dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--grad, linear-gradient(120deg, #86a2f4, #0ccbc0));
}
.mini-text { font-size: 12px; font-weight: 800; color: var(--ink); }

/* ---------- 섹션 공통 ---------- */
.section { padding: 110px 0; position: relative; }
.section-head { margin-bottom: 56px; }
.label {
  color: var(--teal-deep);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 4px;
  margin-bottom: 18px;
}
.section-head h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -1px;
  margin-bottom: 20px;
  color: var(--ink);
}
.section-sub { color: var(--muted); font-size: 1.05rem; }

/* ---------- 카드 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.card h3 { font-size: 1.22rem; font-weight: 800; margin-bottom: 12px; }
.card p { color: var(--muted); font-size: 0.98rem; }
.cards .card { padding: 34px 30px; transition: transform 0.22s ease, box-shadow 0.22s ease; }
.cards .card:hover {
  transform: translateY(-6px);
  box-shadow: 0 26px 60px rgba(35, 42, 55, 0.16);
}
.card-icon {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 16px;
  background: #eef2fe;
  color: var(--peri-deep);
  margin-bottom: 22px;
}
.card-icon svg { width: 28px; height: 28px; }

/* ---------- 슬로건 밴드 ---------- */
.slogan-band {
  padding: 96px 0;
  background:
    radial-gradient(ellipse 55% 120% at 78% 20%, rgba(255, 255, 255, 0.10), transparent 60%),
    linear-gradient(160deg, #3c4756 0%, #2a3340 48%, #1d242e 100%);
  text-align: center;
}
.slogan-en {
  font-size: clamp(2rem, 5vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.25;
  color: #fff;
}
.slogan-en .soft { color: rgba(255, 255, 255, 0.62); }
.slogan-ko { color: rgba(255, 255, 255, 0.85); margin-top: 16px; font-size: 1.1rem; letter-spacing: 6px; }

/* ---------- 배너 섹션 ---------- */
.banner-card { padding: 22px; }
.banner-card img {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
}
.banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 22px 6px 6px;
}

/* ---------- 규정 섹션 ---------- */
.rules-card { overflow: hidden; }
.rules-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 22px 28px;
  border-bottom: 1px solid var(--border);
  background: #f6f8fc;
}
.rules-tabs { display: flex; gap: 8px; }
.tab-btn {
  padding: 9px 20px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.tab-btn:hover { border-color: rgba(91, 124, 224, 0.45); color: var(--ink); }
.tab-btn.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.rules-actions { display: flex; gap: 10px; }
.rules-body { padding: 38px 38px 28px; }

/* API 활용법 안내 */
.api-guide h3 { font-size: 1.5rem; font-weight: 800; margin: 6px 0 16px; }
.api-guide h4 {
  font-size: 1.08rem;
  font-weight: 800;
  margin: 28px 0 10px;
  padding-left: 12px;
  border-left: 3px solid var(--peri);
}
.api-guide p { margin: 10px 0; color: var(--muted); }
.api-guide ul { margin: 10px 0 10px 22px; }
.api-guide li { margin: 6px 0; color: var(--muted); }
.api-guide pre {
  margin: 14px 0;
  padding: 18px 20px;
  border-radius: 14px;
  background: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow-x: auto;
}
.api-guide pre code {
  background: none;
  border: none;
  padding: 0;
  color: #dbe4f3;
  font-size: 0.88rem;
  line-height: 1.8;
  white-space: pre;
}
.rules-foot {
  padding: 18px 28px;
  border-top: 1px dashed var(--border);
  font-size: 0.92rem;
}

/* ---------- 마크다운 렌더링 ---------- */
.rules-body h1 {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 8px 0 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.rules-body h2 { font-size: 1.5rem; font-weight: 800; margin: 28px 0 14px; }
.rules-body h3 { font-size: 1.22rem; font-weight: 800; margin: 24px 0 12px; color: var(--peri-deep); }
.rules-body h4, .rules-body h5, .rules-body h6 {
  font-size: 1.05rem; font-weight: 700; margin: 18px 0 10px; color: var(--muted);
}
.rules-body p { margin: 12px 0; }
.rules-body a {
  color: var(--peri-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.rules-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 26px 0;
}
.rules-body ul, .rules-body ol { margin: 12px 0 12px 22px; }
.rules-body li { margin: 6px 0; }
.rules-body blockquote {
  margin: 18px 0;
  padding: 14px 22px;
  border-left: 3px solid var(--peri);
  border-radius: 0 12px 12px 0;
  background: #f2f5fd;
  color: #39435a;
}
.rules-body code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: #f1f4f9;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 7px;
}
.rules-body pre {
  margin: 18px 0;
  padding: 20px 22px;
  border-radius: 14px;
  background: #f4f6fa;
  border: 1px solid var(--border);
  overflow-x: auto;
}
.rules-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.92rem;
  line-height: 1.85;
  color: #3a4354;
  white-space: pre;
}
.spoiler {
  background: #e8ecf3;
  border-radius: 6px;
  padding: 2px 6px;
  cursor: pointer;
  filter: blur(5px);
  transition: filter 0.25s ease;
}
.spoiler:hover, .spoiler.revealed { filter: blur(0); }

/* ---------- 연락처 ---------- */
.contact-card {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 30px 32px;
  max-width: 560px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.contact-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 26px 60px rgba(35, 42, 55, 0.16);
}
.contact-card .card-icon { margin-bottom: 0; background: #e2faf8; color: var(--teal-deep); }
.contact-label { font-size: 12px; letter-spacing: 3px; color: var(--muted); font-weight: 700; }
.contact-mail { font-size: 1.35rem; font-weight: 800; }

/* ---------- 푸터 ---------- */
.footer {
  background: var(--ink);
  padding-top: 60px;
  color: #aeb8c6;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
  padding-bottom: 44px;
}
.footer-brand .brand { margin-bottom: 18px; }
.footer-brand .brand-text { color: #fff; }
.footer-brand .muted { font-size: 0.92rem; line-height: 1.9; color: #8b96a7; }

/* 화이트 알약 크레딧 배지 (배너 하단과 동일) */
.credits { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; }
.credit-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border-radius: 16px;
  padding: 13px 20px;
  color: var(--ink);
}
.credit-pill img { object-fit: contain; }
/* 여백 트리밍된 에셋 기준 — The CLOUD가 MiFun보다 약간 크게 */
.credit-pill img.logo-cloud { height: 34px; width: auto; }
.credit-pill img.logo-mifun { height: 32px; width: auto; }
.credit-pill span { display: block; font-size: 11px; color: var(--muted); font-weight: 700; letter-spacing: 0.5px; }
.credit-pill strong { display: block; font-size: 15px; font-weight: 800; line-height: 1.25; }

.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-title { font-size: 12px; letter-spacing: 3px; color: #8b96a7; font-weight: 800; margin-bottom: 6px; }
.footer-links a { color: #aeb8c6; font-size: 0.95rem; transition: color 0.2s; }
.footer-links a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 22px 0;
  text-align: center;
  color: #8b96a7;
  font-size: 0.85rem;
}

/* ---------- 토스트 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: #fff;
  padding: 13px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 100;
  box-shadow: 0 18px 40px rgba(35, 42, 55, 0.35);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 반응형 (태블릿) ---------- */
@media (max-width: 980px) {
  .hero { padding: 118px 0 64px; min-height: auto; }
  .hero-inner { grid-template-columns: 1fr; gap: 34px; }
  .hero-visual { order: 2; min-height: 360px; }
  .hero-device { width: min(270px, 74%); border-radius: 32px; }
  .hero-mini-card { width: 184px; left: 2px; bottom: 4px; padding: 14px 16px; }
  .hero-en { font-size: 1.35rem; letter-spacing: 4px; margin-bottom: 8px; }
  .hero h1 { font-size: clamp(2.05rem, 8.2vw, 2.7rem); margin-bottom: 30px; }
  .kicker { font-size: 20px; gap: 11px; margin-bottom: 22px; }
  .kicker-mark { height: 36px; }
}

/* ---------- 반응형 (모바일) ---------- */
@media (max-width: 900px) {
  /* 내비게이션 — 햄버거 드롭다운 */
  .nav-inner { height: 72px; gap: 12px; }
  .brand-mark-img { height: 32px; }
  .brand-text { font-size: 18px; }
  .nav-toggle { display: inline-flex; margin-left: auto; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 0;
    flex-direction: column;
    gap: 0;
    padding: 8px 4vw 16px;
    background: rgba(238, 241, 245, 0.98);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 24px 40px rgba(35, 42, 55, 0.14);
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    padding: 15px 10px;
    font-size: 16px;
    color: var(--ink);
    border-bottom: 1px solid var(--border);
  }
  .nav-links a:last-child { border-bottom: none; }

  /* 관리자 버튼 — 상단바에서 메뉴 내부로 이동 */
  .nav-admin { display: none; }
  .nav-links .menu-admin {
    display: block;
    margin-top: 12px;
    padding: 15px 18px;
    text-align: center;
    background: var(--ink);
    color: #fff;
    border: none;
    border-radius: 999px;
    font-weight: 700;
  }

  /* 섹션 여백 축소 */
  .cards { grid-template-columns: 1fr; }
  .section { padding: 64px 0; }
  .section-head { margin-bottom: 36px; }
  .slogan-band { padding: 64px 0; }
  .slogan-en { letter-spacing: -0.5px; }
  /* 모바일: Simplify Comm. / via Shared Rules 2줄 렌더링 */
  .slogan-en .grad { display: block; }
  .slogan-ko { letter-spacing: 3px; font-size: 1rem; }

  /* 규정 카드 */
  .rules-head { padding: 16px; gap: 12px; }
  .rules-body { padding: 22px 16px 16px; }
  .rules-body pre code { font-size: 0.82rem; }
  .api-guide pre code { font-size: 0.78rem; }
  .tab-btn { padding: 10px 16px; font-size: 13px; }

  /* 터치 영역 확대 */
  .btn { min-height: 46px; padding: 12px 22px; }
  .btn-sm { min-height: 42px; padding: 10px 18px; }

  /* 연락처·푸터 */
  .contact-card { max-width: 100%; padding: 24px 22px; gap: 18px; }
  .contact-mail { font-size: 1.15rem; }
  .footer-inner { flex-direction: column; gap: 32px; }
  .credits { width: 100%; }
  .credit-pill { flex: 1 1 220px; justify-content: center; }
}
