/* ==========================================================================
   NetworkMonitor Blog — design system
   Identity preserved from the original site: dark navy canvas, cyan→purple
   accent, layered-diamond logo, system-ui with monospace eyebrows.
   ========================================================================== */

:root {
  --bg:        #0f172a;
  --bg-2:      #0b1120;
  --panel:     #020617;
  --panel-2:   #111c33;
  --line:      #1e2937;
  --line-2:    #334155;
  --text:      #e2e8f0;
  --text-2:    #cbd5e1;
  --muted:     #94a3b8;
  --muted-2:   #64748b;

  --primary:   #67f6ff;   /* cyan */
  --accent:    #a855f7;   /* purple */
  --green:     #34d399;
  --amber:     #fbbf24;
  --red:       #fb7185;

  --grad: linear-gradient(135deg, #67f6ff, #a855f7);
  --grad-soft: linear-gradient(135deg, rgba(103,246,255,.12), rgba(168,85,247,.12));

  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --wide: 1180px;
  --prose: 780px;
  --r: 16px;
  --r-lg: 22px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 17px;
  /* faint grid, matches original hero texture */
  background-image:
    linear-gradient(90deg, rgba(103,246,255,.030) 1px, transparent 1px),
    linear-gradient(rgba(103,246,255,.030) 1px, transparent 1px);
  background-size: 64px 64px;
  background-attachment: fixed;
}

img, svg { max-width: 100%; height: auto; display: block; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 4px; }

.container { max-width: var(--wide); margin: 0 auto; padding: 0 2rem; }
.narrow { max-width: var(--prose); margin: 0 auto; padding: 0 2rem; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--primary); color: #001018; padding: 10px 16px;
  font-family: var(--mono); font-size: 13px; border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; top: 0; }

/* --- Nav ------------------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(15,23,42,.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.nav-content {
  max-width: var(--wide); margin: 0 auto; padding: 1rem 2rem;
  display: flex; align-items: center; gap: 1.5rem;
}
.logo { display: flex; align-items: center; gap: .75rem; color: #fff; }
.logo:hover { text-decoration: none; }
.logo-icon {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  background: var(--grad); display: flex; align-items: center; justify-content: center;
}
.logo-name { font-size: 1.4rem; font-weight: 700; letter-spacing: -.02em; }
.nav-links { margin-left: auto; display: flex; align-items: center; gap: 1.5rem; }
.nav-links a { color: var(--muted); font-weight: 500; font-size: .95rem; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a[aria-current="page"] { color: var(--primary); }
.nav-back { color: var(--muted); font-weight: 500; }
@media (max-width: 820px) {
  .nav-content { flex-wrap: wrap; gap: .75rem 1.25rem; padding: .85rem 1.25rem; }
  .nav-links { margin-left: 0; width: 100%; gap: 1rem; flex-wrap: wrap; font-size: .9rem; }
  .container, .narrow { padding: 0 1.25rem; }
}

/* --- Eyebrow / tags -------------------------------------------------- */
.eyebrow {
  font-family: var(--mono); font-size: .78rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--primary); margin-bottom: 1rem;
}
.tag {
  display: inline-block; font-family: var(--mono); font-size: .68rem;
  letter-spacing: .12em; text-transform: uppercase; padding: .35rem .7rem;
  border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted);
}
.tag.cyan   { color: var(--primary); border-color: rgba(103,246,255,.4); background: rgba(103,246,255,.06); }
.tag.purple { color: var(--accent);  border-color: rgba(168,85,247,.4);  background: rgba(168,85,247,.08); }
.tag.green  { color: var(--green);   border-color: rgba(52,211,153,.4);  background: rgba(52,211,153,.06); }

/* --- Buttons -------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: .55rem; font-weight: 600;
  font-size: .95rem; padding: .85rem 1.5rem; border-radius: 12px;
  border: 1px solid transparent; transition: transform .15s, box-shadow .15s, background .15s, border-color .15s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--grad); color: #05101c; box-shadow: 0 8px 30px -12px rgba(103,246,255,.6); }
.btn-primary:hover { box-shadow: 0 14px 40px -12px rgba(103,246,255,.7); }
.btn-ghost { border-color: var(--line-2); color: var(--text); background: rgba(255,255,255,.02); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

/* --- Hero ------------------------------------------------------------ */
.hero { padding: 6rem 0 3rem; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 55% at 78% 8%, rgba(168,85,247,.16), transparent 60%),
    radial-gradient(55% 50% at 8% 4%, rgba(103,246,255,.14), transparent 60%);
}
.hero h1 {
  font-size: clamp(2.4rem, 5.4vw, 4rem); line-height: 1.04; font-weight: 800;
  letter-spacing: -.04em; margin-bottom: 1.5rem; max-width: 16ch;
}
.hero h1 .grad {
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-lede { font-size: 1.2rem; color: var(--text-2); max-width: 60ch; margin-bottom: 2rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.hero-meta { margin-top: 1.75rem; font-family: var(--mono); font-size: .8rem; color: var(--muted-2); letter-spacing: .04em; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 2.5rem; margin-top: 3rem; }
.hero-stats .stat .n { font-size: 1.9rem; font-weight: 800; letter-spacing: -.03em; }
.hero-stats .stat .n .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero-stats .stat .l { font-size: .85rem; color: var(--muted); }

/* --- Section scaffolding -------------------------------------------- */
.section { padding: 4rem 0; }
.section-head { max-width: 62ch; margin-bottom: 2.5rem; }
.section-head h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); font-weight: 700; letter-spacing: -.03em; line-height: 1.12; margin-bottom: .9rem; }
.section-head p { color: var(--text-2); }
.divider { height: 1px; background: linear-gradient(90deg, transparent, var(--line-2), transparent); margin: 0; border: 0; }

