/* =========================================================
   SyntaxGenius — Global Stylesheet
   Design language: developer-terminal inspired.
   Signature element: the "command line" motif used in the
   nav breadcrumb, hero terminal, and section eyebrows.
   ========================================================= */

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

:root{
  /* ---- Light theme tokens ---- */
  --bg: #F7F7FB;
  --surface: #FFFFFF;
  --surface-2: #EFEFF7;
  --border: #E2E2ED;
  --text: #14121F;
  --text-muted: #62607A;
  --accent: #5B5FEF;
  --accent-ink: #ffffff;
  --accent-soft: #EEEEFD;
  --accent-alt: #12B3A8;
  --danger: #E0495F;
  --shadow: 0 1px 2px rgba(20,18,31,0.04), 0 8px 24px rgba(20,18,31,0.06);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --maxw: 1180px;
  color-scheme: light;
}

[data-theme="dark"]{
  --bg: #0E0E16;
  --surface: #17171F;
  --surface-2: #1E1E29;
  --border: #2B2B38;
  --text: #F1F1F7;
  --text-muted: #9A98B0;
  --accent: #8083FF;
  --accent-ink: #0E0E16;
  --accent-soft: #22223A;
  --accent-alt: #2DD9CB;
  --danger: #FF6B7F;
  --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 12px 28px rgba(0,0,0,0.35);
  color-scheme: dark;
}

*,*::before,*::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin:0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  transition: background .25s ease, color .25s ease;
  -webkit-font-smoothing: antialiased;
}
img{ max-width:100%; display:block; }
a{ color: inherit; text-decoration:none; }
ul{ margin:0; padding:0; list-style:none; }
button{ font-family: inherit; }

h1,h2,h3,h4{
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 .5em;
  letter-spacing: -0.01em;
}
h1{ font-size: clamp(2rem, 4vw + 1rem, 3.4rem); }
h2{ font-size: clamp(1.5rem, 2vw + 1rem, 2.2rem); }
h3{ font-size: 1.25rem; }
p{ margin: 0 0 1em; color: var(--text-muted); }

