/* ================================================================
   byFox.dev — Technical Editorial
   Design language: monospace metadata, dark-first, teal accents
   ================================================================ */

/* Fonts loaded via <link> in HTML <head> for non-blocking render */

/* ----- Tokens ----- */
:root {
  --bg: #0a0d10;
  --bg-elev: #111518;
  --bg-elev-2: #161b1f;
  --bg-card: #0e1316;
  --border: #1e252a;
  --border-strong: #2a333a;
  --text: #e6ecef;
  --text-dim: #8a969e;
  --text-muted: #5a6770;

  --accent: #4ecdc4;          /* бирюза из NetGeoAudit кнопок */
  --accent-dim: #2b8079;
  --accent-glow: rgba(78, 205, 196, 0.15);
  --warn: #ffc107;
  --danger: #ff6b6b;
  --ok: #4caf50;

  --font-display: 'Fraunces', 'Times New Roman', serif;
  --font-sans: 'Inter Tight', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;

  --radius: 4px;
  --radius-lg: 8px;

  --container: 1200px;
  --container-wide: 1360px;

  --trans: 220ms cubic-bezier(.2, .6, .2, 1);
}

[data-theme="light"] {
  --bg: #fafaf7;
  --bg-elev: #f2f1ec;
  --bg-elev-2: #ebeae3;
  --bg-card: #ffffff;
  --border: #d9d6cc;
  --border-strong: #b8b3a3;
  --text: #1a1d20;
  --text-dim: #5a6770;
  --text-muted: #8a969e;
  --accent: #1e8d85;
  --accent-dim: #4ecdc4;
  --accent-glow: rgba(30, 141, 133, 0.12);
}

/* ----- 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);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

img, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: color var(--trans); }
button { font: inherit; cursor: pointer; background: none; border: none; color: inherit; }
ul, ol { list-style: none; }

/* ----- Background texture ----- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 0%, var(--accent-glow) 0%, transparent 40%),
    radial-gradient(circle at 80% 100%, rgba(78, 205, 196, 0.05) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 80px 80px;
  opacity: 0.25;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
}

main, header, footer { position: relative; z-index: 1; }

/* ----- Layout ----- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}
.container-wide {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 24px;
}

/* ----- Typography ----- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 500; line-height: 1.1; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.5rem, 6vw, 5rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 3rem); }
h3 { font-size: clamp(1.3rem, 2vw, 1.75rem); }
h4 { font-size: 1.1rem; font-weight: 600; }

.mono { font-family: var(--font-mono); }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ----- Header / Nav ----- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  max-width: var(--container-wide);
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 28px;
  height: 28px;
  border: 1px solid var(--accent);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 2px;
}
.brand-name { color: var(--text); }
.brand-name em { color: var(--accent); font-style: normal; }

.nav-tools { display: flex; align-items: center; gap: 8px; }
.nav-link {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  padding: 8px 12px;
  border-radius: var(--radius);
  transition: all var(--trans);
}
.nav-link:hover { color: var(--accent); background: var(--bg-elev); }

.lang-switch, .theme-switch {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev);
}
.lang-switch a, .theme-switch button {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 8px;
  color: var(--text-dim);
  border-radius: 2px;
  transition: all var(--trans);
  letter-spacing: 0.05em;
}
.lang-switch a.active, .theme-switch button.active {
  background: var(--accent);
  color: var(--bg);
}
.lang-switch a:hover:not(.active), .theme-switch button:hover:not(.active) { color: var(--text); }

/* ----- Hero ----- */
.hero {
  padding: clamp(4rem, 10vw, 8rem) 0 clamp(3rem, 6vw, 6rem);
  position: relative;
}
.hero-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 3rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.hero-meta span { display: flex; align-items: center; gap: 8px; }
.hero-meta span::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  margin-bottom: 1.5rem;
  max-width: 14ch;
}
.hero-title .accent {
  font-style: italic;
  font-weight: 500;
  color: var(--accent);
}
.hero-sub {
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
  color: var(--text-dim);
  max-width: 56ch;
  margin-bottom: 2.5rem;
  line-height: 1.55;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* ----- Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: var(--radius);
  transition: all var(--trans);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: var(--bg);
}
.btn-primary:hover {
  background: color-mix(in srgb, var(--accent) 85%, white);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px -8px var(--accent);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-arrow::after {
  content: '→';
  transition: transform var(--trans);
}
.btn-arrow:hover::after { transform: translateX(4px); }
.btn-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  opacity: 0.65;
  margin-left: 2px;
  padding-left: 8px;
  border-left: 1px solid currentColor;
  border-left-color: color-mix(in srgb, currentColor 35%, transparent);
}

