/* =========================================================
   중계중 전교 부회장 기호 6 정재윤 — campaign landing page
   모바일 우선. 배경 #04173d.
   ========================================================= */

:root {
  --bg: #04173d;
  --bg-soft: #082253;
  --surface: rgba(255, 255, 255, 0.055);
  --surface-strong: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.13);
  --text: #f4f7fd;
  --muted: #a7b6d6;
  --accent: #79b0ff;
  --accent-strong: #3f86ff;
  --ok: #5ee39b;
  --ok-bg: rgba(46, 204, 113, 0.15);
  --no: #ff9a9a;
  --no-bg: rgba(229, 72, 77, 0.17);
  --pending: #ecd9a0;
  --pending-bg: rgba(201, 178, 122, 0.15);
  --radius: 16px;
  --maxw: 720px;
  --font: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
p,
figure {
  margin: 0;
}

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

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

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

/* ── 히어로 ─────────────────────────────────────────────── */

.hero {
  position: relative;
  /* 스크롤 여유 공간: 스테이지(100svh) + 페이드 구간 */
  height: 190vh;
  height: 190svh;
}

.hero__stage {
  position: sticky;
  top: 0;
  display: grid;
  place-items: center;
  height: 100vh;
  height: 100svh;
  padding: 32px 24px;
  overflow: hidden;
}

.hero__content {
  width: 100%;
  max-width: 560px;
  text-align: center;
  transform-origin: 50% 55%;
  will-change: transform, opacity;
}

.hero__eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--accent);
  text-transform: uppercase;
}

.hero__photo {
  position: relative;
  width: min(46vw, 208px);
  aspect-ratio: 1 / 1;
  margin: 26px auto 24px;
  border-radius: 26px;
  overflow: hidden;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  box-shadow: 0 22px 50px -24px rgba(0, 0, 0, 0.75);
}

.hero__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__photo-fallback {
  display: none;
  position: absolute;
  inset: 0;
  place-items: center;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: linear-gradient(150deg, #0c2a60, #061a44);
}

.hero__photo.is-missing img {
  display: none;
}

.hero__photo.is-missing .hero__photo-fallback {
  display: grid;
}

.hero__title {
  font-size: clamp(1.65rem, 7.4vw, 2.75rem);
  line-height: 1.32;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hero__num {
  color: var(--accent);
  white-space: nowrap;
}

.hero__tagline {
  margin-top: 16px;
  font-size: clamp(0.95rem, 3.6vw, 1.05rem);
  color: var(--muted);
}

.hero__hint {
  position: absolute;
  bottom: 26px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  animation: hint-bob 2.2s ease-in-out infinite;
}

.hero__hint span {
  display: inline-block;
  margin-left: 2px;
}

@keyframes hint-bob {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.65;
  }
  50% {
    transform: translateY(5px);
    opacity: 1;
  }
}

/* ── 공통 섹션 ──────────────────────────────────────────── */

.section {
  padding: 64px 20px 40px;
}

.section__inner {
  max-width: var(--maxw);
  margin: 0 auto;
}

.section__title {
  font-size: clamp(1.3rem, 5.4vw, 1.6rem);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.section__desc {
  margin-top: 8px;
  font-size: 0.92rem;
  color: var(--muted);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

/* ── 슬라이드 섹션 ──────────────────────────────────────── */

.slides {
  position: relative;
  height: calc(100vh + (var(--slide-count, 3) - 1) * 62vh);
  height: calc(100svh + (var(--slide-count, 3) - 1) * 62svh);
}

.slides__viewport {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100vh;
  height: 100svh;
  padding: 56px 0 40px;
  overflow: hidden;
}

.slides__head {
  padding: 0 20px 18px;
  text-align: center;
}

.slides__window {
  overflow: hidden;
}

.slides__track {
  display: flex;
  gap: 16px;
  padding: 0 20px;
  will-change: transform;
}

.slide {
  flex: 0 0 var(--slide-w, 78vw);
  min-width: 0;
}

.slide__frame {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #0a1f4a;
  overflow: hidden;
}

.slide__frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.slide__placeholder {
  display: none;
  padding: 16px;
  text-align: center;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--muted);
}

.slide__placeholder code {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--accent);
}

.slide.is-missing .slide__frame img {
  display: none;
}

.slide.is-missing .slide__frame {
  border-style: dashed;
}

.slide.is-missing .slide__placeholder {
  display: block;
}

.slides__foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 20px 20px 0;
}

.slides__dots {
  display: flex;
  gap: 7px;
}

.slides__dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.26);
  cursor: pointer;
  transition: width 0.25s ease, background 0.25s ease;
}

.slides__dot[aria-selected="true"] {
  width: 22px;
  background: var(--accent);
}

.slides__counter {
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

/* ── 폼 ─────────────────────────────────────────────────── */

.form {
  margin-top: 22px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px;
}

.field:last-child {
  margin-bottom: 0;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.field-row .field {
  margin-bottom: 0;
}

.field label {
  font-size: 0.88rem;
  font-weight: 600;
}

.req,
.opt {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  vertical-align: 1px;
}

.req {
  color: var(--accent);
  background: rgba(121, 176, 255, 0.14);
}

.opt {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.07);
}

input[type="text"],
textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px; /* iOS 확대 방지 */
  color: var(--text);
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.2s ease;
}

