/* ============================================
   Twaynick Homelab dashboard
   Dark cyber design system (from the original TechTips site)
============================================ */

:root {
  --bg: #0a0c10;
  --surface: #111318;
  --surface2: #181c24;
  --border: #1f2733;
  --accent: #00e5ff;
  --accent2: #7b2fff;
  --accent3: #00ff9d;
  --text: #c8d6e5;
  --text-dim: #5a6a7e;
  --mono: 'Share Tech Mono', monospace;
  --sans: 'Exo 2', sans-serif;
}

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

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

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

/* ---------- NAV ---------- */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,12,16,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-logo {
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--accent);
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  white-space: nowrap;
}
.nav-logo .dim { color: var(--text-dim); }
.nav-logo .glow { color: var(--accent); text-shadow: 0 0 20px rgba(0,229,255,0.5); }

.nav-cursor {
  display: inline-block;
  width: 8px;
  height: 1em;
  background: var(--accent);
  margin-left: 3px;
  animation: cursorBlink 1.1s step-end infinite;
}
@keyframes cursorBlink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }

.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--accent); }

/* ---------- HERO ---------- */
.hero {
  position: relative;
  z-index: 1;
  padding: 6rem 2rem 1rem;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.hero .hero-label {
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 300;
  color: var(--text);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 0.6s 0.1s forwards;
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  min-height: 2.2em;
  opacity: 0;
  animation: fadeUp 0.6s 0.25s forwards;
}
.hero h1 .glow {
  color: var(--accent);
  text-shadow: 0 0 30px rgba(0,229,255,0.4);
}

#hero-line1 { position: relative; display: inline; }
#hero-line1.glitching::before,
#hero-line1.glitching::after {
  content: attr(data-text);
  position: absolute;
  left: 0; top: 0;
  white-space: nowrap;
  pointer-events: none;
  color: rgba(255,255,255,0.25);
}
#hero-line1.glitching::before {
  animation: glitch-1 3.5s infinite;
  clip-path: polygon(0 20%, 100% 20%, 100% 50%, 0 50%);
}
#hero-line1.glitching::after {
  animation: glitch-2 3.5s infinite;
  clip-path: polygon(0 55%, 100% 55%, 100% 80%, 0 80%);
}
@keyframes glitch-1 { 0%,85%,100% { transform: translate(0); } 87% { transform: translate(-3px,1px); } 89% { transform: translate(3px,-1px); } 91% { transform: translate(0); } }
@keyframes glitch-2 { 0%,85%,100% { transform: translate(0); } 87% { transform: translate(3px,1px); } 89% { transform: translate(-3px,-1px); } 91% { transform: translate(0); } }

.hero-cursor {
  display: inline-block;
  width: 16px;
  height: 0.85em;
  background: var(--accent);
  vertical-align: middle;
  margin-left: 4px;
  animation: cursorBlink 1.1s step-end infinite;
  transition: opacity 0.4s;
}
.hero-cursor.done { animation: none; opacity: 0; }

.hero p {
  font-size: 1.05rem;
  color: var(--text);
  line-height: 1.7;
  font-weight: 300;
  margin-bottom: 2.5rem;
  opacity: 0;
  animation: fadeUp 0.6s 0.4s forwards;
}

