/* LiteNet design system.
 *
 * Every value here is measured from https://litenet.tel — see TOKENS.md for the
 * provenance of each one. This file is the single source of truth for the two
 * modern surfaces (the public site and the NOC console). The dial-up portal
 * cannot use it at all; its translation table is at the bottom of TOKENS.md.
 *
 * Deliberately hand-written, framework-free, one file. The public site is
 * served from a $20/month box that also carries sixteen modem lines, and the
 * NOC has to load over a tailnet from wherever the operator happens to be.
 */

/* --------------------------------------------------------------------------
 * Fonts. Self-hosted rather than pulled from a CDN: the same two subsets
 * litenet.tel ships, byte for byte, so the two sites render identically and
 * neither depends on a third party staying up.
 * -------------------------------------------------------------------------- */

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(inter-latin.woff2) format("woff2");
  unicode-range: u+00??, u+0131, u+0152-0153, u+02bb-02bc, u+02c6, u+02da,
    u+02dc, u+0304, u+0308, u+0329, u+2000-206f, u+20ac, u+2122, u+2191, u+2193,
    u+2212, u+2215, u+feff, u+fffd;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(inter-latin-ext.woff2) format("woff2");
  unicode-range: u+0100-02ba, u+02bd-02c5, u+02c7-02cc, u+02ce-02d7, u+02dd-02ff,
    u+0304, u+0308, u+0329, u+1d00-1dbf, u+1e00-1e9f, u+1ef2-1eff, u+2020,
    u+20a0-20ab, u+20ad-20c0, u+2113, u+2c60-2c7f, u+a720-a7ff;
}

/* Metric-matched to Inter so the first paint and the webfont paint occupy the
 * same boxes. Without the overrides the hero reflows by about a line. */
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial");
  ascent-override: 90.44%;
  descent-override: 22.52%;
  line-gap-override: 0%;
  size-adjust: 107.12%;
}

/* --------------------------------------------------------------------------
 * Tokens
 * -------------------------------------------------------------------------- */

:root {
  --ln-bg: #030712;
  --ln-bg-deep: #000000;
  --ln-fg: #d1d5db;
  --ln-fg-strong: #ffffff;
  --ln-fg-muted: #9ca3af;
  --ln-fg-faint: #6b7280;
  --ln-line: #1f2937;
  --ln-line-hover: #374151;
  --ln-surface: rgba(3, 7, 18, 0.5);
  --ln-surface-solid: #111827;
  --ln-accent: #3b82f6;
  --ln-accent-hover: #60a5fa;
  --ln-accent-press: #2563eb;
  --ln-violet: #7832ff;
  --ln-ok: #22c55e;
  --ln-warn: #f59e0b;
  --ln-bad: #ef4444;

  --ln-font: Inter, "Inter Fallback", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ln-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  --ln-container: 1280px;
  --ln-gutter: 32px;
  --ln-radius: 8px;
  --ln-radius-sm: 6px;
  --ln-header-h: 57px;
}

/* --------------------------------------------------------------------------
 * Reset and page frame
 * -------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--ln-header-h) + 24px);
}

body {
  margin: 0;
  min-height: 100vh;
  position: relative;
  background: var(--ln-bg);
  color: var(--ln-fg);
  font-family: var(--ln-font);
  font-size: 16px;
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* The fixed field. Three coloured lobes over a corner-to-corner ramp; this is
 * the single most recognisable thing about the brand on screen. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -10;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 80%, rgba(50, 100, 255, 0.1), transparent 40%),
    radial-gradient(circle at 80% 20%, rgba(120, 50, 255, 0.1), transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(150, 150, 150, 0.05), transparent 50%),
    linear-gradient(to bottom right, var(--ln-bg), var(--ln-bg-deep), var(--ln-bg));
}

.ln-page {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.ln-container {
  width: 100%;
  max-width: var(--ln-container);
  margin: 0 auto;
  padding: 0 var(--ln-gutter);
}

.ln-section {
  padding: 128px 0;
}
.ln-section--tight {
  padding: 96px 0;
}

/* --------------------------------------------------------------------------
 * Type
 * -------------------------------------------------------------------------- */

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  color: var(--ln-fg-strong);
  text-wrap: balance;
}

.ln-display {
  font-size: clamp(2.75rem, 8vw, 6rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--ln-fg-strong);
}

.ln-h2 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.ln-h3 {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 2rem;
}

.ln-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ln-accent);
}

.ln-lead {
  font-size: 1.125rem;
  line-height: 1.75rem;
  color: var(--ln-fg-muted);
  max-width: 46rem;
  text-wrap: pretty;
}

.ln-muted {
  color: var(--ln-fg-muted);
}
.ln-faint {
  color: var(--ln-fg-faint);
}
.ln-strong {
  color: var(--ln-fg-strong);
}
.ln-mono {
  font-family: var(--ln-mono);
  font-variant-numeric: tabular-nums;
}

/* The hero's second line. litenet.tel renders "LiteNet" as a blue-to-indigo
 * ramp; this is that ramp. */