input[type="text"]::placeholder,
textarea::placeholder {
  color: rgba(167, 182, 214, 0.62);
}

input[type="text"]:focus,
textarea:focus {
  border-color: var(--accent);
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 112px;
  line-height: 1.6;
}

.counter {
  align-self: flex-end;
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.notice {
  margin: 4px 0 16px;
  font-size: 0.76rem;
  line-height: 1.5;
  color: rgba(167, 182, 214, 0.82);
}

.submit {
  width: 100%;
  padding: 14px 18px;
  font-size: 1rem;
  font-weight: 700;
  color: #04173d;
  background: var(--accent);
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.12s ease;
}

.submit:hover {
  background: #94c2ff;
}

.submit:active {
  transform: scale(0.99);
}

.submit[disabled] {
  opacity: 0.55;
  cursor: progress;
}

.form-status {
  min-height: 1.3em;
  margin-top: 12px;
  font-size: 0.85rem;
  text-align: center;
  color: var(--muted);
}

.form-status.is-ok {
  color: var(--ok);
}

.form-status.is-error {
  color: var(--no);
}

/* ── 공약 목록 ──────────────────────────────────────────── */

.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 26px;
}

.pledge {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.pledge__text {
  white-space: pre-wrap;
  font-size: 0.95rem;
}

.pledge__meta {
  margin-top: 6px;
  font-size: 0.76rem;
  color: var(--muted);
}

.badge {
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  border-radius: 999px;
}

.badge--possible {
  color: var(--ok);
  background: var(--ok-bg);
}

.badge--impossible {
  color: var(--no);
  background: var(--no-bg);
}

.badge--pending {
  color: var(--pending);
  background: var(--pending-bg);
}

/* ── 질문 아코디언 ──────────────────────────────────────── */

.qa {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 26px;
}

.qa__item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.qa__item.is-open {
  background: var(--surface-strong);
  border-color: rgba(121, 176, 255, 0.35);
}

.qa__q {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
  padding: 16px;
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
}

.qa__q-text {
  display: block;
  font-size: 0.95rem;
  white-space: pre-wrap;
}

.qa__q-main {
  display: block;
  min-width: 0;
}

.qa__q-meta {
  display: block;
  margin-top: 6px;
  font-size: 0.76rem;
  color: var(--muted);
}

.qa__icon {
  flex: 0 0 auto;
  margin-top: 2px;
  font-size: 1.15rem;
  line-height: 1;
  color: var(--accent);
  transition: transform 0.28s ease;
}

.qa__q[aria-expanded="true"] .qa__icon {
  transform: rotate(45deg);
}

.qa__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease;
}

.qa__item.is-open .qa__panel {
  grid-template-rows: 1fr;
}

.qa__panel-inner {
  overflow: hidden;
}

.qa__answer {
  padding: 0 16px 18px;
  font-size: 0.9rem;
  line-height: 1.7;
  color: #dfe7f7;
  white-space: pre-wrap;
  border-top: 1px solid transparent;
}

.qa__item.is-open .qa__answer {
  border-top-color: rgba(255, 255, 255, 0.08);
  padding-top: 14px;
  margin-top: 2px;
}

.qa__answer.is-empty {
  color: var(--muted);
  font-style: normal;
}

/* ── 빈 상태 / 푸터 ─────────────────────────────────────── */

.empty {
  margin-top: 22px;
  padding: 26px 16px;
  font-size: 0.88rem;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 14px;
}

.footer {
  padding: 72px 20px 40px;
  text-align: center;
}

.footer__main {
  font-size: 0.88rem;
  font-weight: 600;
}

.footer__sub {
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--muted);
}

/* ── 큰 화면 ───────────────────────────────────────────── */

@media (min-width: 720px) {
  .section {
    padding: 88px 32px 48px;
  }

  .slides {
    height: calc(100vh + (var(--slide-count, 3) - 1) * 58vh);
    height: calc(100svh + (var(--slide-count, 3) - 1) * 58svh);
  }

  .slide {
    flex-basis: min(72vw, 640px);
  }

  .hero__photo {
    width: 220px;
  }
}

/* ── 움직임 줄이기 ─────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .hero {
    height: auto;
  }

  .hero__stage {
    position: static;
    height: auto;
    min-height: 0;
    padding: 88px 24px 64px;
  }

  .hero__content {
    opacity: 1 !important;
    transform: none !important;
  }

  .hero__hint {
    position: static;
    margin-top: 40px;
    animation: none;
  }

  .slides {
    height: auto;
  }

  .slides__viewport {
    position: static;
    height: auto;
    min-height: 0;
    padding: 72px 0 40px;
  }

  .slides__track {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 8px;
    will-change: auto;
  }

  .slide {
    scroll-snap-align: center;
  }

  .qa__panel {
    transition: none;
  }

  .hero__hint,
  .qa__icon,
  .submit,
  .slides__dot {
    transition: none;
  }
}
