/* ============================================
   IPCraft marketing — shared system ("Address Plan")
   Tokens, type, nav, buttons, footer. Page layouts live in
   css/<page>.css. See style-guide.md.
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  color-scheme: light dark;

  /* Surfaces: drafting film, with white sheets laid on it */
  --paper: #f2f3ef;
  --sheet: #ffffff;
  --sheet-2: #f8f9f6;
  --rule: #d6d9d2;
  --rule-strong: #b9beb5;

  /* Ink */
  --ink: #14181d;
  --ink-2: #48505a;
  --ink-3: #5e6670;

  /* Action: the product teal, darkened for AA on white */
  --action: #00775f;
  --action-hover: #005e4b;
  --action-ink: #ffffff;
  --action-tint: rgba(0, 119, 95, 0.1);

  /* Categories: the TIA-598 fiber colour code, used to tell address
     blocks apart. Graphical use only (fills, borders) — never body text. */
  --c-infra: #6f7c8a;      /* slate */
  --c-servers: #2f6bd8;    /* blue */
  --c-users: #2e9a5b;      /* green */
  --c-wireless: #e07a1f;   /* orange */
  --c-facilities: #95623e; /* brown */
  --c-platform: #c9506f;   /* rose */

  /* Status */
  --ok: #2e9a5b;
  --warn: #b27500;
  --danger: #c9372c;

  /* Code panels stay dark in both themes */
  --code-bg: #161b20;
  --code-rule: #2a3137;
  --code-ink: #d5dade;
  --code-dim: #8a939b;

  --font-sans: 'Atkinson Hyperlegible Next', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Atkinson Hyperlegible Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 6px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #111518;
    --sheet: #181d21;
    --sheet-2: #1d2328;
    --rule: #2a3137;
    --rule-strong: #3a434b;
    --ink: #e9ece8;
    --ink-2: #aeb5bc;
    --ink-3: #8a929a;
    --action: #2bd3ac;
    --action-hover: #5fe3c3;
    --action-ink: #06261f;
    --action-tint: rgba(43, 211, 172, 0.12);
    --c-infra: #8d9aa8;
    --c-servers: #5b8ef0;
    --c-users: #43b875;
    --c-wireless: #f08f3a;
    --c-facilities: #b9835c;
    --c-platform: #e2738f;
    --ok: #43b875;
    --warn: #e0a43a;
    --danger: #ef6a5f;
    --code-bg: #0d1013;
    --code-rule: #232a30;
  }
}

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

body {
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink-2);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] { display: none !important; }
a { color: var(--action); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--action-hover); }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
::selection { background: var(--action); color: var(--action-ink); }

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

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -48px;
  z-index: 200;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
  text-decoration: none;
}
.skip-link:focus { top: 8px; color: var(--paper); }

/* ============================================
   TYPE
   ============================================ */
h1, h2, h3, h4 {
  color: var(--ink);
  font-weight: 800;
  text-wrap: balance;
}
.display {
  font-size: clamp(2.75rem, 1.5rem + 4.4vw, 4.75rem);
  line-height: 1;
  letter-spacing: -0.032em;
}
.h2 {
  font-size: clamp(2rem, 1.35rem + 2.1vw, 3rem);
  line-height: 1.06;
  letter-spacing: -0.024em;
}
.h3 {
  font-size: 1.25rem;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.008em;
}
.lead {
  font-size: clamp(1.125rem, 1.05rem + 0.3vw, 1.3125rem);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 34em;
  text-wrap: pretty;
}
.prose { max-width: 36em; text-wrap: pretty; }
.prose p + p { margin-top: 0.9em; }
.mono, code, kbd, samp { font-family: var(--font-mono); font-size: 0.94em; }
kbd {
  padding: 0.05em 0.4em;
  border: 1px solid var(--rule-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--sheet);
  color: var(--ink);
  font-size: 0.875em;
}
p code, li code {
  padding: 0.05em 0.35em;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--sheet);
  color: var(--ink);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn-primary { background: var(--action); color: var(--action-ink); }
