/* ===== Design tokens ===== */
:root {
  --bg: #0e1116;
  --bg-soft: #161b22;
  --card: #1c232d;
  --text: #e8edf3;
  --muted: #9aa7b4;
  --brand: #ff5a5f;
  --brand-dark: #e04347;
  --accent: #4fd1c5;
  --border: #28323d;
  --radius: 14px;
  --maxw: 1080px;
}

/* ===== Base ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3 { line-height: 1.2; font-weight: 800; }

section { padding: 80px 0; }

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 12px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease, opacity 0.15s ease;
  border: 2px solid transparent;
  cursor: pointer;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--accent); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); padding: 8px 16px; }
.btn-lg { padding: 16px 32px; font-size: 1.1rem; }

/* ===== Crisis bar ===== */
.crisis-bar {
  background: var(--brand-dark);
  color: #fff;
  font-size: 0.9rem;
}
.crisis-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 24px;
  flex-wrap: wrap;
}
.crisis-label { font-weight: 800; white-space: nowrap; }
.crisis-text { color: #ffe3e4; }
.crisis-text a { color: #fff; font-weight: 700; text-decoration: underline; white-space: nowrap; }

/* ===== Language toggle ===== */
.lang-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.lang-btn {
  background: transparent;
  color: var(--muted);
  border: none;
  padding: 7px 14px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
}
.lang-btn:hover { color: var(--text); }
.lang-btn.active { background: var(--brand); color: #fff; }

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(14, 17, 22, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
}
.logo {
  font-weight: 900;
  font-size: 1.3rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.logo span { color: var(--brand); }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a { color: var(--muted); text-decoration: none; font-weight: 600; }
.nav-links a:hover { color: var(--text); }
.nav-links a.btn-ghost:hover { color: var(--text); }

/* ===== Hero ===== */
.hero {
  background: radial-gradient(1200px 500px at 70% -10%, rgba(255,90,95,0.18), transparent),
              radial-gradient(900px 400px at 0% 10%, rgba(79,209,197,0.12), transparent);
  padding: 110px 0 90px;
}
.hero-inner { max-width: 760px; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); letter-spacing: -0.02em; }
.lead {
  font-size: 1.25rem;
  color: var(--muted);
  margin: 24px 0 32px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-note { margin-top: 22px; font-size: 0.9rem; color: var(--muted); }

/* ===== Mission ===== */
.mission { background: var(--bg-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.mission h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); max-width: 700px; }
.mission-text { margin-top: 18px; font-size: 1.15rem; color: var(--muted); max-width: 760px; }

/* ===== Victim protection callout ===== */
.protect {
  margin-top: 30px;
  max-width: 760px;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius);
  padding: 26px 28px;
}
.protect h3 { font-size: 1.3rem; margin-bottom: 10px; color: var(--text); }
.protect p { color: var(--muted); }

/* ===== How it works ===== */
.how h2 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin-bottom: 40px; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
.card-num {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  margin-bottom: 16px;
}
.card h3 { font-size: 1.3rem; margin-bottom: 8px; }
.card p { color: var(--muted); }

/* ===== Guardian Angels ===== */
.angels { background: var(--bg-soft); border-top: 1px solid var(--border); }
.angels-inner { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: start; }
.angels h2 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin-bottom: 16px; }
.angels-text p { color: var(--muted); font-size: 1.1rem; }
.checklist { list-style: none; margin: 22px 0 28px; }
.checklist li { padding-left: 30px; position: relative; margin-bottom: 12px; color: var(--text); }
.checklist li::before {
  content: "✓";
  position: absolute; left: 0;
  color: var(--accent);
  font-weight: 900;
}
.angels-pledge {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 28px;
}
.angels-pledge h3 { font-size: 1.2rem; margin-bottom: 12px; }
.angels-pledge p { color: var(--muted); font-style: italic; }

/* ===== CTA ===== */
.cta { text-align: center; }
.cta h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.cta p { color: var(--muted); font-size: 1.15rem; margin: 14px 0 28px; }

/* ===== Report form ===== */
.report { padding: 60px 0 90px; }
.report-inner { max-width: 720px; }
.report h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 8px 0 16px; }
.report-sub { color: var(--muted); font-size: 1.1rem; margin-bottom: 36px; }

.form-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  background: var(--bg-soft);
}
.form-block legend {
  font-weight: 800;
  padding: 0 10px;
  color: var(--text);
}
.block-note { color: var(--muted); font-size: 0.95rem; margin-bottom: 18px; }

