:root {
  --bg-1: #8ef3c0;
  --bg-2: #22d3ee;
  --text-main: #041317;
  --text-muted: rgba(4, 19, 23, 0.78);
  --card: rgba(255, 255, 255, 0.98);
  --card-soft: rgba(255, 255, 255, 0.94);
  --border-soft: rgba(255, 255, 255, 0.8);
  --accent: #22c55e;
  --accent-blue: #0ea5e9;
  --accent-error: #ef4444;
  --accent-warn: #f97316;
  --radius-xl: 24px;
  --radius-pill: 999px;
  --shadow-soft: 0 18px 50px rgba(15, 23, 42, 0.32);
  --shadow-small: 0 12px 28px rgba(15, 23, 42, 0.18);
  --transition-fast: 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* RESET */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-main);
  min-height: 100vh;
  position: relative;
  background: transparent;
}

/* Background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 0% 0%, #bbf7d0 0, transparent 46%),
    radial-gradient(circle at 100% 100%, #38bdf8 0, transparent 40%),
    linear-gradient(135deg, var(--bg-1) 0%, #bef264 22%, #5eead4 55%, var(--bg-2) 100%);
  filter: saturate(1.05);
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.2),
      transparent 35%,
      rgba(0, 0, 0, 0.2)
    ),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.28),
      rgba(255, 255, 255, 0.28) 1px,
      transparent 1px,
      transparent 2px
    );
  mix-blend-mode: soft-light;
  opacity: 0.6;
  pointer-events: none;
}

.bg-layer {
  display: none;
}

/* LAYOUT */
.container {
  width: min(1120px, 100% - 48px);
  margin-inline: auto;
}

/* HEADER */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.96),
    rgba(255, 255, 255, 0.86)
  );
  border-bottom: 1px solid rgba(255, 255, 255, 0.9);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 14px;
}

.logo {
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.08em;
  color: var(--text-main);
  text-decoration: none;
}

.logo span {
  color: var(--accent);
  margin-left: 2px;
}

.nav {
  display: flex;
  gap: 18px;
  font-size: 0.94rem;
}

.nav a {
  text-decoration: none;
  color: rgba(15, 23, 42, 0.7);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-weight: 500;
  transition: background var(--transition-fast), color var(--transition-fast),
    transform var(--transition-fast);
}

.nav a:hover {
  background: rgba(255, 255, 255, 0.96);
  color: var(--text-main);
  transform: translateY(-1px);
}

.nav-toggle {
  display: none;
  border: none;
  background: none;
  padding: 6px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 4px 0;
  border-radius: 999px;
  background: var(--text-main);
}

/* HERO */
.tool-main {
  padding-bottom: 70px;
}

.tool-hero {
  padding-top: 110px;
  padding-bottom: 24px;
}

.tool-kicker {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(5, 20, 22, 0.7);
  margin-bottom: 8px;
}

.tool-title {
  margin: 0 0 8px;
  font-size: clamp(2rem, 2.6vw, 2.8rem);
  letter-spacing: -0.06em;
}

.tool-subtitle {
  margin: 0;
  max-width: 720px;
  font-size: 1rem;
  color: var(--text-muted);
}

/* TOOL LAYOUT */
.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.2fr);
  gap: 24px;
  align-items: flex-start;
}

.tool-card {
  background: var(--card);
  border-radius: var(--radius-xl);
  padding: 20px 22px 22px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.tool-card h2 {
  margin: 0 0 10px;
  font-size: 1.1rem;
}

/* FORM */
.form-row {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

label {
  font-size: 0.86rem;
  font-weight: 600;
  color: rgba(15, 23, 42, 0.9);
}

input,
textarea {
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  padding: 9px 11px;
  font-family: inherit;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.97);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:focus,
textarea:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.4);
}

textarea {
  resize: vertical;
}

.field-hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.field-with-counter {
  position: relative;
}

.char-counter {
  position: absolute;
  right: 8px;
  bottom: 6px;
  font-size: 0.76rem;
  color: rgba(15, 23, 42, 0.6);
  background: rgba(255, 255, 255, 0.9);
  padding: 2px 7px;
  border-radius: 999px;
}

/* BUTTON */
.btn {
  border-radius: var(--radius-pill);
  padding: 9px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast),
    background var(--transition-fast), color var(--transition-fast);
}

.btn.secondary {
  background: rgba(15, 23, 42, 0.86);
  color: #e5f9ff;
  box-shadow: var(--shadow-small);
}

.btn.secondary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

/* PREVIEW */
.preview-card {
  background: var(--card-soft);
}

.snippet-preview {
  margin-top: 6px;
  margin-bottom: 18px;
  border-radius: 16px;
  background: #fff;
  padding: 14px 14px 16px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.22);
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.snippet-title {
  font-size: 1.02rem;
  color: #1a0dab;
  margin: 0 0 4px;
}

.snippet-url {
  font-size: 0.78rem;
  color: #006621;
  margin: 0 0 6px;
}

.snippet-desc {
  font-size: 0.86rem;
  color: #4b5563;
  margin: 0;
}

/* ANALYSIS */
.analysis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin: 8px 0 16px;
}

.analysis-item {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 16px;
  padding: 8px 10px;
  border: 1px solid rgba(148, 163, 184, 0.5);
}

.analysis-label {
  margin: 0 0 4px;
  font-size: 0.8rem;
  color: rgba(15, 23, 42, 0.7);
}

.analysis-value {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
}

.analysis-score {
  grid-column: 1 / -1;
}

.score-value {
  font-size: 1.1rem;
}

/* status colors */
.status-ok {
  color: #16a34a;
}

.status-warn {
  color: var(--accent-warn);
}

.status-bad {
  color: var(--accent-error);
}

/* TIPS */
.tips-card {
  margin-top: 10px;
  padding: 10px 12px 12px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.94);
  color: #e5e7eb;
  font-size: 0.86rem;
}

.tips-card h3 {
  margin: 0 0 4px;
  font-size: 0.9rem;
}

.tips-card ul {
  margin: 4px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

/* FOOTER */
.site-footer {
  padding: 22px 0 26px;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(18px);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 0.84rem;
  color: rgba(15, 23, 42, 0.82);
}

.footer-tagline {
  margin: 0;
}

/* RESPONSIVE */
@media (max-width: 960px) {
  .tool-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .nav {
    position: absolute;
    inset-inline: 0;
    top: 54px;
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 24px 14px;
    background: rgba(255, 255, 255, 0.97);
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 220ms ease-out, opacity 200ms ease-out;
  }

  .nav.open {
    max-height: 80vh;
    opacity: 1;
    overflow-y: auto;
  }

  .nav-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .tool-hero {
    padding-top: 96px;
  }

  .tool-layout {
    gap: 18px;
  }
}
