/* SmartKama Hub — premium dark, glass, motion-safe */
:root {
  --bg0: #03040a;
  --bg1: #0a0d18;
  --card: rgba(12, 18, 35, 0.72);
  --card-2: rgba(18, 26, 48, 0.55);
  --stroke: rgba(120, 200, 255, 0.14);
  --stroke-bright: rgba(60, 240, 255, 0.22);
  --text: #eceeff;
  --muted: #8e98b8;
  --accent: #3cf0ff;
  --accent2: #a78bfa;
  --accent3: #22d3ee;
  --ok: #34d399;
  --err: #f87171;
  --r: 20px;
  --r-sm: 12px;
  --font: "Sora", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.55);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

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

body {
  margin: 0;
  min-height: 100vh;
  position: relative;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg0);
  line-height: 1.55;
  opacity: 0;
  transition: opacity 0.5s var(--ease-out);
}
body.is-ready { opacity: 1; }

/* Ambient: grid + orbs + noise (SVG filter-free noise via gradient) */
.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.page-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, var(--bg0) 0%, transparent 32%, var(--bg1) 100%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 60px,
      rgba(60, 240, 255, 0.03) 60px,
      rgba(60, 240, 255, 0.03) 61px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 60px,
      rgba(139, 92, 246, 0.025) 60px,
      rgba(139, 92, 246, 0.025) 61px
    );
  opacity: 0.75;
  mask-image: linear-gradient(180deg, #000 40%, transparent 100%);
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  animation: float 22s var(--ease-out) infinite alternate;
}
.orb-1 { width: min(50vw, 420px); height: min(50vw, 420px); top: -8%; right: -5%; background: radial-gradient(circle, rgba(60, 240, 255, 0.4), transparent 70%); }
.orb-2 { width: min(40vw, 360px); height: min(40vw, 360px); bottom: 10%; left: -8%; background: radial-gradient(circle, rgba(139, 92, 246, 0.4), transparent 70%); animation-delay: -7s; }
.orb-3 { width: 200px; height: 200px; top: 40%; left: 45%; background: radial-gradient(circle, rgba(34, 211, 238, 0.2), transparent 70%); animation-duration: 18s; opacity: 0.3; }
@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(12px, -18px) scale(1.04); }
}

@media (prefers-reduced-motion: reduce) {
  .orb { animation: none; }
}

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--bg0);
  font-weight: 600;
  border-radius: 8px;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  backdrop-filter: blur(18px) saturate(1.2);
  background: rgba(3, 4, 10, 0.82);
  border-bottom: 1px solid var(--stroke);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.35);
}
.logo {
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.logo-mark {
  display: inline-flex;
  width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(60, 240, 255, 0.25), rgba(139, 92, 246, 0.35));
  border: 1px solid var(--stroke-bright);
  font-size: 0.9rem;
  line-height: 1;
}
.logo span { color: var(--accent); font-weight: 600; }
.nav-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.lang {
  background: var(--card-2);
  border: 1px solid var(--stroke);
  color: var(--text);
  padding: 0.4rem 0.7rem;
  border-radius: var(--r-sm);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.lang:hover, .lang:focus-visible {
  border-color: var(--stroke-bright);
  box-shadow: 0 0 0 1px rgba(60, 240, 255, 0.12);
  outline: none;
}
.lang.is-on {
  color: var(--bg0);
  background: linear-gradient(135deg, var(--accent) 0%, #6366f1 100%);
  border-color: transparent;
  box-shadow: 0 4px 20px rgba(60, 240, 255, 0.25);
}

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 1.25rem 3.5rem; }

.hero {
  text-align: center;
  padding: 2.75rem 0 0.5rem;
}
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 1rem;
  padding: 0.35rem 0.85rem 0.35rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent3);
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.12), rgba(139, 92, 246, 0.15));
  border: 1px solid rgba(60, 240, 255, 0.2);
  border-radius: 999px;
  box-shadow: 0 0 24px rgba(60, 240, 255, 0.08);
}
.hero-kicker-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-kicker-dot { animation: none; }
}