.container{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* Visible keyboard focus */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* =========================================================
   Eyebrow / mono label — signature typographic device
   ========================================================= */
.eyebrow{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.eyebrow::before{ content:"$"; opacity:.7; }

/* =========================================================
   Header / Navigation
   ========================================================= */
.site-header{
  position: sticky;
  top:0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 14px 24px;
  max-width: var(--maxw);
  margin:0 auto;
  gap: 16px;
}
.brand{
  display:flex;
  align-items:center;
  gap:8px;
  font-family: var(--font-mono);
  font-weight:600;
  font-size:1.05rem;
  color: var(--text);
}
.brand .brand-caret{
  color: var(--accent);
}
.brand .brand-caret::after{
  content:"";
  display:inline-block;
  width:8px; height:1.1em;
  background: var(--accent);
  margin-left:6px;
  vertical-align:-2px;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink{ 50%{ opacity:0; } }

.nav-links{
  display:flex;
  align-items:center;
  gap: 4px;
}
.nav-links > li > a{
  font-family: var(--font-mono);
  font-size: 0.88rem;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: background .15s ease, color .15s ease;
}
.nav-links > li > a:hover,
.nav-links > li > a.active{
  color: var(--text);
  background: var(--surface-2);
}

.nav-tools{ position:relative; }
.tools-menu{
  display:none;
  position:absolute;
  top: 100%;
  left:0;
  margin-top: 10px;
  min-width: 260px;
  background: var(--surface);
  border:1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  padding: 8px;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}
/* Invisible bridge that fills the visual gap between the trigger link
   and the dropdown, so the pointer never leaves a hoverable element
   while moving from one to the other (fixes menu closing mid-move). */
.tools-menu::before{
  content:"";
  position:absolute;
  top:-10px;
  left:0;
  right:0;
  height:10px;
}
.nav-tools:hover .tools-menu,
.nav-tools:focus-within .tools-menu{ display:grid; }
.tools-menu a{
  display:block;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  white-space: nowrap;
}
.tools-menu a:hover{ background: var(--accent-soft); color: var(--accent); }

.nav-right{ display:flex; align-items:center; gap:10px; }

.theme-toggle{
  display:flex;
  align-items:center;
  justify-content:center;
  width:38px; height:38px;
  border-radius: 999px;
  border:1px solid var(--border);
  background: var(--surface);
  cursor:pointer;
  color: var(--text);
}
.theme-toggle svg{ width:18px; height:18px; }
.theme-toggle .icon-moon{ display:none; }
[data-theme="dark"] .theme-toggle .icon-sun{ display:none; }
[data-theme="dark"] .theme-toggle .icon-moon{ display:block; }

.menu-btn{
  display:none;
  width:38px; height:38px;
  border-radius: 8px;
  border:1px solid var(--border);
  background: var(--surface);
  cursor:pointer;
  align-items:center;
  justify-content:center;
}
.menu-btn span, .menu-btn::before, .menu-btn::after{
  content:"";
  display:block;
  width:16px; height:2px;
  background: var(--text);
  position:relative;
}
.menu-btn{ flex-direction:column; gap:3px; }
.menu-btn::before{ content:none; }
.menu-btn::after{ content:none; }

/* =========================================================
   Buttons
   ========================================================= */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight:500;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border:1px solid transparent;
  cursor:pointer;
  transition: transform .12s ease, background .15s ease, border-color .15s ease;
}
.btn:active{ transform: translateY(1px); }
.btn-primary{ background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover{ background: color-mix(in srgb, var(--accent) 88%, black 0%); filter:brightness(1.05); }
.btn-ghost{ background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover{ background: var(--surface-2); }
.btn-sm{ padding: 8px 14px; font-size: 0.8rem; }
.btn-block{ width:100%; }

/* =========================================================
   Hero (home page) — terminal signature element
   ========================================================= */
.hero{
  padding: 72px 0 56px;
}
.hero-grid{
  display:grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 48px;
  align-items:center;
}
.hero h1 span{ color: var(--accent); }
.hero-actions{ display:flex; gap:12px; margin-top: 24px; flex-wrap:wrap; }

.terminal{
  background: #14131F;
  border-radius: var(--radius-md);
  overflow:hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
[data-theme="dark"] .terminal{ background: #0B0B12; }
.terminal-bar{
  display:flex;
  align-items:center;
  gap:6px;
  padding: 10px 14px;
  background: #1D1C2B;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
[data-theme="dark"] .terminal-bar{ background:#121120; }
.terminal-dot{ width:10px; height:10px; border-radius:50%; }
.dot-a{ background:#FF6159; } .dot-b{ background:#FFC12F; } .dot-c{ background:#28C93F; }
.terminal-title{ margin-left:8px; font-family: var(--font-mono); font-size:0.75rem; color:#9694B0; }
.terminal-body{
  padding: 20px 18px;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: #DCDAF5;
  min-height: 210px;
}
.terminal-body .line{ margin-bottom: 10px; }
.terminal-body .prompt{ color: #7BE6C9; }
.terminal-body .cmd{ color:#fff; }
.terminal-body .out{ color:#9694B0; padding-left: 1.2em; }
.terminal-cursor{
  display:inline-block; width:7px; height:1em; background:#DCDAF5; vertical-align:-2px;
  animation: blink 1s steps(1) infinite;
}

/* =========================================================
   Tool cards grid (home)
   ========================================================= */
.section{ padding: 56px 0; }
.section-head{ margin-bottom: 32px; max-width: 640px; }

.tool-grid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.tool-card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.tool-card:hover{
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.tool-card .tool-icon{
  width: 42px; height:42px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display:flex; align-items:center; justify-content:center;
  margin-bottom: 14px;
}
.tool-card .tool-icon svg{ width:22px; height:22px; }
.tool-card h3{ margin-bottom:6px; font-size: 1.05rem; }
.tool-card p{ font-size: 0.9rem; margin-bottom: 10px; }
.tool-card .tool-cmd{
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--accent-alt);
}
.tool-card .tool-cmd::before{ content:"$ "; opacity:.6; }

/* =========================================================
   Breadcrumb (command-line style, used on tool + inner pages)
   ========================================================= */
.breadcrumb{
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 18px 0 0;
}
.breadcrumb a{ color: var(--text-muted); }
.breadcrumb a:hover{ color: var(--accent); }
.breadcrumb .sep{ margin: 0 6px; opacity:.5; }
.breadcrumb .current{ color: var(--accent); }

/* =========================================================
   Tool page layout
   ========================================================= */
.tool-page-head{ padding: 22px 0 8px; }
.tool-page-head h1{ font-size: clamp(1.6rem, 2.4vw + 1rem, 2.2rem); }
.tool-page-head p{ max-width: 640px; }

.ad-slot{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height: 90px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: var(--surface-2);
  margin: 28px 0;
}

.tool-panel{
  background: var(--surface);
  border:1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.field-label{
  display:block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.input, textarea.input, select.input{
  width:100%;
  background: var(--surface-2);
  border:1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  resize: vertical;
}
textarea.input{ min-height: 140px; font-family: var(--font-mono); font-size: 0.88rem; }
.input:focus, textarea.input:focus{ border-color: var(--accent); }

.control-row{ display:flex; flex-wrap:wrap; gap:16px; align-items:center; margin: 16px 0; }
.control-group{ display:flex; flex-direction:column; gap:6px; }
.inline-check{ display:flex; align-items:center; gap:8px; font-size:0.88rem; }
.inline-check input{ width:16px; height:16px; accent-color: var(--accent); }

.result-box{
  background: var(--surface-2);
  border:1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  word-break: break-all;
  min-height: 48px;
}

.stat-row{ display:flex; flex-wrap:wrap; gap: 14px; margin-top: 16px; }
.stat{
  flex:1 1 120px;
  background: var(--surface-2);
  border:1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.stat .num{ font-family: var(--font-mono); font-size:1.4rem; font-weight:600; color:var(--accent); }
.stat .lbl{ font-size:0.78rem; color:var(--text-muted); }

.how-to{
  background: var(--surface);
  border:1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin: 24px 0 8px;
}
.how-to ol, .how-to ul{ padding-left: 1.2em; list-style: decimal; color: var(--text-muted); }
.how-to ul{ list-style: disc; }
.how-to li{ margin-bottom: 8px; }

.related-tools{ margin-top: 12px; }
.related-tools .tool-grid{ grid-template-columns: repeat(3, 1fr); }

/* =========================================================
   Static content pages (About/Privacy/Terms/Contact)
   ========================================================= */
.content-page{ padding: 40px 0 60px; }
.content-page .prose{ max-width: 780px; }
.prose h2{ margin-top: 1.6em; }
.prose p, .prose li{ color: var(--text-muted); }
.prose ul{ list-style: disc; padding-left: 1.3em; margin-bottom: 1em; }
.prose li{ margin-bottom: 6px; }

.contact-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items:start;
}
.contact-card{
  background: var(--surface);
  border:1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
}
.contact-card .field-label{ margin-top:14px; }
.contact-card .field-label:first-child{ margin-top:0; }
.form-note{ font-size:0.82rem; margin-top:12px; }

.error-page{
  min-height: 60vh;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding: 60px 24px;
}
.error-page .code{
  font-family: var(--font-mono);
  font-size: clamp(3rem, 8vw, 6rem);
  color: var(--accent);
  line-height:1;
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer{
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: 64px;
}
.footer-grid{
  display:grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
  padding: 48px 0 28px;
}
.footer-brand .brand{ margin-bottom: 10px; }
.footer-brand p{ font-size: 0.88rem; max-width: 280px; }
.footer-col h4{
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-bottom: 14px;
  text-transform: uppercase;
}
.footer-col ul li{ margin-bottom: 10px; }
.footer-col a{ font-size: 0.9rem; color: var(--text-muted); }
.footer-col a:hover{ color: var(--accent); }
.footer-social{ display:flex; gap:10px; margin-top:16px; }
.footer-social a{
  width:34px; height:34px;
  border-radius:50%;
  border:1px solid var(--border);
  display:flex; align-items:center; justify-content:center;
}
.footer-social a:hover{ border-color: var(--accent); color: var(--accent); }
.footer-social svg{ width:15px; height:15px; }

.footer-bottom{
  border-top:1px solid var(--border);
  padding: 18px 0;
  display:flex;
  justify-content:space-between;
  align-items:center;
  flex-wrap:wrap;
  gap:10px;
}
.footer-bottom p{ margin:0; font-size:0.8rem; }
.footer-bottom-links{ display:flex; gap:16px; }
.footer-bottom-links a{ font-size:0.8rem; color: var(--text-muted); }
.footer-bottom-links a:hover{ color: var(--accent); }

.toast{
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 10px 18px;
  border-radius: 999px;
  opacity:0;
  pointer-events:none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 999;
}
.toast.show{ opacity:1; transform: translateX(-50%) translateY(0); }