.ln-gradient-text {
  background: linear-gradient(100deg, #60a5fa 0%, #3b82f6 45%, #8b5cf6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

a {
  color: var(--ln-accent);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: var(--ln-accent-hover);
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
 * The mark
 * -------------------------------------------------------------------------- */

.ln-mark {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.ln-mark svg,
.ln-mark img {
  position: relative;
  display: block;
  height: 100%;
  width: auto;
  color: var(--ln-fg-strong);
}
.ln-mark::before {
  content: "";
  position: absolute;
  inset: -18%;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.2);
  filter: blur(12px);
  z-index: 0;
}

.ln-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--ln-fg-strong);
  letter-spacing: -0.01em;
}
.ln-wordmark:hover {
  text-decoration: none;
  color: var(--ln-fg-strong);
}
.ln-wordmark .ln-mark {
  height: 22px;
}
.ln-wordmark small {
  display: block;
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--ln-fg-faint);
  margin-top: 3px;
}

/* --------------------------------------------------------------------------
 * Header
 * -------------------------------------------------------------------------- */

.ln-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--ln-header-h);
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--ln-line);
}
.ln-header .ln-container {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 100%;
}
.ln-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}
.ln-nav a {
  padding: 8px;
  border-radius: var(--ln-radius-sm);
  color: var(--ln-fg);
  font-size: 0.9375rem;
  transition: color 0.2s, background-color 0.2s;
}
.ln-nav a:hover,
.ln-nav a[aria-current="page"] {
  color: var(--ln-fg-strong);
  background: rgba(31, 41, 55, 0.5);
  text-decoration: none;
}

.ln-nav-toggle {
  display: none;
  margin-left: auto;
  background: var(--ln-surface-solid);
  border: 1px solid var(--ln-line-hover);
  color: var(--ln-fg-strong);
  border-radius: var(--ln-radius-sm);
  padding: 6px 10px;
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
 * Buttons
 * -------------------------------------------------------------------------- */

.ln-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  border-radius: var(--ln-radius-sm);
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.ln-btn:hover {
  text-decoration: none;
}
.ln-btn--primary {
  background: var(--ln-accent-press);
  color: #fff;
}
.ln-btn--primary:hover {
  background: #1d4ed8;
  color: #fff;
}
.ln-btn--ghost {
  background: var(--ln-surface-solid);
  border-color: var(--ln-line-hover);
  color: var(--ln-fg-strong);
}
.ln-btn--ghost:hover {
  background: #1f2937;
  color: var(--ln-fg-strong);
}
.ln-btn--lg {
  padding: 13px 26px;
  font-size: 1rem;
}

/* --------------------------------------------------------------------------
 * Cards
 * -------------------------------------------------------------------------- */

.ln-card {
  position: relative;
  border: 1px solid var(--ln-line);
  border-radius: var(--ln-radius);
  background: var(--ln-surface);
  padding: 24px;
  transition: border-color 0.5s ease-out, transform 0.5s ease-out;
}
.ln-card--hover:hover {
  border-color: var(--ln-line-hover);
  transform: translateY(-4px);
}
.ln-card--accent:hover {
  border-color: var(--ln-accent);
}

.ln-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.ln-grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 32px;
}

/* --------------------------------------------------------------------------
 * Stats, pills, dots
 * -------------------------------------------------------------------------- */

.ln-stat {
  font-family: var(--ln-mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--ln-fg-strong);
  letter-spacing: -0.02em;
}
.ln-stat-label {
  font-size: 0.8125rem;
  color: var(--ln-fg-muted);
  margin-top: 6px;
}

.ln-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border: 1px solid var(--ln-line);
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.6);
  font-size: 0.8125rem;
  color: var(--ln-fg-muted);
}

.ln-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex: none;
  background: var(--ln-fg-faint);
}
.ln-dot--ok {
  background: var(--ln-ok);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}
.ln-dot--warn {
  background: var(--ln-warn);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}
.ln-dot--bad {
  background: var(--ln-bad);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* --------------------------------------------------------------------------
 * Tables
 * -------------------------------------------------------------------------- */

.ln-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}
.ln-table th,
.ln-table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--ln-line);
  vertical-align: baseline;
}
.ln-table th {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ln-fg-faint);
  white-space: nowrap;
}
.ln-table td.ln-num,
.ln-table th.ln-num {
  text-align: right;
  font-family: var(--ln-mono);
  font-variant-numeric: tabular-nums;
}
.ln-table tbody tr:last-child td {
  border-bottom: 0;
}
.ln-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--ln-line);
  border-radius: var(--ln-radius);
  background: var(--ln-surface);
}

/* --------------------------------------------------------------------------
 * Footer
 * -------------------------------------------------------------------------- */