.hero h1 {
  font-size: clamp(1.65rem, 4.2vw, 2.45rem);
  line-height: 1.15;
  margin: 0 0 0.9rem;
  letter-spacing: -0.04em;
  font-weight: 700;
  background: linear-gradient(120deg, #fff 0%, #c8d4ff 40%, #7dd3fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 8px 40px rgba(60, 240, 255, 0.12);
}
.hero p {
  color: var(--muted);
  max-width: 32rem;
  margin: 0 auto;
  font-size: 1.04rem;
  line-height: 1.6;
}
.hero-tg-wrap {
  margin: 1.25rem 0 0.25rem;
  text-align: center;
}
a.hero-tg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--bg0) !important;
  text-decoration: none !important;
  background: linear-gradient(135deg, #2aabee 0%, #229ed9 50%, #0088cc 100%);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(34, 158, 217, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.2s, box-shadow 0.2s;
}
a.hero-tg:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(34, 158, 217, 0.45);
  color: #fff !important;
}
a.hero-tg:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.hero-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 0.65rem;
  margin: 1.5rem 0 0.25rem;
  padding: 0;
  list-style: none;
}
.hero-chips li {
  margin: 0;
  padding: 0.45rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  background: var(--card-2);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  transition: border-color 0.2s, color 0.2s, transform 0.2s var(--ease-out);
}
.hero-chips li:hover {
  border-color: var(--stroke-bright);
  color: var(--text);
  transform: translateY(-1px);
}

/* IP card */
.ip-section { margin: 2rem 0 2.75rem; }
.ip-card {
  position: relative;
  border-radius: var(--r);
  padding: 1.5rem 1.45rem 1.55rem;
  background: var(--card);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transition: box-shadow 0.35s var(--ease-out), border-color 0.35s;
}
.ip-card:hover {
  border-color: rgba(60, 240, 255, 0.2);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(60, 240, 255, 0.06) inset, 0 0 60px rgba(60, 240, 255, 0.06);
}
.ip-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(125deg, rgba(60, 240, 255, 0.1), transparent 38%, rgba(139, 92, 246, 0.12));
  pointer-events: none;
  opacity: 0.9;
}
.ip-card::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(60, 240, 255, 0.4), rgba(139, 92, 246, 0.35), transparent);
  pointer-events: none;
}
.ip-card h2 { position: relative; margin: 0 0 1rem; font-size: 0.95rem; color: var(--muted); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }

.ip-row {
  position: relative;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem;
  margin-bottom: 0.5rem;
}
.ip-big {
  font-family: var(--mono);
  font-size: clamp(1.5rem, 3.2vw, 1.95rem);
  color: #fff;
  word-break: break-all;
  letter-spacing: 0.02em;
  text-shadow: 0 0 32px rgba(60, 240, 255, 0.2);
}
.ip-fam {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  border: 1px solid rgba(60, 240, 255, 0.4);
  border-radius: 7px;
  padding: 0.18rem 0.5rem;
  background: rgba(60, 240, 255, 0.08);
}
.ip-actions { position: relative; display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.95rem; }
.sub-meta-title {
  position: relative;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0.85rem 0 0.3rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.sub-meta-wrap[hidden] { display: none !important; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  border: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(60, 240, 255, 0.12), rgba(60, 240, 255, 0.06));
  color: var(--text);
  padding: 0.5rem 1rem;
  border-radius: 12px;
  font: inherit; font-size: 0.88rem; font-weight: 500;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  transition: background 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}
