/* ============================================
   FreelanceKit — Shared Design System
   Font: Syne (display) + Space Mono (mono) + DM Sans (body)
   Theme: Dark industrial with electric amber accent
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=Space+Mono:wght@400;700&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;1,400&display=swap');

/* ── CSS Variables ─────────────────────────── */
:root {
  --bg:          #0a0a0b;
  --bg-2:        #111114;
  --bg-3:        #18181d;
  --bg-4:        #222228;
  --border:      #2a2a32;
  --border-2:    #3a3a44;
  --text:        #f0eff4;
  --text-2:      #9998aa;
  --text-3:      #5c5b6e;
  --accent:      #f5a623;
  --accent-2:    #ff7b2c;
  --accent-dim:  rgba(245,166,35,0.12);
  --accent-glow: rgba(245,166,35,0.25);
  --green:       #2dca73;
  --red:         #ff4d4d;
  --blue:        #4d9eff;
  --purple:      #a855f7;

  --font-display: 'Syne', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'Space Mono', monospace;

  --radius:    8px;
  --radius-lg: 16px;
  --shadow:    0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.6);

  --max-w: 1140px;
  --header-h: 64px;
}

/* ── Reset ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-2); }
button { cursor: pointer; font-family: var(--font-body); }
input, select, textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
}

/* ── Header ────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(10,10,11,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}
.header-inner {
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}
.logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--text);
  letter-spacing: -0.02em;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.logo span { color: var(--accent); }
.logo-icon {
  width: 28px; height: 28px;
  background: var(--accent);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  color: #000;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: nowrap;
}
.site-nav a {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-2);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius);
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
}
.site-nav a:hover, .site-nav a.active {
  color: var(--text);
  background: var(--bg-3);
}
.nav-home-btn {
  background: var(--accent-dim) !important;
  color: var(--accent) !important;
  border: 1px solid rgba(245,166,35,0.2);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text-2);
  border-radius: 2px;
  transition: 0.3s;
}

/* ── Mobile Nav ────────────────────────────── */
.mobile-nav {
  display: none;
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  z-index: 99;
  padding: 1rem 1.5rem;
  flex-direction: column;
  gap: 0.25rem;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  color: var(--text-2);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius);
  transition: 0.2s;
}
.mobile-nav a:hover { color: var(--text); background: var(--bg-3); }

/* ── AdSense Slots ─────────────────────────── */
.ad-slot {
  width: 100%;
  background: var(--bg-3);
  border: 1px dashed var(--border-2);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  color: var(--text-3);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 1.5rem 0;
  user-select: none;
}

/* ── Page Layout ───────────────────────────── */
.page-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.container {
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Tool Page Hero ────────────────────────── */
.tool-hero {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.tool-hero::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, var(--accent-glow), transparent 70%);
  pointer-events: none;
}
.tool-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent-dim);
  border: 1px solid rgba(245,166,35,0.25);
  color: var(--accent);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
  margin-bottom: 1rem;
}
.tool-hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 0.75rem;
}
.tool-hero p {
  font-size: 1.05rem;
  color: var(--text-2);
  max-width: 540px;
  line-height: 1.6;
}

/* ── Tool Layout ───────────────────────────── */
.tool-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding: 2.5rem 0;
  flex: 1;
}
.tool-layout.single-col {
  grid-template-columns: 1fr;
  max-width: 680px;
}
.tool-layout.wide {
  grid-template-columns: 1fr;
}

/* ── Cards ─────────────────────────────────── */
.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
}
.card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.card-title .icon {
  width: 28px; height: 28px;
  background: var(--accent-dim);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* ── Form Elements ─────────────────────────── */
.field {
  margin-bottom: 1.1rem;
}
.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 0.85rem;
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  -webkit-appearance: none;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239998aa' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.2rem;
}
.field textarea { resize: vertical; min-height: 100px; line-height: 1.5; }
.field-hint {
  font-size: 0.78rem;
  color: var(--text-3);
  margin-top: 0.3rem;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}
.prefix-input {
  position: relative;
}
.prefix-input .prefix {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  font-size: 0.9rem;
  pointer-events: none;
}
.prefix-input input { padding-left: 1.75rem; }

