/* 기본 변수와 문서 설정 */
:root {
  --bg: #080a10;
  --bg-soft: #0d1119;
  --surface: #111722;
  --surface-strong: #151d2a;
  --surface-muted: #0c1119;
  --line: #273140;
  --line-strong: #3a4658;
  --text: #f4f7fb;
  --text-soft: #c3ccd8;
  --text-muted: #8994a4;
  --blue: #72b7ff;
  --blue-strong: #2f8ff0;
  --violet: #a995ff;
  --violet-strong: #8067f2;
  --success: #72d6a0;
  --amber: #ffd27a;
  --danger: #ff8b8b;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.36);
  --radius: 14px;
  --radius-small: 10px;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(128, 103, 242, 0.18), transparent 34rem),
    radial-gradient(circle at 82% 12%, rgba(47, 143, 240, 0.16), transparent 32rem),
    linear-gradient(180deg, #080a10 0%, #090d14 52%, #07090e 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", sans-serif;
  line-height: 1.55;
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background-image: linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), transparent 70%);
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

/* 접근성과 포커스 상태 */
:focus-visible {
  outline: 3px solid rgba(114, 183, 255, 0.95);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 13px;
  border-radius: var(--radius-small);
  background: var(--text);
  color: #07111d;
  font-weight: 900;
  transform: translateY(-140%);
}

.skip-link:focus {
  transform: translateY(0);
}

/* 상단 헤더 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(39, 49, 64, 0.78);
  background: rgba(8, 10, 16, 0.82);
  backdrop-filter: blur(18px);
}

.header-inner {
  width: min(var(--max), calc(100% - 40px));
  min-height: 72px;
  padding: 10px 0;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 900;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(114, 183, 255, 0.34);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(128, 103, 242, 0.92), rgba(47, 143, 240, 0.86));
  color: white;
  font-size: 13px;
  box-shadow: 0 14px 34px rgba(47, 143, 240, 0.22);
}

.brand-text {
  font-size: 18px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-nav a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 800;
}

.site-nav a:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

/* 히어로와 작업 패널 */
main {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

.hero {
  padding: 78px 0 44px;
}

.hero-copy {
  max-width: 860px;
  margin: 0 auto 34px;
  text-align: center;
}

.eyebrow,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--violet);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.eyebrow::before,
.section-kicker::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  content: "";
  box-shadow: 0 0 22px rgba(114, 183, 255, 0.9);
}

h1 {
  margin-bottom: 18px;
  color: white;
  font-size: clamp(40px, 7.2vw, 74px);
  line-height: 1.08;
  font-weight: 950;
}

.hero-lead {
  max-width: 760px;
  margin: 0 auto;
  color: var(--text-soft);
  font-size: clamp(16px, 1.8vw, 20px);
  word-break: keep-all;
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 22px auto 0;
  padding: 0;
  list-style: none;
}

.hero-facts li {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid rgba(114, 183, 255, 0.24);
  border-radius: 999px;
  background: rgba(114, 183, 255, 0.08);
  color: #d8ebff;
  font-size: 13px;
  font-weight: 900;
}

.workspace-panel {
  border: 1px solid rgba(82, 96, 118, 0.72);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(17, 23, 34, 0.97), rgba(8, 12, 18, 0.99));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(420px, 1.14fr);
  min-height: 560px;
}

.input-panel,
.keyword-panel,
.query-panel {
  min-width: 0;
  padding: 30px;
}

.input-panel {
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.018);
}

.query-panel {
  border-top: 1px solid var(--line);
  background: rgba(8, 12, 18, 0.46);
}

.panel-heading h2,
.result-head h2,
.section-heading h2 {
  margin-bottom: 8px;
  color: white;
  font-size: clamp(23px, 2.5vw, 32px);
  line-height: 1.18;
}

.panel-heading p,
.section-heading p,
.hint {
  color: var(--text-muted);
  margin-bottom: 0;
  word-break: keep-all;
}

