:root {
  --bg: #080808;
  --bg-elev: #111111;
  --border: #1f1f1f;
  --text: #ededed;
  --muted: #9aa0ad;
  --gold: #d4a72c;
  --gold-soft: rgba(212, 167, 44, 0.35);
  --nav-h: 68px;
  --hero-pad: clamp(14px, 4vh, 56px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 20px;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--gold-soft);
}
.brand-name { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; }


/* ---------- Hero ---------- */
/* Sizes scale with viewport height so the whole hero fits on one screen. */
.hero {
  max-width: none;
  margin: 0;
  padding: var(--hero-pad) 40px var(--hero-pad);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}
.hero-main { text-align: left; }
.hero-side { min-height: 0; }

.avatar {
  display: block;
  width: clamp(110px, 32vh, 300px);
  height: clamp(110px, 32vh, 300px);
  margin: 0 0 clamp(12px, 3.5vh, 36px);
  border-radius: 50%;
  object-fit: cover;
  background: #0b0b0b;
  border: 3px solid var(--gold);
  box-shadow: 0 0 40px rgba(212, 167, 44, 0.18);
}

.hero h1 {
  margin: 0;
  font-size: clamp(3rem, min(11vw, 15vh), 9rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
}
.accent { color: var(--gold); }

.subtitle {
  margin: clamp(8px, 2.5vh, 22px) 0 clamp(14px, 4vh, 40px);
  font-size: clamp(1.1rem, min(3vw, 4.4vh), 2.6rem);
  font-weight: 300;
  color: #c9cdd6;
  letter-spacing: .01em;
}

.tech {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; justify-content: flex-start; gap: min(clamp(20px, 5vh, 44px), 4.5vw);
}
.tech li {
  width: min(clamp(34px, 7vh, 64px), 11vw);
  height: min(clamp(34px, 7vh, 64px), 11vw);
  color: #9aa0b4;
  transition: color .15s, transform .15s;
}
.tech li:hover { color: var(--gold); transform: translateY(-2px); }
.tech a { display: block; position: relative; width: 100%; height: 100%; }
.tech a[data-tip] { cursor: default; }
.tech a[data-tip]::after {
  content: attr(data-tip);
  position: absolute; left: 50%; top: calc(100% + 10px);
  transform: translateX(-50%);
  padding: 4px 12px;
  white-space: nowrap;
  font-size: .85rem; font-weight: 600;
  color: var(--gold);
  background: #151515;
  border: 1px solid var(--gold-soft);
  border-radius: 999px;
  opacity: 0; pointer-events: none;
  transition: opacity .15s;
}
.tech a[data-tip]:hover::after,
.tech a[data-tip]:focus-visible::after { opacity: 1; }
.tech svg { width: 100%; height: 100%; }


@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 24px; padding-left: 24px; padding-right: 24px; padding-bottom: 64px; }
}

/* ---------- Contact page ---------- */
.page {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(24px, 6vh, 64px) 24px 80px;
}
.back { display: inline-block; margin-bottom: 28px; color: var(--muted); font-weight: 600; transition: color .15s; }
.back:hover { color: var(--gold); }
.page h1 { margin: 0 0 8px; font-size: clamp(2rem, 6vw, 3rem); letter-spacing: -0.03em; line-height: 1.1; }
.page h1::after { content: ""; display: block; width: 48px; height: 3px; margin-top: 14px; background: var(--gold); border-radius: 2px; }
.page .intro { margin: 18px 0 28px; color: var(--muted); font-size: 1.1rem; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li {
  counter-increment: step;
  position: relative;
  margin-bottom: 14px;
  padding: 18px 20px 18px 64px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.steps li::before {
  content: counter(step);
  position: absolute; left: 18px; top: 16px;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--gold-soft);
  color: var(--gold); font-weight: 700;
}

/* ---------- Version footer ---------- */
.version {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  padding: 10px 20px;
  font-size: .8rem;
  color: var(--muted);
  background: linear-gradient(to top, rgba(8, 8, 8, 0.95), rgba(8, 8, 8, 0));
  pointer-events: none;
}
.version a { pointer-events: auto; color: var(--gold); }
.version a:hover { text-decoration: underline; }
.version code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }
@media (max-width: 600px) { .version-msg { display: none; } }

