/* ── Reset & Base ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0d1117;
  --bg-alt: #161b22;
  --bg-card: #1c2128;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #58a6ff;
  --accent-hover: #79c0ff;
  --green: #3fb950;
  --green-dim: rgba(63, 185, 80, 0.15);
  --border: #30363d;
  --border-bright: #484f58;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'SF Mono', Consolas, monospace;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-hover);
}

/* ── Focus Styles ── */
a:focus-visible,
button:focus-visible,
.contact-link:focus-visible,
.project-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Skip Link ── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--accent);
  color: var(--bg);
  padding: 0.5rem 1rem;
  border-radius: 0 0 4px 4px;
  font-weight: 600;
  font-size: 0.85rem;
  z-index: 200;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0;
  color: var(--bg);
}

/* ── Fade-in Animation ── */
.fade-in {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Animated Background Grid ── */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(rgba(88, 166, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(88, 166, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* ── Layout ── */
.container {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

section {
  padding: 5rem 0;
  position: relative;
}

section + section {
  border-top: 1px solid var(--border);
}

/* ── Navigation ── */
nav {
  position: sticky;
  top: 0;
  border-bottom: 1px solid var(--border);
  z-index: 100;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  background: rgba(13, 17, 23, 0.85);
}

nav .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

nav .logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
  color: var(--green);
  text-decoration: none;
  letter-spacing: -0.5px;
}

nav .logo::before {
  content: '> ';
  color: var(--text-muted);
}

nav .nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

nav .nav-links a {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  transition: color 0.2s;
}

nav .nav-links a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* ── Hero ── */
.hero {
  padding: 5rem 0 4rem;
}

.hero-content {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.hero-photo {
  width: 150px;
  height: 150px;
  border-radius: 12px;
  background: var(--bg-alt);
  border: 2px solid var(--border);
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}

.hero-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  box-shadow: inset 0 0 20px rgba(88, 166, 255, 0.1);
  pointer-events: none;
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 30% 15%;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.hero .tagline {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--green);
  margin-bottom: 1rem;
}

.hero .tagline::before {
  content: '$ ';
  color: var(--text-muted);
}

.hero .bio {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 480px;
}

/* ── Section Headers ── */
.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.section-title .icon {
  color: var(--accent);
  display: flex;
}

.section-title .icon svg {
  width: 22px;
  height: 22px;
}

/* ── Tech Banner ── */
.tech-gallery {
  padding: 0 0 1rem;
  border: none;
}

.tech-banner {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  padding: 1.5rem 0;
  margin-bottom: 1rem;
  scrollbar-width: none;
}

.tech-banner::-webkit-scrollbar {
  display: none;
}

.tech-banner-item {
  flex-shrink: 0;
  width: 280px;
  height: 160px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  position: relative;
}

.tech-banner-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.7;
  transition: opacity 0.3s;
}

.tech-banner-item:hover img {
  opacity: 0.9;
}

.tech-banner-item .overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.75rem 1rem;
  background: linear-gradient(transparent, rgba(13, 17, 23, 0.9));
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Terminal Window ── */
.terminal {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.terminal-margin {
  margin-top: 2.5rem;
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.6rem 1rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-dot.red { background: #f85149; }
.terminal-dot.yellow { background: #d29922; }
.terminal-dot.green { background: #3fb950; }

.terminal-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
}

.terminal-body {
  padding: 1rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.8;
}

.terminal-body .prompt {
  color: var(--green);
}

.terminal-body .cmd {
  color: var(--text);
}

.terminal-body .comment {
  color: var(--border-bright);
}

.terminal-body .output {
  color: var(--accent);
}

/* ── Projects ── */
.project-cards {
  display: grid;
  gap: 1rem;
}

.project-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  display: block;
  color: var(--text);
}

.project-card:hover {
  border-color: var(--border-bright);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  text-decoration: none;
  color: var(--text);
}

.project-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.project-card-header svg {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.project-card h3 {
  font-size: 1rem;
  font-weight: 600;
}

.project-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.project-card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.project-card .tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  background: var(--green-dim);
  color: var(--green);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

.project-icon {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  flex-shrink: 0;
  object-fit: cover;
}

.project-card-media {
  cursor: default;
}

.project-video {
  display: block;
  width: 100%;
  border-radius: 6px;
  border: 1px solid var(--border);
  margin-bottom: 0.75rem;
  background: #000;
}

/* ── Interests ── */
.interests-content {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 540px;
}

.interest-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.interest-tag {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.interest-tag svg {
  width: 14px;
  height: 14px;
  color: var(--accent);
}

/* ── Contact ── */
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.contact-link:hover {
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(88, 166, 255, 0.1);
  text-decoration: none;
  color: var(--text);
}

.contact-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-muted);
}

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: var(--font-mono);
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .tech-banner-item {
    width: 240px;
    height: 140px;
  }
}

@media (max-width: 600px) {
  .hero-content {
    flex-direction: column;
    text-align: center;
  }

  .hero .bio {
    max-width: 100%;
  }

  .hero h1 {
    font-size: 1.6rem;
  }

  nav .nav-links {
    gap: 1rem;
  }

  nav .nav-links a {
    font-size: 0.75rem;
  }

  section {
    padding: 3.5rem 0;
  }

  .contact-links {
    flex-direction: column;
  }

  .tech-banner-item {
    width: 240px;
    height: 130px;
  }
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .tech-banner-item img {
    transition: none;
  }

  a {
    transition: none;
  }
}
