/* Bias Match — Co-Star풍 편집 디자인. 크림/잉크, 세리프 제목, 모노 숫자, 강조색 하나(그룹 팬덤 색). */

:root {
  --bg: #F5F2EC;
  --ink: #111111;
  --muted: rgba(17, 17, 17, .6);
  --accent: #7C4DFF;
  --line: rgba(17, 17, 17, .12);
  --gutter: 16px;
  --max: 640px;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, "JetBrains Mono", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111111;
    --ink: #F5F2EC;
    --muted: rgba(245, 242, 236, .6);
    --line: rgba(245, 242, 236, .14);
  }
}

:root[data-theme="dark"] {
  --bg: #111111;
  --ink: #F5F2EC;
  --muted: rgba(245, 242, 236, .6);
  --line: rgba(245, 242, 236, .14);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* 상단 띠 — 공유 카드의 팬덤 색 띠와 같은 장치. */
.bar {
  height: 6px;
  background: var(--accent);
  transition: background .3s ease;
}

a { color: inherit; }

.site-head { padding: 0 0 8px; }

/* 히어로 — 사진 위 어두운 그라데이션, 그 위에 크림 잉크. 사진 출처는 /about. */
/* 사진은 히어로 전체를 덮고, 글은 그 위에 얹힌다(아래로 쌓이지 않는다).
   260px는 사진의 최소 높이다. 글이 길어지면 히어로가 같이 자라고 사진도 따라 늘어난다. */
.hero {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  background: #111111;
}

.hero-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, .25) 0%, rgba(0, 0, 0, .8) 100%);
}

.hero-text {
  position: relative;
  z-index: 1;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-top: 26px;
  padding-bottom: 22px;
  color: #F5F2EC;
}

.hero-text .tagline { color: rgba(245, 242, 236, .78); }

/* 폼이 첫 화면에 남아 있어야 한다. 히어로 안에서는 본문보다 한 단계 작게 쓴다. */
.hero-intro {
  margin: 14px 0 0;
  max-width: 52ch;
  font-size: 15px;
  line-height: 1.45;
  color: rgba(245, 242, 236, .88);
}

.hero-micro {
  margin: 12px 0 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .06em;
  color: rgba(245, 242, 236, .68);
}

.hero-more { margin: 10px 0 0; }

.hero-more a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  font-size: 14px;
  color: #F5F2EC;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (min-width: 560px) {
  .hero, .hero-text { min-height: 360px; }
}

/* 섹션 사이를 끊는 사진 한 장. 캡션 없음. */
.break-photo {
  display: block;
  width: 100%;
  height: 200px;
  object-fit: cover;
  margin: 56px 0 0;
}

.site-head h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 40px;
  line-height: 1.05;
  letter-spacing: -.01em;
  margin: 0;
}

.tagline {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
}

/* 모노 라벨 — 카드 상단의 "BIASMATCH · BTS"와 같은 톤. */
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
}

.step { padding: 24px 0 40px; }
.step[hidden] { display: none; }

.step h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 28px;
  line-height: 1.15;
  margin: 0 0 20px;
}

/* ── 폼 ── */

.field { margin: 0 0 20px; }

.field > label,
.legend {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 8px;
}

select {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 16px;
  border: 1px solid var(--line);
  border-radius: 2px;
  appearance: none;
}

select {
  /* 기본 화살표가 지워지므로 직접 그린다. currentColor가 아니라 고정 삼각형. */
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 20px) 21px, calc(100% - 14px) 21px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 40px;
}

input:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

input:disabled,
select:disabled { color: var(--muted); border-style: dashed; }

/* 생년월일·시각은 한 줄에 놓인 선택 상자다. 390px에서도 세 칸이 들어간다. */
.picker {
  display: grid;
  gap: 8px;
}

.picker.date { grid-template-columns: 1.2fr 1fr 0.8fr; }
.picker.time { grid-template-columns: 1fr 1fr; }

.pick { display: block; min-width: 0; }

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-top: 10px;
  font-size: 15px;
  cursor: pointer;
}

.check input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
  margin: 0;
  flex: none;
}

.error {
  margin: 12px 0 0;
  min-height: 1.4em;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
}

.error:not(:empty) {
  border-left: 3px solid var(--accent);
  padding-left: 10px;
}

/* ── 랜딩 설명 (1단계, 폼 아래) ── */

.landing { margin-top: 0; }

/* 섹션마다 헤어라인 하나, 위아래 56px. 읽는 폭은 62ch에서 멈춘다. */
.sec {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.landing h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 24px;
  line-height: 1.2;
  margin: 0 0 12px;
}

.measure { max-width: 62ch; }

.landing p { max-width: 62ch; }

.note {
  margin: 16px 0 0;
  font-size: 15px;
  color: var(--muted);
}

