:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #667085;
  --soft: #f5f7fb;
  --panel: #ffffff;
  --panel-strong: #fbfcfe;
  --line: #d7dee8;
  --line-strong: #b8c3d0;
  --accent: #08756f;
  --accent-dark: #065f59;
  --accent-soft: #e7f5f3;
  --blue: #2457c5;
  --blue-soft: #eaf0ff;
  --amber: #a95d05;
  --amber-soft: #fff3df;
  --shadow: 0 18px 42px rgba(24, 39, 75, 0.08);
  --shadow-soft: 0 10px 28px rgba(24, 39, 75, 0.06);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, #ffffff 0, var(--soft) 320px),
    var(--soft);
  line-height: 1.5;
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  min-height: 68px;
  padding: 12px 28px;
  border-bottom: 1px solid rgba(215, 222, 232, 0.85);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 0 rgba(17, 24, 39, 0.03);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.brand::before {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.32);
  content: "";
}

.topbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}

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

nav a {
  padding: 8px 10px;
  border-radius: 7px;
}

nav a:hover {
  color: var(--accent-dark);
  background: var(--accent-soft);
}

footer a:hover {
  color: var(--accent);
}

.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
  font-size: 13px;
}

.language-switch a {
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
}

.language-switch a.active {
  background: var(--accent);
  color: #fff;
}

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 336px);
  gap: 22px;
  align-items: stretch;
  padding: 30px 0 18px;
}

.hero > div {
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

h1,
h2 {
  margin: 0;
  line-height: 1.12;
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  font-size: 42px;
}

h2 {
  font-size: 26px;
}

.lede {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.ad-unit {
  display: grid;
  place-items: center;
  min-height: 220px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background:
    repeating-linear-gradient(45deg, rgba(215, 222, 232, 0.28), rgba(215, 222, 232, 0.28) 8px, transparent 8px, transparent 16px),
    #f8fafc;
  color: #778394;
  text-align: center;
}

.ad-unit .adsbygoogle {
  width: 100%;
  min-height: inherit;
}

.ad-fallback {
  display: grid;
  place-items: center;
}

.ad-unit span {
  display: block;
  font-weight: 800;
}

.ad-unit small {
  display: block;
  margin-top: 4px;
}

.ad-unit-inline {
  min-height: 92px;
  width: min(100%, 300px);
}

.ad-unit[data-ad-mode="placeholder"] {
  user-select: none;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin: 16px 0 26px;
}

.tool-card {
  position: relative;
  display: block;
  min-height: 142px;
  padding: 17px 17px 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(24, 39, 75, 0.04);
  text-decoration: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.tool-card::before {
  display: block;
  width: 38px;
  height: 6px;
  margin-bottom: 15px;
  border-radius: 999px;
  background: var(--accent);
  content: "";
}

.tool-card:nth-child(2)::before,
.tool-card:nth-child(5)::before {
  background: var(--blue);
}

.tool-card:nth-child(3)::before {
  background: var(--amber);
}

.tool-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.tool-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 17px;
}

.tool-card span {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

.tool-section,
.content-block {
  margin: 18px 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 24px 26px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-strong);
}

.section-head p {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--muted);
}

.content-block {
  padding: 26px;
}

.content-block p {
  max-width: 860px;
  color: var(--muted);
}

.panel {
  display: grid;
  gap: 16px;
  padding: 24px 26px 26px;
}

.file-drop {
  display: grid;
  place-items: center;
  min-height: 142px;
  padding: 18px;
  border: 1px dashed #91a0b4;
  border-radius: 8px;
  background: #f8fbfd;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.file-drop:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.file-drop span {
  margin-top: 8px;
  font-weight: 700;
  color: var(--ink);
}

.file-drop input {
  width: min(92%, 440px);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfd;
}

label {
  display: grid;
  gap: 7px;
  min-width: 150px;
  color: #46515f;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cbd5df;
  border-radius: 7px;
  padding: 10px 11px;
  font: inherit;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(8, 117, 111, 0.14);
}

input[type="range"] {
  width: 220px;
  padding: 0;
  accent-color: var(--accent);
}

textarea {
  resize: vertical;
}

.output-area {
  min-height: 220px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 14px;
  line-height: 1.6;
}

button {
  min-height: 42px;
  padding: 10px 16px;
  border: 0;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(8, 117, 111, 0.18);
  font-weight: 800;
  cursor: pointer;
  transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

button:hover {
  background: var(--accent-dark);
  box-shadow: 0 10px 22px rgba(8, 117, 111, 0.24);
  transform: translateY(-1px);
}

button.secondary {
  background: #344054;
  box-shadow: 0 8px 18px rgba(52, 64, 84, 0.12);
}

button.secondary:hover {
  background: #1f2937;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

.result {
  min-height: 44px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  color: var(--muted);
}

.result:empty {
  display: none;
}

.result a {
  color: var(--accent-dark);
  font-weight: 800;
}

.file-results {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.file-result-row {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
}

.file-result-row strong {
  color: var(--ink);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.stats span {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfd;
  color: #344054;
  font-weight: 800;
}

.two-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
}

.wide {
  grid-column: 1 / -1;
}

footer {
  display: flex;
  justify-content: center;
  gap: 18px;
  padding: 36px 16px;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 960px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

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

  .ad-unit {
    min-height: 110px;
  }

  h1 {
    font-size: 34px;
  }

  .section-head {
    grid-template-columns: 1fr;
  }

  .two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  main {
    width: min(100% - 20px, 1180px);
  }

  .topbar {
    padding: 12px 16px;
  }

  nav a {
    padding: 7px 8px;
  }

  .hero > div,
  .section-head,
  .panel,
  .content-block {
    padding: 18px;
  }

  .tool-grid,
  .stats {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 30px;
  }

  h2 {
    font-size: 23px;
  }

  .controls {
    align-items: stretch;
  }

  .controls > * {
    width: 100%;
  }

  input[type="range"] {
    width: 100%;
  }
}
