/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0c0f;
  --bg2: #0f1215;
  --surface: #131820;
  --surface2: #1a2030;
  --border: #1e2a3a;
  --green: #00ff88;
  --green-dim: #00cc6a;
  --green-subtle: rgba(0,255,136,0.06);
  --text: #d4e0ec;
  --text-dim: #7a8fa8;
  --text-muted: #3d5570;
  --red: #ff4655;
  --yellow: #f5c542;
  --font-mono: 'JetBrains Mono', monospace;
  --font-display: 'Syne', sans-serif;
  --radius: 6px;
  --nav-h: 60px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.7;
  overflow-x: hidden;
}

.scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 2px,
    rgba(0,0,0,0.03) 2px, rgba(0,0,0,0.03) 4px
  );
}

/* === NAV === */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: rgba(10,12,15,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--green);
  letter-spacing: 0.05em;
  font-size: 15px;
}

.nav-links { display: flex; gap: 28px; }

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

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

/* === HERO === */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + 60px) 32px 80px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(0,255,136,0.07) 0%, transparent 70%);
  pointer-events: none;
}

.hero-bg-text {
  position: absolute;
  bottom: -20px; right: -40px;
  font-family: var(--font-display);
  font-size: clamp(120px, 18vw, 280px);
  font-weight: 800;
  color: transparent;
  -webkit-text-stroke: 1px rgba(0,255,136,0.04);
  user-select: none;
  pointer-events: none;
  line-height: 1;
}

.hero-content {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.hero-photo {
  width: 90px; height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--green);
  margin-bottom: 20px;
  display: block;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--green-subtle);
  border: 1px solid rgba(0,255,136,0.2);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--green);
  margin-bottom: 24px;
  text-transform: uppercase;
}

.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(0,255,136,0.4); }
  50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(0,255,136,0); }
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(52px, 7vw, 88px);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 20px;
}

.hero-name em {
  font-style: normal;
  color: var(--green);
  text-shadow: 0 0 40px rgba(0,255,136,0.3);
}

.hero-subtitle {
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 28px;
  line-height: 1.8;
}

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

.hero-tags span {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  transition: all 0.2s;
}

.hero-tags span:hover {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-subtle);
}

/* === TERMINAL === */
.terminal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(0,255,136,0.05);
}

.terminal-bar {
  background: var(--surface2);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--border);
}

.tb-dot { width: 12px; height: 12px; border-radius: 50%; }
.tb-dot.red    { background: var(--red); }
.tb-dot.yellow { background: var(--yellow); }
.tb-dot.green  { background: var(--green); }

.tb-title {
  margin-left: 12px;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.terminal-body {
  padding: 20px 20px 24px;
  min-height: 220px;
  max-height: 340px;
  overflow-y: auto;
  cursor: text;
}

.terminal-body::-webkit-scrollbar { width: 4px; }
.terminal-body::-webkit-scrollbar-track { background: transparent; }
.terminal-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* input line */
.t-input-line {
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
}

#terminal-hint {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
  font-size: 13px;
  pointer-events: none;
  user-select: none;
  animation: blink 2s step-end infinite;
}

#terminal-input {
  position: relative;
  z-index: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  caret-color: var(--green);
  flex: 1;
  min-width: 0;
}

/* history lines */
.t-history-line {
  display: flex;
  gap: 4px;
  margin-bottom: 2px;
}

.t-history-output {
  padding-left: 20px;
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 6px;
  white-space: pre-wrap;
  line-height: 1.6;
}

/* === SECTIONS === */
.section { padding: 100px 32px; }
.alt-bg { background: var(--bg2); }

.container { max-width: 1100px; margin: 0 auto; }

.section-header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 52px;
}

.section-num {
  font-size: 11px;
  color: var(--green);
  letter-spacing: 0.15em;
  opacity: 0.7;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-desc {
  color: var(--text-dim);
  max-width: 680px;
  margin-bottom: 48px;
  font-size: 13px;
  line-height: 1.9;
}

/* === SKILLS === */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
}

.skill-category h3 {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--green);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.skill-list { display: flex; flex-direction: column; gap: 14px; }

.skill-item { display: flex; align-items: center; gap: 14px; }