/* ---------- SECTIONS ---------- */
.section {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 2rem 3rem;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
  opacity: 0;
  animation: fadeUp 0.5s 0.5s forwards;
}
.section-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}
.section-note {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ---------- CARDS ---------- */
.cards {
  --c: #00e5ff;
  --c-rgb: 0,229,255;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.25rem;
}

/* Per-card accent colors (class names are also used by me/links.json) */
.c-cyan   { --c: #00e5ff; --c-rgb: 0,229,255; }
.c-purple { --c: #7b2fff; --c-rgb: 123,47,255; }
.c-green  { --c: #00ff9d; --c-rgb: 0,255,157; }
.c-blue   { --c: #4f8ef7; --c-rgb: 79,142,247; }
.c-red    { --c: #f4514f; --c-rgb: 244,81,79; }
.c-orange { --c: #ffa500; --c-rgb: 255,165,0; }
.c-gold   { --c: #ffc230; --c-rgb: 255,194,48; }
.c-sky    { --c: #35c5f4; --c-rgb: 53,197,244; }
.c-coral  { --c: #ff7a59; --c-rgb: 255,122,89; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.9rem 1.5rem 1.6rem;
  color: var(--text);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
  opacity: 0;
  animation: fadeUp 0.5s forwards;
}
.card:nth-child(1) { animation-delay: 0.6s; }
.card:nth-child(2) { animation-delay: 0.7s; }
.card:nth-child(3) { animation-delay: 0.8s; }
.card:nth-child(4) { animation-delay: 0.9s; }
.card:nth-child(5) { animation-delay: 1.0s; }
.card:nth-child(6) { animation-delay: 1.1s; }
.private .card { animation-delay: 0.1s; }

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(var(--c-rgb),0.07), transparent);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.card:hover, .card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  border-color: var(--c);
  outline: none;
}
.card:hover::before, .card:focus-visible::before { opacity: 1; }

.card-icon { font-size: 2rem; margin-bottom: 1.1rem; display: block; line-height: 1; }

.card-logo {
  display: block;
  height: 44px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
  margin-bottom: 1.1rem;
}
.private .card-logo { height: 38px; margin-bottom: 0.9rem; }

.card-tag {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  display: block;
  color: var(--c);
}

.card h2 {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 0.6rem;
  letter-spacing: -0.01em;
}

.card-sub {
  display: block;
  margin-top: 0.2rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.card p {
  font-size: 0.84rem;
  color: var(--text);
  line-height: 1.6;
  font-weight: 300;
  flex: 1;
}

.card-host {
  display: block;
  margin-top: 1rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  opacity: 0.7;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-arrow {
  display: inline-block;
  margin-top: 0.5rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  opacity: 0.4;
  transition: opacity 0.2s, transform 0.2s, color 0.2s;
}
.card:hover .card-arrow, .card:focus-visible .card-arrow {
  opacity: 1;
  transform: translateX(4px);
  color: var(--c);
}

/* Admin cards: compact so all five fit on one row on desktop */
.private .cards { grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 1rem; }
.private .card { padding: 1.5rem 1.2rem 1.3rem; }
.private .card-icon { font-size: 1.7rem; margin-bottom: 0.9rem; }
.private .card h2 { font-size: 1.05rem; }
.private .lock-indicator { top: 0.9rem; right: 0.9rem; }

/* Lock badge (same look as the tips site's Access badge) */
.lock-indicator {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(0,229,255,0.08);
  border: 1px solid rgba(0,229,255,0.25);
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
  z-index: 2;
}
.lock-indicator.own { color: var(--text-dim); background: rgba(90,106,126,0.1); border-color: rgba(90,106,126,0.3); }

/* ---------- HELP STRIP ---------- */
.start-here-inner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.4rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  opacity: 0;
  animation: fadeUp 0.6s 1s forwards;
}
.start-here-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}
.start-here-title { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.1rem; }
.start-here-subtitle { font-size: 0.82rem; color: var(--text-dim); font-weight: 300; line-height: 1.5; }
.start-here-steps { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.start-step {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  color: var(--text);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.start-step:hover { border-color: var(--accent); color: var(--accent); background: rgba(0,229,255,0.04); }
.start-step-num { font-family: var(--mono); font-size: 0.6rem; color: var(--accent); letter-spacing: 0.08em; }
.start-step-arrow { color: var(--text-dim); font-size: 0.75rem; }

.help-strip { flex-direction: row; align-items: center; justify-content: space-between; gap: 1.25rem; }
.help-strip .start-here-label { display: block; margin-bottom: 0.4rem; }
.help-btn { cursor: pointer; font-family: var(--sans); font-size: 0.9rem; padding: 0.65rem 1.1rem; flex-shrink: 0; }
@media (max-width: 600px) { .help-strip { flex-direction: column; align-items: flex-start; } }

/* ---------- FOOTER ---------- */
footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}
#footer-text { cursor: default; user-select: none; -webkit-user-select: none; }
#signout { color: var(--text-dim); margin-left: 0.25rem; }
#signout:hover { color: var(--accent); }

/* ---------- MOTION ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .hero-label, .hero h1, .hero p, .section-head, .card, .start-here-inner { opacity: 1 !important; }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 600px) {
  nav { padding: 0 1.1rem; }
  .nav-links { gap: 1.1rem; }
  .hero { padding: 4rem 1.25rem 0.5rem; }
  .section { padding: 0 1.25rem 2.5rem; }
  .cards { grid-template-columns: 1fr; }
  .start-here-steps { flex-direction: column; align-items: flex-start; }
  .start-step-arrow { display: none; }
  .section-head { flex-direction: column; gap: 0.3rem; }
}
@media (max-width: 420px) {
  .nav-logo .dim { display: none; }
}
