@import url("../assets/design-system.css");

:root {
  --bg: #f7f6f3;
  --panel: #ffffff;
  --panel-2: #f1eee8;
  --text: #182220;
  --muted: #4f615d;
  --line: #d8d2c8;
  --accent: #0f766e;
  --accent-2: #185b82;
  --shadow: 0 12px 28px rgba(16, 24, 40, 0.08);
  --radius: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: Poppins, Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(circle at 10% 0%, #ffffff 0%, transparent 45%),
    radial-gradient(circle at 100% 10%, #e6f0ee 0%, transparent 38%),
    var(--bg);
  line-height: 1.55;
}

a {
  color: var(--accent-2);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
  background: rgba(247, 246, 243, 0.88);
}

.container {
  width: min(980px, 92vw);
  margin: 0 auto;
}

.header-inner {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text);
  font-size: 0.95rem;
}

.nav {
  display: flex;
  gap: 1rem;
  flex-wrap: nowrap;
  font-size: 0.92rem;
  align-items: center;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 2px;
}

.nav::-webkit-scrollbar {
  display: none;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
}

.header-cta {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
}

.header-cta:hover {
  border-color: color-mix(in oklab, var(--accent) 36%, #fff);
  text-decoration: none;
}

.page {
  padding: 2.2rem 0 2.6rem;
}

h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.8rem, 4.2vw, 2.55rem);
}

.lead {
  margin: 0 0 1.25rem;
  color: var(--muted);
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem;
}

.inputs {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.8rem;
}

label {
  display: grid;
  gap: 0.3rem;
  font-weight: 700;
  font-size: 0.9rem;
}

input,
select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 0.6rem 0.65rem;
  font: inherit;
}

input:focus,
select:focus {
  outline: 2px solid color-mix(in oklab, var(--accent) 22%, #fff);
  outline-offset: 1px;
  border-color: var(--accent);
}

.result {
  display: block;
  width: 100%;
  margin-top: 0.9rem;
  padding: 0.8rem;
  border-radius: var(--radius-sm);
  background: color-mix(in oklab, var(--accent) 10%, #fff);
  border: 1px solid color-mix(in oklab, var(--accent) 28%, #fff);
  font-weight: 700;
}

.formula {
  margin-top: 0.7rem;
  font-size: 0.87rem;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 0.6rem;
}

.tool-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.8rem;
  flex-wrap: wrap;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 0.66rem 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(120deg, var(--accent-2), var(--accent));
}

.btn-secondary {
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.related-section {
  margin-top: 1rem;
}

.seo-section,
.faq-section,
.internal-section {
  margin-top: 1rem;
}

.seo-section h2,
.faq-section h2,
.internal-section h2,
.related-section h2 {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
}

.seo-section p,
.internal-section p,
.related-section p {
  margin: 0 0 0.45rem;
  color: var(--muted);
}

.intent-list {
  margin: 0.3rem 0 0;
  padding: 0.52rem 0.6rem;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  color: #243130;
  font-size: 0.83rem;
}

.faq-list {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.faq-list details {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 0.55rem 0.6rem;
}

.faq-list summary {
  cursor: pointer;
  font-weight: 700;
}

.faq-list p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.keyword-library {
  margin-top: 0.65rem;
}

.keyword-library summary {
  cursor: pointer;
  font-weight: 700;
}

.keyword-library pre {
  margin: 0.5rem 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--panel-2);
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 0.6rem;
  color: #243130;
  font-size: 0.83rem;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
}

.internal-links {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  margin-top: 0.55rem;
}

.related-link {
  display: block;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 0.5rem 0.6rem;
  color: var(--text);
  text-decoration: none;
}

.related-link:hover {
  border-color: color-mix(in oklab, var(--accent) 36%, #fff);
  text-decoration: none;
}

.related-link.active {
  border-color: color-mix(in oklab, var(--accent) 42%, #fff);
  background: color-mix(in oklab, var(--accent) 10%, #fff);
}

.page-footer {
  border-top: 1px solid var(--line);
  margin-top: 1.6rem;
  padding-top: 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
}

.footer-grid h3 {
  margin: 0 0 0.3rem;
  font-size: 0.95rem;
  color: var(--text);
}

.footer-links {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem;
}

.footer-note {
  margin: 0.55rem 0 0;
  font-size: 0.86rem;
  color: var(--muted);
}

@media (pointer: coarse) {
  .btn,
  .header-cta,
  .related-link,
  .internal-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .nav a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding-inline: 0.3rem;
  }

  input,
  select {
    min-height: 44px;
    font-size: 16px;
  }

  .tool-actions {
    gap: 0.75rem;
  }
}

@media (max-width: 760px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0.4rem;
    padding-top: 0.42rem;
    padding-bottom: 0.48rem;
  }

  .nav {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (min-width: 700px) {
  .internal-links,
  .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-grid {
    grid-template-columns: 1.2fr 1fr;
    align-items: start;
  }

  .footer-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