.field { display: block; margin-bottom: 18px; }
.field-label { display: block; font-weight: 700; margin-bottom: 6px; }
.field-label em { color: var(--brand); font-style: normal; font-weight: 700; }
.field-help { display: block; color: var(--muted); font-size: 0.9rem; margin-bottom: 8px; }

.field input[type="text"],
.field input[type="date"],
.field input[type="file"],
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.field textarea { resize: vertical; }

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

.consent { margin: 8px 0 24px; }
.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.95rem;
}
.check input { margin-top: 4px; }

.form-foot { color: var(--muted); font-size: 0.9rem; margin-top: 14px; }

.report-success {
  text-align: center;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 40px 28px;
}
.report-success h2 { font-size: 1.8rem; margin-bottom: 12px; }
.report-success p { color: var(--muted); margin-bottom: 24px; }

@media (max-width: 600px) {
  .field-row { grid-template-columns: 1fr; }
}

/* Long pages written twice (privacy policy): show only the current language */
html[lang="ko"] [data-lang-only="en"],
html:not([lang="ko"]) [data-lang-only="ko"] { display: none; }

/* ===== Privacy policy ===== */
.policy h2 { font-size: 1.2rem; margin: 32px 0 10px; }
.policy p, .policy li { color: var(--muted); margin-bottom: 10px; }
.policy strong { color: var(--text); }
.policy ul { padding-left: 22px; margin-bottom: 10px; }
.policy a { color: var(--accent); }
.footer-links a { color: var(--muted); }

/* ===== Footer ===== */
.site-footer { background: var(--bg-soft); border-top: 1px solid var(--border); padding: 50px 0; }
.footer-inner { text-align: center; }
.footer-note { color: var(--muted); max-width: 620px; margin: 14px auto; font-size: 0.95rem; }
.copyright { color: var(--muted); font-size: 0.85rem; margin-top: 10px; }

/* ===== Responsive ===== */
@media (max-width: 820px) {
  .cards { grid-template-columns: 1fr; }
  .angels-inner { grid-template-columns: 1fr; }
  .nav-links a:not(.btn-ghost) { display: none; }
  .crisis-text { font-size: 0.82rem; }
}
/* Phones: logo, "Report a case" and the language toggle must share one row */
@media (max-width: 480px) {
  .container.nav { padding: 0 16px; }
  .logo { font-size: 1.1rem; }
  .nav-links { gap: 8px; }
  .nav-links .btn-ghost { padding: 6px 10px; font-size: 0.85rem; white-space: nowrap; }
  .lang-btn { padding: 6px 10px; white-space: nowrap; }
}

