:root {
  --bg: #060b08;
  --panel: rgba(7, 16, 11, 0.82);
  --panel-strong: rgba(8, 19, 13, 0.96);
  --panel-soft: rgba(24, 66, 37, 0.18);
  --text: #dfffe7;
  --muted: #82b18f;
  --line: rgba(81, 255, 139, 0.16);
  --accent: #53ff8b;
  --accent-2: #1be85e;
  --accent-3: #0f1f15;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

[data-theme="sunset"] {
  --bg: #121019;
  --panel: rgba(24, 17, 34, 0.84);
  --panel-strong: rgba(31, 21, 44, 0.96);
  --panel-soft: rgba(255, 138, 91, 0.14);
  --text: #ffe9d6;
  --muted: #c6ab96;
  --line: rgba(255, 197, 106, 0.16);
  --accent: #ff8a5b;
  --accent-2: #ffc56a;
  --accent-3: #251b35;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Roboto", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top, rgba(83, 255, 139, 0.08), transparent 28%), var(--bg);
  overflow-x: hidden;
}

#matrix-canvas,
.scanlines,
.cursor-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

#matrix-canvas {
  z-index: 0;
  opacity: 0.24;
}

.scanlines {
  z-index: 1;
  background: linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 100% 4px;
  opacity: 0.1;
}

.cursor-glow {
  z-index: 2;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(83, 255, 139, 0.16), transparent 65%);
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 180ms ease;
}

[data-theme="sunset"] .cursor-glow {
  background: radial-gradient(circle, rgba(255, 138, 91, 0.18), transparent 65%);
}

.site-shell {
  position: relative;
  z-index: 3;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 0 0 40px;
}

.topbar,
.terminal-box,
.project-card,
.system-card {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding: 14px 16px;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  background: rgba(3, 10, 6, 0.75);
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #071109;
  font-family: "VT323", monospace;
  font-size: 1.8rem;
}

.brand-copy {
  display: grid;
}

.brand-name {
  font-weight: 700;
}

.brand-role {
  color: var(--muted);
  font-family: "Source Code Pro", monospace;
  font-size: 0.85rem;
}

.topnav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
}

.topnav a,
.project-links a,
.contact-grid a {
  color: var(--text);
  text-decoration: none;
}

.topnav a:hover,
.project-links a:hover,
.contact-grid a:hover {
  color: var(--accent);
}

.theme-toggle,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--accent);
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}

.theme-toggle {
  width: 46px;
  padding: 0;
}

.theme-icon {
  width: 18px;
  height: 18px;
}

.theme-icon-sun {
  display: none;
}

[data-theme="sunset"] .theme-icon-sun {
  display: block;
}

[data-theme="sunset"] .theme-icon-moon {
  display: none;
}

main {
  display: grid;
  gap: 22px;
  margin-top: 18px;
}

.terminal-box {
  border-radius: 22px;
  background: var(--panel);
  backdrop-filter: blur(12px);
}

.hero {
  overflow: hidden;
}

.terminal-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.terminal-head p {
  margin: 0 0 0 8px;
  color: var(--muted);
  font-family: "Source Code Pro", monospace;
  font-size: 0.82rem;
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(83, 255, 139, 0.5);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 22px;
  padding: 24px;
}

.hero-copy {
  display: grid;
  align-content: start;
}

.eyebrow,
.section-kicker,
.system-label {
  margin: 0 0 14px;
  color: var(--accent);
  font-family: "Source Code Pro", monospace;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
}

.hero h1,
.section-header h2,
.info-card h2,
.system-card h2 {
  margin: 0;
}

.hero h1 {
  font-family: "VT323", monospace;
  font-size: clamp(3.4rem, 7vw, 6.2rem);
  line-height: 0.9;
  color: var(--accent);
  text-shadow: 0 0 18px rgba(83, 255, 139, 0.18);
}

.hero h1 span {
  display: block;
  color: var(--text);
}

.lede,
.section-header p,
.info-card p,
.system-card p,
.project-card p {
  color: var(--muted);
  line-height: 1.75;
}

.lede {
  max-width: 640px;
  margin: 16px 0 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0 18px;
}

.button.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #071109;
  font-weight: 700;
}

.status-line {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-family: "Source Code Pro", monospace;
  font-size: 0.85rem;
}

.status-led {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(83, 255, 139, 0.6);
}

.system-card {
  padding: 22px;
  border-radius: 18px;
  background: var(--panel-strong);
}

.avatar-shell {
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  margin: 20px 0 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--accent);
  font-family: "VT323", monospace;
  font-size: 3rem;
}

.system-card h2 {
  font-size: 1.8rem;
  line-height: 1.2;
}

.chip-row,
.skill-list,
.project-meta,
.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip-row,
.skill-list {
  margin-top: 18px;
}

.chip-row span,
.skill-list span,
.project-tag,
.project-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--accent);
  font-family: "Source Code Pro", monospace;
  font-size: 0.8rem;
}

.grid-section {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.info-card {
  padding: 22px;
}

.projects-section,
.contact-section {
  padding: 24px;
}

.section-header {
  max-width: 700px;
  margin-bottom: 18px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.project-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: 18px;
  background: var(--panel-strong);
}

.project-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.project-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--accent);
  font-family: "Source Code Pro", monospace;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.project-card h4 {
  margin: 0;
  font-size: 1.2rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.contact-grid a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
}

@media (max-width: 980px) {
  .topbar,
  .hero-grid,
  .grid-section,
  .project-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    justify-items: center;
  }
}

@media (max-width: 640px) {
  .site-shell {
    width: 100%;
  }

  .topnav,
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .button,
  .theme-toggle {
    width: 100%;
  }

  .hero-grid,
  .projects-section,
  .contact-section,
  .info-card,
  .system-card {
    padding: 18px;
  }
}
