/* AS36231 — Tempest Hosting network information site
   Visual system aligned with tempest.net's production brand: Outfit on
   every heading tag, Jost everywhere else (body, nav, buttons), light-
   primary theme with a dark hero, monochrome palette (no accent hue),
   soft ambient shadows, pill-radius chrome. */

:root {
  --bg-primary: #f8f8fa;
  --bg-secondary: #f0f1f7;
  --bg-dark: #0b0e18;
  --bg-dark-light: #151a28;
  --bg-white: #fff;

  --text-dark: #0b0e18;
  --text-light: #fff;
  --text-muted: #5c6270;
  --text-muted-light: #d9d9d9;

  --border-light: #d9d9d9;
  --border-dark: #222a3d;

  --status-good: #15803d;
  --status-warn: #b45309;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 24px;
  --radius-pill: 9999px;

  --shadow-sm: 0 4px 6px -1px rgba(11, 14, 24, .05);
  --shadow-md: 0 10px 15px -3px rgba(11, 14, 24, .08);
  --shadow-lg: 0 10px 30px -10px rgba(11, 14, 24, .18);

  --font-primary: "Jost", sans-serif;
  --font-heading: "Outfit", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --transition-speed: .3s;
}

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

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  background: var(--bg-primary);
  color: var(--text-dark);
  font-family: var(--font-primary);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

a { color: inherit; text-decoration: underline; text-underline-offset: 2px; transition: color var(--transition-speed); }
a:hover { color: var(--text-muted); }
a:focus-visible { outline: 2px solid var(--text-dark); outline-offset: 3px; border-radius: 2px; }

code, .mono {
  font-family: var(--font-mono);
  font-size: 0.88em;
}

h2, h3 { font-family: var(--font-heading); }
strong, b { font-weight: 600; }

.no-js .js-loading { display: none; }

.retry-link {
  background: none;
  border: none;
  padding: 0;
  margin-left: 4px;
  font: inherit;
  font-weight: 600;
  color: var(--text-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.retry-link:hover { color: var(--text-muted); }
.retry-link:focus-visible { outline: 2px solid var(--text-dark); outline-offset: 3px; border-radius: 2px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -48px;
  left: 24px;
  z-index: 100;
  background: var(--text-dark);
  color: var(--text-light);
  font-family: var(--font-primary);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: top var(--transition-speed);
}
.skip-link:focus { top: 12px; }
.skip-link:focus-visible { outline: 2px solid var(--text-light); outline-offset: 3px; }

/* ---------- header ---------- */

.site-header {
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-primary);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 80px;
  padding-top: 12px;
  padding-bottom: 12px;
  flex-wrap: wrap;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.wordmark:hover { text-decoration: none; }

.wordmark-logo {
  height: 24px;
  width: auto;
  display: block;
}

.wordmark-asn {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  padding: 2px 12px;
  background: var(--bg-white);
}

.site-nav {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}

.site-nav a {
  font-family: var(--font-primary);
  color: var(--text-dark);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  padding: 11px 2px;
}
.site-nav a:hover { color: var(--text-muted); }

/* ---------- hero ---------- */

.hero {
  padding: 40px 0 32px;
  background: var(--bg-dark);
  color: var(--text-light);
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: var(--text-light);
}

.hero-sub {
  max-width: 620px;
  margin-top: 10px;
  color: var(--text-muted-light);
  font-size: 1rem;
}

.hero-meta {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted-light);
  opacity: 0.85;
}
.hero-meta span + span::before {
  content: "·";
  margin: 0 10px;
}

/* ---------- sections ---------- */

section { padding: 48px 0 8px; }

h2 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
}

h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 10px;
}

/* ---------- stat tiles ---------- */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

/* Reserve the loaded-content height so the loading->loaded swap doesn't
   shift everything below it (measured: 136px desktop / 592px mobile at
   the four-tile primary row; see the 560px override below). */
#tiles-primary { min-height: 136px; }

.tiles-secondary {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-top: 12px;
}
.tiles-secondary .tile {
  padding: 16px 18px;
}
.tiles-secondary .tile-value {
  font-size: 1.5rem;
}
.tiles-secondary .tile-cta {
  font-size: 1rem;
}

.tile {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 22px 22px;
  transition: box-shadow var(--transition-speed);
}
.tile:hover { box-shadow: var(--shadow-md); }

.tile-label {
  font-family: var(--font-heading);
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.tile-value {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.25;
  margin-top: 4px;
  color: var(--text-dark);
}

.tile-value small {
  font-family: var(--font-primary);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 2px;
}

.tile-sub {
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.tile-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.tile-cta {
  margin-top: 4px;
  font-family: var(--font-primary);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-dark);
}
.tile-link:hover .tile-cta { color: var(--text-muted); }
.tile-cta span { margin-left: 1px; }

/* ---------- tables ---------- */

.table-wrap {
  position: relative;
  overflow-x: auto;
  border-radius: var(--radius-lg);
  background: var(--bg-white);
  box-shadow: var(--shadow-sm);
}

/* Facilities can run to a dozen-plus rows; a single loading row can't
   reserve that. Partial mitigation, not a full fix -- reserving the true
   final height would mean shipping row count in the static HTML, which
   this no-build-step site deliberately doesn't do. ~6 rows (measured:
   48px header + 52px/row) meaningfully cuts the shift without reserving
   so much space that a smaller facility list looks like empty chrome
   while it's still loading. */
.table-wrap-facilities { min-height: 360px; }
.table-wrap:focus-visible {
  outline: 2px solid var(--text-dark);
  outline-offset: -2px;
}

.table-wrap.is-scrollable::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 32px;
  background: linear-gradient(to right, transparent, rgba(11, 14, 24, 0.1));
  pointer-events: none;
  border-top-right-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

.table-wrap p { padding: 14px 18px; color: var(--text-muted); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th, td {
  text-align: left;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

tbody tr:last-child th,
tbody tr:last-child td { border-bottom: none; }

thead th {
  font-family: var(--font-heading);
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: var(--bg-secondary);
}
thead tr:first-child th:first-child { border-top-left-radius: var(--radius-lg); }
thead tr:first-child th:last-child { border-top-right-radius: var(--radius-lg); }

th.num, td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

td.mono { color: var(--text-muted); }

td a { display: block; margin: -14px -18px; padding: 14px 18px; }
td a:focus-visible { outline-offset: -3px; }

tbody tr:hover { background: var(--bg-secondary); }

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.85rem;
  font-weight: 500;
}
.status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.status.up { color: var(--status-good); }
.status.down { color: var(--status-warn); }

/* ---------- policy cards ---------- */

.policy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 28px 28px;
}

.card p { color: var(--text-muted); margin-bottom: 14px; }

.card ul {
  list-style: none;
  color: var(--text-muted);
}

.card li {
  padding-left: 20px;
  position: relative;
  margin-bottom: 10px;
  font-size: 0.94rem;
}

.card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--text-dark);
}

.card code {
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  padding: 2px 7px;
}

/* ---------- footer ---------- */

.site-footer {
  margin-top: 72px;
  background: var(--bg-secondary);
  padding: 32px 0 44px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.site-footer p { margin-bottom: 6px; }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--text-dark); }

@media (max-width: 560px) {
  .hero { padding: 32px 0 24px; }
  th, td { padding: 12px 14px; }
  td a { margin: -12px -14px; padding: 12px 14px; }
  .nav-overflow { display: none; }
  #tiles-primary { min-height: 592px; }
}