.ln-footer {
  margin-top: auto;
  border-top: 1px solid rgba(31, 41, 55, 0.5);
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: var(--ln-fg-muted);
  padding: 48px 0;
  font-size: 0.875rem;
}
.ln-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
}
.ln-footer-links a {
  position: relative;
  color: var(--ln-fg-muted);
}
.ln-footer-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 0;
  height: 2px;
  background: var(--ln-accent-hover);
  transition: width 0.3s;
}
.ln-footer-links a:hover {
  color: var(--ln-accent-hover);
  text-decoration: none;
}
.ln-footer-links a:hover::after {
  width: 100%;
}

/* --------------------------------------------------------------------------
 * Utilities. A deliberately short list — anything used once belongs in the
 * page, not here.
 * -------------------------------------------------------------------------- */

.ln-stack > * + * {
  margin-top: 16px;
}
.ln-stack-lg > * + * {
  margin-top: 32px;
}
.ln-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.ln-center {
  text-align: center;
}
.ln-center .ln-lead {
  margin-left: auto;
  margin-right: auto;
}
.ln-hr {
  border: 0;
  border-top: 1px solid var(--ln-line);
  margin: 32px 0;
}
.ln-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.ln-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--ln-accent-press);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 var(--ln-radius-sm) 0;
}
.ln-skip:focus {
  left: 0;
}

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

@media (max-width: 860px) {
  :root {
    --ln-gutter: 20px;
  }
  .ln-section {
    padding: 80px 0;
  }
  .ln-section--tight {
    padding: 64px 0;
  }
  .ln-nav-toggle {
    display: block;
  }
  .ln-nav {
    display: none;
    position: absolute;
    top: var(--ln-header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px var(--ln-gutter) 16px;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--ln-line);
  }
  .ln-nav[data-open="true"] {
    display: flex;
  }
  .ln-nav a {
    padding: 12px 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

@media print {
  body::before {
    display: none;
  }
  body {
    background: #fff;
    color: #000;
  }
  .ln-header,
  .ln-footer {
    display: none;
  }
}

/* --------------------------------------------------------------------------
 * Forms
 *
 * One form exists on the public site — the account application — and these are
 * its styles. They live here rather than on the page because the NOC console's
 * approve and deny controls reuse them, and two copies of a focus ring is how
 * two surfaces stop looking like one company.
 * -------------------------------------------------------------------------- */

.ln-form {
  margin-top: 32px;
}

.ln-fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 28px;
  /* fieldset defaults to min-content, which collapses the grid inside it */
  min-width: 0;
}

.ln-legend {
  padding: 0;
  margin-bottom: 16px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ln-accent);
}

.ln-field-row {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.ln-field {
  margin: 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.ln-field-row .ln-field {
  margin-bottom: 0;
}

.ln-field label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ln-fg-strong);
}

.ln-req {
  color: var(--ln-accent);
}

.ln-hint {
  font-size: 0.8125rem;
  color: var(--ln-fg-faint);
}

.ln-field input,
.ln-field select,
.ln-field textarea {
  width: 100%;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--ln-fg-strong);
  background: rgba(3, 7, 18, 0.6);
  border: 1px solid var(--ln-line);
  border-radius: var(--ln-radius-sm);
  padding: 11px 13px;
  transition: border-color 0.2s, background-color 0.2s;
}
.ln-field textarea {
  resize: vertical;
  min-height: 96px;
}
.ln-field input::placeholder,
.ln-field textarea::placeholder {
  color: var(--ln-fg-faint);
}
.ln-field input:hover,
.ln-field select:hover,
.ln-field textarea:hover {
  border-color: var(--ln-line-hover);
}
.ln-field input:focus,
.ln-field select:focus,
.ln-field textarea:focus {
  outline: none;
  border-color: var(--ln-accent);
  background: rgba(3, 7, 18, 0.9);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* :user-invalid rather than :invalid. :invalid paints every required field red
 * on first paint, before the visitor has typed a character, which reads as
 * "you have already done something wrong". */
.ln-field input:user-invalid,
.ln-field select:user-invalid,
.ln-field textarea:user-invalid {
  border-color: var(--ln-bad);
}

.ln-check {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 4px 0 0;
}
.ln-check input {
  margin: 3px 0 0;
  width: 17px;
  height: 17px;
  flex: none;
  accent-color: var(--ln-accent-press);
}
.ln-check label {
  font-size: 0.9375rem;
  color: var(--ln-fg-muted);
  line-height: 1.6;
}

.ln-form-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 8px;
  padding-top: 24px;
  border-top: 1px solid var(--ln-line);
}

/* The honeypot. Positioned off-screen rather than display:none, because some
 * bots skip fields they can tell are hidden; aria-hidden on the wrapper keeps
 * it away from anybody using a screen reader. */
.ln-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* The banner the server renders above the form after a POST. */
.ln-note {
  border: 1px solid var(--ln-line);
  border-left-width: 3px;
  border-radius: var(--ln-radius-sm);
  padding: 16px 18px;
  margin: 0 0 28px;
  background: rgba(17, 24, 39, 0.5);
  font-size: 0.9375rem;
}
.ln-note--ok {
  border-left-color: var(--ln-ok);
}
.ln-note--bad {
  border-left-color: var(--ln-bad);
}
.ln-note strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ln-fg-strong);
}
