/* ============================================================
   RFCalc — Global Stylesheet
   Edit this file to change colors/fonts across the whole site.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Syne:wght@400;600;800&display=swap');

/* --- Design tokens --- */
:root {
  --bg:       #0a0e1a;
  --surface:  #111827;
  --surface2: #1a2235;
  --accent:   #00e5ff;
  --accent2:  #7c3aed;
  --text:     #f0f4ff;
  --muted:    #6b7a99;
  --border:   rgba(0,229,255,0.15);
  --success:  #00ffaa;
  --danger:   #ff6b6b;
  --mono:     'Space Mono', monospace;
  --display:  'Syne', sans-serif;

  /* Section accent colors — change here to retheme a whole section */
  --color-calculators: #00e5ff;
  --color-sparams:     #a78bfa;
  --color-antennas:    #34d399;
  --color-passives:    #fbbf24;
  --color-linkbudget:  #f87171;
  --color-theory:      #60a5fa;
  --color-interview:   #fb923c;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--display);
  min-height: 100vh;
  overflow-x: hidden;
}

/* --- Grid background --- */
body::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(0,229,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,229,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* --- Glow orb --- */
body::after {
  content: ''; position: fixed; top: -200px; right: -200px;
  width: 600px; height: 600px; z-index: 0; pointer-events: none;
  background: radial-gradient(circle, rgba(124,58,237,0.12) 0%, transparent 70%);
}

/* ============================================================
   HEADER / NAV  (injected by nav.js)
   ============================================================ */
#rfcalc-header {
  position: relative; z-index: 100;
  background: rgba(10,14,26,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-top {
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0.9rem 2rem; flex-wrap: wrap;
}

.nav-logo {
  font-size: 1.35rem; font-weight: 800;
  letter-spacing: -0.02em; color: var(--accent);
  text-decoration: none; white-space: nowrap;
}
.nav-logo span { color: var(--text); }

.nav-sections { display: flex; gap: 0.25rem; flex-wrap: wrap; flex: 1; }

.nav-section-btn {
  font-family: var(--mono); font-size: 0.68rem;
  color: var(--muted); text-decoration: none;
  padding: 0.3rem 0.75rem; border-radius: 999px;
  border: 1px solid transparent; letter-spacing: 0.04em;
  white-space: nowrap; transition: all 0.18s; cursor: pointer;
  background: none;
}
.nav-section-btn:hover { color: var(--text); border-color: rgba(255,255,255,0.12); }
.nav-section-btn.active { color: var(--accent); background: rgba(0,229,255,0.08); border-color: var(--border); }

.nav-badge {
  font-family: var(--mono); font-size: 0.65rem;
  background: rgba(0,229,255,0.08); color: var(--accent);
  border: 1px solid var(--border); padding: 0.2rem 0.65rem;
  border-radius: 999px; letter-spacing: 0.08em; white-space: nowrap;
}

.nav-contact {
  font-family: var(--mono); font-size: 0.68rem;
  color: var(--text); text-decoration: none;
  padding: 0.3rem 0.9rem; border-radius: 999px;
  border: 1px solid rgba(0,229,255,0.3);
  background: rgba(0,229,255,0.06);
  letter-spacing: 0.04em; white-space: nowrap;
  transition: all 0.18s; margin-left: auto;
}
.nav-contact:hover {
  background: rgba(0,229,255,0.14);
  border-color: var(--accent);
  color: var(--accent);
}

/* Sub-nav (section pages) */
.nav-sub {
  display: flex; gap: 0.25rem; flex-wrap: wrap;
  padding: 0.55rem 2rem;
  border-top: 1px solid rgba(255,255,255,0.05);
  background: rgba(0,0,0,0.15);
}

.nav-sub-link {
  font-family: var(--mono); font-size: 0.67rem;
  color: var(--muted); text-decoration: none;
  padding: 0.25rem 0.65rem; border-radius: 999px;
  border: 1px solid transparent; letter-spacing: 0.04em;
  white-space: nowrap; transition: all 0.18s;
}
.nav-sub-link:hover { color: var(--text); border-color: rgba(255,255,255,0.1); }
.nav-sub-link.active { color: var(--accent); background: rgba(0,229,255,0.07); border-color: var(--border); }
.nav-sub-link.soon { opacity: 0.4; pointer-events: none; }

/* ============================================================
   MAIN CONTENT WRAPPER
   ============================================================ */
main {
  position: relative; z-index: 10;
  max-width: 1100px; margin: 0 auto;
  padding: 3rem 2rem 5rem;
}

/* --- Page header --- */
.page-header { margin-bottom: 2.5rem; animation: fadeUp 0.5s ease both; }
.page-eyebrow {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 0.5rem;
}
.page-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800;
  letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 0.55rem;
}
.page-title em { font-style: normal; color: var(--accent); }
.page-desc { font-size: 0.95rem; color: var(--muted); line-height: 1.65; max-width: 560px; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 2rem; position: relative; overflow: hidden;
}
.card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}
.card-result {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 2rem; position: relative; overflow: hidden;
}
.card-result::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
}
.card-title {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 1.4rem;
}

/* Two-column calc layout */
.calc-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 2rem; animation: fadeUp 0.5s 0.1s ease both;
}
@media (max-width: 680px) { .calc-grid { grid-template-columns: 1fr; } }

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.field { margin-bottom: 1.15rem; }

label {
  display: block; font-family: var(--mono); font-size: 0.76rem;
  color: var(--muted); letter-spacing: 0.04em; margin-bottom: 0.38rem;
}