/* ── Buttons ───────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  transition: transform 0.15s, box-shadow 0.15s, background 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--accent);
  color: #000;
  width: 100%;
  font-size: 0.95rem;
  padding: 0.8rem 1.5rem;
  box-shadow: 0 4px 16px var(--accent-glow);
}
.btn-primary:hover {
  background: var(--accent-2);
  box-shadow: 0 6px 24px rgba(255,123,44,0.35);
  color: #000;
}
.btn-secondary {
  background: var(--bg-4);
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-3); color: var(--text); }
.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 0.45rem 0.9rem; font-size: 0.82rem; }
.btn-group { display: flex; gap: 0.6rem; margin-top: 1rem; }
.btn-group .btn { flex: 1; }

/* ── Result Display ────────────────────────── */
.result-card {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  position: relative;
  overflow: hidden;
}
.result-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.result-label {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.4rem;
}
.result-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: -0.04em;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.35rem;
}
.result-value.large { font-size: clamp(2.4rem, 6vw, 3.6rem); }
.result-sub {
  font-size: 0.85rem;
  color: var(--text-2);
}
.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}
.result-item {
  background: var(--bg-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}
.result-item .val {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--text);
  letter-spacing: -0.02em;
}
.result-item .lbl {
  font-size: 0.75rem;
  color: var(--text-3);
  margin-top: 0.25rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Info / Alert Boxes ────────────────────── */
.info-box {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  font-size: 0.875rem;
  color: var(--text-2);
  margin-top: 1rem;
}
.info-box.warn { border-left-color: var(--accent); }
.info-box.success { border-left-color: var(--green); }
.info-box.danger { border-left-color: var(--red); }
.info-box strong { color: var(--text); }

/* ── Progress / Meter ──────────────────────── */
.meter-wrap {
  margin-top: 0.75rem;
}
.meter-bar {
  height: 6px;
  background: var(--bg-4);
  border-radius: 100px;
  overflow: hidden;
}
.meter-fill {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.4s cubic-bezier(0.4,0,0.2,1);
}
.meter-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-3);
  margin-top: 0.3rem;
}

/* ── Tabs ──────────────────────────────────── */
.tab-bar {
  display: flex;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px;
  gap: 3px;
  margin-bottom: 1.25rem;
}
.tab-btn {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: none;
  background: transparent;
  color: var(--text-3);
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 5px;
  cursor: pointer;
  transition: 0.2s;
  white-space: nowrap;
}
.tab-btn.active {
  background: var(--bg-4);
  color: var(--text);
}

/* ── Character Counter Visuals ─────────────── */
.char-display {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.char-count { font-weight: 700; }
.char-count.ok { color: var(--green); }
.char-count.warn { color: var(--accent); }
.char-count.over { color: var(--red); }

/* ── Footer ────────────────────────────────── */
.site-footer {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  padding: 2.5rem 0 2rem;
  margin-top: auto;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: start;
}
.footer-brand .logo { margin-bottom: 0.5rem; font-size: 1.1rem; }
.footer-brand p { font-size: 0.82rem; color: var(--text-3); max-width: 280px; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: flex-end;
}
.footer-links a { font-size: 0.82rem; color: var(--text-3); }
.footer-links a:hover { color: var(--text); }
.footer-copy {
  margin-top: 1.5rem;
  font-size: 0.75rem;
  color: var(--text-3);
  font-family: var(--font-mono);
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  max-width: var(--max-w);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* ── Utilities ─────────────────────────────── */
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-mono { font-family: var(--font-mono); }
.text-accent { color: var(--accent); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-muted { color: var(--text-2); }
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}
.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-green { background: rgba(45,202,115,0.15); color: var(--green); }
.badge-amber { background: var(--accent-dim); color: var(--accent); }
.badge-red { background: rgba(255,77,77,0.15); color: var(--red); }
.badge-blue { background: rgba(77,158,255,0.15); color: var(--blue); }

/* ── Responsive ────────────────────────────── */
@media (max-width: 768px) {
  .site-nav { display: none; }
  .hamburger { display: flex; }
  .tool-layout { grid-template-columns: 1fr; gap: 1.25rem; }
  .field-row { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-links { justify-content: flex-start; }
  .result-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .container { padding: 0 1rem; }
  .card { padding: 1.25rem; }
  .result-grid { grid-template-columns: 1fr; }
  .btn-group { flex-direction: column; }
  .tab-btn { font-size: 0.75rem; padding: 0.4rem 0.5rem; }
}

/* ── Animations ────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
  50%       { box-shadow: 0 0 0 8px transparent; }
}
.fade-up { animation: fadeUp 0.4s ease both; }
.fade-up-2 { animation: fadeUp 0.4s 0.08s ease both; }
.fade-up-3 { animation: fadeUp 0.4s 0.16s ease both; }