.btn:hover {
  background: linear-gradient(180deg, rgba(60, 240, 255, 0.2), rgba(60, 240, 255, 0.08));
  border-color: var(--stroke-bright);
  box-shadow: 0 4px 20px rgba(60, 240, 255, 0.12);
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:active { transform: scale(0.98); }
.btn-ghost { background: transparent; box-shadow: none; }
.status-pill {
  position: relative;
  display: inline-block; font-size: 0.72rem; font-weight: 600; padding: 0.2rem 0.6rem; border-radius: 999px;
  background: rgba(52, 211, 153, 0.14); color: var(--ok); border: 1px solid rgba(52, 211, 153, 0.4);
}
.status-pill.err { background: rgba(248, 113, 113, 0.12); color: var(--err); border-color: rgba(248, 113, 113, 0.4); }
.status-pill.wip { color: #fde68a; border-color: rgba(253, 230, 138, 0.45); background: rgba(120, 53, 15, 0.28); }

.grid-meta {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.8rem 1.25rem;
  margin-top: 1.1rem; padding-top: 1.05rem;
  border-top: 1px solid var(--stroke);
}
.kv { font-size: 0.9rem; }
.kv b { display: block; color: var(--muted); font-weight: 500; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 0.2rem; }
.kv span { color: #f4f6ff; }
.disclaimer { position: relative; font-size: 0.78rem; color: var(--muted); margin-top: 1rem; line-height: 1.5; max-width: 40rem; }

/* Public network resources (OONI, Tor, IETF, etc.) */
.news-section {
  margin: 0 0 1.5rem;
  padding: 0;
}
.news-section .section-head { margin-top: 0.5rem; margin-bottom: 1.1rem; }
.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
}
.news-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.5rem;
  padding: 0.65rem 0.9rem;
  border-radius: var(--r-sm);
  background: var(--card-2);
  border: 1px solid var(--stroke);
  transition: border-color 0.25s var(--ease-out), background 0.25s;
}
.news-item:hover {
  border-color: rgba(60, 240, 255, 0.2);
  background: rgba(18, 26, 48, 0.7);
}
.news-link {
  color: #e8ecff;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid rgba(60, 240, 255, 0.2);
  transition: color 0.2s, border-color 0.2s;
}
.news-link:hover { color: var(--accent); border-color: var(--accent); }
.news-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.news-meta { font-size: 0.78rem; color: var(--muted); }
.news-disc {
  max-width: 42rem;
  margin: 1rem auto 0;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--muted);
  padding: 0.75rem 0.9rem;
  border-radius: var(--r-sm);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(120, 200, 255, 0.1);
}
.news-load, .news-empty, .news-err { color: var(--muted); font-size: 0.9rem; }
.news-err { color: var(--err); }

/* Hub tools (2ip-style extras: first-party, compare, DoH) */
.tools-section { margin: 0 0 1.5rem; }
.tools-section .section-head { margin-top: 0.5rem; margin-bottom: 1.1rem; }
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  max-width: 1120px;
  margin: 0 auto 1.5rem;
}
.tool-card {
  background: var(--card-2);
  border: 1px solid var(--stroke);
  border-radius: var(--r);
  padding: 1.1rem 1.1rem 1.15rem;
  min-height: 0;
}
.tool-card-wide { grid-column: 1 / -1; }
.tool-card-title {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #f0f2ff;
}
.doh-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.doh-inp {
  flex: 1 1 180px;
  min-width: 0;
  padding: 0.45rem 0.6rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--stroke);
  background: rgba(0,0,0,0.25);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.85rem;
}
.doh-sel {
  padding: 0.45rem 0.5rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--stroke);
  background: rgba(0,0,0,0.25);
  color: var(--text);
  font-size: 0.85rem;
}
.doh-out {
  margin: 0.75rem 0 0;
  padding: 0.75rem 0.9rem;
  max-height: 220px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.45;
  color: #dbe2ff;
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--stroke);
  border-radius: var(--r-sm);
  white-space: pre-wrap;
  word-break: break-word;
}
.hub-nl-out { max-height: min(50vh, 480px); }
.hub-nl-status-wrap { margin: 0.35rem 0 0.15rem; }
.status-pill.ok { color: #a7f3d0; border-color: rgba(52, 211, 153, 0.45); background: rgba(6, 78, 59, 0.32); }
.hub-nl-meta {
  margin: 0.35rem 0 0.15rem;
  font-size: 0.78rem;
  color: var(--muted);
  font-family: var(--mono);
}
.hub-history {
  margin-top: 0.7rem;
  border: 1px solid var(--stroke);
  border-radius: var(--r-sm);
  background: rgba(0, 0, 0, 0.18);
  padding: 0.55rem 0.65rem;
}
.hub-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
  color: var(--muted);
  font-size: 0.82rem;
}
.btn-mini {
  padding: 0.25rem 0.45rem;
  font-size: 0.74rem;
}
.hub-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.hub-history-item {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(127, 152, 255, 0.2);
  background: rgba(6, 10, 23, 0.5);
  color: #dbe2ff;
  border-radius: 8px;
  padding: 0.42rem 0.55rem;
  font-size: 0.75rem;
  cursor: pointer;
}
.hub-history-item:hover {
  border-color: rgba(60, 240, 255, 0.35);
}
.hub-history-empty {
  font-size: 0.75rem;
  color: var(--muted);
}
.hub-kpi {
  margin-top: 0.55rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.45rem;
}
.hub-kpi .kv {
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: rgba(8, 12, 24, 0.42);
  padding: 0.35rem 0.45rem;
}
.hub-kpi .kv b {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
  margin-bottom: 0.1rem;
}
.hub-kpi .kv span {
  font-size: 0.8rem;
  color: #eaf0ff;
  font-family: var(--mono);
}
.ip-compare-line { word-break: break-all; }

