@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Fraunces:opsz,wght@9..144,300;9..144,500;9..144,700&display=swap');

:root {
  --bg: #0B0F14;
  --surface: #141A23;
  --surface-hover: #1B2331;
  --border: #1E2A38;
  --border-focus: #3B7BF7;
  --text: #E8ECF1;
  --text-muted: #7A8BA3;
  --accent: #3B7BF7;
  --accent-glow: rgba(59, 123, 247, 0.15);
  --accent-2: #22D693;
  --accent-2-glow: rgba(34, 214, 147, 0.12);
  --warning: #F5A623;
  --radius: 12px;
  --radius-lg: 20px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── HEADER ── */
header {
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(11, 15, 20, 0.85);
  backdrop-filter: blur(20px);
  z-index: 100;
}

.logo {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 1.45rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--accent), #6C5CE7);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
  font-weight: 700;
  font-family: 'DM Sans', sans-serif;
}

nav { display: flex; gap: 4px; flex-wrap: wrap; }

nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.86rem;
  padding: 8px 14px;
  border-radius: 8px;
  transition: all 0.2s;
  font-weight: 500;
  white-space: nowrap;
}

nav a:hover { color: var(--text); background: var(--surface); }
nav a.active { background: var(--accent-glow); color: var(--accent); }

/* ── HERO ── */
.hero {
  text-align: center;
  padding: 64px 32px 40px;
  max-width: 720px;
  margin: 0 auto;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 300px;
  background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero h1 {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.9rem, 5vw, 2.8rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.hero h1 span { color: var(--accent); }
.hero h1 .green { color: var(--accent-2); }
.hero h1 .yellow { color: var(--warning); }

.hero p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 540px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  line-height: 1.7;
}

/* ── BREADCRUMBS ── */
.breadcrumb {
  max-width: 960px;
  margin: 20px auto 0;
  padding: 0 32px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { margin: 0 6px; opacity: 0.5; }

/* ── AD SLOTS ── */
.ad-slot {
  max-width: 728px;
  margin: 0 auto 36px;
  height: 90px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ad-slot-sidebar {
  width: 100%;
  height: 250px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.73rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 24px;
}

/* ── TOOL CARDS (Home Page) ── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  max-width: 960px;
  margin: 0 auto 56px;
  padding: 0 32px;
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
}

.tool-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  opacity: 0;
  transition: opacity 0.25s;
}

.tool-card:nth-child(1)::after { background: linear-gradient(90deg, var(--accent), #5B9BFF); }
.tool-card:nth-child(2)::after { background: linear-gradient(90deg, var(--accent-2), #44F0B8); }
.tool-card:nth-child(3)::after { background: linear-gradient(90deg, var(--warning), #FFD166); }
.tool-card:nth-child(4)::after { background: linear-gradient(90deg, #B064FF, #D4A0FF); }

.tool-card:hover {
  border-color: var(--border-focus);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.tool-card:hover::after { opacity: 1; }

.tool-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 18px;
}

.tool-card:nth-child(1) .tool-icon { background: rgba(59,123,247,0.12); }
.tool-card:nth-child(2) .tool-icon { background: rgba(34,214,147,0.12); }
.tool-card:nth-child(3) .tool-icon { background: rgba(245,166,35,0.12); }
.tool-card:nth-child(4) .tool-icon { background: rgba(176,100,255,0.12); }

.tool-card h3 { font-size: 1.04rem; font-weight: 600; margin-bottom: 8px; }
.tool-card p { color: var(--text-muted); font-size: 0.84rem; line-height: 1.55; }

/* ── CALCULATOR LAYOUT ── */
.calc-wrapper {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 32px 64px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
}

.calc-main {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
}

.calc-main h2 {
  font-family: 'Fraunces', serif;
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.calc-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 32px;
  line-height: 1.6;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}

.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-group.full { grid-column: 1 / -1; }

label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-prefix, .input-suffix {
  position: absolute;
  color: var(--text-muted);
  font-size: 0.92rem;
  pointer-events: none;
  font-weight: 500;
}

.input-prefix { left: 14px; }
.input-suffix { right: 14px; }

input[type="number"], input[type="text"], select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s;
  outline: none;
  -moz-appearance: textfield;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

input:focus, select:focus { border-color: var(--accent); }

.has-prefix input { padding-left: 32px; }
.has-suffix input { padding-right: 36px; }

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237A8BA3' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.btn-calculate {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--accent), #2B6BF0);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s;
  letter-spacing: 0.02em;
}

.btn-calculate:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(59, 123, 247, 0.3);
}

.btn-calculate.green { background: linear-gradient(135deg, var(--accent-2), #1AA875); }
.btn-calculate.green:hover { box-shadow: 0 6px 24px rgba(34, 214, 147, 0.3); }
.btn-calculate.yellow { background: linear-gradient(135deg, var(--warning), #E09300); }
.btn-calculate.yellow:hover { box-shadow: 0 6px 24px rgba(245, 166, 35, 0.3); }
.btn-calculate.purple { background: linear-gradient(135deg, #B064FF, #8A3FE0); }
.btn-calculate.purple:hover { box-shadow: 0 6px 24px rgba(176, 100, 255, 0.3); }

/* ── RESULTS ── */
.results {
  margin-top: 32px;
  display: none;
  animation: fadeUp 0.4s ease;
}

.results.show { display: block; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.results-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.result-big {
  font-family: 'Fraunces', serif;
  font-size: 2.3rem;
  font-weight: 700;
  color: var(--accent);
}

.result-big.green { color: var(--accent-2); }
.result-big.purple { color: #B064FF; }

.result-label {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.result-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 18px 16px;
}

.result-card .label {
  font-size: 0.73rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.result-card .value { font-size: 1.2rem; font-weight: 600; }
.result-card .value.green { color: var(--accent-2); }
.result-card .value.yellow { color: var(--warning); }
.result-card .value.purple { color: #B064FF; }

/* ── CHART ── */
.chart-container {
  margin-top: 28px;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
  height: 220px;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 160px;
  padding-top: 10px;
}

.bar {
  flex: 1;
  border-radius: 3px 3px 0 0;
  position: relative;
  transition: all 0.3s ease;
  min-width: 4px;
}

.bar:hover { opacity: 0.8; }

.chart-legend {
  display: flex;
  gap: 20px;
  margin-top: 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
  margin-right: 6px;
  vertical-align: middle;
}

/* ── SIDEBAR ── */
.tip-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.tip-box h4 {
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tip-list { list-style: none; }

.tip-list li {
  font-size: 0.84rem;
  color: var(--text-muted);
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.55;
}

.tip-list li:last-child { border: none; }
.tip-list li strong { color: var(--text); font-weight: 500; }

/* ── OTHER CALCULATORS LINKS ── */
.other-tools {
  margin-top: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.other-tools h4 {
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--text-muted);
}

.other-tools a {
  display: block;
  padding: 10px 14px;
  margin-bottom: 6px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 500;
  background: var(--bg);
  transition: all 0.2s;
}

.other-tools a:last-child { margin-bottom: 0; }
.other-tools a:hover { background: var(--surface-hover); color: var(--accent); }
.other-tools a .emoji { margin-right: 8px; }

/* ── SEO CONTENT ── */
.seo-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 32px 64px;
}

.seo-content article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
}

.seo-content h2 {
  font-family: 'Fraunces', serif;
  font-size: 1.35rem;
  margin-bottom: 16px;
}

.seo-content h3 {
  font-size: 1.05rem;
  margin: 28px 0 10px;
}

.seo-content p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.75;
  margin-bottom: 16px;
}

.seo-content ul {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.75;
  margin-bottom: 16px;
  padding-left: 20px;
}

.seo-content ul li { margin-bottom: 6px; }

/* ── FAQ ── */
.faq { margin-top: 32px; }

.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
}

.faq-item:last-child { border: none; }

.faq-q {
  font-weight: 600;
  font-size: 0.96rem;
  margin-bottom: 8px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-q::after { content: '+'; color: var(--accent); font-size: 1.2rem; }
.faq-item.open .faq-q::after { content: '−'; }

.faq-a {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.7;
  display: none;
}

.faq-item.open .faq-a { display: block; }

/* ── FOOTER ── */
footer {
  text-align: center;
  padding: 32px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
}

footer a { color: var(--text-muted); text-decoration: none; }
footer a:hover { color: var(--text); }

.footer-links { margin-top: 8px; }
.footer-links a { margin: 0 8px; }

.disclaimer {
  margin-top: 10px;
  font-size: 0.72rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .calc-wrapper { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .results-grid { grid-template-columns: 1fr; }
  header { padding: 16px 20px; }
  nav { gap: 2px; }
  nav a { padding: 6px 10px; font-size: 0.78rem; }
  .hero { padding: 40px 20px 28px; }
  .tools-grid { padding: 0 20px; grid-template-columns: 1fr 1fr; }
  .calc-wrapper { padding: 0 20px 48px; }
  .seo-content { padding: 0 20px 48px; }
  .calc-main { padding: 24px 20px; }
  .seo-content article { padding: 28px 22px; }
  .breadcrumb { padding: 0 20px; }
}

@media (max-width: 480px) {
  .tools-grid { grid-template-columns: 1fr; }
}