.input-row { display: flex; gap: 0.45rem; }

input[type="number"], input[type="text"], select, textarea {
  background: var(--surface2); border: 1px solid rgba(255,255,255,0.08);
  color: var(--text); font-family: var(--mono); font-size: 0.92rem;
  padding: 0.6rem 0.9rem; border-radius: 8px; width: 100%; outline: none;
  transition: border-color 0.18s; -moz-appearance: textfield;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,229,255,0.08);
}
select { cursor: pointer; appearance: none; }

.unit-badge {
  font-family: var(--mono); font-size: 0.72rem; color: var(--muted);
  background: var(--surface2); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px; padding: 0 0.7rem;
  display: flex; align-items: center; white-space: nowrap; min-width: fit-content;
}

.mode-toggle {
  display: flex; background: var(--surface2);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px; overflow: hidden; margin-bottom: 1.4rem;
}
.mode-btn {
  flex: 1; padding: 0.55rem; font-family: var(--mono); font-size: 0.7rem;
  background: none; border: none; color: var(--muted);
  cursor: pointer; letter-spacing: 0.04em; transition: all 0.18s;
}
.mode-btn.active { background: rgba(0,229,255,0.1); color: var(--accent); }

.btn-calc {
  width: 100%; padding: 0.85rem; background: var(--accent); color: var(--bg);
  font-family: var(--display); font-size: 0.88rem; font-weight: 700;
  letter-spacing: 0.05em; border: none; border-radius: 8px;
  cursor: pointer; margin-top: 0.4rem; transition: all 0.18s; text-transform: uppercase;
}
.btn-calc:hover { background: #33eeff; transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0,229,255,0.22); }
.btn-calc:active { transform: translateY(0); }

.error-msg { font-family: var(--mono); font-size: 0.72rem; color: var(--danger); margin-top: 0.45rem; display: none; }

/* ============================================================
   RESULTS
   ============================================================ */
.result-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.8rem 0; border-bottom: 1px solid rgba(255,255,255,0.05);
}
.result-row:last-child { border-bottom: none; }
.result-label { font-family: var(--mono); font-size: 0.73rem; color: var(--muted); }
.result-value { font-family: var(--mono); font-size: 1.05rem; font-weight: 700; color: var(--success); }
.result-unit  { font-family: var(--mono); font-size: 0.68rem; color: var(--muted); margin-left: 0.28rem; }

.placeholder {
  text-align: center; padding: 3rem 1rem;
  font-family: var(--mono); font-size: 0.78rem;
  color: var(--muted); letter-spacing: 0.05em;
}
.placeholder-icon { font-size: 2rem; opacity: 0.25; margin-bottom: 0.75rem; }

/* ============================================================
   DIAGRAM BOX
   ============================================================ */
.diagram {
  margin: 1.2rem 0; background: var(--surface2);
  border-radius: 10px; padding: 1.1rem;
  border: 1px solid rgba(255,255,255,0.05);
}
.diagram svg { width: 100%; height: auto; display: block; }

/* ============================================================
   FORMULA BOX
   ============================================================ */
.formula-box {
  background: rgba(0,229,255,0.04); border: 1px solid rgba(0,229,255,0.13);
  border-radius: 8px; padding: 0.9rem 1rem;
  font-family: var(--mono); font-size: 0.7rem;
  color: var(--muted); margin-top: 0.9rem; line-height: 1.95;
}
.formula-box strong { color: var(--accent); }

/* ============================================================
   SECTION INDEX CARDS  (used on section landing pages)
   ============================================================ */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1rem;
}

.tool-card {
  background: var(--surface); border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px; padding: 1.1rem 1.25rem;
  text-decoration: none; display: block;
  transition: all 0.18s; position: relative;
}
.tool-card:hover { border-color: var(--border); transform: translateY(-2px); }
.tool-card.live:hover { border-color: var(--accent); }
.tool-card.active-page { border-color: var(--accent); background: rgba(0,229,255,0.05); }

.tool-card-name { font-size: 0.88rem; font-weight: 600; color: var(--text); margin-bottom: 0.22rem; }
.tool-card-desc { font-family: var(--mono); font-size: 0.7rem; color: var(--muted); }

.tag {
  position: absolute; top: 0.55rem; right: 0.55rem;
  font-family: var(--mono); font-size: 0.55rem; letter-spacing: 0.07em;
  text-transform: uppercase; padding: 0.12rem 0.4rem; border-radius: 4px;
}
.tag-live  { color: var(--success); background: rgba(0,255,170,0.1); border: 1px solid rgba(0,255,170,0.2); }
.tag-soon  { color: var(--muted);   background: var(--surface2);      border: 1px solid rgba(255,255,255,0.08); }
.tag-new   { color: #fbbf24;        background: rgba(251,191,36,0.1);  border: 1px solid rgba(251,191,36,0.25); }

/* ============================================================
   SECTION DIVIDER
   ============================================================ */
.section-header {
  display: flex; align-items: center; gap: 1rem;
  margin: 2.5rem 0 1.2rem;
}
.section-header-title { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.01em; }
.section-header-line { flex: 1; height: 1px; background: rgba(255,255,255,0.07); }

/* ============================================================
   FOOTER
   ============================================================ */
#rfcalc-footer {
  position: relative; z-index: 10; text-align: center;
  padding: 2.5rem 2rem; border-top: 1px solid var(--border);
  font-family: var(--mono); font-size: 0.7rem;
  color: var(--muted); letter-spacing: 0.06em; margin-top: 4rem;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
