:root {
  --bg: #f4f7fb;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-solid: #ffffff;
  --text: #102033;
  --muted: #59708a;
  --line: rgba(16, 32, 51, 0.1);
  --primary: #0c6cf2;
  --primary-deep: #084bb2;
  --accent: #ff8d52;
  --success: #10804b;
  --shadow: 0 24px 60px rgba(16, 32, 51, 0.14);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(12, 108, 242, 0.18), transparent 34%),
    radial-gradient(circle at top right, rgba(255, 141, 82, 0.18), transparent 28%),
    linear-gradient(180deg, #edf4ff 0%, #f7f9fc 48%, #eef4f7 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 999px;
  filter: blur(24px);
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}

body::before {
  width: 320px;
  height: 320px;
  top: 12%;
  right: -80px;
  background: rgba(12, 108, 242, 0.12);
}

body::after {
  width: 280px;
  height: 280px;
  bottom: 10%;
  left: -60px;
  background: rgba(255, 141, 82, 0.12);
}

img,
video {
  max-width: 100%;
  display: block;
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
}

.page-shell {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--primary), #30b9d4);
  color: #ffffff;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  letter-spacing: 0.03em;
  box-shadow: 0 12px 24px rgba(12, 108, 242, 0.22);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-text strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.05rem;
}

.brand-text small,
.topbar-pill,
.helper-text,
.hero-copy,
.feature-card p,
.tips-card li,
.ad-placeholder p,
.footer-panel p {
  color: var(--muted);
}

.topbar-pill {
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px);
  font-size: 0.95rem;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 430px);
  gap: 24px;
}

.left-column,
.right-column {
  display: grid;
  gap: 24px;
  align-content: start;
}

.right-column {
  position: relative;
}

.panel,
.feature-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.panel::before,
.feature-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.32), transparent 30%);
  pointer-events: none;
}

.hero,
.converter-panel,
.result-panel,
.footer-panel {
  padding: 28px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary-deep);
}

.hero h1,
.converter-panel h2,
.result-panel h2,
.footer-panel h2,
.feature-card h3,
.ad-placeholder h3,
.tips-card h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  line-height: 1.05;
}

.hero h1 {
  max-width: 12ch;
  font-size: clamp(2.4rem, 4vw, 4.5rem);
}

.hero-copy {
  max-width: 66ch;
  margin: 18px 0 24px;
  font-size: 1.08rem;
  line-height: 1.7;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.hero-stats article,
.advice-card,
.status-card,
.source-card,
.tips-card {
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--line);
}

.hero-stats article {
  padding: 18px;
}

.hero-stats strong,
.meta-value,
.empty-state strong,
.dropzone-copy strong {
  display: block;
  margin-bottom: 8px;
  font-weight: 800;
}

.hero-stats span {
  color: var(--muted);
  line-height: 1.55;
}

.format-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.format-row span,
.ad-label {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(16, 32, 51, 0.06);
  color: var(--primary-deep);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.panel-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 20px;
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
}

.button-primary {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), #20a7d5);
  box-shadow: 0 18px 34px rgba(12, 108, 242, 0.28);
}

.button-ghost {
  color: var(--text);
  background: rgba(16, 32, 51, 0.06);
}

.button-block {
  width: 100%;
}

.dropzone {
  display: grid;
  gap: 10px;
  padding: 28px;
  border: 2px dashed rgba(12, 108, 242, 0.28);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(12, 108, 242, 0.08), rgba(48, 185, 212, 0.05)),
    rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.dropzone:hover,
.dropzone.is-dragover {
  transform: translateY(-1px);
  border-color: rgba(12, 108, 242, 0.52);
  background:
    linear-gradient(135deg, rgba(12, 108, 242, 0.11), rgba(48, 185, 212, 0.08)),
    rgba(255, 255, 255, 0.68);
}

.dropzone input {
  display: none;
}

.dropzone-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dropzone-copy strong {
  margin: 0;
  font-size: 1.15rem;
}

.dropzone-note {
  color: var(--muted);
  font-size: 0.95rem;
}

