:root {
  --ink: #14212b;
  --muted: #5b6772;
  --line: #d9e2e7;
  --paper: #ffffff;
  --soft: #f5f8f8;
  --teal: #0f766e;
  --teal-dark: #0b4f4b;
  --amber: #d97706;
  --coral: #d84a3a;
  --green: #16803c;
  --blue: #2563a8;
  --shadow: 0 18px 42px rgba(20, 33, 43, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--soft);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

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

.site-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

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

.brand strong {
  display: block;
  font-size: 1.1rem;
  line-height: 1.1;
}

.brand small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

.top-nav,
.site-footer nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.top-nav a,
.site-footer a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 650;
}

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

.hero {
  position: relative;
  min-height: 410px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 34px;
  align-items: center;
  padding: 52px;
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.1), rgba(217, 119, 6, 0.08)),
    radial-gradient(circle at top right, rgba(37, 99, 168, 0.16), transparent 38%),
    var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero:before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(20, 33, 43, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 33, 43, 0.045) 1px, transparent 1px);
  background-size: 34px 34px;
  pointer-events: none;
}

.hero-copy,
.hero-visual {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: 3.1rem;
  line-height: 1.03;
  letter-spacing: 0;
}

.hero-text {
  max-width: 620px;
  margin: 18px 0 0;
  color: #314250;
  font-size: 1.08rem;
}

.hero-actions,
.button-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 22px;
}

.button,
.card-action {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 760;
  text-decoration: none;
  cursor: pointer;
}

.button.primary,
.card-action {
  color: #fff;
  background: var(--teal);
}

.button.primary:hover,
.card-action:hover {
  background: var(--teal-dark);
}

.button.secondary {
  color: var(--teal-dark);
  background: #e6f3f1;
  border-color: #b7d8d4;
}