/* 입력과 버튼 */
.analysis-form,
.feedback-form,
.add-keyword-form {
  display: grid;
  gap: 14px;
}

.analysis-form {
  margin-top: 24px;
}

.field,
.field-wide {
  min-width: 0;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 900;
}

.field-label span {
  color: var(--text-muted);
  font-weight: 800;
}

.text-control {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  background: #090d14;
  color: var(--text);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

textarea.text-control {
  min-height: 164px;
  padding: 15px;
  resize: vertical;
}

input.text-control,
select.text-control {
  min-height: 46px;
  padding: 0 13px;
}

.text-control::placeholder {
  color: #687385;
}

.text-control:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(114, 183, 255, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.input-help {
  margin: -4px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.form-actions,
.query-actions,
.platform-group,
.keyword-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.primary-button,
.secondary-button,
.text-button,
.copy-button,
.platform-link,
.example-list button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-small);
  border: 1px solid var(--line);
  text-align: center;
  font-weight: 900;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.primary-button {
  padding: 0 18px;
  border-color: rgba(114, 183, 255, 0.58);
  background: linear-gradient(135deg, var(--violet-strong), var(--blue-strong));
  color: white;
  box-shadow: 0 18px 34px rgba(47, 143, 240, 0.2);
}

.secondary-button,
.copy-button,
.platform-link,
.example-list button {
  padding: 0 13px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
}

.text-button {
  padding: 0 8px;
  border-color: transparent;
  background: transparent;
  color: var(--text-muted);
}

.primary-button:hover,
.secondary-button:hover,
.text-button:hover,
.copy-button:hover,
.platform-link:hover,
.example-list button:hover {
  transform: translateY(-1px);
  border-color: rgba(114, 183, 255, 0.58);
  color: white;
}

button:disabled,
.platform-link[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.46;
  transform: none;
}

/* 좋은 입력 예시 */
.example-details {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.026);
}

.example-details summary {
  padding: 14px 16px;
  color: var(--text-soft);
  font-weight: 900;
  cursor: pointer;
}

.guide-card {
  padding: 0 16px 16px;
}

.guide-copy,
.formula {
  margin-bottom: 12px;
  color: var(--text-muted);
  font-size: 14px;
}

.formula {
  padding: 10px 12px;
  border: 1px solid rgba(114, 183, 255, 0.22);
  border-radius: var(--radius-small);
  background: rgba(114, 183, 255, 0.08);
  color: #d8ebff;
  font-weight: 800;
}

.example-list {
  display: grid;
  gap: 9px;
}

.example-list button {
  justify-content: flex-start;
  min-height: 0;
  padding: 12px;
  text-align: left;
  line-height: 1.45;
}

/* 키워드 분석 영역 */
.result-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.compact-status {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 800;
}

.empty-state {
  display: grid;
  gap: 7px;
  min-height: 128px;
  align-content: center;
  padding: 18px;
  border: 1px dashed rgba(137, 148, 164, 0.42);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-muted);
}

.empty-state.compact {
  min-height: 88px;
}

.empty-state strong {
  color: var(--text-soft);
}

.chip-zone {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.keyword-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 40px;
  border: 1px solid rgba(114, 183, 255, 0.28);
  border-radius: 999px;
  background: rgba(114, 183, 255, 0.08);
  color: var(--text);
  overflow: hidden;
}