.how {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.how li {
  display: grid;
  grid-template-columns: 24px 18px 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
  line-height: 1.5;
}

.how .n {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--accent);
}

/* 24px 라인 아이콘. 채움 없이 선만, 뮤트 잉크. */
.icon {
  display: block;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.how .icon circle { fill: var(--muted); stroke: none; }

.gets {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.gets li {
  position: relative;
  padding: 13px 0 13px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
  line-height: 1.5;
}

.gets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 20px;
  width: 6px;
  height: 6px;
  background: var(--accent);
}

/* 예시 카드. 사진이 아니라 타이포 카드라서 작게 넣어도 읽힌다. */
.card-sample {
  margin: 28px 0 0;
}

.card-sample img {
  display: block;
  width: 100%;
  max-width: 280px;
  height: auto;
  margin: 0 auto;
  border: 1px solid var(--line);
}

.card-sample figcaption {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-align: center;
  color: var(--muted);
}

.faq { border-top: 1px solid var(--line); }

.faq details { border-bottom: 1px solid var(--line); }

.faq summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 0;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  margin-left: auto;
  font-family: var(--mono);
  color: var(--muted);
}

.faq details[open] summary::after { content: "\2013"; }

.faq p {
  margin: 0 0 14px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
}

/* 랜딩의 고정 예시 도표. 결과 화면의 도표와 같은 좌표계를 쓴다. */
.sample-chart { margin: 20px 0 0; }

/* 640px 열을 가득 채우면 칸이 우스울 만큼 커진다. 읽을 만한 크기에서 멈춘다. */
.sample-chart .pillars { max-width: 420px; }

/* ── 버튼 ── */

button {
  font-family: var(--sans);
  font-size: 16px;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 20px;
  width: 100%;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
}

.btn.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.btn:hover { opacity: .85; }

.btn-row {
  display: grid;
  gap: 10px;
  margin-top: 28px;
}

@media (min-width: 560px) {
  .btn-row.two { grid-template-columns: 1fr 1fr; }
}

/* ── 그룹 그리드 ── */

.groups {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 560px) {
  .groups { grid-template-columns: repeat(3, 1fr); }
}

.group-btn {
  width: 100%;
  min-height: 92px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 2px;
  text-align: left;
}

.group-btn:hover { border-color: var(--ink); }
.group-btn:disabled { opacity: .45; cursor: default; }
.groups[aria-busy="true"] .group-btn:hover { border-color: var(--line); }

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: none;
}

.group-name {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.1;
}

.group-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: auto;
}

/* 스켈레톤 */
.skeleton .group-btn {
  border-style: dashed;
  background: var(--line);
  opacity: .5;
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse { 50% { opacity: .25; } }

/* ── 결과 ── */

/* 헤더 스트립: 390px에서는 링 위·이름 아래, 넓어지면 나란히. */
.result-head {
  display: grid;
  gap: 16px;
  justify-items: start;
  margin: 8px 0 0;
}

@media (min-width: 520px) {
  .result-head {
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 24px;
  }
}

.ring-slot { flex: none; }

.ring-slot .ring {
  display: block;
  width: 126px;
  height: 126px;
}

.ring-track { stroke: var(--line); }
.ring-fill { stroke: var(--accent); }

.ring-score {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 38px;
  font-variant-numeric: tabular-nums;
  /* 글자라서 대비가 필요하다. 서버가 테마별로 안전한 색을 --score-color로 준다(app.js). */
  fill: var(--score-color, var(--accent));
}

.ring-of {
  font-family: var(--mono);
  font-size: 12px;
  fill: var(--muted);
}

.member-name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(38px, 11vw, 52px);
  line-height: 1.02;
  letter-spacing: -.02em;
  margin: 0;
  word-break: break-word;
}

.member-ko {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  margin: 6px 0 0;
}

/* ── 사주 기둥 도표 ── */

#charts-label { margin-top: 36px; }
#charts-label[hidden], #elements-label[hidden] { display: none; }

.charts {
  display: grid;
  gap: 24px;
}

@media (min-width: 560px) {
  .charts { grid-template-columns: 1fr 1fr; }
}

.chart-panel { margin: 0; }

.chart-title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}

.pillars {
  display: block;
  width: 100%;
  height: auto;
}

.pillar-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .08em;
  fill: var(--muted);
}

.pillar-label.day { fill: var(--ink); }

.cell-glyph {
  font-family: var(--serif);
  font-size: 28px;
  fill: var(--ink);
}

.cell-glyph.unknown {
  font-family: var(--mono);
  font-size: 22px;
  fill: var(--muted);
}

/* 칸 오른쪽 위의 오행 한자. 색을 못 읽어도 어느 원소인지 글자로 남는다. */
.cell-el {
  font-family: var(--serif);
  font-size: 11px;
  fill: var(--muted);
}

.cell-roman {
  font-family: var(--mono);
  font-size: 11px;
  fill: var(--muted);
}

