/* ===== CSS VARIABLES ===== */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --bg-card: #ffffff;
  --text: #111827;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg: 0 16px 40px rgba(0,0,0,0.10), 0 4px 12px rgba(0,0,0,0.05);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --font-sans: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
  --transition: 0.2s ease;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }
ul, ol { padding-left: 1.4em; }
h1,h2,h3,h4,h5,h6 { line-height: 1.3; color: var(--text); font-weight: 700; }
h1 { font-size: clamp(1.75rem, 4vw, 2.6rem); font-family: var(--font-display); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.15rem, 2.5vw, 1.4rem); }
p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

/* ===== GOOGLE FONTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&family=Playfair+Display:wght@700&display=swap');

/* ===== LAYOUT ===== */
.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 780px; margin: 0 auto; padding: 0 20px; }
.section { padding: 64px 0; }
.section-sm { padding: 40px 0; }

/* ===== NAV ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  max-width: 1120px;
  margin: 0 auto;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo svg { flex-shrink: 0; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  padding: 0;
}
.nav-links a {
  display: block;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all var(--transition);
}
.nav-links a:hover, .nav-links a.active {
  color: var(--primary);
  background: var(--primary-light);
}
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--text);
}
.mobile-menu {
  display: none;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border);
  background: white;
}
.mobile-menu.open { display: block; }
.mobile-menu a {
  display: block;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-muted);
  font-weight: 500;
}
.mobile-menu a:last-child { border-bottom: none; }

/* ===== HERO ===== */
.hero {
  background: linear-gradient(135deg, #f0f6ff 0%, #fff8ed 100%);
  padding: 72px 0 64px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(37,99,235,0.08) 0%, transparent 70%);
  border-radius: 50%;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -40px; left: -40px;
  width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(245,158,11,0.07) 0%, transparent 70%);
  border-radius: 50%;
}
.hero-content { position: relative; z-index: 1; max-width: 720px; }
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-light);
  color: var(--primary);
  padding: 5px 14px;
  border-radius: 99px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 18px;
  letter-spacing: 0.02em;
}
.hero h1 { margin-bottom: 16px; }
.hero-lead {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 32px;
  max-width: 600px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1.4;
}
.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 14px rgba(37,99,235,0.3);
}
.btn-primary:hover {
  background: var(--primary-dark);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37,99,235,0.35);
}
.btn-outline {
  background: white;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover {
  background: var(--primary-light);
  color: var(--primary);
}
.btn-accent {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 14px rgba(245,158,11,0.3);
}
.btn-accent:hover {
  background: var(--accent-dark);
  color: white;
  transform: translateY(-1px);
}
.hero-btns { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats {
  display: flex;
  gap: 32px;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid rgba(0,0,0,0.07);
  flex-wrap: wrap;
}
.hero-stat strong { display: block; font-size: 1.6rem; font-weight: 700; color: var(--primary); }
.hero-stat span { font-size: 0.85rem; color: var(--text-muted); }

/* ===== CARDS ===== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 28px;
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }

/* ===== TABLE ===== */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin: 24px 0;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 580px;
}
thead tr { background: var(--primary); color: white; }
thead th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border-light); transition: background var(--transition); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f0f6ff; }
tbody td {
  padding: 12px 16px;
  color: var(--text);
  white-space: nowrap;
}
tbody tr:nth-child(even) { background: var(--bg-soft); }
tbody tr:nth-child(even):hover { background: #f0f6ff; }

/* ===== SECTION HEADER ===== */
.section-header { text-align: center; margin-bottom: 40px; }
.section-header h2 { margin-bottom: 10px; }
.section-header p { color: var(--text-muted); max-width: 540px; margin: 0 auto; }
.section-label {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  padding: 4px 14px;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

/* ===== TOC ===== */
.toc {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  margin: 32px 0;
  overflow: hidden;
}
.toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  font-size: 0.95rem;
}
.toc-header:hover { background: rgba(37,99,235,0.04); }
.toc-body { padding: 8px 20px 16px; }
.toc-body ol { list-style: decimal; }
.toc-body li { margin: 4px 0; font-size: 0.9rem; }
.toc-body a { color: var(--primary); font-weight: 500; }
.toc-toggle-icon { transition: transform 0.25s; }
.toc.open .toc-toggle-icon { transform: rotate(180deg); }

/* ===== FAQ ===== */
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  overflow: hidden;
}
.faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  gap: 12px;
  user-select: none;
  background: white;
  transition: background var(--transition);
}
.faq-q:hover { background: var(--bg-soft); }
.faq-q.active { background: var(--primary-light); color: var(--primary); }
.faq-icon { flex-shrink: 0; transition: transform 0.25s; }
.faq-q.active .faq-icon { transform: rotate(45deg); }
.faq-a {
  display: none;
  padding: 0 20px 16px;
  font-size: 0.93rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-light);
  line-height: 1.7;
}
.faq-a.open { display: block; }