.btn-primary:hover { background: var(--action-hover); color: var(--action-ink); }
.btn-secondary { background: var(--sheet); color: var(--ink); border-color: var(--rule-strong); }
.btn-secondary:hover { color: var(--ink); border-color: var(--ink-3); }
.btn-lg { min-height: 52px; padding: 0 26px; font-size: 1.0625rem; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 0.9375rem; }

/* ============================================
   NAV
   ============================================ */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}
.site-nav-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 1.1875rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.brand:hover { color: var(--ink); }
/* The mark: a /22 carved into a /23 and two /24s, Z-ordered */
.brand-mark { width: 22px; height: 22px; flex: none; }
.brand-mark .a { fill: var(--action); }
.brand-mark .b { fill: var(--ink); }
.site-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}
.site-links a {
  display: inline-block;
  padding: 8px 12px;
  border-radius: var(--radius);
  color: var(--ink-2);
  font-size: 0.9688rem;
  font-weight: 500;
  text-decoration: none;
}
.site-links a:hover { color: var(--ink); background: var(--sheet); }
.site-links a[aria-current="page"] { color: var(--ink); font-weight: 700; }
.site-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.site-signin {
  padding: 8px 12px;
  color: var(--ink-2);
  font-size: 0.9688rem;
  font-weight: 500;
  text-decoration: none;
}
.site-signin:hover { color: var(--ink); }
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
}
.menu-toggle svg { width: 22px; height: 22px; }
.menu-toggle .close { display: none; }
.menu-toggle[aria-expanded="true"] .open { display: none; }
.menu-toggle[aria-expanded="true"] .close { display: block; }

@media (max-width: 860px) {
  .site-nav-inner { gap: 12px; }
  .site-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px var(--gutter) 16px;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
  }
  .site-links.is-open { display: flex; }
  .site-links a { display: block; padding: 12px 0; font-size: 1.0625rem; border-radius: 0; }
  .site-links a:hover { background: none; }
  .site-links li + li { border-top: 1px solid var(--rule); }
  .menu-toggle { display: inline-flex; }
}
.site-links .narrow-only { display: none; }
@media (max-width: 420px) {
  .site-signin { display: none; }
  .site-links .narrow-only { display: block; }
}

/* ============================================
   SECTIONS
   ============================================ */
.band {
  padding-block: clamp(72px, 9vw, 128px);
  border-top: 1px solid var(--rule);
}
.band-head { max-width: 46rem; margin-bottom: clamp(36px, 5vw, 56px); }
.band-head .lead { margin-top: 18px; }

/* Sheet: a white panel laid on the paper — the frame for product renderings */
.sheet {
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 8px;
}

/* ============================================
   CODE
   ============================================ */
.code {
  overflow: hidden;
  background: var(--code-bg);
  border: 1px solid var(--code-rule);
  border-radius: 8px;
  color: var(--code-ink);
}
.code pre {
  margin: 0;
  padding: 20px 22px 22px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.8438rem;
  line-height: 1.75;
  tab-size: 2;
}
.code .c { color: var(--code-dim); }
.code .cmd { color: #5fe3c3; }
.code .f { color: #8cb4ff; }
.code .s { color: #b9e3a8; }
.code .v { color: #f4c56a; }
.code .k { color: #d0b6ff; }
.code .o { color: var(--code-dim); }

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  padding: 56px 0 40px;
  border-top: 1px solid var(--rule);
  font-size: 0.9375rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
  gap: 32px;
}
.footer-about p { max-width: 22em; margin-top: 12px; color: var(--ink-3); }
.footer-col h2 {
  margin-bottom: 12px;
  font-size: 0.9375rem;
  font-weight: 700;
}
.footer-col ul { list-style: none; }
.footer-col li + li { margin-top: 6px; }
.footer-col a { color: var(--ink-2); text-decoration: none; }
.footer-col a:hover { color: var(--ink); text-decoration: underline; }
.footer-base {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  color: var(--ink-3);
  font-size: 0.875rem;
}
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-about { grid-column: 1 / -1; }
}
