/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #1e293b;
  --text-secondary: #64748b;
  --border: #e2e8f0;
  --success: #16a34a;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
  --max-w: 1100px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ===== Layout ===== */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.25rem; }

/* ===== Header ===== */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); padding: 1rem 0; position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; }
.logo { font-size: 1.5rem; font-weight: 800; color: var(--text); }
.logo span { color: var(--primary); }
.nav-links { display: flex; gap: 1.5rem; list-style: none; flex-wrap: wrap; }
.nav-links a { color: var(--text-secondary); font-weight: 500; font-size: .95rem; transition: color .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--primary); text-decoration: none; }

/* ===== Hero ===== */
.hero { background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%); color: #fff; padding: 3.5rem 0; text-align: center; }
.hero h1 { font-size: 2.25rem; font-weight: 800; margin-bottom: .75rem; }
.hero p { font-size: 1.15rem; opacity: .9; max-width: 600px; margin: 0 auto; }

/* ===== Tool Cards Grid ===== */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; padding: 2.5rem 0; }
.tool-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.75rem; transition: box-shadow .2s, transform .2s; }
.tool-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.tool-card .icon { font-size: 2rem; margin-bottom: .75rem; }
.tool-card h3 { font-size: 1.15rem; margin-bottom: .5rem; }
.tool-card h3 a { color: var(--text); }
.tool-card h3 a:hover { color: var(--primary); text-decoration: none; }
.tool-card p { color: var(--text-secondary); font-size: .9rem; margin-bottom: 1rem; }
.tool-card .btn { display: inline-block; background: var(--primary); color: #fff; padding: .5rem 1.25rem; border-radius: 8px; font-weight: 600; font-size: .9rem; transition: background .2s; }
.tool-card .btn:hover { background: var(--primary-dark); text-decoration: none; }

/* ===== Calculator Page Layout ===== */
.calc-page { padding: 2.5rem 0 3rem; }
.calc-page h1 { font-size: 1.85rem; font-weight: 800; margin-bottom: .5rem; }
.calc-page .subtitle { color: var(--text-secondary); font-size: 1.05rem; margin-bottom: 2rem; }
.calc-wrapper { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; }
.calc-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); }
.calc-box h2 { font-size: 1.2rem; margin-bottom: 1.25rem; color: var(--text); }

/* ===== Forms ===== */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .4rem; color: var(--text); }
.form-group input, .form-group select { width: 100%; padding: .65rem .85rem; border: 1px solid var(--border); border-radius: 8px; font-size: 1rem; font-family: var(--font); transition: border-color .2s; }
.form-group input:focus, .form-group select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.form-group .hint { font-size: .8rem; color: var(--text-secondary); margin-top: .25rem; }

.btn-calc { display: inline-flex; align-items: center; gap: .5rem; background: var(--primary); color: #fff; border: none; padding: .75rem 1.75rem; border-radius: 8px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: background .2s; font-family: var(--font); }
.btn-calc:hover { background: var(--primary-dark); }

/* ===== Result ===== */
.result-box { background: var(--primary-light); border: 2px solid var(--primary); border-radius: var(--radius); padding: 1.5rem; text-align: center; margin-top: 1rem; display: none; }
.result-box.visible { display: block; }
.result-box .result-label { font-size: .9rem; color: var(--text-secondary); margin-bottom: .25rem; }
.result-box .result-value { font-size: 2rem; font-weight: 800; color: var(--primary-dark); }
.result-box .result-detail { font-size: .85rem; color: var(--text-secondary); margin-top: .5rem; }

.result-table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.result-table th, .result-table td { padding: .6rem .75rem; text-align: left; border-bottom: 1px solid var(--border); font-size: .9rem; }
.result-table th { background: var(--bg); font-weight: 600; color: var(--text-secondary); }
.result-table td { color: var(--text); }

/* ===== Content / SEO Text ===== */
.content-section { padding: 2rem 0 3rem; }
.content-section h2 { font-size: 1.4rem; margin-bottom: 1rem; }
.content-section h3 { font-size: 1.15rem; margin: 1.5rem 0 .75rem; }
.content-section p { margin-bottom: 1rem; color: var(--text); line-height: 1.7; }
.content-section ul, .content-section ol { margin: .75rem 0 1rem 1.5rem; }
.content-section li { margin-bottom: .4rem; }

/* ===== Footer ===== */
.site-footer { background: var(--text); color: #94a3b8; padding: 2.5rem 0; margin-top: 3rem; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 2rem; }
.footer-col h4 { color: #fff; font-size: .95rem; margin-bottom: .75rem; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: .4rem; }
.footer-col a { color: #94a3b8; font-size: .9rem; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #334155; margin-top: 2rem; padding-top: 1.25rem; text-align: center; font-size: .85rem; }

/* ===== Breadcrumb ===== */
.breadcrumb { padding: 1rem 0; font-size: .85rem; color: var(--text-secondary); }
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { margin: 0 .4rem; }

/* ===== About ===== */
.about-page { padding: 2.5rem 0 3rem; max-width: 720px; }
.about-page h1 { font-size: 1.85rem; font-weight: 800; margin-bottom: 1.25rem; }
.about-page p { margin-bottom: 1rem; line-height: 1.7; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.6rem; }
  .hero p { font-size: 1rem; }
  .calc-wrapper { grid-template-columns: 1fr; }
  .header-inner { justify-content: center; text-align: center; }
  .nav-links { justify-content: center; }
  .footer-inner { flex-direction: column; }
  .tools-grid { grid-template-columns: 1fr; }
  .result-box .result-value { font-size: 1.5rem; }
}