/* --- Cards / grid ---------------------------------------------------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid.two { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid, .grid.two { grid-template-columns: 1fr; } }

.card {
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.8rem;
  display: flex; flex-direction: column; transition: border-color .2s, transform .2s;
}
.card:hover { border-color: var(--line-2); transform: translateY(-3px); }
.card .tag { margin-bottom: 1rem; align-self: flex-start; }
.card h3 { font-size: 1.28rem; font-weight: 700; line-height: 1.3; letter-spacing: -.02em; margin-bottom: .7rem; }
.card h3 a { color: #fff; }
.card h3 a:hover { color: var(--primary); text-decoration: none; }
.card p { color: var(--muted); font-size: .96rem; margin-bottom: 1.4rem; }
.card .meta { margin-top: auto; display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono); font-size: .74rem; color: var(--muted-2); border-top: 1px solid var(--line); padding-top: 1rem; }
.card .arrow { color: var(--primary); font-weight: 600; }

.feature {
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: 2rem;
}
.feature .ico {
  width: 48px; height: 48px; border-radius: 14px; margin-bottom: 1.25rem;
  background: var(--grad-soft); border: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: center;
}
.feature h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: .6rem; letter-spacing: -.02em; }
.feature p { color: var(--muted); font-size: .95rem; }

/* --- Highlight / callout boxes -------------------------------------- */
.highlight-box {
  background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-lg);
  padding: 2rem; margin: 2.5rem 0;
}
.highlight-box .eyebrow { margin-bottom: .6rem; }
.callout {
  border-left: 3px solid var(--primary); background: rgba(103,246,255,.05);
  border-radius: 0 12px 12px 0; padding: 1.2rem 1.5rem; margin: 2rem 0;
}
.callout.warn { border-left-color: var(--amber); background: rgba(251,191,36,.06); }
.callout.purple { border-left-color: var(--accent); background: rgba(168,85,247,.07); }
.callout strong { display: block; font-family: var(--mono); font-size: .74rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: .4rem; }
.callout p:last-child { margin-bottom: 0; }

/* --- Numbered process ----------------------------------------------- */
.steps { counter-reset: step; display: grid; gap: 1.25rem; margin: 2rem 0; }
.step {
  display: grid; grid-template-columns: auto 1fr; gap: 1.25rem; align-items: start;
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--r); padding: 1.4rem 1.6rem;
}
.step::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  font-family: var(--mono); font-size: 1.1rem; font-weight: 700;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.step h3 { font-size: 1.08rem; font-weight: 700; margin-bottom: .35rem; }
.step p { color: var(--muted); font-size: .94rem; margin: 0; }

/* --- Article -------------------------------------------------------- */
.article-head { padding: 4rem 0 1rem; }
.article-head .kicker { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin-bottom: 1.4rem; }
.article-head .kicker time, .article-head .kicker .rt { font-family: var(--mono); font-size: .82rem; color: var(--muted-2); }
.article-head h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); font-weight: 800; letter-spacing: -.04em; line-height: 1.07; margin-bottom: 1.2rem; }
.article-head .standfirst { font-size: 1.22rem; color: var(--text-2); max-width: 60ch; }
.article-head .byline { margin-top: 1.4rem; font-size: .9rem; color: var(--muted); }
.article-head .byline b { color: var(--text); font-weight: 600; }

.article-layout { display: grid; grid-template-columns: minmax(0,1fr) 250px; gap: 3.5rem; align-items: start; padding: 2.5rem 0 5rem; }
@media (max-width: 1040px) { .article-layout { grid-template-columns: 1fr; gap: 0; } }

