:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --ink: #12151b;
  --muted: #626a78;
  --line: #d3d9e3;
  --accent: #1277ff; /* Hive 블루 */
  --accent-ink: #ffffff;
  --accent-soft: #e5f0ff;
  --danger: #d6331f;
  --ok: #1f7a4d;
  --warn-bg: #fdf0c8;
  --warn-ink: #6b4a00;
  --sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216;
    --surface: #171b22;
    --ink: #e9edf3;
    --muted: #939baa;
    --line: #2d333d;
    --accent: #5aa0ff; /* 어두운 배경에서 읽히도록 밝힌 Hive 블루 */
    --accent-ink: #06172f;
    --accent-soft: #11233f;
    --danger: #ff7262;
    --ok: #5fd39a;
    --warn-bg: #33290c;
    --warn-ink: #f1d27a;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
:lang(ko) body { word-break: keep-all; }

.top, main {
  width: min(100% - 32px, 760px);
  margin-inline: auto;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.brand { font-size: 17px; }
.brand path { stroke: var(--accent-ink); }
.top-tools { display: flex; align-items: center; gap: 12px; min-width: 0; }
.lang-select {
  max-width: 9.5em;
  min-height: 34px;
  padding: 0 8px;
  background: transparent;
  color: var(--muted);
  border: 1.5px solid var(--line);
  border-radius: 9px;
  font: 500 13.5px var(--sans);
  cursor: pointer;
}
.lang-select:hover { border-color: var(--ink); color: var(--ink); }
.lang-select option { background: var(--surface); color: var(--ink); }
.account { min-width: 0; }
.account-user { display: flex; align-items: center; gap: 4px; min-width: 0; color: var(--muted); font-size: 14px; }
.account-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.limits { margin: 12px 0 0; color: var(--muted); font-size: 13px; text-align: center; }

.hero { padding: 40px 0 32px; }
.hero h1 {
  overflow-wrap: break-word; /* 긴 단어가 많은 언어에서 화면 밖으로 넘치지 않게 */
  margin: 0 0 16px;
  font-size: clamp(34px, 7vw, 56px);
  line-height: 1.12;
  letter-spacing: -0.035em;
  font-weight: 800;
}
.lede { margin: 0; max-width: 34em; color: var(--muted); font-size: 17px; }

/* ---- 드롭존 ---- */

.dropzone {
  display: grid;
  place-items: center;
  min-height: 340px;
  padding: 40px 24px;
  background: var(--surface);
  border: 2px dashed var(--line);
  border-radius: 24px;
  text-align: center;
  transition: border-color .15s, background-color .15s, transform .15s;
}
.dropzone[data-state="done"], .dropzone[data-state="error"], .dropzone[data-state="uploading"] { border-style: solid; }

body.dragging .dropzone:not([data-state="uploading"]) {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: scale(1.01);
}
body.dragging .dz-icon { color: var(--accent); }

.view { display: none; flex-direction: column; align-items: center; width: 100%; }
.dropzone[data-state="idle"] .view-idle,
.dropzone[data-state="uploading"] .view-uploading,
.dropzone[data-state="done"] .view-done,
.dropzone[data-state="error"] .view-error { display: flex; }

.dz-icon { color: var(--muted); margin-bottom: 16px; transition: color .15s; }
.dz-icon.ok { color: var(--ok); }
.dz-icon.bad { color: var(--danger); }
.dz-title { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -0.02em; }
.dz-sub { margin: 6px 0 0; color: var(--muted); font-size: 14.5px; max-width: 34em; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 24px; }

.target {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
  padding: 6px 14px;
  padding-inline-end: 8px;
  background: var(--accent-soft);
  border-radius: 999px;
  font-size: 14px;
}
.target b { font-family: var(--mono); font-weight: 600; }

.url {
  display: block;
  max-width: 100%;
  margin-top: 12px;
  color: var(--accent);
  font: 600 clamp(15px, 3.4vw, 19px) var(--mono);
  overflow-wrap: anywhere;
  text-underline-offset: 4px;
}

.warn {
  margin: 16px 0 0;
  padding: 10px 14px;
  background: var(--warn-bg);
  color: var(--warn-ink);
  border-radius: 10px;
  font-size: 14px;
}

.bar {
  width: min(100%, 420px);
  height: 8px;
  margin: 20px 0 10px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.bar-fill { width: 0; height: 100%; background: var(--accent); border-radius: inherit; transition: width .2s ease-out; }
.bar.indeterminate .bar-fill { width: 40% !important; animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

/* ---- 버튼 ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  font: 600 15px var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: border-color .15s, background-color .15s, filter .15s;
}
.btn:hover { border-color: var(--ink); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { border-color: var(--accent); filter: brightness(1.08); }
.btn-small { min-height: 34px; padding: 0 12px; border-radius: 9px; font-size: 13.5px; }
.btn-danger, .btn-danger:hover { border-color: var(--danger); color: var(--danger); }
.btn:disabled { opacity: .5; cursor: default; }

.link {
  padding: 2px 8px;
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

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

/* ---- 내 사이트 ---- */

.sites { margin-top: 56px; }
.sites-head h2 { margin: 0; font-size: 20px; letter-spacing: -0.02em; }
.sites-head p { margin: 4px 0 16px; color: var(--muted); font-size: 14px; }

.site-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.site.is-target { border-inline-start: 3px solid var(--accent); padding-inline-start: 14px; }
.site-main { min-width: 0; flex: 1 1 260px; }
.site-link {
  color: var(--ink);
  font: 600 15px var(--mono);
  overflow-wrap: anywhere;
  text-underline-offset: 4px;
}
.site-link:hover { color: var(--accent); }
.site-meta { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
.site-actions { display: flex; gap: 8px; }

/* ---- 사용 방법 ---- */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px 28px;
  margin: 56px 0 72px;
}
.steps div { display: flex; gap: 12px; }
.steps span {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  font: 600 13px var(--mono);
}
.steps p { margin: 0; color: var(--muted); font-size: 14px; }
.steps b { display: block; color: var(--ink); font-size: 15px; }

@media (max-width: 520px) {
  .hero { padding-top: 20px; }
  .dropzone { min-height: 300px; padding: 32px 16px; border-radius: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .bar.indeterminate .bar-fill { animation-duration: 3s; }
}

/* 글자 간격을 줄이면 글자가 이어지는 문자(아랍어 등)와 결합 문자(힌디어, 태국어)가 깨진다. */
:lang(ar) *, :lang(he) *, :lang(hi) *, :lang(th) * { letter-spacing: 0 !important; }