.skill-name {
  min-width: 160px;
  font-size: 12px;
  color: var(--text-dim);
}

.skill-bar {
  flex: 1;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.skill-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--green-dim), var(--green));
  border-radius: 2px;
  transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.skill-fill.animated { width: var(--pct); }

/* === PROJECTS === */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.project-card:hover {
  border-color: rgba(0,255,136,0.25);
  box-shadow: 0 0 30px rgba(0,255,136,0.05);
}

.project-card.featured {
  grid-column: 1 / -1;
  border-color: rgba(0,255,136,0.15);
  background: linear-gradient(135deg, var(--surface), var(--surface2));
}

.project-badge {
  display: inline-block;
  background: var(--green-subtle);
  border: 1px solid rgba(0,255,136,0.25);
  color: var(--green);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 3px;
  margin-bottom: 14px;
}

.project-badge-inline {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

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

.project-top h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
}

.project-link {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 11px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.project-link:hover { color: var(--green); border-color: var(--green); }

.project-card p {
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.8;
}

.project-card code {
  background: var(--surface2);
  padding: 1px 6px;
  border-radius: 3px;
  color: var(--green);
  font-size: 12px;
}

.project-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.project-stack span {
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-muted);
}

.project-services {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.svc { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-dim); }

.svc-dot { width: 6px; height: 6px; border-radius: 50%; }
.svc-dot.green { background: var(--green); box-shadow: 0 0 6px var(--green); }

/* === ACCESS === */
.access-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 48px;
}

.access-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
}

.access-card:hover {
  border-color: rgba(0,255,136,0.3);
  box-shadow: 0 0 24px rgba(0,255,136,0.06);
}

.access-icon {
  width: 52px; height: 52px;
  border-radius: 10px;
  background: var(--green-subtle);
  border: 1px solid rgba(0,255,136,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--green);
}

.access-info { flex: 1; }

.access-info h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.access-info p { font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }

.access-url { font-size: 11px; color: var(--green-dim); font-family: var(--font-mono); }

.access-btn {
  padding: 8px 16px;
  background: var(--green-subtle);
  border: 1px solid rgba(0,255,136,0.2);
  border-radius: var(--radius);
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s;
  flex-shrink: 0;
}

.access-btn:hover { background: rgba(0,255,136,0.12); border-color: var(--green); }

/* === ARCH DIAGRAM === */
.arch-diagram {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 32px;
}

.arch-title {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 24px;
}

.arch-flow {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.arch-node {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 16px;
  font-size: 12px;
  color: var(--text-dim);
}

.arch-node.cmd {
  background: var(--green-subtle);
  border-color: rgba(0,255,136,0.2);
  color: var(--green);
}

.arch-arrow { color: var(--text-muted); font-size: 18px; }

.arch-targets { display: flex; gap: 20px; flex-wrap: wrap; }

.arch-target {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 180px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.arch-target.lxc    { border-color: rgba(74,170,255,0.2); background: rgba(74,170,255,0.04); }
.arch-target.vm     { border-color: rgba(255,70,85,0.2);  background: rgba(255,70,85,0.04); }
.arch-target.tunnel { border-color: rgba(0,255,136,0.2);  background: rgba(0,255,136,0.04); }

.arch-target-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.arch-target span { font-size: 12px; color: var(--text-dim); }

/* === CONTACT === */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-dim);
  font-size: 13px;
  transition: all 0.2s;
}

.contact-card:not(.static):hover { border-color: rgba(0,255,136,0.25); color: var(--text); }
.contact-card svg { color: var(--green); flex-shrink: 0; }

/* === FOOTER === */
.footer {
  padding: 28px 32px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .hero-content { grid-template-columns: 1fr; gap: 40px; }
  .hero-bg-text { font-size: 80px; }
  .skills-grid, .projects-grid, .access-grid, .contact-grid { grid-template-columns: 1fr; }
  .project-card.featured { grid-column: 1; }
  .nav-links { gap: 16px; }
  .section { padding: 70px 20px; }
  .hero { padding: 120px 20px 60px; }
  .footer { flex-direction: column; gap: 8px; text-align: center; }
  .arch-flow { justify-content: center; }
}