/* ===== CALCULATOR ===== */
.calc-wrap {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px;
  max-width: 640px;
  margin: 0 auto;
  border: 1px solid var(--border);
}
.calc-input-group { margin-bottom: 22px; }
.calc-input-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 0.9rem;
  color: var(--text);
}
.calc-input-group input {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg-soft);
}
.calc-input-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
  background: white;
}
.calc-or {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-light);
  margin: -8px 0 22px;
  font-weight: 500;
}
.calc-results {
  background: var(--primary);
  border-radius: var(--radius);
  padding: 28px;
  color: white;
  margin-top: 24px;
  display: none;
}
.calc-results.visible { display: block; }
.calc-results h3 { color: white; margin-bottom: 18px; font-size: 1rem; opacity: 0.85; }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.result-item { background: rgba(255,255,255,0.12); border-radius: var(--radius-sm); padding: 14px; }
.result-label { font-size: 0.78rem; opacity: 0.75; margin-bottom: 4px; letter-spacing: 0.04em; }
.result-value { font-size: 1.5rem; font-weight: 700; }
.calc-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: #dc2626;
  font-size: 0.9rem;
  margin-top: 12px;
  display: none;
}
.calc-error.visible { display: block; }

/* ===== RING SIZER ===== */
.sizer-wrap {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 36px;
  border: 1px solid var(--border);
}
.sizer-instructions {
  background: linear-gradient(135deg, var(--primary-light), #eff6ff);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 28px;
  border-left: 4px solid var(--primary);
}
.sizer-instructions h3 { font-size: 1rem; margin-bottom: 8px; color: var(--primary-dark); }
.sizer-instructions ol { font-size: 0.9rem; color: var(--text-muted); padding-left: 1.2em; }
.sizer-instructions li { margin: 4px 0; }
.calibration-bar {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 22px;
}
.calibration-bar h4 { font-size: 0.9rem; margin-bottom: 10px; }
.cal-input-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cal-input-row label { font-size: 0.85rem; color: var(--text-muted); white-space: nowrap; }
.cal-input-row input[type="number"] {
  width: 90px;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}
.cal-input-row input[type="number"]:focus { outline: none; border-color: var(--primary); }
.sizer-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.sizer-controls label { font-weight: 600; font-size: 0.9rem; }
.sizer-controls input[type="range"] {
  flex: 1;
  min-width: 150px;
  accent-color: var(--primary);
  height: 6px;
  cursor: pointer;
}
.unit-toggle {
  display: flex;
  gap: 4px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
}
.unit-btn {
  padding: 6px 14px;
  border: none;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  background: transparent;
  color: var(--text-muted);
}
.unit-btn.active { background: var(--primary); color: white; box-shadow: 0 2px 6px rgba(37,99,235,0.25); }
#sizer-canvas-wrapper {
  background: white;
  background-image:
    linear-gradient(rgba(37,99,235,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37,99,235,0.05) 1px, transparent 1px);
  background-size: 20px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 340px;
  position: relative;
}
#sizer-canvas { display: block; }
.sizer-readout {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.readout-chip {
  flex: 1;
  min-width: 120px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  text-align: center;
}
.readout-chip .chip-label { font-size: 0.75rem; color: var(--primary); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; display: block; margin-bottom: 2px; }
.readout-chip .chip-val { font-size: 1.2rem; font-weight: 700; color: var(--primary-dark); }

/* ===== BLOG ===== */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.blog-card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}
.blog-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.blog-card-img {
  height: 180px;
  background: linear-gradient(135deg, var(--primary) 0%, #60a5fa 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2.5rem;
}
.blog-card-body { padding: 22px; }
.blog-card-meta { font-size: 0.8rem; color: var(--text-light); margin-bottom: 10px; }
.blog-card-body h2 { font-size: 1.1rem; margin-bottom: 10px; }
.blog-card-body p { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 14px; }

/* ===== ARTICLE ===== */
.article-header { padding: 56px 0 40px; background: linear-gradient(135deg, #f0f6ff, #fff8ed); }
.article-meta { display: flex; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.meta-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--primary-light);
  color: var(--primary);
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 600;
}
.article-body h2 { margin: 32px 0 14px; padding-top: 8px; }
.article-body h3 { margin: 24px 0 10px; color: var(--primary-dark); }
.article-body p { margin-bottom: 1.1rem; }
.article-body ul, .article-body ol { margin-bottom: 1rem; }
.article-body li { margin: 5px 0; }

/* ===== CONTACT ===== */
.contact-card {
  max-width: 520px;
  margin: 0 auto;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 48px 40px;
  text-align: center;
  border: 1px solid var(--border);
}
.contact-icon {
  width: 72px; height: 72px;
  background: var(--primary-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: var(--primary);
  font-size: 1.8rem;
}

/* ===== FOOTER ===== */
.footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 48px 0 24px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer-brand { max-width: 280px; }
.footer-brand p { font-size: 0.88rem; margin-top: 12px; }
.footer h4 { color: white; font-size: 0.9rem; margin-bottom: 14px; text-transform: uppercase; letter-spacing: 0.06em; }
.footer-links { list-style: none; padding: 0; }
.footer-links li { margin: 8px 0; }
.footer-links a { color: #94a3b8; font-size: 0.88rem; transition: color var(--transition); }
.footer-links a:hover { color: white; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  flex-wrap: wrap;
  gap: 8px;
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 0.83rem;
  padding: 12px 0;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--primary); }
.breadcrumb-sep { color: var(--text-light); }

/* ===== INFO BOX ===== */
.info-box {
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  padding: 18px 22px;
  border-left: 4px solid var(--primary);
  margin: 24px 0;
  font-size: 0.93rem;
}
.info-box strong { color: var(--primary-dark); }

/* ===== MODAL / CALIBRATION MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: white;
  border-radius: var(--radius-lg);
  padding: 36px;
  max-width: 460px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}
.modal h3 { margin-bottom: 12px; }
.modal p { color: var(--text-muted); font-size: 0.93rem; margin-bottom: 20px; }
.modal-credit-line {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 18px;
}
.modal-credit-line span { font-size: 0.85rem; color: var(--text-muted); }
#modal-credit-bar {
  height: 14px;
  background: var(--primary);
  border-radius: 4px;
  width: 96px;
  position: relative;
}

/* ===== UTILS ===== */
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.fw-600 { font-weight: 600; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.items-center { align-items: center; }
.badge {
  display: inline-block;
  background: var(--accent);
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  vertical-align: middle;
  margin-left: 4px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; max-width: 100%; }
  .hero { padding: 48px 0 40px; }
  .hero-stats { gap: 20px; }
  .calc-wrap { padding: 24px 18px; }
  .sizer-wrap { padding: 22px 16px; }
  .contact-card { padding: 32px 20px; }
  .result-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: 1fr 1fr; }
  .hero-btns { flex-direction: column; }
  .hero-btns .btn { width: 100%; justify-content: center; }
}
