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

:root {
  --bg:     #050d0a;
  --card:   #0b1812;
  --border: rgba(34, 197, 94, 0.14);
  --green:  #22c55e;
  --green2: #4ade80;
  --text:   #e2f0e8;
  --text2:  #6b9b78;
  --text3:  #3d6b4d;
  --mono:   'JetBrains Mono', monospace;
}

html, body { min-height: 100%; }

body {
  background: var(--bg);
  font-family: 'Inter', sans-serif;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 28px;
  position: relative;
}

/* ── Grid bg ── */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(34,197,94,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34,197,94,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none; z-index: 0;
}

/* ── Scanline ── */
body::after {
  content: '';
  position: fixed; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(34,197,94,0.3), transparent);
  animation: scan 5s linear infinite;
  pointer-events: none; z-index: 0;
}

@keyframes scan  { from { top: -2px; } to { top: 100vh; } }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .15; } }
@keyframes spin  { to { transform: rotate(360deg); } }
@keyframes ringPulse {
  0%,100% { transform: scale(1); opacity: 1; }
  50%     { transform: scale(1.08); opacity: .5; }
}

/* ── Canvas ── */
#netCanvas {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none; z-index: 1;
}

/* ── Glow ── */
.glow {
  position: fixed; border-radius: 50%; pointer-events: none; z-index: 0;
  background: radial-gradient(circle, rgba(34,197,94,0.09) 0%, transparent 70%);
}

