:root {
  color-scheme: light dark;
  --bg: #f7f7fb;
  --surface: #ffffff;
  --surface-strong: #eef0f7;
  --text: #14151f;
  --muted: #60677a;
  --line: #d9ddea;
  --accent: #5865f2;
  --accent-strong: #3f4bd8;
  --accent-soft: #e8eaff;
  --success: #137446;
  --shadow: 0 18px 50px rgba(33, 36, 57, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101116;
    --surface: #1a1c25;
    --surface-strong: #242735;
    --text: #f3f4fa;
    --muted: #b8bdd0;
    --line: #343849;
    --accent: #7b86ff;
    --accent-strong: #a8afff;
    --accent-soft: #252a4f;
    --success: #6bd99d;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f7fb;
  --surface: #ffffff;
  --surface-strong: #eef0f7;
  --text: #14151f;
  --muted: #60677a;
  --line: #d9ddea;
  --accent: #5865f2;
  --accent-strong: #3f4bd8;
  --accent-soft: #e8eaff;
  --success: #137446;
  --shadow: 0 18px 50px rgba(33, 36, 57, 0.12);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101116;
  --surface: #1a1c25;
  --surface-strong: #242735;
  --text: #f3f4fa;
  --muted: #b8bdd0;
  --line: #343849;
  --accent: #7b86ff;
  --accent-strong: #a8afff;
  --accent-soft: #252a4f;
  --success: #6bd99d;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

.topbar,
main,
footer {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
}

.brand {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 900;
  text-decoration: none;
}

main {
  padding: 18px 0 48px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  gap: 32px;
  align-items: start;
  min-height: 70vh;
}

.hero__copy {
  padding-top: 24px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
  line-height: 1.05;
}

h1 {
  max-width: 680px;
  font-size: clamp(2.35rem, 4.8vw, 4.7rem);
}

h2 {
  font-size: clamp(1.55rem, 2.4vw, 2.25rem);
}

.hero__lede {
  max-width: 640px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.converter,
.result-card,
.embed-dialog {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.converter {
  padding: 24px;
}

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

.field,
.result-card label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

input,
select {
  padding: 0 13px;
}

textarea {
  padding: 13px;
  resize: vertical;
}

button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font: inherit;
  font-weight: 800;
}

.primary-action {
  width: 100%;
  margin-top: 18px;
  border-color: transparent;
  background: var(--accent);
  color: white;
}

.primary-action:hover {
  background: var(--accent-strong);
}

.preview,
.unix-row {
  margin-top: 18px;
  border-radius: 8px;
  background: var(--surface-strong);
}

.preview {
  display: grid;
  gap: 6px;
  padding: 16px;
}

.preview__label,
.unix-row span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.preview strong {
  min-height: 30px;
  font-size: 1.08rem;
}

.result-card {
  margin-top: 18px;
  padding: 18px;
}

.copy-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.copy-line input,
code,
textarea {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.unix-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
}

code {
  overflow-wrap: anywhere;
  color: var(--success);
  font-size: 0.98rem;
}

.guide {
  padding: 56px 0 0;
}

.guide__text {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 18px;
  color: var(--muted);
}

.guide__text p {
  margin: 0;
}

footer {
  display: grid;
  gap: 16px;
  align-items: start;
  border-top: 1px solid var(--line);
  padding: 24px 0 32px;
  color: var(--muted);
  font-size: 0.92rem;
}

footer p {
  margin: 0;
}

.footer-copy {
  display: grid;
  gap: 14px;
  max-width: 880px;
  color: var(--muted);
}

.embed-dialog {
  width: min(680px, calc(100% - 32px));
  color: var(--text);
  padding: 22px;
}

.embed-dialog::backdrop {
  background: rgba(10, 11, 18, 0.58);
}

.dialog-head {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.embed-dialog p {
  color: var(--muted);
}

.embed-dialog textarea {
  margin-bottom: 12px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 820px) {
  .topbar,
  main,
  footer {
    width: min(100% - 24px, 680px);
  }

  main {
    padding-top: 8px;
  }

  .hero,
  .field-grid,
  .guide__text {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .converter {
    padding: 18px;
  }

  .copy-line {
    grid-template-columns: 1fr;
  }
}
