:root {
  color-scheme: light;
  --ink: #17201b;
  --muted: #657068;
  --paper: #f4f3ed;
  --card: #fffef9;
  --line: #d9ddd6;
  --green: #175c3c;
  --green-soft: #e4efe8;
  --lime: #dff06a;
  --warning: #7a4d08;
  --warning-bg: #fff6de;
  --shadow: 0 22px 60px rgba(38, 50, 42, 0.09);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(223, 240, 106, 0.28), transparent 26rem),
    var(--paper);
  font-family: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", system-ui, sans-serif;
  line-height: 1.6;
}

button, textarea { font: inherit; }
button { cursor: pointer; }

.site-header {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  color: var(--ink);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--green);
}

.official-badge, .confidence {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border: 1px solid #bbcfbf;
  border-radius: 999px;
  color: var(--green);
  background: rgba(255, 255, 255, 0.65);
  font-size: 13px;
  font-weight: 750;
}

main {
  width: min(920px, calc(100% - 40px));
  margin: 0 auto;
}

.hero { padding: 76px 0 54px; }
.eyebrow, .step {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 800px;
  font-size: clamp(42px, 7vw, 72px);
  line-height: 1.08;
  letter-spacing: -0.055em;
}

h1 em {
  position: relative;
  z-index: 0;
  color: var(--green);
  font-style: normal;
}

h1 em::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: -3px;
  right: -3px;
  bottom: 4px;
  height: 0.28em;
  background: var(--lime);
  transform: rotate(-0.8deg);
}

.hero-copy {
  max-width: 650px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.ask-panel, .answer {
  padding: 34px;
  border: 1px solid rgba(23, 92, 60, 0.15);
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.panel-heading, .answer-head, .sources-heading {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: space-between;
}

h2, h3 { margin: 0; letter-spacing: -0.025em; }
h2 { font-size: 28px; }
h3 { font-size: 19px; }
.privacy-note { color: var(--muted); font-size: 13px; }

textarea {
  width: 100%;
  margin-top: 24px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  resize: vertical;
  color: var(--ink);
  background: #fafbf8;
  outline: none;
  transition: border-color 160ms, box-shadow 160ms;
}

textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(23, 92, 60, 0.1);
}

.form-footer {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#char-count { color: var(--muted); font-size: 13px; }

#submit-button {
  min-height: 48px;
  padding: 0 19px;
  display: inline-flex;
  align-items: center;
  gap: 28px;
  border: 0;
  border-radius: 13px;
  color: white;
  background: var(--green);
  font-weight: 800;
}

#submit-button:hover { background: #0f4d31; }
#submit-button:disabled { cursor: wait; opacity: 0.65; }

.examples {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.examples span { margin-right: 4px; color: var(--muted); font-size: 13px; }
.examples button {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #445149;
  background: transparent;
  font-size: 13px;
}
.examples button:hover { border-color: var(--green); color: var(--green); }

.status {
  margin: 24px 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.65);
}
.status.error { border-color: #e0ad9e; color: #8a3020; background: #fff2ed; }

.answer { margin-top: 24px; }
.summary { margin: 24px 0; font-size: 18px; }
.answer-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 16px;
}
.answer-grid article {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fafbf8;
}
.answer-grid ol { margin: 14px 0 0; padding-left: 22px; }
.answer-grid li + li { margin-top: 9px; }
.caution-card { color: var(--warning); background: var(--warning-bg) !important; border-color: #efd9a3 !important; }
.caution-card p { margin: 14px 0 0; }

.sources-section { margin-top: 34px; padding-top: 30px; border-top: 1px solid var(--line); }
#source-count { color: var(--muted); font-size: 13px; }
.sources { margin-top: 18px; display: grid; gap: 12px; }
.source-card {
  padding: 18px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--ink);
  background: white;
  text-decoration: none;
}
.source-card:hover { border-color: var(--green); }
.source-type {
  padding: 4px 8px;
  border-radius: 7px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 12px;
  font-weight: 800;
}
.source-card strong { display: block; }
.source-card p { margin: 5px 0 0; color: var(--muted); font-size: 14px; }
.source-arrow { color: var(--green); font-weight: 900; }
.disclaimer { margin: 24px 0 0; color: var(--muted); font-size: 12px; }

footer {
  width: min(920px, calc(100% - 40px));
  margin: 56px auto 0;
  padding: 26px 0 40px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
footer p { margin: 0; }
footer a { color: var(--green); font-weight: 750; }

.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: 680px) {
  .site-header, main, footer { width: min(100% - 28px, 920px); }
  .hero { padding: 48px 0 36px; }
  h1 { font-size: 42px; }
  .ask-panel, .answer { padding: 22px; border-radius: 19px; }
  .panel-heading, .answer-head { display: block; }
  .privacy-note { display: block; margin-top: 8px; }
  .form-footer { align-items: flex-end; gap: 16px; }
  #submit-button { flex: 1; justify-content: space-between; }
  .answer-grid { grid-template-columns: 1fr; }
  .source-card { grid-template-columns: auto 1fr; }
  .source-arrow { display: none; }
  footer { display: block; }
  footer a { display: inline-block; margin-top: 8px; }
}
