:root {
  --bg: #050505;
  --card-bg: rgba(15, 15, 15, 0.7);
  --card-border: #1f1f1f;
  --accent: #ffffff;
  --text-primary: #ffffff;
  --text-secondary: #888888;
  --mono-font: "JetBrains Mono", monospace;
  --main-font: "Inter", sans-serif;
  --glow-color: rgba(255, 255, 255, 0.08);
  --skeleton: #1a1a1a;
  --radius: 16px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.light-mode {
  --bg: #f5f5f7;
  --card-bg: rgba(255, 255, 255, 0.7);
  --card-border: #e0e0e0;
  --accent: #000000;
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --glow-color: rgba(0, 0, 0, 0.05);
  --skeleton: #e0e0e0;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: var(--main-font);
  margin: 0;
  overflow-x: hidden;
}

.noise {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.04;
  background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyBAAAAAD9vT9EAAAAAnRSTlMAAHaTzTgAAAAWSURBVDjLY2AgE6AnYBjVjFHNWBoNAAbSAidS+K0cAAAAAElFTkSuQmCC");
}

.grid-background {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(to right, #111 1px, transparent 1px),
    linear-gradient(to bottom, #111 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: radial-gradient(circle at 50% 50%, black, transparent);
  z-index: -1;
  opacity: 0.3;
}

.light-mode .grid-background {
  background-image: linear-gradient(to right, #ddd 1px, transparent 1px),
    linear-gradient(to bottom, #ddd 1px, transparent 1px);
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 90px 20px 80px;
}

.hero {
  margin-bottom: 40px;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  box-shadow: var(--shadow);
}

.header-logo--left {
  width: 72px;
  height: 72px;
  border-radius: 16px;
}

.header-logo--right {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  opacity: 0.95;
}

h1 {
  font-size: 3.8rem;
  margin: 0;
  font-weight: 700;
  letter-spacing: -3px;
  font-family: var(--mono-font);
  line-height: 1;
  white-space: nowrap;
}

.description {
  max-width: 620px;
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.7;
  margin: 18px 0 10px;
}

.theme-btn {
  background: var(--card-bg);
  color: var(--text-primary);
  border: 1px solid var(--card-border);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 12px;
  backdrop-filter: blur(10px);
  transition: transform 0.15s ease, border-color 0.2s ease;
}

.theme-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.25);
}

.light-mode .theme-btn:hover {
  border-color: rgba(0, 0, 0, 0.18);
}

.theme-btn svg {
  width: 18px;
  height: 18px;
}

.sun-icon {
  display: none;
}

.light-mode .sun-icon {
  display: block;
}

.light-mode .moon-icon {
  display: none;
}

.projects {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 34px;
}

.bento-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 34px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(12px);
  border-radius: var(--radius);
  transition: transform 0.25s ease, border-color 0.25s ease, opacity 0.5s ease;
  box-shadow: var(--shadow);
}

.bento-card.is-loading {
  pointer-events: none;
}

.bento-card.is-loading * {
  visibility: hidden;
}

.bento-card.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, var(--glow-color), transparent);
  background-size: 200% 100%;
  animation: skeleton-shine 1.5s infinite;
}

@keyframes skeleton-shine {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.bento-card:not(.is-loading):hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.28);
}

.light-mode .bento-card:not(.is-loading):hover {
  border-color: rgba(0, 0, 0, 0.16);
}

.bento-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    420px circle at var(--mouse-x) var(--mouse-y),
    var(--glow-color),
    transparent 80%
  );
  pointer-events: none;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono-font);
  font-size: 0.65rem;
  color: var(--text-secondary);
  margin-bottom: 22px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.status-dot {
  height: 8px;
  width: 8px;
  background-color: #00ff88;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
  box-shadow: 0 0 12px rgba(0, 255, 136, 0.5);
}

.bento-card h2 {
  font-size: 1.85rem;
  margin: 0 0 14px;
  font-weight: 650;
  letter-spacing: -0.5px;
}

.bento-card h3 {
  font-size: 1.2rem;
  margin: 0 0 10px;
  font-weight: 650;
}

.bento-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 26px;
  flex-grow: 1;
}

.card-footer {
  margin-top: auto;
}

.link-btn {
  font-family: var(--mono-font);
  font-size: 0.72rem;
  text-transform: uppercase;
  border: 1px solid var(--card-border);
  padding: 10px 16px;
  display: inline-block;
  border-radius: 10px;
  transition: transform 0.15s ease, border-color 0.2s ease, background 0.2s ease;
  background: rgba(255, 255, 255, 0.02);
}

.link-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.25);
}

.light-mode .link-btn {
  background: rgba(0, 0, 0, 0.03);
}

.light-mode .link-btn:hover {
  border-color: rgba(0, 0, 0, 0.18);
}

.past-projects-section {
  margin-top: 60px;
}

.section-head {
  margin-bottom: 20px;
}

.section-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.4px;
}

.section-subtitle {
  margin: 10px 0 0;
  max-width: 680px;
  color: var(--text-secondary);
  font-size: 0.98rem;
  line-height: 1.7;
}

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

.past-project-card {
  padding: 18px 20px;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  min-height: 78px;
}

.past-project-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.02);
  flex-shrink: 0;
}

.light-mode .past-project-logo {
  background: rgba(0, 0, 0, 0.03);
}

.past-project-name {
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.past-project-card:hover {
  transform: translateY(-3px);
}

footer {
  margin-top: 78px;
  padding-top: 26px;
  border-top: 1px solid var(--card-border);
  font-family: var(--mono-font);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

@media (max-width: 768px) {
  .projects {
    grid-template-columns: 1fr;
  }

  .container {
    padding: 70px 16px 70px;
  }

  h1 {
    font-size: 3rem;
    letter-spacing: -2px;
  }

  .header-logo--right {
    display: none;
  }

  .description {
    font-size: 1rem;
  }
}

@media (max-width: 420px) {
  h1 {
    font-size: 2.6rem;
  }

  .brand-container {
    gap: 12px;
  }
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--card-border);
  border-radius: 4px;
}