/* ===== Upload progress & submit error ===== */
.upload-progress { margin-top: 16px; }
.progress-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--brand);
  transition: width 0.2s ease;
}
.progress-label { margin-top: 8px; color: var(--muted); font-size: 0.9rem; }
.form-error { margin-top: 16px; color: #ff6b6b; font-weight: 600; }

/* ===== Guardian Angel region checkboxes ===== */
.field input[type="email"] {
  width: 100%;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
}

/* ===== Location picker (type to search) ===== */
.location-picker { position: relative; }
.loc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.loc-chips:not(:empty) { margin-bottom: 10px; }
.loc-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(79, 209, 197, 0.15);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 4px 6px 4px 12px;
  border-radius: 999px;
}
.loc-chip button {
  background: none;
  border: 0;
  color: inherit;
  font-size: 1.1rem;
  line-height: 1;
  padding: 2px 6px;
  cursor: pointer;
}
.loc-list {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  margin-top: 4px;
  max-height: 260px;
  overflow-y: auto;
  list-style: none;
  background: var(--card);
  border: 1px solid var(--accent);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.loc-list li { padding: 10px 14px; cursor: pointer; }
.loc-list li[aria-selected="true"],
.loc-list li[role="option"]:hover { background: rgba(79, 209, 197, 0.15); }
.loc-list .loc-empty { color: var(--muted); cursor: default; }

/* ===== Case wall ===== */
.cases-inner { max-width: 820px; }
.case-filter { max-width: 280px; }
.case-list { display: grid; gap: 20px; }
.case-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius);
  padding: 24px;
  scroll-margin-top: 90px; /* keep #case-id links clear of the sticky header */
}
.case-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.case-region {
  background: rgba(79, 209, 197, 0.15);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 3px 12px;
  border-radius: 999px;
}
.case-place { color: var(--muted); font-size: 0.95rem; }
.case-card video { width: 100%; max-height: 420px; border-radius: 10px; background: #000; margin-bottom: 14px; }
.case-player, .stream-player {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  margin-bottom: 14px;
}
.case-player iframe, .stream-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.case-novideo { color: var(--muted); font-size: 0.9rem; font-style: italic; margin-bottom: 12px; }
.case-summary { white-space: pre-line; overflow-wrap: anywhere; margin-bottom: 12px; }
.case-dates { color: var(--muted); font-size: 0.85rem; }
.case-empty { color: var(--muted); padding: 40px 0; text-align: center; }

/* ===== Comments under a case =====
   Modeled on Facebook's comment list: a round initial, name · time on
   one small line, the text right under it, small actions, no dividers.
   The list scrolls inside its own panel so the page never grows long. */
.comments { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 10px; }
.comments-toggle {
  background: none;
  border: 0;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 2px 0;
}
.comment-list {
  margin: 6px 0 4px;
  max-height: min(65vh, 560px);
  overflow-y: auto;
  overscroll-behavior: contain; /* scrolling the panel doesn't scroll the page */
  padding-right: 4px;
}
.comment { display: flex; gap: 8px; padding: 5px 0; font-size: 0.92rem; }
.comment-avatar {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #3a4552;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.comment-reply .comment-avatar { width: 24px; height: 24px; font-size: 0.72rem; }
.comment-main { flex: 1; min-width: 0; }
.comment-pinned {
  background: rgba(79, 209, 197, 0.06);
  border: 1px solid rgba(79, 209, 197, 0.3);
  border-radius: 10px;
  padding: 6px 8px;
  margin-bottom: 4px;
}
.comment-pin { color: var(--accent); font-size: 0.7rem; font-weight: 800; line-height: 1.3; }
.comment-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; line-height: 1.3; }
.comment-name { font-weight: 700; font-size: 0.82rem; }
.comment-date { color: var(--muted); font-size: 0.74rem; }
.comment-body { white-space: pre-line; overflow-wrap: anywhere; line-height: 1.35; }
.comment-actions { display: flex; gap: 14px; align-items: center; margin-top: 1px; }
.comment-like,
.comment-action,
.comment-replies-toggle {
  background: none;
  border: 0;
  padding: 1px 0;
  color: var(--muted);
  font: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1.4;
}
.comment-like:hover,
.comment-action:hover { color: var(--text); }
.comment-like.liked { color: var(--brand); }
.comment-action:disabled { cursor: default; }
.comment-actions .comment-flag { margin-left: auto; color: #e5605f; }
.comment-actions .comment-flag:hover { color: #ff7b7a; }
.comment-replies-toggle { color: var(--accent); }
.comment-replies-toggle::before {
  content: "";
  display: inline-block;
  width: 18px;
  border-top: 1px solid currentColor;
  vertical-align: middle;
  margin-right: 6px;
}
.comment-replies { margin-top: 2px; }
.comment-reply { padding: 3px 0; }
.comment-more { margin: 6px 0 2px; font-size: 0.82rem; padding: 6px 14px; }
.comment-empty { color: var(--muted); font-size: 0.88rem; padding: 6px 0; }

.comment-form { display: grid; gap: 6px; margin: 6px 0; }
.comment-form.compact .comment-form-row,
.comment-form.compact .comment-lockhint { display: none; }
.comment-form-row { display: flex; gap: 6px; }
.comment-form-row input { flex: 1; min-width: 140px; }
.comment-form-row { flex-wrap: wrap; align-items: center; }
/* "Post as: Anonymous | Name" switch */
.comment-as { display: inline-flex; border: 1px solid var(--border); border-radius: 18px; overflow: hidden; flex: none; }
.comment-as button {
  background: transparent;
  border: 0;
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 7px 12px;
  cursor: pointer;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.comment-as button[aria-pressed="true"] { background: rgba(79, 209, 197, 0.18); color: var(--accent); }
.comment-form .comment-trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.comment-notice { color: var(--muted); font-size: 0.72rem; line-height: 1.35; }
.comment-form input,
.comment-form textarea {
  width: 100%;
  padding: 8px 14px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 18px;
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
}
.comment-form textarea { resize: none; overflow: hidden; line-height: 1.35; display: block; }
.comment-form input:focus,
.comment-form textarea:focus { outline: none; border-color: var(--accent); }
.comment-form .btn { padding: 6px 16px; font-size: 0.85rem; white-space: nowrap; }
