:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --surface: #ffffff;
  --ink: #18202f;
  --muted: #5d687a;
  --line: #d9dee8;
  --accent: #0f766e;
  --accent-dark: #0b5f59;
  --accent-soft: #e6f4f2;
  --warning: #9f4f12;
  --shadow: 0 18px 45px rgba(19, 31, 50, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}

a {
  color: inherit;
}

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 22px 24px;
}

.brand {
  font-weight: 800;
  text-decoration: none;
  letter-spacing: 0;
}

.nav,
.site-footer {
  flex-wrap: wrap;
}

.nav {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 15px;
}

.nav a,
.site-footer a {
  text-decoration: none;
}

.nav a:hover,
.site-footer a:hover {
  color: var(--accent);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 460px);
  gap: 42px;
  align-items: center;
  max-width: 1120px;
  margin: 0 auto;
  padding: 54px 24px 64px;
}

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

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 13px;
}

h1,
h2 {
  line-height: 1.15;
}

h1 {
  margin: 0;
  font-size: clamp(36px, 6vw, 68px);
}

h2 {
  margin: 0 0 12px;
  font-size: 24px;
}

.lead {
  margin: 20px 0;
  color: var(--muted);
  font-size: 19px;
  max-width: 600px;
}

.privacy-note {
  display: inline-block;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #b9ded8;
  background: var(--accent-soft);
  color: #155e56;
  border-radius: 8px;
  font-size: 15px;
}

.converter {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
}

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

label {
  font-weight: 700;
  font-size: 14px;
}

input[type="number"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

input[type="number"] {
  height: 44px;
  padding: 8px 10px;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.file-control {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.file-picker {
  flex: 0 0 auto;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

.file-name {
  min-width: 0;
  color: var(--muted);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-panel {
  display: grid;
  place-items: center;
  min-height: 292px;
  margin: 18px 0;
  border: 1px dashed #bfc8d8;
  border-radius: 8px;
  background:
    linear-gradient(45deg, #eef1f6 25%, transparent 25%),
    linear-gradient(-45deg, #eef1f6 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eef1f6 75%),
    linear-gradient(-45deg, transparent 75%, #eef1f6 75%);
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

.preview-empty {
  max-width: 220px;
  text-align: center;
  color: var(--muted);
}

.preview-canvas-wrap {
  position: relative;
  width: min(256px, 100%);
  aspect-ratio: 1;
}

#previewCanvas {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  cursor: crosshair;
}

.hotspot-marker {
  position: absolute;
  width: 17px;
  height: 17px;
  border: 2px solid #e11d48;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.hotspot-marker::before,
.hotspot-marker::after {
  content: "";
  position: absolute;
  background: #e11d48;
}

.hotspot-marker::before {
  left: 50%;
  top: -7px;
  width: 2px;
  height: 27px;
  transform: translateX(-50%);
}

.hotspot-marker::after {
  top: 50%;
  left: -7px;
  width: 27px;
  height: 2px;
  transform: translateY(-50%);
}

.hotspot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.status {
  min-height: 24px;
  margin: 14px 0;
  color: var(--muted);
  font-size: 14px;
}

.status.warning {
  color: var(--warning);
}

.primary-button {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.primary-button:hover:not(:disabled) {
  background: var(--accent-dark);
}

.primary-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.content-band {
  background: #fff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px 24px;
}

.content-grid p,
.page p,
.page li {
  color: var(--muted);
}

.page {
  max-width: 820px;
  margin: 0 auto;
  padding: 54px 24px 72px;
}

.page h1 {
  font-size: clamp(34px, 5vw, 54px);
  margin-bottom: 18px;
}

.page h2 {
  margin-top: 34px;
}

.page ul,
.page ol {
  padding-left: 24px;
}

.site-footer {
  justify-content: center;
  color: var(--muted);
  font-size: 14px;
}

.hidden {
  display: none;
}

@media (max-width: 860px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero {
    grid-template-columns: 1fr;
    padding-top: 34px;
  }

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

@media (max-width: 520px) {
  .hero,
  .site-header,
  .site-footer,
  .page {
    padding-left: 16px;
    padding-right: 16px;
  }

  .nav {
    gap: 12px;
  }

  .converter {
    padding: 16px;
  }
}