.source-card,
.status-card,
.advice-card,
.tips-card {
  padding: 18px;
}

.source-card {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.source-meta,
.result-metadata {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.meta-label {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.meta-value {
  margin: 0;
  font-size: 1rem;
}

.source-preview,
.result-preview-frame {
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(12, 108, 242, 0.06), rgba(255, 141, 82, 0.06)),
    rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
}

.source-preview {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.setting {
  display: grid;
  gap: 8px;
}

.setting span {
  font-weight: 700;
  font-size: 0.95rem;
}

.setting input,
.setting select {
  width: 100%;
  min-height: 52px;
  padding: 0 15px;
  border-radius: 14px;
  border: 1px solid rgba(16, 32, 51, 0.12);
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  outline: none;
}

.setting input:focus,
.setting select:focus {
  border-color: rgba(12, 108, 242, 0.46);
  box-shadow: 0 0 0 4px rgba(12, 108, 242, 0.08);
}

.setting-note {
  align-content: center;
  min-height: 100%;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(12, 108, 242, 0.08);
  border: 1px solid rgba(12, 108, 242, 0.12);
  color: var(--primary-deep);
  line-height: 1.6;
}

.advice-card {
  margin-top: 18px;
  color: var(--success);
  font-weight: 700;
  line-height: 1.6;
}

.actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 22px;
}

.helper-text {
  line-height: 1.6;
}

.status-card {
  margin-top: 18px;
}

.status-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  font-weight: 700;
}

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(16, 32, 51, 0.08);
  overflow: hidden;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #30b9d4);
  transition: width 180ms ease;
}

.result-panel {
  position: sticky;
  top: 24px;
}

.result-preview-frame {
  min-height: 280px;
  display: grid;
  place-items: center;
  padding: 20px;
}

.result-preview-frame-filled {
  padding: 0;
}

.result-preview-frame img {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  border-radius: 20px;
}

.empty-state {
  display: grid;
  gap: 8px;
  text-align: center;
  color: var(--muted);
}

.result-metadata {
  margin-top: 18px;
}

.tips-card {
  margin-top: 18px;
}

.tips-card ul {
  margin: 14px 0 0;
  padding-left: 18px;
}

.tips-card li {
  margin-bottom: 10px;
  line-height: 1.55;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.feature-card {
  padding: 22px;
}

.feature-card h3 {
  font-size: 1.15rem;
  margin-bottom: 10px;
}

.ad-slot {
  min-height: 140px;
}

.ad-placeholder {
  height: 100%;
  display: grid;
  gap: 12px;
  align-content: center;
  padding: 22px;
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255, 141, 82, 0.1), rgba(12, 108, 242, 0.1)),
    rgba(255, 255, 255, 0.7);
  border: 1px dashed rgba(16, 32, 51, 0.14);
}

.ad-placeholder p,
.ad-placeholder h3,
.ad-placeholder a {
  margin: 0;
}

.ad-placeholder a {
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
}

.ad-slot-wide {
  margin-top: 6px;
}

.ad-slot-rail {
  margin-top: 20px;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.9fr);
  gap: 22px;
  align-items: center;
}

.footer-panel code {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(16, 32, 51, 0.08);
}

.noscript-warning {
  margin: 18px 0 0;
  color: #b3261e;
  font-weight: 700;
}

.reveal {
  animation: rise 500ms ease both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1120px) {
  .layout,
  .footer-grid,
  .hero-stats,
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .result-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  .page-shell {
    padding: 18px;
  }

  .topbar,
  .actions,
  .panel-header,
  .source-meta,
  .result-metadata,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .actions,
  .panel-header {
    display: grid;
  }

  .hero,
  .converter-panel,
  .result-panel,
  .footer-panel,
  .feature-card {
    padding: 22px;
  }

  .hero h1 {
    max-width: 100%;
    font-size: clamp(2.2rem, 11vw, 3.3rem);
  }

  .topbar-pill {
    font-size: 0.9rem;
  }

  .button,
  .setting input,
  .setting select {
    width: 100%;
  }
}