/* ---------- Stats panel ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: clamp(8px, 1.8vh, 16px);
  height: calc(100vh - var(--nav-h) - var(--hero-pad) - 44px);
  max-height: 720px;
  min-height: 420px;
}
.stat {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  min-height: 0;
  padding: clamp(10px, 2vh, 20px) clamp(12px, 2vh, 20px);
  background: linear-gradient(160deg, #151515, #0d0d0d);
  border: 1px solid var(--border);
  border-radius: 14px;
  opacity: 0;
  animation: rise .7s cubic-bezier(.2, .7, .2, 1) forwards;
  animation-delay: calc(var(--i, 0) * 90ms + 150ms);
  transition: border-color .2s, box-shadow .2s;
}
.stat[hidden] { display: none; }
.stat:hover { border-color: var(--gold-soft); box-shadow: 0 0 30px rgba(212, 167, 44, 0.08); }
.stat::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 35%, rgba(212, 167, 44, 0.08) 50%, transparent 65%);
  transform: translateX(-100%);
  animation: sheen 7s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 900ms + 2s);
  pointer-events: none;
}
.stat-wide { grid-column: 1 / -1; }

.stat h3 {
  margin: 0;
  display: flex; align-items: center; gap: 8px;
  font-size: .72rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.stat-num {
  font-size: clamp(1.7rem, 6vh, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat-num .unit { margin-left: 3px; font-size: .5em; color: var(--gold); }
.stat-sub { margin: 0; font-size: .8rem; color: var(--muted); }

.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #3ddc84;
  animation: pulse 1.8s infinite;
}

.gauge { display: flex; align-items: center; gap: 12px; flex: 1; min-height: 0; }
.ring { position: relative; height: 100%; max-height: 96px; aspect-ratio: 1; flex-shrink: 0; }
.ring svg { display: block; width: 100%; height: 100%; }
.ring-num {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(.85rem, 2.4vh, 1.25rem); font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.ring-num .unit { margin-left: 1px; font-size: .7em; color: var(--gold); }
.gauge-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.gauge-text strong { font-size: clamp(.95rem, 2.3vh, 1.2rem); color: var(--text); }
.gauge-text span { font-size: .75rem; color: var(--muted); }
.ring-track { fill: none; stroke: #222; stroke-width: 9; }
.ring-fill {
  fill: none; stroke: var(--gold); stroke-width: 9; stroke-linecap: round;
  filter: drop-shadow(0 0 5px rgba(212, 167, 44, 0.55));
  transition: stroke-dashoffset 1.4s cubic-bezier(.2, .7, .2, 1);
}

.badge-rate { margin-left: auto; color: var(--gold); letter-spacing: .04em; text-transform: none; }
#activity-canvas { display: block; flex: 1 1 0; min-height: 0; width: 100%; }

.private {
  margin-left: auto;
  padding: 1px 9px;
  font-size: .68rem; letter-spacing: .04em; text-transform: none;
  color: var(--gold);
  border: 1px solid var(--gold-soft);
  border-radius: 999px;
}
.device {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(6px, 1.6vh, 14px) 14px;
}
.dev-item { opacity: 0; animation: rise .6s ease forwards; animation-delay: calc(var(--i, 0) * 80ms + 700ms); min-width: 0; }
.dev-item dt { font-size: .7rem; color: var(--muted); }
.dev-item dd {
  margin: 0;
  font-size: clamp(.8rem, 1.9vh, 1rem); font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes sheen { 0%, 55% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(61, 220, 132, .55); }
  70% { box-shadow: 0 0 0 9px rgba(61, 220, 132, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0); }
}

@media (max-width: 760px) {
  .stats { height: auto; max-height: none; min-height: 0; grid-auto-rows: minmax(130px, auto); }
  .device { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #activity-canvas { min-height: 60px; }
}
@media (prefers-reduced-motion: reduce) {
  .stat, .dev-item { animation: none; opacity: 1; }
  .stat::before, .live-dot { animation: none; }
  .ring-fill { transition: none; }
}

/* Short windows: keep the device card from clipping */
@media (max-height: 700px) and (min-width: 1000px) {
  .device { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (max-height: 700px) and (max-width: 999px) and (min-width: 761px) {
  .dev-item:nth-child(n + 4) { display: none; }
}
/* Phones: footer sits at the end of the page instead of floating over the cards */
@media (max-width: 760px) {
  .version { position: static; padding: 18px 24px 28px; background: none; }
  .hero { padding-bottom: 8px; }
}

@media (max-width: 760px) {
  .gauge { flex-direction: column; align-items: flex-start; justify-content: center; gap: 6px; }
  .ring { height: 76px; max-height: none; }
  .gauge-text { flex-direction: row; align-items: baseline; gap: 6px; }
}