.keyword-chip span {
  padding: 8px 4px 8px 12px;
  font-size: 13px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.keyword-chip small {
  color: var(--text-muted);
  font-weight: 800;
}

.keyword-chip.is-inferred {
  border-color: rgba(255, 210, 122, 0.34);
  background: rgba(255, 210, 122, 0.09);
}

.keyword-chip.is-inferred small {
  color: #ffe4a8;
}

.remove-chip {
  min-width: 36px;
  height: 38px;
  border: 0;
  border-left: 1px solid rgba(114, 183, 255, 0.22);
  background: transparent;
  color: var(--text-soft);
  font-size: 17px;
}

.remove-chip:hover {
  background: rgba(255, 139, 139, 0.12);
  color: white;
}

.unknown-zone {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(255, 139, 139, 0.32);
  border-radius: var(--radius-small);
  background: rgba(255, 139, 139, 0.07);
}

.unknown-zone h3 {
  margin-bottom: 6px;
  color: #ffd0d0;
  font-size: 15px;
}

.unknown-zone p {
  margin-bottom: 6px;
  color: var(--text-soft);
  font-size: 14px;
}

.analysis-advice {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(255, 210, 122, 0.3);
  border-radius: var(--radius-small);
  background: rgba(255, 210, 122, 0.07);
}

.analysis-advice h3 {
  margin-bottom: 8px;
  color: #ffe4a8;
  font-size: 15px;
}

.analysis-advice ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: var(--text-soft);
  font-size: 14px;
}

.add-keyword-form {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: end;
  margin-top: 16px;
}

.keyword-actions {
  margin-top: 14px;
}

/* 검색어 결과 영역 */
.query-actions {
  justify-content: flex-end;
}

.query-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.query-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: rgba(10, 15, 23, 0.9);
  transform: translateY(5px);
  opacity: 0;
  animation: resultIn 0.2s ease forwards;
}

.query-item.is-selected {
  border-color: rgba(114, 183, 255, 0.72);
  background: linear-gradient(135deg, rgba(128, 103, 242, 0.16), rgba(47, 143, 240, 0.12));
}

.query-label {
  display: block;
  margin-bottom: 3px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.query-select {
  width: 100%;
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.query-source {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.platform-group {
  margin-top: 16px;
}

.platform-link {
  flex: 1 1 130px;
  font-size: 14px;
}

.platform-link:not([aria-disabled="true"]) {
  border-color: rgba(114, 183, 255, 0.42);
  color: white;
}


.site-nav a[aria-current="page"] {
  border-color: rgba(114, 183, 255, 0.5);
  color: white;
}

.tool-disclosure,
.privacy-note {
  margin: 14px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 800;
  word-break: keep-all;
}

.privacy-note {
  margin-bottom: 0;
}

.privacy-note a,
.footer-links a,
.policy-section a {
  color: #d8ebff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* 정보 콘텐츠 섹션 */
.content-section {
  padding: 70px 0 8px;
}

.step-list,
.content-grid,
.writing-examples,
.glossary-grid {
  display: grid;
  gap: 14px;
}

.step-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.step-list li {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(17, 23, 34, 0.66);
  counter-increment: step;
}

.step-list li::before {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  border-radius: 10px;
  background: rgba(255, 210, 122, 0.14);
  color: var(--amber);
  content: counter(step);
  font-weight: 950;
}

.step-list strong,
.content-card h3,
.writing-examples h3,
.glossary-grid h3,
.faq-list summary,
.policy-section h2 {
  color: white;
}

.step-list span,
.content-card p,
.writing-examples p,
.glossary-grid p,
.faq-list p,
.policy-lead,
.policy-section p,
.policy-meta {
  color: var(--text-soft);
  word-break: keep-all;
}

.formula-card,
.content-card,
.writing-examples article,
.glossary-grid article,
.faq-list details,
.policy-article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(17, 23, 34, 0.66);
}

.formula-card {
  margin-bottom: 14px;
  padding: 18px;
}

.formula-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--amber);
}

.formula-card p {
  margin-bottom: 0;
  color: #fff0c7;
  font-weight: 900;
}

.writing-examples,
.content-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.glossary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.content-card,
.writing-examples article,
.glossary-grid article {
  padding: 18px;
}

.content-card h3,
.writing-examples h3,
.glossary-grid h3 {
  margin-bottom: 8px;
  font-size: 18px;
}

.content-card p:last-child,
.writing-examples p:last-child,
.glossary-grid p:last-child {
  margin-bottom: 0;
}

.faq-list {
  display: grid;
  gap: 10px;
}

.faq-list details {
  padding: 0 16px;
}

.faq-list summary {
  min-height: 54px;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 900;
}

.faq-list p {
  margin-bottom: 16px;
}
/* 피드백 폼 */
.feedback-section {
  padding: 76px 0;
}

.section-heading {
  max-width: 720px;
  margin-bottom: 24px;
}

.feedback-form {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(17, 23, 34, 0.72);
}

.feedback-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field-wide {
  grid-column: 1 / -1;
}

.status-message {
  min-height: 42px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}


/* 개인정보처리방침 페이지 */
.policy-main {
  padding: 62px 0;
}

.policy-article {
  max-width: 920px;
  margin: 0 auto;
  padding: 34px;
}

.policy-article h1 {
  margin-bottom: 16px;
  font-size: clamp(36px, 6vw, 58px);
}

.policy-lead {
  max-width: 760px;
  font-size: 17px;
}

.policy-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 28px 0;
}

