:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --surface: #ffffff;
  --ink: #172033;
  --muted: #667086;
  --line: #dde3ee;
  --accent: #176b87;
  --accent-dark: #0e4f66;
  --soft: #edf6f8;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

a {
  color: inherit;
}

.topbar {
  align-items: center;
  background: rgba(247, 248, 251, 0.94);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 68px;
  padding: 0 5vw;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  align-items: center;
  display: inline-flex;
  font-weight: 800;
  gap: 10px;
  text-decoration: none;
}

.brand-mark {
  align-items: center;
  background: var(--accent);
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  height: 34px;
  justify-content: center;
  width: 34px;
}

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

nav a,
footer a {
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: none;
}

.language-button {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent-dark);
  cursor: pointer;
  font-weight: 800;
  min-height: 34px;
  padding: 0 12px;
}

main {
  margin: 0 auto;
  max-width: 1200px;
  padding: 0 5vw 58px;
}

.hero {
  align-items: end;
  display: grid;
  gap: 32px;
  grid-template-columns: minmax(0, 1fr) 360px;
  min-height: 420px;
  padding: 64px 0 36px;
}

.hero-copy {
  max-width: 780px;
}

.eyebrow {
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 10px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2.4rem, 7vw, 4.85rem);
  line-height: 1.03;
  margin-bottom: 22px;
}

h2 {
  font-size: 2rem;
  line-height: 1.18;
  margin-bottom: 0;
}

h3 {
  font-size: 1.13rem;
  margin-bottom: 10px;
}

p,
li,
dd {
  color: var(--muted);
  line-height: 1.72;
}

.hero-copy p:last-child {
  font-size: 1.12rem;
  max-width: 730px;
}

.hero-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  overflow: hidden;
}

.hero-panel div {
  display: flex;
  justify-content: space-between;
  padding: 20px;
}

.hero-panel div + div {
  border-top: 1px solid var(--line);
}

.hero-panel span {
  color: var(--muted);
}

.tool-shell,
.content-grid {
  margin-top: 28px;
}

.tool-shell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
}

.section-head {
  margin-bottom: 20px;
}

.tool-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
}

.dropzone {
  align-items: center;
  border: 2px dashed #9eb4c0;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 210px;
  padding: 24px;
  text-align: center;
  transition:
    background 160ms ease,
    border-color 160ms ease;
}

.dropzone.dragover,
.dropzone:focus {
  background: var(--soft);
  border-color: var(--accent);
  outline: none;
}

.dropzone input {
  display: none;
}

.drop-icon {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent-dark);
  display: inline-flex;
  font-size: 2rem;
  height: 52px;
  justify-content: center;
  margin-bottom: 14px;
  width: 52px;
}

.dropzone p {
  color: var(--ink);
  font-weight: 760;
  margin-bottom: 4px;
}

.dropzone span,
.status {
  color: var(--muted);
}

.settings-grid,
.preset-grid,
.actions {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

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

label {
  color: var(--ink);
  display: grid;
  font-size: 0.92rem;
  font-weight: 760;
  gap: 8px;
}

.check-row {
  align-items: center;
  background: #fbfcff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  grid-column: 1 / -1;
  min-height: 44px;
  padding: 0 12px;
}

input,
select {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  min-height: 42px;
  padding: 0 12px;
}

input[type="range"] {
  padding: 0;
}

button {
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  font-weight: 800;
  min-height: 44px;
  padding: 0 16px;
}

button.secondary,
.preset {
  background: #e8f1f4;
  color: var(--accent-dark);
}

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

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

.actions {
  grid-template-columns: minmax(0, 1fr) 110px;
}

.status {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 16px;
  padding: 12px 14px;
}

.preview-panel {
  min-width: 0;
}

.preview-panel canvas {
  aspect-ratio: 4 / 3;
  background:
    linear-gradient(45deg, #e3e9f0 25%, transparent 25%),
    linear-gradient(-45deg, #e3e9f0 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e3e9f0 75%),
    linear-gradient(-45deg, transparent 75%, #e3e9f0 75%);
  background-color: #fff;
  background-position:
    0 0,
    0 10px,
    10px -10px,
    -10px 0;
  background-size: 20px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: block;
  max-height: 620px;
  max-width: 100%;
  object-fit: contain;
  width: 100%;
}

.meta-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
  margin: 14px 0 0;
}

.meta-grid div {
  background: #fbfcff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

dt {
  color: var(--ink);
  font-weight: 800;
  margin-bottom: 4px;
}

dd {
  margin: 0;
}

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

.content-grid .section-head {
  grid-column: 1 / -1;
}

article,
.page section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
}

article a,
.page a {
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

footer {
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: center;
  padding: 26px 5vw 34px;
}

footer span {
  color: var(--muted);
}

.page {
  max-width: 880px;
  padding-top: 52px;
}

.page h1 {
  font-size: clamp(2.15rem, 6vw, 4rem);
  max-width: 820px;
}

.page section {
  margin-bottom: 18px;
}

.page ol,
.page ul {
  color: var(--muted);
  line-height: 1.72;
  padding-left: 22px;
}

@media (max-width: 860px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    padding-bottom: 16px;
    padding-top: 16px;
  }

  nav {
    justify-content: flex-start;
  }

  .hero,
  .tool-grid,
  .content-grid,
  .settings-grid,
  .actions {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 44px;
  }

  .tool-shell {
    padding: 20px;
  }
}