/* "Day master"와 "unknown"이 한 줄에 나란히 선다. 8.5px라야 272 안에서 서로 닿지 않는다. */
.pillar-note {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: .08em;
  fill: var(--muted);
}

.chart-signs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 12px 0 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.chart-signs .sep { opacity: .5; }

.chart-signs .sign-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* 원소 색 점. 점 옆에는 원소 이름이 늘 글자로 붙는다. */
.el-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}

/* ── 오행 균형 ── */

#elements-label { margin-top: 36px; }

.chart-elements { margin: 0; }

.elements {
  display: block;
  width: 100%;
  height: auto;
}

.el-head {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  fill: var(--muted);
}

.el-value {
  font-family: var(--mono);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  fill: var(--muted);
}

.el-hanja {
  font-family: var(--serif);
  font-size: 15px;
  fill: var(--ink);
}

.el-name {
  font-family: var(--mono);
  font-size: 8.5px;
  fill: var(--muted);
}

.badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  margin: 4px 0 0;
}

.hook {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 26px;
  line-height: 1.22;
  margin: 20px 0 0;
}

.hook p { margin: 0; }

.evidence {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}

.evidence li {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 10px;
  margin: 0 0 6px;
}

/* 상태 마커. 글리프 자체가 방향을 말하므로 색은 거들 뿐이다. */
.mark { line-height: 1.7; }
.mark.up { color: var(--accent); }
.mark.flat { color: var(--muted); }
.mark.down { color: var(--ink); }

.same-dm {
  margin: 18px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

/* 순위 */

#rank-label { margin-top: 32px; }

.rank {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.rank li {
  border-bottom: 1px solid var(--line);
  padding: 12px 0 10px;
}

.rank .row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.rank .nm { font-size: 16px; }
.rank .top .nm { font-weight: 600; }

.rank .sc {
  font-family: var(--mono);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.rank .bar {
  height: 6px;
  margin-top: 8px;
  background: var(--accent);
  opacity: .35;
  border-radius: 3px;
}

.rank .top .bar { opacity: 1; }

.fade {
  opacity: 0;
  animation: fade-in .4s ease forwards;
}

@keyframes fade-in { to { opacity: 1; } }

/* ── 정책 본문 ── */

.prose { padding-top: 16px; }

.mono { font-family: var(--mono); font-size: .9em; }

.prose h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 24px;
  margin: 32px 0 8px;
}

.prose h3 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 16px;
  margin: 24px 0 6px;
}

.prose p, .prose li { font-size: 15px; line-height: 1.65; }
.prose ul { padding-left: 20px; }

/* ── 푸터 ── */

.site-foot {
  border-top: 1px solid var(--line);
  margin-top: 40px;
  padding: 20px 0 40px;
  color: var(--muted);
  font-size: 13px;
}

.site-foot p { margin: 0 0 6px; }
.site-foot a { min-height: 44px; display: inline-flex; align-items: center; }

/* ── 유료 리포트: 판매 페이지 ── */

.lede {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.3;
  margin: 0 0 28px;
}

.toc {
  margin: 0 0 28px;
  padding-left: 20px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 2;
  color: var(--muted);
}

.toc li::marker { color: var(--accent); }

.sample {
  margin: 0 0 28px;
  padding: 0 0 0 16px;
  border-left: 2px solid var(--accent);
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.35;
}

.sample p { margin: 0 0 12px; }
.sample p:last-child { margin-bottom: 0; }

.price {
  font-family: var(--mono);
  font-size: 22px;
  letter-spacing: .02em;
  margin: 0 0 16px;
}

.pay { min-height: 52px; }
.pay[hidden] { display: none; }

.fineprint {
  margin: 28px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

/* ── 유료 리포트: 본문 ── */

.status {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 8px;
}

.status[hidden] { display: none; }

.sr-h {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.report:empty { display: none; }

.report h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.15;
  margin: 40px 0 12px;
}

.report h2:first-child { margin-top: 0; }

.report p {
  font-size: 17px;
  line-height: 1.7;
  margin: 0 0 16px;
}

.report ul {
  margin: 0 0 16px;
  padding-left: 20px;
}

.report li {
  font-size: 17px;
  line-height: 1.7;
  margin: 0 0 8px;
}

/* 인쇄·PDF 저장. 리포트는 읽고 나서 저장해 두는 물건이다. */
@media print {
  .bar, .site-head .tagline, .eyebrow, .status, .error, .fineprint, .site-foot a { display: none; }
  .hero, .break-photo { display: none; }
  body { background: #fff; color: #000; }
  .wrap { max-width: none; padding: 0; }
  .report h2 { break-after: avoid; page-break-after: avoid; }
  .report p, .report li { break-inside: avoid; page-break-inside: avoid; }
  .site-foot { border-color: #999; }
}

/* ── 모션 ── */

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