.map-link { color: var(--accent3); text-decoration: underline; text-underline-offset: 2px; }
.map-link:hover { color: #fff; }
.mini-note {
  font-size: 0.78rem; color: var(--muted);
  line-height: 1.45;
  margin: 0 0 0.4rem;
  max-width: 42rem;
}
.webrtc-box { margin-top: 0.5rem; }
.webrtc-list { display: flex; flex-direction: column; gap: 0.4rem; }
.webrtc-cand { font-size: 0.88rem; line-height: 1.4; }
.webrtc-err { color: #fbbf24; }
code.ice-typ, code.ice-ip {
  font-family: var(--mono);
  font-size: 0.82rem;
  background: rgba(0,0,0,0.25);
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
  border: 1px solid var(--stroke);
}

/* Services */
.section-head { margin: 2.5rem 0 1.15rem; text-align: center; }
h2.section-title {
  position: relative;
  display: inline-block;
  font-size: 1.15rem;
  margin: 0;
  letter-spacing: -0.02em;
  font-weight: 700;
}
h2.section-title::after {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  margin: 0.5rem auto 0;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}
.section-sub { margin: 0.5rem 0 0; font-size: 0.88rem; color: var(--muted); }

.svc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.1rem;
  margin-bottom: 2.5rem;
}
.svc {
  position: relative;
  border-radius: var(--r);
  padding: 1.3rem 1.25rem 1.4rem;
  background: var(--card-2);
  border: 1px solid var(--stroke);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s, border-color 0.3s;
  display: flex; flex-direction: column;
  min-height: 200px;
  overflow: hidden;
}
.svc::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  opacity: 0;
  transition: opacity 0.3s;
}
.svc:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 48px rgba(0,0,0,0.4);
  border-color: rgba(60, 240, 255, 0.25);
}
.svc:hover::before { opacity: 1; }
.svc-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem; height: 2.5rem;
  margin-bottom: 0.6rem;
  font-size: 1.2rem;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(60, 240, 255, 0.1), rgba(139, 92, 246, 0.15));
  border: 1px solid var(--stroke);
}
.svc h3 { margin: 0 0 0.45rem; font-size: 1.08rem; font-weight: 600; letter-spacing: -0.02em; }
.svc p { color: var(--muted); font-size: 0.9rem; margin: 0 0 0.9rem; flex: 1; line-height: 1.5; }
.svc a.cta {
  margin-top: auto;
  align-self: flex-start;
  font-weight: 600;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(60, 240, 255, 0.25);
  transition: color 0.2s, border-color 0.2s;
}
.svc a.cta:hover { color: #fff; border-color: var(--accent); text-decoration: none; }
.svc a.cta::after { content: " ↗"; opacity: 0.65; font-size: 0.9em; }

.foot {
  text-align: center; padding: 2.5rem 1.25rem 3rem; color: var(--muted);
  font-size: 0.86rem; line-height: 1.6;
  max-width: 1120px; margin: 0 auto;
  border-top: 1px solid var(--stroke);
  background: linear-gradient(180deg, transparent, rgba(3, 4, 10, 0.5));
}

.skel { color: var(--muted); font-style: italic; }

@media (max-width: 520px) {
  .topbar { padding: 0.75rem 1rem; }
  .ip-card { padding: 1.2rem 1.05rem; }
  .hero h1 { font-size: 1.45rem; }
}
