:root {
  --bg-0: #fdfbf4;
  --bg-1: #f3efe3;
  --ink-0: #11140f;
  --ink-1: #2f352a;
  --ink-muted: #5f6756;
  --accent-0: #0b6e4f;
  --accent-1: #c75512;
  --line: #d8ddcc;
  --card: #fffefa;
  --shadow: 0 18px 35px rgba(39, 45, 33, 0.12);
  --radius-lg: 18px;
  --radius-md: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Avenir Next", "IBM Plex Sans KR", "Noto Sans JP", "Noto Sans SC", sans-serif;
  color: var(--ink-0);
  background: linear-gradient(145deg, var(--bg-0), var(--bg-1));
  line-height: 1.45;
}

.bg-layer {
  position: fixed;
  inset: -20% -10% auto;
  height: 420px;
  background:
    radial-gradient(circle at 20% 30%, rgba(199, 85, 18, 0.16), transparent 48%),
    radial-gradient(circle at 80% 20%, rgba(11, 110, 79, 0.16), transparent 46%);
  pointer-events: none;
  z-index: -1;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1.1rem;
  border-bottom: 1px solid rgba(216, 221, 204, 0.9);
  background: rgba(255, 254, 250, 0.92);
  backdrop-filter: blur(10px);
}

.brand {
  font-weight: 800;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--ink-0);
}

.tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  white-space: nowrap;
  padding-bottom: 0.15rem;
}

.tab {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-1);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.tab.is-active {
  border-color: var(--accent-0);
  color: var(--accent-0);
}

.tab:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.language-picker {
  position: relative;
}

.language-button {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 0.3rem 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
}

.language-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 170px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: var(--shadow);
  list-style: none;
  margin: 0;
  padding: 0.4rem;
}

.language-option {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0.45rem 0.5rem;
  border-radius: 8px;
  font: inherit;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.language-option:hover,
.language-option:focus-visible {
  background: #eef2e6;
  outline: none;
}

main {
  width: min(1120px, 100% - 2rem);
  margin: 1.2rem auto 2.5rem;
  display: grid;
  gap: 1rem;
}

.card {
  background: var(--card);
  border: 1px solid #ecefdf;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1rem;
}

.hero h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  line-height: 1.15;
}

.hero p {
  margin: 0;
  color: var(--ink-muted);
}

.trust-list {
  margin-top: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.trust-item {
  border: 1px solid #d4dbc7;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  background: #f7f8f2;
  font-size: 0.9rem;
}

.section-head {
  margin-bottom: 0.9rem;
}

.section-head h2,
.content-section h2,
.results-block h3 {
  margin: 0;
}

.muted {
  color: var(--ink-muted);
}

.is-hidden {
  display: none !important;
}

.drop-zone {
  border: 2px dashed #b8c3a7;
  border-radius: var(--radius-md);
  background: #f6f8ee;
  text-align: center;
  padding: 1rem;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.drop-zone.is-dragover {
  border-color: var(--accent-0);
  transform: scale(1.01);
  background: #ebf5f1;
}

.drop-zone small {
  display: block;
  margin-top: 0.35rem;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 0.9rem;
}

.option {
  display: grid;
  gap: 0.35rem;
}

select,
input[type="number"],
input[type="range"],
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.5rem 0.55rem;
  font: inherit;
  background: #fff;
}

textarea {
  resize: vertical;
  min-height: 180px;
  line-height: 1.4;
}

.text-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 0.9rem;
}

.audio-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1rem;
}

.audio-preview-grid h3 {
  margin: 0 0 0.4rem;
}

.audio-preview-grid audio {
  width: 100%;
}

.audio-preview-grid video {
  width: 100%;
  max-height: 320px;
  border-radius: 8px;
  background: #111;
}

.audio-progress-wrap {
  margin-top: 0.65rem;
  display: grid;
  gap: 0.3rem;
}

.audio-progress-wrap progress {
  width: 100%;
  height: 10px;
}

.video-thumb-preview {
  display: block;
  max-width: 100%;
  max-height: 280px;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 0.8rem;
}

.actions {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.primary-btn,
.ghost-btn {
  border-radius: 10px;
  padding: 0.5rem 0.85rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.primary-btn {
  border: 1px solid var(--accent-0);
  background: var(--accent-0);
  color: #fff;
}

.ghost-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-1);
}

.ghost-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.status {
  margin: 0.75rem 0 0;
}

.results-block {
  margin-top: 1rem;
}

.result-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.result-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: center;
}

.result-meta {
  display: grid;
  gap: 0.15rem;
}

.result-name {
  font-weight: 700;
}

.footer {
  width: min(1120px, 100% - 2rem);
  margin: 0 auto 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  padding-top: 0.2rem;
}

.footer a {
  color: var(--ink-1);
  text-decoration: none;
  border-bottom: 1px dotted #9aa68a;
}

@media (max-width: 920px) {
  .topbar {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand language"
      "tabs tabs";
  }

  .brand {
    grid-area: brand;
  }

  .tabs {
    grid-area: tabs;
  }

  .language-picker {
    grid-area: language;
    justify-self: end;
  }
}

@media (max-width: 720px) {
  main {
    width: min(1120px, 100% - 1rem);
    margin-top: 0.9rem;
  }

  .card {
    padding: 0.85rem;
  }

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

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

  .audio-preview-grid {
    grid-template-columns: 1fr;
  }

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