/* ----- Section ----- */
.section {
  padding: clamp(3rem, 6vw, 6rem) 0;
  position: relative;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 3rem;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.section-head h2 { font-weight: 400; }
.section-head h2 em { color: var(--accent); font-style: italic; font-weight: 500; }
.section-count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

/* ----- Utility grid ----- */
.util-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}
.util-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 28px 24px;
  transition: all var(--trans);
  display: flex;
  flex-direction: column;
  min-height: 280px;
  overflow: hidden;
}
.util-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent) 50%, transparent);
  opacity: 0;
  transition: opacity var(--trans);
}
.util-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.util-card:hover::before { opacity: 1; }
.util-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  gap: 12px;
}
.util-card-num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}
.util-card-version {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 2px 8px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--text-dim);
  white-space: nowrap;
}
.util-card-version.new { color: var(--accent); border-color: var(--accent-dim); }
.util-card-version.ext { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.util-card h3 {
  font-family: var(--font-display);
  font-weight: 500;
  margin-bottom: 8px;
  font-size: 1.5rem;
}
.util-card p {
  color: var(--text-dim);
  font-size: 0.93rem;
  line-height: 1.55;
  flex-grow: 1;
}
.util-card-meta {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  flex-wrap: wrap;
}
.util-card-meta span { display: flex; align-items: center; gap: 6px; }
.util-card-meta .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); }
.util-card-meta .dot.live { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.util-card-meta .dot.ext { background: var(--warn); }
.util-card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  align-self: flex-start;
}
.util-card-link::after {
  content: '→';
  transition: transform var(--trans);
}
.util-card:hover .util-card-link::after { transform: translateX(4px); }

/* Placeholder card for future utilities */
.util-card.placeholder {
  border-style: dashed;
  opacity: 0.5;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 280px;
}
.util-card.placeholder p {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 20ch;
}

/* ----- About block ----- */
.about {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}
.about-text p {
  color: var(--text-dim);
  margin-bottom: 1rem;
  font-size: 1.02rem;
  line-height: 1.7;
}
.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  font-family: var(--font-mono);
}
.about-card dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 24px; font-size: 0.85rem; }
.about-card dt { color: var(--text-muted); letter-spacing: 0.05em; text-transform: uppercase; font-size: 0.72rem; padding-top: 2px; }
.about-card dd { color: var(--text); }
.about-card dd a { color: var(--accent); }
.about-card dd a:hover { text-decoration: underline; }
.about-card hr { border: none; border-top: 1px solid var(--border); margin: 24px 0; }

@media (max-width: 860px) {
  .about { grid-template-columns: 1fr; gap: 32px; }
}

/* ----- Utility page specific ----- */
.util-hero {
  padding: clamp(3rem, 6vw, 5rem) 0 clamp(2rem, 4vw, 3rem);
}
.util-breadcrumb {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  letter-spacing: 0.05em;
}
.util-breadcrumb a { color: var(--text-dim); }
.util-breadcrumb a:hover { color: var(--accent); }
.util-breadcrumb span { color: var(--text); }
.util-breadcrumb .sep { color: var(--border-strong); margin: 0 8px; }

.util-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: end;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}
.util-header h1 { font-weight: 400; margin-bottom: 16px; }
.util-header h1 em { font-style: italic; color: var(--accent); font-weight: 500; }
.util-header .util-tagline {
  font-size: 1.15rem;
  color: var(--text-dim);
  max-width: 60ch;
  line-height: 1.5;
}
.util-specs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  text-align: right;
}
.util-specs strong { color: var(--text); font-weight: 600; }
.util-specs .badge-free {
  display: inline-block;
  padding: 4px 10px;
  background: var(--accent);
  color: var(--bg);
  border-radius: 2px;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  font-weight: 700;
}

@media (max-width: 860px) {
  .util-header { grid-template-columns: 1fr; gap: 24px; }
  .util-specs { text-align: left; }
}

/* Pricing card */
.pricing {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  margin: 48px 0;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 40px;
  position: relative;
  overflow: hidden;
}
.pricing::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent);
}
.pricing-head { margin-bottom: 8px; }
.pricing h3 { font-size: 1.5rem; margin-bottom: 8px; }
.pricing .price-line { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.pricing .price {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 500;
  color: var(--accent);
  line-height: 1;
}
.pricing .price-sub { font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-dim); }
.pricing ul { display: grid; gap: 8px; font-size: 0.92rem; color: var(--text-dim); }
.pricing ul li { position: relative; padding-left: 22px; }
.pricing ul li::before { content: '✓'; position: absolute; left: 0; top: 0; color: var(--accent); font-weight: bold; }
.pricing-cta { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.pricing-cta small { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-muted); letter-spacing: 0.05em; }