.policy-meta div {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(114, 183, 255, 0.2);
  border-radius: var(--radius-small);
  background: rgba(114, 183, 255, 0.06);
}

.policy-meta dt {
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 900;
}

.policy-meta dd {
  margin: 0;
  color: var(--text);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.policy-section {
  padding: 20px 0;
  border-top: 1px solid var(--line);
}

.policy-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}
.status-message[data-state="error"] {
  border-color: rgba(255, 139, 139, 0.54);
  background: rgba(255, 139, 139, 0.1);
  color: #ffd0d0;
}

.status-message[data-state="success"],
.status-message[data-state="loading"] {
  border-color: rgba(114, 183, 255, 0.38);
  background: rgba(114, 183, 255, 0.08);
  color: #d5ebff;
}

/* 푸터와 알림 */
.site-footer {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 42px;
  border-top: 1px solid var(--line);
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.site-footer strong {
  color: var(--text);
}

.site-footer p {
  max-width: 520px;
  margin-bottom: 0;
  font-size: 13px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 50;
  max-width: min(560px, calc(100% - 32px));
  padding: 12px 15px;
  border: 1px solid rgba(114, 183, 255, 0.3);
  border-radius: 999px;
  background: #111722;
  color: white;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
  font-size: 14px;
  font-weight: 900;
  text-align: center;
  transform: translateX(-50%) translateY(14px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.toast.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* 애니메이션 */
@keyframes resultIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 반응형 레이아웃 */
@media (max-width: 1024px) {
  .panel-grid {
    grid-template-columns: 1fr;
  }

  .input-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .add-keyword-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  main,
  .header-inner,
  .site-footer {
    width: calc(100% - 32px);
  }

  .hero {
    padding-top: 54px;
  }

  .input-panel,
  .keyword-panel,
  .query-panel,
  .feedback-form {
    padding: 22px;
  }

  .result-head,
  .site-footer {
    flex-direction: column;
  }

  .feedback-grid {
    grid-template-columns: 1fr;
  }

  .field-wide {
    grid-column: auto;
  }
}

@media (max-width: 480px) {
  .header-inner {
    min-height: 66px;
  }

  .brand-text {
    font-size: 16px;
  }

  .site-nav a {
    padding: 0 8px;
    font-size: 13px;
  }

  h1 {
    font-size: 36px;
  }

  .hero-lead {
    font-size: 16px;
  }

  .input-panel,
  .keyword-panel,
  .query-panel,
  .feedback-form {
    padding: 18px;
  }

  .primary-button,
  .secondary-button,
  .text-button,
  .copy-button,
  .platform-link {
    width: 100%;
  }

  .query-item {
    grid-template-columns: 1fr;
  }
}

/* 콘텐츠/정책 반응형 보완 */
@media (max-width: 1024px) {
  .step-list,
  .glossary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .writing-examples,
  .content-grid,
  .policy-meta {
    grid-template-columns: 1fr;
  }

  .policy-article {
    padding: 24px;
  }
}

@media (max-width: 640px) {
  .step-list,
  .glossary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .header-inner {
    align-items: flex-start;
  }

  .content-card,
  .policy-article {
    padding: 18px;
  }
}
