:root {
  --bg:           #0d0f0e;
  --bg2:          #131614;
  --bg3:          #1a1d1b;
  --border:       rgba(255,255,255,0.07);
  --border2:      rgba(255,255,255,0.12);
  --teal:         #1D9E75;
  --teal-hover:   #24c490;
  --teal-dim:     #0F6E56;
  --teal-glow:    #1D9E7533;
  --text:         #e8ece9;
  --muted:        #8a9490;
  --dim:          #4a5550;
  --chart-upload: #4a9eff;
  --chart-ping:   #ff6666;
  --mono:         'JetBrains Mono', monospace;
  --sans:         'Syne', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

.site {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 2rem 6rem;
}

/* NAV */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 5rem;
}

.nav-logo {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--teal);
  letter-spacing: 0.04em;
}

.nav-links { display: flex; gap: 2rem; }

.nav-links a {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--teal); }

/* HERO */
.hero { margin-bottom: 5rem; position: relative; }

.hero-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--teal);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-eyebrow::before {
  content: '';
  display: inline-block;
  width: 28px;
  height: 1px;
  background: var(--teal);
}

.hero h1 {
  font-size: clamp(36px, 6vw, 58px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 1.5rem;
}

.hero h1 em { font-style: normal; color: var(--teal); }

.hero-desc {
  font-size: 16px;
  color: var(--muted);
  max-width: 520px;
  line-height: 1.8;
  margin-bottom: 2rem;
  font-family: var(--mono);
}

.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

/* BUTTONS */
.btn {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  padding: 10px 22px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  background: var(--teal);
  color: #051a13;
  border: 1px solid var(--teal);
}

.btn-primary:hover { background: var(--teal-hover); border-color: var(--teal-hover); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border2);
}

.btn-ghost:hover { color: var(--text); border-color: var(--muted); }


/* SECTION HEADING */
.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 1.5rem;
}

.section-tag {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--teal);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.section-line { flex: 1; height: 1px; background: var(--border); }

/* PROJECT CARD */
.projects { margin-bottom: 5rem; }

.project-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2rem;
  margin-bottom: 2rem;
  transition: border-color 0.2s;
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--teal);
  opacity: 0;
  transition: opacity 0.2s;
}

.project-card:hover { border-color: var(--border2); }
.project-card:hover::before { opacity: 1; }
.project-card.featured { border-color: var(--teal-dim); }
.project-card.featured::before { opacity: 1; }

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 12px;
}

.card-icon-wrap {
  width: 42px;
  height: 42px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-icon-wrap svg {
  width: 20px;
  height: 20px;
  stroke: var(--teal);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-badges { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.badge {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 3px 9px;
  border-radius: 3px;
  text-transform: uppercase;
}

.badge-live   { background: rgba(29,158,117,0.15); color: #4ecfa0; border: 1px solid rgba(29,158,117,0.3); }
.badge-wip    { background: rgba(239,159,39,0.12); color: #f0b855; border: 1px solid rgba(239,159,39,0.25); }
.badge-pinned { background: rgba(255,255,255,0.05); color: var(--muted); border: 1px solid var(--border); }

.card-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 8px;
}

.card-desc {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

.card-detail {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.card-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 12px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}

.card-detail-row:last-child { border-bottom: none; }
.detail-key { color: var(--dim); }
.detail-val { color: var(--text); }
.detail-val.teal { color: var(--teal); }
.teal { color: var(--teal); }

.card-tags { display: flex; gap: 8px; flex-wrap: wrap; }

.tag {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 3px;
}

.placeholder-card {
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  margin-top: 1rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

/* DASHBOARD CARD */
.dashboard-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  width: 100%;
  margin: 0 auto 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#speedChart {
  width: 100% !important;
  height: 250px !important;
}

.card-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.card-footer {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: right;
}

.mtg-embed {
  width: 100%;
  height: 380px;
  border: none;
  border-radius: 6px;
  margin: 1rem 0;
  display: block;
}


/* ABOUT */
.about {
  margin-bottom: 5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.about-text p {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.9;
  margin-bottom: 1rem;
}

.about-specs {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.spec-row:last-child { border-bottom: none; }
.spec-key { color: var(--dim); }
.spec-val { color: var(--text); }

/* CONTACT */
.contact-bar {
  background: var(--bg2);
  border: 1px solid var(--teal-dim);
  border-radius: 10px;
  padding: 2rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 5rem;
  position: relative;
  overflow: hidden;
}

.contact-bar::after {
  content: '';
  position: absolute;
  right: -60px; top: -60px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: var(--teal-glow);
  pointer-events: none;
}

.contact-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--teal);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.contact-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* FOOTER */
footer {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-left { font-family: var(--mono); font-size: 11px; color: var(--dim); }
.footer-right { font-family: var(--mono); font-size: 11px; color: var(--teal); }

.footer-links { display: flex; gap: 1.5rem; }

.footer-links a {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.08em;
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--teal); }

/* ANIMATIONS */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero        { animation: fadeUp 0.5s ease both; }
.projects    { animation: fadeUp 0.5s 0.1s ease both; }
.about       { animation: fadeUp 0.5s 0.2s ease both; }
.contact-bar { animation: fadeUp 0.5s 0.3s ease both; }

/* MOBILE */
@media (max-width: 640px) {
  .about { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .nav-links { gap: 1.2rem; }
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* CONTACT FORM */
.contact-form-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 480px;
}

.contact-input {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  padding: 10px 14px;
  width: 100%;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.contact-input::placeholder {
  color: var(--dim);
}

.contact-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-glow);
}

.contact-textarea {
  resize: vertical;
  min-height: 120px;
}

.contact-status {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  min-height: 1.5rem;
}

.contact-status.success { color: var(--teal); }
.contact-status.error   { color: #ff6666; }