@media (max-width: 720px) {
  .pricing { grid-template-columns: 1fr; padding: 28px; }
  .pricing-cta { align-items: flex-start; }
}

/* Feature grid */
.feat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.feat-grid .feat {
  background: var(--bg-card);
  padding: 28px;
}
.feat h4 {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
  font-weight: 600;
}
.feat p { color: var(--text-dim); font-size: 0.93rem; line-height: 1.55; }

/* Screenshots */
.shots {
  display: grid;
  gap: 40px;
  margin: 48px 0;
}
.shot {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.shot-caption {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.shot-caption strong { color: var(--text); }
.shot-caption code {
  background: var(--bg-elev);
  padding: 2px 6px;
  border-radius: 2px;
  color: var(--accent);
  font-size: 0.72rem;
}
.shot img {
  width: 100%;
  background: #000;
}

/* FAQ */
.faq { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.faq details {
  background: var(--bg-card);
  padding: 0;
}
.faq summary {
  padding: 20px 24px;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1.02rem;
  transition: color var(--trans);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--accent); }
.faq summary::after {
  content: '+';
  font-family: var(--font-mono);
  font-size: 1.4rem;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform var(--trans);
}
.faq details[open] summary::after { content: '−'; color: var(--accent); }
.faq details[open] summary { color: var(--accent); }
.faq .faq-answer {
  padding: 0 24px 24px;
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.65;
}
.faq .faq-answer p + p { margin-top: 10px; }
.faq .faq-answer ul { margin-top: 10px; padding-left: 18px; list-style: disc; }

/* ----- Footer ----- */
.site-footer {
  margin-top: 5rem;
  padding: 48px 0 32px;
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer-grid h5 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
  font-weight: 600;
}
.footer-grid ul li { margin-bottom: 8px; }
.footer-grid ul li a {
  color: var(--text-dim);
  font-size: 0.9rem;
  transition: color var(--trans);
}
.footer-grid ul li a:hover { color: var(--accent); }
.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 12px;
}
.footer-bottom a { color: var(--text-dim); }
.footer-bottom a:hover { color: var(--accent); }
.footer-about p { font-size: 0.9rem; color: var(--text-dim); line-height: 1.6; max-width: 40ch; }

@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }
}

/* ----- Reveal animation ----- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 600ms ease, transform 600ms ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ----- Mobile ----- */
@media (max-width: 640px) {
  .nav { padding: 12px 16px; flex-wrap: wrap; gap: 12px; }
  .nav-tools { order: 3; width: 100%; justify-content: flex-end; }
  .container, .container-wide { padding: 0 16px; }
  .util-card { padding: 24px; }
  .hero { padding: 3rem 0 2rem; }
  .section { padding: 3rem 0; }
}

/* ----- Focus ----- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

/* ================================================================
   Cursor spotlight — global glow + card-level hover spotlight
   ================================================================ */
.cursor-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 500ms ease;
  background: radial-gradient(
    380px circle at var(--mx, -9999px) var(--my, -9999px),
    color-mix(in srgb, var(--accent) 10%, transparent) 0%,
    transparent 60%
  );
}
[data-theme="light"] .cursor-glow {
  background: radial-gradient(
    380px circle at var(--mx, -9999px) var(--my, -9999px),
    color-mix(in srgb, var(--accent) 14%, transparent) 0%,
    transparent 60%
  );
}
body.has-cursor .cursor-glow { opacity: 1; }

.util-card,
.feat,
.pricing,
.about-card { isolation: isolate; }
.feat,
.about-card { position: relative; }

.util-card::after,
.feat::after,
.pricing::after,
.about-card::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(
    180px circle at var(--cx, 50%) var(--cy, 50%),
    color-mix(in srgb, var(--accent) 20%, transparent) 0%,
    transparent 60%
  );
  opacity: 0;
  transition: opacity 280ms ease;
  z-index: -1;
}
.util-card:hover::after,
.feat:hover::after,
.pricing:hover::after,
.about-card:hover::after { opacity: 1; }

@media (hover: none), (pointer: coarse), (prefers-reduced-motion: reduce) {
  .cursor-glow,
  .util-card::after,
  .feat::after,
  .pricing::after,
  .about-card::after { display: none !important; }
}
