:root {
  --bg: #f6f8f7;
  --surface: #ffffff;
  --border: #e3e8e6;
  --text: #1f2933;
  --text-soft: #5b6b76;
  --primary: #0f766e;
  --primary-dark: #0b5d57;
  --primary-soft: #e6f2f0;
  --accent: #d97706;
  --accent-dark: #b45309;
  --accent-soft: #fdf3e3;
  --green: #10b981;
  --red: #ef4444;
  --gray: #9ca3af;
  --shadow: 0 10px 30px rgba(15, 40, 45, 0.08);
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
}

.container {
  width: min(1000px, 92%);
  margin: 0 auto;
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
}

.logo-mark { font-size: 22px; }
.logo-text { font-size: 20px; letter-spacing: 0.2px; }

.site-nav {
  display: flex;
  gap: 22px;
  align-items: center;
}

.site-nav a {
  color: var(--text-soft);
  text-decoration: none;
  font-size: 15px;
}

.site-nav a:hover { color: var(--primary); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 14px rgba(15, 118, 110, 0.35);
}

.btn-accent {
  background: var(--accent);
  color: #fff;
}

.btn-accent:hover {
  background: var(--accent-dark);
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35);
}

.btn-lg { padding: 14px 24px; font-size: 16px; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-soft);
}

.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn:active { transform: translateY(1px); }

.btn-header { white-space: nowrap; }

/* ---------- hero ---------- */
.hero {
  padding: 72px 0 60px;
  text-align: center;
  background:
    radial-gradient(1200px 400px at 50% -10%, rgba(15, 118, 110, 0.10), transparent 60%);
}

.hero-badge {
  display: inline-block;
  margin: 0 0 18px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
}

.hero h1 {
  margin: 0 0 14px;
  font-size: 48px;
  letter-spacing: -0.5px;
  color: var(--primary-dark);
}

.hero-sub {
  max-width: 640px;
  margin: 0 auto 36px;
  font-size: 18px;
  color: var(--text-soft);
}

/* ---------- analyze form ---------- */
.analyze-form { max-width: 680px; margin: 0 auto; }

.analyze-field {
  display: flex;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  box-shadow: var(--shadow);
}

.analyze-field:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

#link-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 16px;
  padding: 10px 12px;
  font-family: inherit;
  color: var(--text);
  min-width: 0;
}

#link-input::placeholder { color: #93a1ac; }

.field-note { margin: 14px 0 0; font-size: 13px; color: var(--text-soft); }

.field-hint {
  margin: 10px 0 0;
  padding: 10px 14px;
  background: #fdecea;
  border: 1px solid #f5c6c2;
  color: #b91c1c;
  border-radius: 8px;
  font-size: 14px;
}

/* ---------- loading ---------- */
.loading { margin-top: 28px; color: var(--text-soft); }

.spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto 10px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- result ---------- */
.result { padding: 10px 0 70px; }

.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  animation: fadeIn 0.35s ease;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.result-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.result-org { font-size: 20px; font-weight: 700; margin: 0; }

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.meta-chip {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 14px;
  color: var(--text-soft);
  white-space: nowrap;
}

.meta-chip b { color: var(--text); }

.tonality {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
  align-items: center;
  padding: 18px;
  background: var(--bg);
  border-radius: 12px;
  margin-bottom: 20px;
}

.donut {
  width: 140px;
  height: 140px;
  margin: 0 auto;
  border-radius: 50%;
  position: relative;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 26px;
  background: var(--bg);
  border-radius: 50%;
}

.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.donut-center b { font-size: 24px; color: var(--text); }
.donut-center span { font-size: 12px; color: var(--text-soft); }

.legend { display: flex; flex-direction: column; gap: 10px; }

.legend-row { display: flex; align-items: center; gap: 10px; font-size: 15px; }

.legend-dot { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.legend-name { color: var(--text-soft); }
.legend-value { margin-left: auto; font-weight: 600; }

.block { margin-bottom: 18px; }
.block:last-child { margin-bottom: 0; }

.block h3 { margin: 0 0 8px; font-size: 16px; color: var(--text); }

.verdict {
  background: var(--primary-soft);
  border-left: 4px solid var(--primary);
  padding: 14px 16px;
  border-radius: 8px;
  color: var(--primary-dark);
}

.list { margin: 0; padding: 0; list-style: none; }

.list li { padding: 6px 0; }

.quote {
  background: var(--bg);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 0 0 12px;
}

.quote-label { font-size: 13px; color: var(--text-soft); display: block; margin-bottom: 6px; }

.quote-text {
  margin: 0;
  font-style: italic;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.result-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- sections ---------- */
.section { padding: 56px 0; }
.section-alt { background: #eef4f2; }

.section-title {
  margin: 0 0 28px;
  font-size: 28px;
  color: var(--primary-dark);
  text-align: center;
}

.section-text {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  color: var(--text-soft);
  font-size: 17px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}

.step-num {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 12px;
}

.step h3 { margin: 0 0 8px; font-size: 17px; }
.step p { margin: 0; color: var(--text-soft); font-size: 15px; }

/* ---------- footer ---------- */
.site-footer {
  background: #16282c;
  color: #c8d4d7;
  font-size: 14px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 28px;
  padding: 44px 0 28px;
}

.footer-col h4 { margin: 0 0 12px; color: #fff; font-size: 15px; }

.footer-col .logo-text { color: #fff; font-size: 18px; }

.footer-col a {
  display: block;
  color: #c8d4d7;
  text-decoration: none;
  margin-bottom: 8px;
}

.footer-col a:hover { color: #7fd8c9; }

.footer-col p { margin: 12px 0 0; }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 18px 0 26px;
  color: #93a8ad;
}

.footer-legal { margin: 0; }

.footer-bottom p { margin: 0; }

/* ---------- legal pages ---------- */
.page {
  padding: 48px 0 72px;
  min-height: 55vh;
}

.page h1 { color: var(--primary-dark); font-size: 30px; }

.page h2 { font-size: 20px; margin-top: 30px; color: var(--primary-dark); }

.page p, .page li { color: var(--text-soft); }

.page ul { padding-left: 22px; }

.page .last-updated { color: #93a1ac; font-size: 13px; margin-bottom: 8px; }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .hero h1 { font-size: 36px; }
  .site-nav { display: none; }
  .analyze-field { flex-direction: column; }
  .btn-lg { width: 100%; }
  .tonality { grid-template-columns: 1fr; text-align: center; }
  .result-top { flex-direction: column; align-items: flex-start; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 520px) {
  .hero { padding: 44px 0 40px; }
  .result-card { padding: 18px; }
  .footer-inner { grid-template-columns: 1fr; }
}