:root {
  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-code: "IBM Plex Mono", Consolas, monospace;
  --bg-0: #f3f6f7;
  --bg-1: #ffffff;
  --ink-0: #0f1720;
  --ink-1: #3b4b5a;
  --accent: #0b7a75;
  --accent-2: #ee6c4d;
  --line: #d9e1e4;
  --ok: #157f3b;
  --warn: #9a3412;
  --error: #b91c1c;
  --shadow: 0 10px 30px rgba(15, 23, 32, 0.08);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-display);
  color: var(--ink-0);
  background:
    radial-gradient(circle at 10% 20%, rgba(11, 122, 117, 0.1), transparent 35%),
    radial-gradient(circle at 80% 0%, rgba(238, 108, 77, 0.12), transparent 30%),
    linear-gradient(180deg, #f8fbfc 0%, #eef3f4 100%);
  line-height: 1.5;
}

a {
  color: inherit;
}

.site-shell {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

.site-header {
  padding: 2rem 0 1rem;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: clamp(1.3rem, 2vw, 1.6rem);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(11, 122, 117, 0.24);
}

.brand-mark {
  color: var(--accent);
}

.badge {
  font-size: 0.8rem;
  color: var(--ink-1);
  border: 1px solid var(--line);
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
}

.hero {
  margin: 1.2rem 0 2rem;
  padding: 2rem;
  border-radius: var(--radius-lg);
  background: var(--bg-1);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.hero::after {
  content: "";
  position: absolute;
  width: 200px;
  height: 200px;
  right: -50px;
  bottom: -50px;
  border-radius: 50%;
  background: linear-gradient(45deg, rgba(11, 122, 117, 0.2), rgba(238, 108, 77, 0.15));
  z-index: -1;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 3.8vw, 3.2rem);
  line-height: 1.08;
}

.hero p {
  margin: 0.9rem 0 0;
  color: var(--ink-1);
  max-width: 70ch;
}

.section-title {
  margin: 0 0 1rem;
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.tool-card {
  text-decoration: none;
  border-radius: var(--radius-md);
  padding: 1rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transform: translateY(0);
  transition: transform 220ms ease, border-color 220ms ease;
}

.tool-card:hover,
.tool-card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.tool-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.tool-card p {
  margin: 0.45rem 0 0;
  color: var(--ink-1);
  font-size: 0.95rem;
}

.ad-slot {
  border: 1px dashed #9db1b6;
  background: rgba(255, 255, 255, 0.78);
  border-radius: var(--radius-sm);
  color: #4f6971;
  display: block;
  text-align: left;
  font-size: 0.8rem;
  min-height: 96px;
  padding: 0.5rem;
  margin: 1rem 0 1.4rem;
}

.ad-slot-note {
  margin: 0 0 0.35rem;
  color: #5b7078;
  font-size: 0.75rem;
}

.ad-unit {
  display: block;
  width: 100%;
  min-height: 90px;
}

.tool-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 1rem 0 2rem;
}

.panel {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  padding: 1rem;
}

.panel h2 {
  margin: 0 0 0.8rem;
  font-size: 1.1rem;
}

.content-block {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  padding: 1rem;
  margin: 0 0 1.2rem;
}

.content-block h2,
.content-block h3 {
  margin-top: 0;
}

.content-block p,
.content-block li {
  color: var(--ink-1);
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.control-group label {
  font-size: 0.82rem;
  color: var(--ink-1);
}

.control-input,
.control-select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #c6d2d6;
  border-radius: var(--radius-sm);
  background: #fbfdfd;
  color: #0b1219;
  padding: 0.6rem 0.75rem;
  font-family: inherit;
  font-size: 0.92rem;
}

.control-input[type="color"] {
  padding: 0.2rem;
}

.qr-preview-wrap {
  border: 1px solid #c6d2d6;
  border-radius: var(--radius-sm);
  min-height: 280px;
  display: grid;
  place-items: center;
  background: #fbfdfd;
}

.qr-preview {
  padding: 0.8rem;
}

.qr-preview img,
.qr-preview canvas {
  max-width: 100%;
  height: auto;
}

.input-field,
.output-field {
  width: 100%;
  min-height: 260px;
  border: 1px solid #c6d2d6;
  border-radius: var(--radius-sm);
  background: #fbfdfd;
  color: #0b1219;
  padding: 0.8rem;
  font-family: var(--font-code);
  font-size: 0.9rem;
  line-height: 1.6;
  resize: vertical;
}

.output-field {
  background: #f7fafb;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.8rem;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-secondary {
  background: #e6eff1;
  color: #16353e;
}

.status {
  margin-top: 0.8rem;
  font-size: 0.92rem;
  min-height: 1.35rem;
}

.status-ok {
  color: var(--ok);
}

.status-warn {
  color: var(--warn);
}

.status-error {
  color: var(--error);
}

.site-footer {
  padding: 1.2rem 0 2rem;
  color: var(--ink-1);
  font-size: 0.9rem;
}

.fade-in {
  opacity: 0;
  transform: translateY(8px);
  animation: fadeUp 500ms ease forwards;
}

.fade-in:nth-child(2) {
  animation-delay: 90ms;
}

.fade-in:nth-child(3) {
  animation-delay: 180ms;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 900px) {
  .tool-layout {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

@media (max-width: 600px) {
  .hero {
    padding: 1.2rem;
  }

  .panel {
    padding: 0.85rem;
  }

  .input-field,
  .output-field {
    min-height: 220px;
  }
}