.prose { font-size: 1.08rem; color: var(--text-2); max-width: var(--prose); }
.prose > p { margin-bottom: 1.6rem; }
.prose h2 { font-size: 1.8rem; font-weight: 700; color: #fff; letter-spacing: -.025em; margin: 3.2rem 0 1.3rem; scroll-margin-top: 90px; }
.prose h3 { font-size: 1.32rem; font-weight: 600; color: var(--text); margin: 2.4rem 0 .9rem; }
.prose ul, .prose ol { margin: 0 0 1.6rem; padding-left: 1.4rem; }
.prose li { margin-bottom: .6rem; }
.prose li::marker { color: var(--primary); }
.prose strong { color: var(--text); font-weight: 600; }
.prose a { border-bottom: 1px solid rgba(103,246,255,.3); }
.prose a:hover { border-bottom-color: var(--primary); text-decoration: none; }
.prose code {
  font-family: var(--mono); font-size: .88em; background: var(--panel);
  border: 1px solid var(--line); border-radius: 6px; padding: .12em .4em; color: var(--primary);
}
.prose kbd {
  font-family: var(--mono); font-size: .82em; background: linear-gradient(180deg, #1c2740, #131d31);
  border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px;
  padding: .2em .5em; color: var(--text); white-space: nowrap;
}
.prose blockquote { margin: 2rem 0; padding: 1.2rem 1.6rem; border-left: 3px solid var(--accent);
  background: rgba(168,85,247,.06); border-radius: 0 12px 12px 0; color: var(--text); }
.prose blockquote p:last-child { margin-bottom: 0; }

.table-wrap { overflow-x: auto; margin: 2rem 0; border: 1px solid var(--line); border-radius: var(--r); }
table { border-collapse: collapse; width: 100%; font-size: .94rem; }
th, td { text-align: left; padding: .85rem 1.1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); background: var(--panel); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td strong { color: var(--primary); font-weight: 600; }

figure { margin: 2.5rem 0; }
figure svg { width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
figcaption { font-family: var(--mono); font-size: .76rem; color: var(--muted-2); margin-top: .8rem; letter-spacing: .02em; }

/* --- TOC / rail ------------------------------------------------------ */
.rail { position: sticky; top: 92px; }
.rail h2 { font-family: var(--mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted-2); margin-bottom: 1rem; }
.toc { list-style: none; border-left: 1px solid var(--line); }
.toc a { display: block; padding: .5rem 0 .5rem 1rem; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); font-size: .9rem; line-height: 1.4; }
.toc a:hover { color: var(--text); border-left-color: var(--primary); text-decoration: none; }
.rail-card { margin-top: 2rem; background: linear-gradient(160deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: var(--r); padding: 1.4rem; }
.rail-card p { font-size: .88rem; color: var(--muted); margin-bottom: 1rem; }
.rail-card .btn { width: 100%; justify-content: center; font-size: .88rem; padding: .7rem 1rem; }
@media (max-width: 1040px) { .rail { position: static; margin-top: 3rem; } }

/* --- Related --------------------------------------------------------- */
.related { border-top: 1px solid var(--line); padding: 3.5rem 0 5rem; }
.related h2 { font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; margin-bottom: 1.8rem; }

/* --- FAQ ------------------------------------------------------------- */
.faq { margin-top: 1.5rem; }
.faq details { border: 1px solid var(--line); border-radius: var(--r); background: linear-gradient(160deg, var(--panel-2), var(--panel)); margin-bottom: .8rem; }
.faq summary { cursor: pointer; padding: 1.1rem 1.4rem; font-weight: 600; font-size: 1.05rem; color: #fff; list-style: none; display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--primary); font-family: var(--mono); font-size: 1.3rem; flex: none; }
.faq details[open] summary::after { content: "\2212"; }
.faq .a { padding: 0 1.4rem 1.2rem; color: var(--muted); font-size: .97rem; }
.faq .a p { margin-bottom: .8rem; }
.faq .a p:last-child { margin-bottom: 0; }

/* --- Footer ---------------------------------------------------------- */
.footer { background: var(--panel); border-top: 1px solid var(--line); padding: 4rem 0 2rem; margin-top: 2rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 2.5rem; }
.footer h4 { font-family: var(--mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted-2); margin-bottom: 1.1rem; }
.footer a { display: block; color: var(--muted); font-size: .92rem; padding: .3rem 0; }
.footer a:hover { color: var(--primary); }
.footer .about { color: var(--muted); font-size: .92rem; margin-bottom: 1rem; max-width: 42ch; }
.footer-bottom { border-top: 1px solid var(--line); margin-top: 3rem; padding-top: 1.6rem; display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; font-family: var(--mono); font-size: .74rem; color: var(--muted-2); }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; } }

/* --- Simple content pages ------------------------------------------- */
.page { padding: 3.5rem 0 5rem; }
.page .prose h1 { font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 800; letter-spacing: -.03em; color: #fff; margin-bottom: 1.4rem; line-height: 1.1; }
.page .prose h2:first-of-type { margin-top: 2.4rem; }
