:root {
  --bg: #04060c;
  --panel: rgba(8, 12, 20, 0.92);
  --line: rgba(148, 163, 184, 0.16);
  --line-strong: rgba(62, 231, 255, 0.34);
  --text: #edf3ff;
  --muted: #98a6c3;
  --cyan: #3ee7ff;
  --violet: #b85cff;
  --magenta: #ff3fb4;
  --green: #3dffb0;
  --warn: #f59e0b;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 10%, rgba(255, 63, 180, 0.20), transparent 24%),
    radial-gradient(circle at 86% 8%, rgba(62, 231, 255, 0.16), transparent 26%),
    radial-gradient(circle at 50% 100%, rgba(184, 92, 255, 0.18), transparent 34%),
    linear-gradient(180deg, var(--bg), #080912 54%, #05070d);
  overflow-x: hidden;
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.28;
  background:
    linear-gradient(90deg, rgba(148, 163, 184, 0.06) 1px, transparent 1px),
    linear-gradient(180deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 20%, black, transparent 72%);
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 48px;
}

.topbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(4, 6, 12, 0.82);
  backdrop-filter: blur(16px);
}

.brand,
.top-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

a {
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  font: 950 0.72rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, var(--magenta), var(--violet), var(--cyan));
  box-shadow: 0 0 28px rgba(184, 92, 255, 0.36);
}

.brand strong {
  display: block;
  letter-spacing: 0.08em;
}

.brand small,
.top-actions a,
.lead,
.panel p,
.status-panel small {
  color: var(--muted);
}

.brand small {
  display: block;
  font: 800 0.68rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.top-actions a {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.55rem 0.72rem;
  font-size: 0.82rem;
  font-weight: 800;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.top-actions a:hover {
  color: #fff;
  border-color: rgba(62, 231, 255, 0.34);
  background: rgba(62, 231, 255, 0.08);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 1rem;
  align-items: stretch;
  padding: 46px 0 18px;
}

.kicker,
.panel-kicker {
  color: var(--cyan);
  font: 900 0.72rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-shadow: 0 0 14px rgba(62, 231, 255, 0.45);
}

h1 {
  max-width: 13ch;
  margin: 0.85rem 0 0;
  font-size: clamp(2.8rem, 9vw, 6rem);
  line-height: 0.92;
  letter-spacing: 0;
  color: transparent;
  background: linear-gradient(90deg, #fff, #dfe8ff 44%, var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
}

.lead {
  max-width: 62ch;
  font-size: 1.05rem;
  line-height: 1.7;
}

.hero-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

.hero-steps span {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 38px;
  padding: 0.4rem 0.72rem;
  color: #dce7ff;
  border: 1px solid rgba(62, 231, 255, 0.18);
  border-radius: 999px;
  background: rgba(62, 231, 255, 0.06);
  font: 900 0.78rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-steps b {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  color: #061015;
  background: var(--cyan);
  box-shadow: 0 0 18px rgba(62, 231, 255, 0.32);
}

.panel,
.status-panel {
  border: 1px solid rgba(62, 231, 255, 0.20);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.012)),
    var(--panel);
  box-shadow:
    0 0 0 1px rgba(255, 63, 180, 0.08),
    0 0 46px rgba(62, 231, 255, 0.10),
    0 24px 76px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  position: relative;
  overflow: hidden;
}

.panel::before,
.status-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(62, 231, 255, 0.12), transparent 34%, rgba(255, 63, 180, 0.10));
  height: 1px;
}

.status-panel {
  padding: 1rem;
  align-self: end;
}

.status-row {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  padding: 0.85rem;
  border: 1px solid rgba(61, 255, 176, 0.18);
  border-radius: 8px;
  background: rgba(61, 255, 176, 0.07);
}

.dot {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 18px rgba(61, 255, 176, 0.75);
}

dl {
  display: grid;
  gap: 0.65rem;
  margin: 1rem 0 0;
}

.safety-note {
  margin-top: 1rem;
  padding: 0.85rem;
  border-radius: 8px;
  border: 1px solid rgba(245, 158, 11, 0.22);
  background: rgba(245, 158, 11, 0.06);
}

.safety-note strong {
  color: #ffe3ae;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.safety-note p {
  margin: 0.4rem 0 0;
  color: #d8c39e;
  line-height: 1.5;
  font-size: 0.9rem;
}

.trust-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 0.5rem 0 1rem;
}

.trust-strip div {
  min-width: 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01)),
    rgba(8, 12, 20, 0.66);
}

