:root {
  --radius: 8px;
  --space: 1.25rem;
  --sidebar-width: 200px;
  --navbar-height: 56px;
  --font-sans: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --accent-color: #6366f1;
  --bg: #0d1424;
  --card-bg: #131d32;
  --text: #e8eaf0;
  --muted: #6b7280;
  --border: rgba(99, 102, 241, 0.2);
  --accent-soft: rgba(99, 102, 241, 0.15);
  --glow: 0 0 12px var(--accent-soft);
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  color: var(--text);
  background: var(--bg);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: var(--navbar-height) 1fr;
  grid-template-areas:
    "sidebar navbar"
    "sidebar content";
}

.navbar {
  grid-area: navbar;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space);
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.2s ease;
}

.brand:hover {
  color: var(--accent-color);
  text-shadow: 0 0 8px var(--accent-soft);
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text);
}

.menu-toggle span {
  display: block;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

.nav-links {
  display: flex;
  gap: 0.5rem;
}

.nav-link {
  padding: 0.5rem 0.75rem;
  color: var(--muted);
  text-decoration: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent-color);
  background: var(--accent-soft);
}

.theme-settings-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--accent-color);
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-settings-btn:hover {
  border-color: var(--accent-color);
  background: var(--accent-soft);
  box-shadow: var(--glow);
}

.theme-settings-icon {
  font-size: 1.2rem;
}

.theme-side-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  max-width: 100%;
  height: 100vh;
  background: var(--card-bg);
  border-left: 1px solid var(--border);
  z-index: 200;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.theme-side-panel.is-open {
  transform: translateX(0);
}

.theme-side-panel-inner {
  padding: var(--space);
}

.theme-side-panel-title {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.theme-side-panel-desc {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.4;
}

.theme-presets {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.theme-preset {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-preset:hover {
  border-color: var(--accent-color);
  background: var(--accent-soft);
}

.theme-preset.is-active {
  border-color: var(--accent-color);
  background: var(--accent-soft);
  box-shadow: inset 0 0 8px var(--accent-soft);
}

.theme-preset-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid var(--border);
}

.theme-preset-label {
  text-align: left;
}

.theme-toast {
  position: fixed;
  bottom: var(--space);
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  z-index: 300;
  opacity: 0;
  visibility: hidden;
  transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
}

.theme-toast.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  visibility: visible;
}

.sidebar {
  grid-area: sidebar;
  background: var(--card-bg);
  border-right: 1px solid var(--border);
  padding: var(--space) 0;
  position: sticky;
  top: var(--navbar-height);
  height: calc(100vh - var(--navbar-height));
  overflow-y: auto;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-link {
  display: block;
  padding: 0.6rem var(--space);
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
}

.sidebar-link:hover,
.sidebar-link.active {
  color: var(--text);
  background: var(--accent-soft);
  border-left-color: var(--accent-color);
}

.content {
  grid-area: content;
  padding: var(--space);
  overflow-y: auto;
  background: var(--bg);
  color: var(--text);
}

.panel {
  max-width: 960px;
  margin: 0 auto 2.5rem;
  padding: var(--space);
}

.section-title {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.section-subtitle {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0 0 var(--space);
  line-height: 1.5;
  max-width: 52ch;
}

.hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space) 2rem;
  align-items: center;
  padding: var(--space) 0;
}

.hero-profile {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.profile-avatar {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 3px solid var(--accent-color);
  object-fit: cover;
  display: block;
  background: #111;
  box-shadow: 0 0 20px var(--accent-soft);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space);
}

.product-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.3s ease;
}

.product-card:hover {
  border-color: var(--accent-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), 0 0 8px var(--accent-soft);
  transform: translateY(-2px);
}

.product-card-body {
  padding: var(--space);
}

.product-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.product-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  flex-shrink: 0;
}