/* ── Main wrapper ── */
.main-wrap {
  width: 100%;
  max-width: 520px;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Base card ── */
.hk-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.hk-card::before, .hk-card::after {
  content: '';
  position: absolute;
  width: 10px; height: 10px;
  border-style: solid;
  border-color: rgba(34,197,94,0.4);
  pointer-events: none; z-index: 3;
  transition: border-color .2s;
}
.hk-card::before { top:-1px; left:-1px; border-width:2px 0 0 2px; }
.hk-card::after  { bottom:-1px; right:-1px; border-width:0 2px 2px 0; }

.accent-line {
  position: absolute; top:0; left:0; right:0; height:1px;
  background: linear-gradient(90deg, transparent, rgba(34,197,94,0.5), transparent);
}

/* ── Terminal header ── */
.term-hdr {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(34,197,94,0.025);
  flex-shrink: 0;
}
.tdot { width:9px; height:9px; border-radius:50%; }
.tdot.r { background: rgba(239,68,68,0.5); }
.tdot.y { background: rgba(251,191,36,0.5); }
.tdot.g { background: rgba(34,197,94,0.6); }
.ttitle {
  font-family: var(--mono); font-size:10.5px; letter-spacing:.09em;
  color: rgba(34,197,94,0.6); margin-left:5px;
}
.tlive {
  margin-left: auto; display:flex; align-items:center; gap:5px;
  font-family: var(--mono); font-size:9px; color:var(--green);
}
.pulse {
  width:6px; height:6px; border-radius:50%; background:var(--green);
  animation: blink 1.4s ease-in-out infinite;
}

/* ── Card body ── */
.card-body {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── Status icon ── */
.status-icon {
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
}
.icon-ring {
  width: 72px; height: 72px; border-radius: 50%;
  border: 2px solid rgba(34,197,94,0.35);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  background: rgba(34,197,94,0.04);
}
.icon-ring::before {
  content: '';
  position: absolute; inset: -6px; border-radius: 50%;
  border: 1px solid rgba(34,197,94,0.12);
  animation: ringPulse 2s ease-in-out infinite;
}
.icon-check {
  font-size: 28px; color: var(--green);
  text-shadow: 0 0 20px rgba(34,197,94,0.8);
}
.icon-gear { font-size: 26px; animation: spin 3s linear infinite; }

/* ── Title area ── */
.title-area { text-align: center; }
.main-title {
  font-family: var(--mono); font-size:16px; font-weight:700;
  letter-spacing:.12em; color:var(--green2);
  text-shadow: 0 0 24px rgba(34,197,94,0.4);
  text-transform: uppercase;
}
.sub-title {
  font-family: var(--mono); font-size:10px; color:var(--text3);
  letter-spacing:.1em; margin-top:5px;
}

/* ── Divider ── */
hr.hkd { border:none; border-top:1px solid var(--border); }

/* ── Log terminal ── */
.log-terminal {
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 14px 16px;
  min-height: 90px;
  position: relative; overflow: hidden;
}
.log-terminal::after {
  content: '';
  position: absolute; left:0; right:0; height:1px;
  background: linear-gradient(90deg, transparent, rgba(34,197,94,0.2), transparent);
  animation: scan 3s linear infinite;
}
.log-line {
  font-family: var(--mono); font-size:11px; line-height:1.9;
  opacity: 0; transform: translateX(-6px);
  transition: opacity .3s, transform .3s;
}
.log-line.visible { opacity: 1; transform: none; }
.log-line .ll-prefix { color: var(--text3); }
.log-line .ll-key    { color: rgba(34,197,94,0.7); }
.log-line .ll-val    { color: var(--green2); }
.log-line .ll-ok     { color: var(--green); }
.log-line .ll-skip   { color: var(--text3); }
.log-line .ll-err    { color: #f87171; }

/* ── Param grid ── */
.param-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.param-item {
  background: rgba(34,197,94,0.025);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 12px 14px;
  opacity: 0; transform: translateY(8px);
  transition: opacity .4s, transform .4s, border-color .2s;
}
.param-item.visible { opacity:1; transform:none; }
.param-item:hover { border-color: rgba(34,197,94,0.4); }
.param-item.full { grid-column: 1 / -1; }
.param-label {
  font-family: var(--mono); font-size:9px; letter-spacing:.14em;
  text-transform: uppercase; color:var(--text3); margin-bottom:6px;
}
.param-value {
  font-family: var(--mono); font-size:13px; font-weight:700;
  color: var(--green2); text-shadow:0 0 12px rgba(34,197,94,0.35);
  word-break: break-all;
}
.param-value.off       { color:#f87171; text-shadow:0 0 12px rgba(239,68,68,0.35); }
.param-value.unchanged { color:var(--text3); font-weight:400; font-size:11px; }
.param-value.masked    { letter-spacing:.1em; font-size:12px; }

/* ── Success banner ── */
.success-banner {
  background: rgba(34,197,94,0.07);
  border: 1px solid rgba(34,197,94,0.28);
  border-radius: 4px;
  padding: 12px 16px;
  display: flex; align-items:center; gap:12px;
  font-family: var(--mono); font-size:11.5px; color:var(--green2);
  opacity: 0; transition: opacity .5s;
  clip-path: polygon(8px 0,100% 0,100% calc(100% - 8px),calc(100% - 8px) 100%,0 100%,0 8px);
}
.success-banner.visible { opacity: 1; }
.success-banner .sb-dot {
  width:7px; height:7px; border-radius:50%; background:var(--green);
  flex-shrink:0; animation:blink 1.4s infinite;
}

/* ── Slabel ── */
.slabel {
  font-family: var(--mono); font-size:9px; letter-spacing:.14em;
  text-transform: uppercase; color:var(--text3); margin-bottom:8px;
}
.slabel em { font-style:normal; color:rgba(34,197,94,0.55); }

/* ════════════════════════════════════════
   HOME PAGE STYLES
   ════════════════════════════════════════ */

/* ── Contact rows ── */
.contact-row {
  display: flex; align-items:center; gap:12px;
  padding: 12px 16px;
  background: rgba(34,197,94,0.025);
  border: 1px solid var(--border);
  border-radius: 4px;
  text-decoration: none; color: inherit;
  opacity: 0; transform: translateY(8px);
  transition: opacity .35s, transform .35s, border-color .2s, background .2s;
}
.contact-row.visible  { opacity:1; transform:none; }
.contact-row:hover    { border-color:rgba(34,197,94,0.4); background:rgba(34,197,94,0.06); }
.contact-icon {
  color: var(--green); flex-shrink:0;
  display: flex; align-items:center; justify-content:center;
  width:28px; height:28px; border-radius:50%;
  background: rgba(34,197,94,0.08);
  border: 1px solid rgba(34,197,94,0.2);
}
.contact-label {
  font-family: var(--mono); font-size:9px; letter-spacing:.14em;
  color: var(--text3); min-width:68px; text-align:left;
}
.contact-value {
  font-family: var(--mono); font-size:12px;
  color: var(--green2); flex:1; text-align:left;
}

/* ── Service cards (homepage) ── */
.svc-link {
  display: flex; align-items:center; gap:14px;
  padding: 14px 16px;
  background: rgba(34,197,94,0.025);
  border: 1px solid var(--border);
  border-radius: 4px;
  text-decoration: none; color: inherit;
  opacity: 0; transform: translateY(8px);
  transition: opacity .35s, transform .35s, border-color .2s, background .2s, box-shadow .2s;
  position: relative; overflow: hidden;
}
.svc-link::before {
  content: '';
  position: absolute; top:0; left:0; right:0; height:1px;
  background: linear-gradient(90deg, transparent, rgba(34,197,94,0.35), transparent);
}
.svc-link.visible { opacity:1; transform:none; }
.svc-link:hover   {
  border-color: rgba(34,197,94,0.45);
  background: rgba(34,197,94,0.06);
  box-shadow: 0 0 20px rgba(34,197,94,0.08);
}
.svc-icon-box {
  width: 40px; height: 40px; border-radius: 8px;
  background: rgba(34,197,94,0.07);
  border: 1px solid rgba(34,197,94,0.18);
  display: flex; align-items:center; justify-content:center;
  color: var(--green); flex-shrink:0;
}
.svc-info { flex:1; min-width:0; }
.svc-name {
  font-family: var(--mono); font-size:11.5px; font-weight:700;
  letter-spacing:.07em; color:var(--text); text-transform:uppercase;
  margin-bottom: 3px;
}
.svc-desc-sm {
  font-size: 11px; color:var(--text2); line-height:1.5;
}
.svc-arrow {
  font-family: var(--mono); font-size:16px; color:var(--text3);
  flex-shrink:0; transition: color .2s, transform .2s;
}
.svc-link:hover .svc-arrow { color:var(--green); transform:translateX(3px); }
.svc-badge-sm {
  font-family: var(--mono); font-size:8px; letter-spacing:.1em;
  padding: 2px 7px; border-radius:2px; text-transform:uppercase;
  background: rgba(34,197,94,0.1); border:1px solid rgba(34,197,94,0.3);
  color: var(--green2); flex-shrink:0;
}

/* ── Responsive ── */
@media (max-width: 520px) {
  body { padding:16px 12px; align-items:flex-start; }
  .card-body { padding:16px; }
  .param-grid { grid-template-columns:1fr; }
  .param-item.full { grid-column:auto; }
  .main-title { font-size:13px; }
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width:4px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:rgba(34,197,94,0.22); border-radius:2px; }

/* ── Toast ── */
#toast {
  position: fixed; bottom:28px; right:28px; z-index:9999;
  font-family: var(--mono); font-size:11.5px; letter-spacing:.05em;
  color: #4ade80;
  background: rgba(11,24,18,0.95);
  border: 1px solid rgba(34,197,94,0.45);
  border-radius: 4px;
  padding: 10px 18px;
  display: flex; align-items:center; gap:10px;
  box-shadow: 0 0 28px rgba(34,197,94,0.25), 0 4px 20px rgba(0,0,0,0.5);
  clip-path: polygon(8px 0,100% 0,100% calc(100% - 8px),calc(100% - 8px) 100%,0 100%,0 8px);
  transform: translateY(12px); opacity:0;
  transition: opacity .25s, transform .25s;
  pointer-events: none;
}
#toast.show { opacity:1; transform:translateY(0); }
#toast .toast-dot { width:6px; height:6px; border-radius:50%; background:var(--green); flex-shrink:0; }
