:root {
  color-scheme: dark;
  --bg: #07100f;
  --panel: #0f1c1b;
  --panel-soft: #132625;
  --ink: #f4fbf9;
  --muted: #a8bfba;
  --line: rgba(196, 241, 232, 0.16);
  --teal: #2dd4bf;
  --lime: #a3e635;
  --coral: #fb7185;
  --amber: #fbbf24;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 10% 0%, rgba(45, 212, 191, 0.16), transparent 28rem),
    radial-gradient(circle at 85% 18%, rgba(251, 113, 133, 0.14), transparent 24rem),
    linear-gradient(145deg, #07100f 0%, #0b1418 52%, #120f19 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

body,
button,
input,
select {
  overflow-wrap: break-word;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--teal), var(--lime));
  color: #031312;
  padding: 0 15px;
  font-weight: 850;
  cursor: pointer;
}

button.secondary {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 16, 15, 0.84);
  backdrop-filter: blur(18px);
  padding: 14px clamp(16px, 4vw, 46px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(45, 212, 191, 0.55);
  border-radius: 9px;
  background: linear-gradient(145deg, #0b2a28, #202313);
  color: var(--lime);
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand small,
nav a,
.eyebrow,
.status,
.details-grid p {
  color: var(--muted);
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border-radius: 999px;
  padding: 0 12px;
  text-decoration: none;
}

nav a:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
}

.menu-toggle {
  display: none;
  width: 70px;
}

.mobile-menu {
  position: fixed;
  inset: 74px 16px auto auto;
  z-index: 30;
  display: grid;
  width: min(260px, calc(100% - 32px));
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(7, 16, 15, 0.96);
  box-shadow: var(--shadow);
  padding: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.mobile-menu.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.mobile-menu a {
  display: flex;
  align-items: center;
  min-height: 44px;
  border-radius: 8px;
  padding: 0 12px;
  text-decoration: none;
}

.mobile-menu a:hover {
  background: rgba(255, 255, 255, 0.07);
}

main {
  width: min(1260px, calc(100% - 32px));
  margin: 0 auto;
}

.tool-shell {
  display: grid;
  grid-template-columns: minmax(310px, 0.72fr) minmax(0, 1.28fr);
  gap: 18px;
  align-items: start;
  padding: 28px 0 22px;
}

.control-panel,
.preview-panel,
.details-grid article {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(15, 28, 27, 0.88);
  box-shadow: var(--shadow);
}

.control-panel,
.preview-panel {
  display: grid;
  gap: 16px;
  padding: clamp(18px, 3vw, 26px);
}

.heading-block {
  display: grid;
  gap: 9px;
}

.app-visual {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0a1514;
}

.eyebrow {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 700px;
  font-size: clamp(2.2rem, 5vw, 4.7rem);
  line-height: 0.96;
}

h1 span {
  display: block;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.3rem);
  line-height: 1.05;
}

.drop-zone {
  display: grid;
  gap: 10px;
  place-items: center;
  min-height: 174px;
  border: 1px dashed rgba(45, 212, 191, 0.48);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(45, 212, 191, 0.1), rgba(251, 191, 36, 0.08)),
    rgba(255, 255, 255, 0.03);
  padding: 18px;
  text-align: center;
}

.drop-zone.is-dragover {
  border-color: var(--lime);
  background: rgba(163, 230, 53, 0.12);
}

.drop-zone input {
  width: 1px;
  height: 1px;
  overflow: hidden;
  position: absolute;
  opacity: 0;
}

.drop-zone strong {
  font-size: 1.2rem;
}

.drop-zone span {
  color: var(--muted);
  font-size: 0.92rem;
}

.preset-row,
.actions,
.output-row,
.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.preset-row button {
  min-height: 40px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
}

.preset-row button.is-active {
  border-color: rgba(163, 230, 53, 0.76);
  background: rgba(163, 230, 53, 0.14);
  color: #edffd1;
}

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

label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

label span {
  color: #cfe0dc;
  font-size: 0.9rem;
  font-weight: 760;
}

label b {
  color: var(--lime);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--teal);
}

select {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--ink);
  padding: 0 12px;
}

.output-row label {
  flex: 1 1 150px;
}

.status {
  min-height: 24px;
}

.preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.stat-row span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: #dffdf7;
  padding: 7px 10px;
  font-size: 0.84rem;
  font-weight: 760;
}

.compare-shell {
  --split: 50%;
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  border: 1px solid rgba(45, 212, 191, 0.3);
  border-radius: 10px;
  background: #091412;
  aspect-ratio: 1200 / 760;
}

.compare-shell canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#afterCanvas {
  clip-path: inset(0 calc(100% - var(--split)) 0 0);
}

.compare-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--split);
  width: 2px;
  background: var(--lime);
  box-shadow: 0 0 16px rgba(163, 230, 53, 0.7);
}

.compare-label {
  position: absolute;
  top: 12px;
  border-radius: 999px;
  background: rgba(3, 19, 18, 0.76);
  color: #f4fbf9;
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 850;
}

.compare-label.before {
  left: 12px;
}

.compare-label.after {
  right: 12px;
}

.compare-control {
  width: 100%;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding-bottom: 42px;
}

.details-grid article {
  padding: 18px;
}

.details-grid strong {
  display: block;
  margin-bottom: 8px;
  color: #effffb;
  font-size: 1.08rem;
}

.article-page {
  width: min(900px, calc(100% - 32px));
  padding: 36px 0 50px;
}

.article-body {
  display: grid;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(15, 28, 27, 0.88);
  box-shadow: var(--shadow);
  padding: clamp(20px, 4vw, 34px);
}

.article-body h1 {
  font-size: clamp(2.1rem, 5vw, 4rem);
}

.article-body h2 {
  margin-top: 12px;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.article-body .lead {
  color: #dffdf7;
  font-size: 1.08rem;
}

.article-body p,
.article-body td,
.article-body th {
  color: var(--muted);
}

.limit-table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  border-spacing: 0;
  font-size: 0.94rem;
}

.limit-table th,
.limit-table td {
  min-width: 140px;
  border-bottom: 1px solid var(--line);
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

.limit-table th {
  color: #effffb;
  background: rgba(45, 212, 191, 0.1);
}

.limit-table tr:last-child td {
  border-bottom: 0;
}

.article-return a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--teal), var(--lime));
  color: #031312;
  padding: 0 15px;
  font-weight: 850;
  text-decoration: none;
}

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 22px;
  font-size: 0.88rem;
}

footer a {
  min-height: 28px;
}

.bottom-cta {
  position: fixed;
  right: 16px;
  bottom: 10px;
  left: 16px;
  z-index: 24;
  display: none;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--teal), var(--lime));
  color: #031312;
  padding: 0 16px;
  font-weight: 900;
  text-decoration: none;
  box-shadow: var(--shadow);
}

@media (max-width: 920px) {
  .tool-shell,
  .details-grid {
    grid-template-columns: 1fr;
  }

  .preview-head {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  body {
    padding-bottom: 76px;
  }

  .topbar {
    align-items: flex-start;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 70px;
  }

  .topbar > nav {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .tool-shell {
    padding-top: 18px;
  }

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

  h1 {
    font-size: 2.3rem;
  }

  .bottom-cta {
    display: inline-flex;
  }
}