.trust-strip span {
  display: block;
  color: var(--cyan);
  font: 900 0.68rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.trust-strip strong {
  display: block;
  margin-top: 0.45rem;
  color: #fff;
  font-size: 0.92rem;
}

dl div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.10);
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
  color: #fff;
  font-weight: 900;
}

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

.panel {
  padding: 1.05rem;
}

.panel-head h2,
.result h2 {
  margin: 0.45rem 0 0;
  font-size: 1.25rem;
}

.panel-head p {
  margin: 0.5rem 0 0;
  line-height: 1.55;
}

.dropzone,
.field {
  display: grid;
  gap: 0.55rem;
  margin-top: 1rem;
}

.dropzone {
  min-height: 180px;
  place-items: center;
  text-align: center;
  padding: 1.2rem;
  border: 1px dashed rgba(62, 231, 255, 0.34);
  border-radius: 8px;
  background: rgba(62, 231, 255, 0.055);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.dropzone:hover {
  transform: translateY(-1px);
  border-color: rgba(62, 231, 255, 0.52);
  background: rgba(62, 231, 255, 0.085);
}

.dropzone.is-dragging,
.dropzone.has-file {
  border-color: rgba(255, 63, 180, 0.70);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 63, 180, 0.20), transparent 58%),
    rgba(62, 231, 255, 0.08);
  box-shadow:
    0 0 0 1px rgba(255, 63, 180, 0.15),
    0 0 34px rgba(184, 92, 255, 0.18);
}

.dropzone.has-file strong {
  color: #fff;
}

.dropzone input {
  display: none;
}

.drop-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 8px;
  color: #061015;
  background: var(--cyan);
  font-weight: 950;
  box-shadow: 0 0 26px rgba(62, 231, 255, 0.34);
}

.field span {
  color: var(--cyan);
  font-weight: 900;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

input[type="url"] {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 0.8rem;
  color: var(--text);
  background: rgba(0, 0, 0, 0.34);
  font: 500 0.95rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
}

input[type="url"]:focus {
  outline: 2px solid rgba(62, 231, 255, 0.35);
  outline-offset: 2px;
}

button,
.primary,
.ghost {
  min-height: 46px;
  border-radius: 6px;
  border: 1px solid rgba(177, 92, 255, 0.55);
  padding: 0.72rem 0.9rem;
  color: #fff;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 140ms ease, filter 160ms ease, border-color 160ms ease, background 160ms ease;
}

.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 1rem;
  background: linear-gradient(135deg, var(--magenta), var(--violet) 54%, var(--cyan));
  box-shadow: 0 0 18px rgba(255, 63, 180, 0.28), 0 0 42px rgba(184, 92, 255, 0.22);
}

button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.primary:hover,
.ghost:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.ghost {
  background: rgba(255, 255, 255, 0.035);
  border-color: var(--line);
}

.hidden {
  display: none;
}

.result,
.error {
  margin-top: 1rem;
}

.result {
  border-color: rgba(61, 255, 176, 0.22);
}

.result-actions {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.result-actions .primary,
.result-actions .ghost {
  width: auto;
  margin-top: 1rem;
  flex: 1 1 220px;
}

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

.summary-grid div {
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
}

.summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.summary-grid strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.6rem;
  color: #fff;
}

.preview-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

h3 {
  margin: 0.2rem 0 0.55rem;
  color: var(--cyan);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

pre {
  max-height: 340px;
  overflow: auto;
  margin: 0;
  padding: 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 8px;
  color: #9beaff;
  background: rgba(0, 0, 0, 0.36);
  font-size: 0.8rem;
  line-height: 1.55;
}

.error {
  border-color: rgba(239, 68, 68, 0.34);
  color: #fecaca;
}

@media (max-width: 820px) {
  .topbar,
  .hero,
  .converter-grid,
  .preview-grid,
  .summary-grid,
  .trust-strip {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .top-actions a {
    flex: 1;
    text-align: center;
  }

  h1 {
    max-width: none;
  }

  .shell {
    width: min(100% - 20px, 1180px);
  }

  .hero {
    padding-top: 28px;
  }
}

@media (max-width: 520px) {
  .shell {
    width: min(100% - 16px, 1180px);
    padding-bottom: 30px;
  }

  .brand strong {
    font-size: 0.9rem;
  }

  .brand small {
    font-size: 0.58rem;
  }

  h1 {
    font-size: 2.55rem;
  }

  .hero-steps span {
    flex: 1 1 100%;
  }

  .panel,
  .status-panel {
    padding: 0.85rem;
  }

  .dropzone {
    min-height: 150px;
  }

  .result-actions .primary,
  .result-actions .ghost {
    flex-basis: 100%;
  }
}