.button.subtle {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

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

.hero-visual {
  background: #0f2027;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  box-shadow: 0 24px 50px rgba(20, 33, 43, 0.22);
  padding: 22px;
}

.window-strip {
  height: 28px;
  border-radius: 6px;
  background:
    radial-gradient(circle at 18px 14px, #ff6b5b 0 5px, transparent 6px),
    radial-gradient(circle at 38px 14px, #f2b84b 0 5px, transparent 6px),
    radial-gradient(circle at 58px 14px, #34c27a 0 5px, transparent 6px),
    rgba(255, 255, 255, 0.1);
  margin-bottom: 18px;
}

.visual-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.visual-grid span {
  min-height: 86px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  font-weight: 850;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.09);
}

.visual-grid span:nth-child(2n) {
  background: rgba(217, 119, 6, 0.34);
}

.visual-grid span:nth-child(3n) {
  background: rgba(15, 118, 110, 0.36);
}

.quick-search {
  display: grid;
  gap: 8px;
  margin: 24px 0;
}

.quick-search label,
.full-label,
.form-grid label,
.file-box {
  color: #253441;
  font-weight: 760;
}

.quick-search input,
.form-grid input,
.form-grid select,
.full-label textarea,
.code-output,
.file-box,
.output-box {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.quick-search input,
.form-grid input,
.form-grid select {
  min-height: 46px;
  padding: 10px 12px;
  margin-top: 6px;
}

.full-label input,
.utility-panel > input,
.utility-panel textarea,
.utility-panel select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

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

.category-card {
  min-height: 220px;
  display: grid;
  grid-template-columns: 120px 1fr;
  grid-template-rows: 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 22px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(20, 33, 43, 0.05);
}

.category-card h2 {
  margin: 0 0 8px;
  font-size: 1.45rem;
  line-height: 1.18;
}

.category-card p {
  margin: 0;
  color: var(--muted);
}

.category-card .card-action {
  grid-column: 1 / -1;
}

.category-card.is-hidden {
  display: none;
}

.category-art {
  width: 112px;
  height: 104px;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
}

.category-art:before,
.category-art:after,
.category-art span:before,
.category-art span:after {
  content: "";
  position: absolute;
  border-radius: 6px;
}

.notes-art { background: #fef3c7; }
.pdf-art { background: #fee2e2; }
.zip-art { background: #dbeafe; }
.image-art { background: #dcfce7; }
.text-art { background: #ede9fe; }
.list-art { background: #fce7f3; }
.random-art { background: #cffafe; }
.time-art { background: #e0e7ff; }
.number-art { background: #ffedd5; }
.dns-art { background: #d1fae5; }

.category-art:before {
  width: 70px;
  height: 54px;
  left: 20px;
  top: 22px;
  background: #fff;
  border: 2px solid rgba(20, 33, 43, 0.16);
}

.category-art:after {
  width: 52px;
  height: 10px;
  left: 30px;
  top: 38px;
  background: currentColor;
  opacity: 0.3;
  box-shadow: 0 18px 0 currentColor;
}

.notes-art { color: var(--amber); }
.pdf-art { color: var(--coral); }
.zip-art { color: var(--blue); }
.image-art { color: var(--green); }
.text-art { color: #7c3aed; }
.list-art { color: #be185d; }
.random-art { color: #0891b2; }
.time-art { color: #4f46e5; }
.number-art { color: #ea580c; }
.dns-art { color: var(--teal); }

.workspace {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  margin-top: 28px;
  align-items: start;
}

.tool-index {
  position: sticky;
  top: 12px;
  display: grid;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.tool-tab {
  width: 100%;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-weight: 760;
  padding: 10px 12px;
  cursor: pointer;
}

.tool-tab:hover,
.tool-tab.active {
  color: var(--teal-dark);
  background: #e6f3f1;
  border-color: #b7d8d4;
}

.tool-panels {
  min-width: 0;
}

.tool-panel {
  display: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 10px 25px rgba(20, 33, 43, 0.05);
}

.tool-panel.active {
  display: block;
}

.panel-heading h2,
.trust-band h2,
.content-grid h2 {
  margin: 0 0 8px;
  line-height: 1.18;
  letter-spacing: 0;
}

.panel-heading p:last-child,
.trust-band p,
.content-grid p {
  margin: 0;
  color: var(--muted);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.full-label {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.full-label textarea,
.code-output {
  min-height: 140px;
  padding: 12px;
  resize: vertical;
}

.file-box {
  display: grid;
  gap: 8px;
  padding: 16px;
  margin-top: 18px;
  cursor: pointer;
}

.file-box input {
  width: 100%;
}

.file-box span,
.metrics {
  color: var(--muted);
  font-weight: 560;
}

.metrics {
  margin-top: 12px;
}

.check-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.check-row label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-weight: 700;
}

.preview-wrap {
  margin-top: 16px;
  min-height: 80px;
}

.preview-wrap img {
  display: none;
  max-width: 100%;
  max-height: 360px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}

.output-box {
  min-height: 120px;
  padding: 14px;
  margin-top: 18px;
}

.code-output {
  white-space: pre-wrap;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.92rem;
}

.trust-band {
  display: grid;
  grid-template-columns: 0.7fr 1.2fr auto;
  gap: 20px;
  align-items: center;
  margin-top: 28px;
  padding: 24px;
  border: 1px solid #b7d8d4;
  border-radius: 8px;
  background: #e6f3f1;
}

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

.content-grid article {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
}

.seo-tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.seo-tool-card {
  min-width: 0;
  display: grid;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 10px 25px rgba(20, 33, 43, 0.05);
}

.seo-tool-card h2,
.seo-tool-card p {
  margin: 0;
}

.tool-page-hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  align-items: center;
  padding: 36px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.tool-page-hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
}

.tool-page-hero p {
  color: var(--muted);
}

.tool-note {
  padding: 18px;
  background: #e6f3f1;
  border: 1px solid #b7d8d4;
  border-radius: 8px;
  color: #24423f;
}

.utility-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
  margin-top: 22px;
}

.utility-panel {
  min-width: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 10px 25px rgba(20, 33, 43, 0.05);
}

.utility-panel h2,
.utility-panel h3,
.utility-panel p {
  margin-top: 0;
}

.utility-panel p,
.utility-panel li {
  color: var(--muted);
}

.preview-image {
  display: none;
  max-width: 100%;
  max-height: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  margin-top: 14px;
}

.qr-canvas {
  display: block;
  max-width: 100%;
  min-height: 180px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  margin-top: 14px;
}

.qr-canvas canvas,
.qr-canvas img {
  display: block;
  max-width: 100%;
  height: auto;
}

.status-line {
  margin-top: 12px;
  color: var(--muted);
  font-weight: 650;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.mini-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  background: #fff;
}

.mini-table th,
.mini-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.mini-table th {
  background: #f5f8f8;
}

.mini-table input,
.utility-panel select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
}

.result-box,
.preview-box {
  width: 100%;
  min-height: 130px;
  padding: 14px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfc;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.preview-box canvas,
.preview-box img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 12px 0;
  border: 1px solid var(--line);
}

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

.sub-tool {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  margin-top: 18px;
}

.sub-tool h3 {
  margin-top: 0;
}

.canvas-stage {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(45deg, #eef4f6 25%, transparent 25%),
    linear-gradient(-45deg, #eef4f6 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eef4f6 75%),
    linear-gradient(-45deg, transparent 75%, #eef4f6 75%);
  background-size: 22px 22px;
  background-position: 0 0, 0 11px, 11px -11px, -11px 0;
  margin-top: 14px;
  padding: 12px;
}

.canvas-stage canvas {
  max-width: 100%;
  height: auto;
  display: block;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 32px 0 42px;
  color: var(--muted);
}

.site-footer p {
  margin: 0;
}

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

  .hero,
  .category-grid,
  .workspace,
  .trust-band,
  .content-grid,
  .seo-tool-grid,
  .tool-page-hero,
  .utility-layout,
  .two-col {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 30px;
  }

  h1 {
    font-size: 2.35rem;
  }

  .tool-index {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

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

  h1 {
    font-size: 2rem;
  }

  .hero-visual {
    display: none;
  }

  .category-card {
    grid-template-columns: 1fr;
  }

  .category-art {
    width: 100%;
    max-width: 180px;
  }

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

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

  .button,
  .card-action {
    width: 100%;
  }
}