.badge-app {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.product-card-role,
.product-card-stack {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 0.25rem;
}

.product-card-usecase {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0.5rem 0;
  line-height: 1.45;
}

.product-card-actions {
  margin-top: 0.75rem;
}

.btn-codester,
.btn-hero-cta,
.btn-projects-cta {
  display: inline-block;
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
  color: var(--text);
  background: var(--accent-color);
  border: 1px solid var(--accent-color);
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-codester:hover,
.btn-hero-cta:hover,
.btn-projects-cta:hover {
  filter: brightness(1.15);
  box-shadow: var(--glow);
}

.btn {
  display: inline-block;
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
  transition: all 0.2s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn.primary {
  color: var(--text);
  background: var(--accent-color);
  border-color: var(--accent-color);
}

.btn.primary:hover {
  filter: brightness(1.15);
  box-shadow: var(--glow);
}

.btn.secondary {
  background: transparent;
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
}

.btn.secondary:hover {
  background: var(--accent-soft);
  box-shadow: var(--glow);
}

.resume-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-hero-cta {
  padding: 0.6rem 1.1rem;
  font-size: 0.95rem;
}

.projects-cta-wrap {
  margin-top: 1.5rem;
  text-align: center;
}

.btn-projects-cta {
  padding: 0.65rem 1.25rem;
  font-size: 0.95rem;
}

.hero-info {
  min-width: 0;
}

.hero-name {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
  color: var(--text);
}

.hero-brand {
  font-size: 0.85rem;
  color: var(--accent-color);
  margin: 0 0 0.25rem;
}

.hero-role {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.hero-tagline {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0.5rem 0 0.75rem;
}

.capabilities-intro {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0 0 var(--space);
  line-height: 1.55;
  max-width: 56ch;
}

.capabilities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space);
}

.capability-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem var(--space);
  font-size: 0.95rem;
  color: var(--text);
  text-align: center;
  transition: all 0.2s ease;
}

.capability-item:hover {
  border-color: var(--accent-color);
  box-shadow: var(--glow);
  transform: translateY(-1px);
}

.highlights-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
  max-width: 420px;
}

.highlights-list li {
  position: relative;
  padding-left: 1.25rem;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.5;
}

.highlights-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-color);
  box-shadow: 0 0 6px var(--accent-color);
}

.contact-layout {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2rem;
  align-items: start;
}

.contact-actions {
  flex-shrink: 0;
}

.contact-reply {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.contact-form-wrap {
  max-width: 400px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.9rem;
  color: var(--muted);
}

.contact-form input,
.contact-form textarea {
  padding: 0.6rem 0.75rem;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.2s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px var(--accent-soft), var(--glow);
}

.contact-form textarea {
  resize: vertical;
  min-height: 100px;
}

.btn-submit {
  padding: 0.65rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  background: var(--accent-color);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  align-self: flex-start;
  transition: all 0.2s ease;
}

.btn-submit:hover {
  filter: brightness(1.15);
  box-shadow: var(--glow);
}

.site-footer {
  max-width: 960px;
  margin: 0 auto;
  padding: var(--space) var(--space) 2rem;
  border-top: 1px solid var(--border);
}

.footer-text {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

.footer-codester {
  margin: 0.5rem 0 0;
  text-align: center;
}

.footer-codester-link {
  font-size: 0.85rem;
  color: var(--accent-color);
  text-decoration: none;
  transition: all 0.2s ease;
}

.footer-codester-link:hover {
  color: var(--text);
  text-shadow: 0 0 4px var(--accent-soft);
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: var(--navbar-height) auto 1fr;
    grid-template-areas:
      "navbar"
      "sidebar"
      "content";
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 0.5rem var(--space);
  }

  .sidebar-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    justify-content: center;
  }

  .sidebar-link {
    padding: 0.4rem 0.6rem;
    border-left: none;
    border-radius: var(--radius);
  }

  .nav-links {
    display: none;
  }

  .nav-links.is-open {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: var(--space);
    gap: 0.25rem;
  }

  .menu-toggle {
    display: flex;
  }

  .hero {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .resume-actions {
    justify-content: center;
  }

  .hero-profile {
    justify-self: center;
  }

  .contact-layout {
    grid-template-columns: 1fr;
  }

  .contact-form-wrap {
    max-width: none;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .theme-side-panel {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .profile-avatar {
    width: 130px;
    height: 130px;
    margin: auto;
  }

  .capabilities-grid {
    grid-template-columns: 1fr;
  }
}
