


:root,
[data-theme="dark"] {
  --bg:          #0c0c0e;
  --bg-raised:   #121216;
  --bg-card:     #16161a;
  --border:      rgba(255, 255, 255, 0.08);
  --border-hover:rgba(255, 255, 255, 0.16);
  --accent:      #2563eb;
  --accent-text: #3b82f6;
  --green:       #22c55e;
  --text-1:      #f4f4f5;
  --text-2:      #a1a1aa;
  --text-3:      #71717a;
  --header-bg:   rgba(12, 12, 14, 0.88);
  --hover-fill:  rgba(255, 255, 255, 0.05);
  --tag-bg:      rgba(255, 255, 255, 0.04);
  --icon-bg:     rgba(255, 255, 255, 0.05);
  --scrollbar-thumb: rgba(255, 255, 255, 0.12);
  --scrollbar-thumb-hover: rgba(255, 255, 255, 0.22);
  --badge-bg:    rgba(34, 197, 94, 0.08);
  --badge-border:rgba(34, 197, 94, 0.2);
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  --card-hover-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.35);
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   14px;
  --header-h:    60px;
  --max-w:       1120px;
  --ease:        cubic-bezier(0.4, 0, 0.2, 1);
  color-scheme: dark;
}

[data-theme="light"] {
  --bg:          #f8f9fa;
  --bg-raised:   #ffffff;
  --bg-card:     #ffffff;
  --border:      rgba(0, 0, 0, 0.08);
  --border-hover:rgba(0, 0, 0, 0.16);
  --accent:      #2563eb;
  --accent-text: #1d4ed8;
  --green:       #16a34a;
  --text-1:      #09090b;
  --text-2:      #52525b;
  --text-3:      #71717a;
  --header-bg:   rgba(248, 249, 250, 0.88);
  --hover-fill:  rgba(0, 0, 0, 0.04);
  --tag-bg:      rgba(0, 0, 0, 0.04);
  --icon-bg:     rgba(0, 0, 0, 0.03);
  --scrollbar-thumb: rgba(0, 0, 0, 0.14);
  --scrollbar-thumb-hover: rgba(0, 0, 0, 0.26);
  --badge-bg:    rgba(22, 163, 74, 0.08);
  --badge-border:rgba(22, 163, 74, 0.2);
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  --card-hover-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.08);
  color-scheme: light;
}


@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg:          #f8f9fa;
    --bg-raised:   #ffffff;
    --bg-card:     #ffffff;
    --border:      rgba(0, 0, 0, 0.08);
    --border-hover:rgba(0, 0, 0, 0.16);
    --accent:      #2563eb;
    --accent-text: #1d4ed8;
    --green:       #16a34a;
    --text-1:      #09090b;
    --text-2:      #52525b;
    --text-3:      #71717a;
    --header-bg:   rgba(248, 249, 250, 0.88);
    --hover-fill:  rgba(0, 0, 0, 0.04);
    --tag-bg:      rgba(0, 0, 0, 0.04);
    --icon-bg:     rgba(0, 0, 0, 0.03);
    --scrollbar-thumb: rgba(0, 0, 0, 0.14);
    --scrollbar-thumb-hover: rgba(0, 0, 0, 0.26);
    --badge-bg:    rgba(22, 163, 74, 0.08);
    --badge-border:rgba(22, 163, 74, 0.2);
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    --card-hover-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.08);
    color-scheme: light;
  }
}


*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg);
  color: var(--text-1);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
}

ul, ol {
  list-style: none;
}


::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: var(--radius-sm); }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }


:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}


.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: 24px;
}


.page-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent);
  z-index: 999;
  transition: width 0.1s linear;
  pointer-events: none;
}


.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  transition: background 0.18s var(--ease), color 0.18s var(--ease),
              border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

.btn-secondary {
  background: transparent;
  color: var(--text-2);
  border-color: var(--border);
}
.btn-secondary:hover {
  color: var(--text-1);
  border-color: var(--border-hover);
  background: var(--hover-fill);
}

.btn-outline {
  background: transparent;
  color: var(--text-2);
  border-color: var(--border);
  font-size: 0.875rem;
  padding: 8px 18px;
}
.btn-outline:hover {
  color: var(--text-1);
  border-color: var(--border-hover);
  background: var(--hover-fill);
}


.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}


.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: var(--accent);
  border-radius: var(--radius-md);
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.brand-mark--sm {
  width: 28px;
  height: 28px;
  font-size: 0.62rem;
  border-radius: var(--radius-sm);
}

.brand-name {
  font-size: 0.925rem;
  font-weight: 600;
  color: var(--text-1);
  letter-spacing: -0.01em;
}


.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}


.site-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-2);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.nav-link:hover,
.nav-link.is-active {
  color: var(--text-1);
  background: var(--hover-fill);
}


.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease), background 0.18s var(--ease), transform 0.18s var(--ease);
  flex-shrink: 0;
}
.theme-toggle:hover {
  color: var(--text-1);
  border-color: var(--border-hover);
  background: var(--hover-fill);
  transform: translateY(-1px);
}
.theme-toggle:active {
  transform: translateY(0);
}

.theme-icon {
  display: block;
  pointer-events: none;
  transition: transform 0.25s var(--ease);
}


:root .theme-icon--sun,
[data-theme="dark"] .theme-icon--sun {
  display: block;
}
:root .theme-icon--moon,
[data-theme="dark"] .theme-icon--moon {
  display: none;
}

[data-theme="light"] .theme-icon--sun {
  display: none;
}
[data-theme="light"] .theme-icon--moon {
  display: block;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-icon--sun {
    display: none;
  }
  :root:not([data-theme="dark"]) .theme-icon--moon {
    display: block;
  }
}


.menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 7px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.menu-btn:hover { background: var(--hover-fill); border-color: var(--border-hover); }

.menu-bar {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--text-2);
  border-radius: var(--radius-sm);
  transform-origin: center;
  transition: transform 0.25s var(--ease), opacity 0.2s var(--ease);
}

.menu-btn[aria-expanded="true"] .menu-bar:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .menu-bar:nth-child(2) { opacity: 0; transform: scaleX(0); }
.menu-btn[aria-expanded="true"] .menu-bar:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }


.mobile-menu {
  display: none;
}

.mobile-menu nav {
  display: flex;
  flex-direction: column;
  padding: 8px 16px 16px;
  gap: 2px;
}

.mobile-link {
  display: block;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-2);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.mobile-link:hover { color: var(--text-1); background: var(--hover-fill); }
.mobile-link--cta { color: var(--accent-text); font-weight: 600; }

.mobile-theme-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px 4px;
  margin-top: 6px;
  border-top: 1px solid var(--border);
}

.mobile-theme-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-2);
}

.theme-toggle--mobile {
  width: auto;
  height: 32px;
  padding: 0 12px;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-1);
}

.mobile-theme-status {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: capitalize;
}


.hero {
  padding: 100px 0 88px;
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  max-width: 680px;
}

.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--green);
  margin-bottom: 28px;
}

.status-dot {
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  flex-shrink: 0;
  animation: pulse-green 2.4s ease-in-out infinite;
}

@keyframes pulse-green {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.hero-heading {
  font-size: clamp(2.4rem, 5.5vw, 3.75rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.035em;
  color: var(--text-1);
  margin-bottom: 20px;
}

.hero-subtext {
  font-size: 1.05rem;
  color: var(--text-2);
  max-width: 560px;
  line-height: 1.7;
  margin-bottom: 36px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}


.section-header {
  margin-bottom: 48px;
}

.section-title {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-1);
  margin-bottom: 8px;
  line-height: 1.2;
}

.section-desc {
  font-size: 0.975rem;
  color: var(--text-2);
}


.work {
  padding: 88px 0;
  border-bottom: 1px solid var(--border);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
}

.project-card {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--card-shadow);
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
  position: relative;
}
.project-card:hover {
  background: var(--bg-raised);
  border-color: var(--border-hover);
  box-shadow: var(--card-hover-shadow);
  transform: translateY(-2px);
}

@media (min-width: 1025px) {
  .project-card:nth-child(4) {
    grid-column: 2 / span 2;
  }
  .project-card:nth-child(5) {
    grid-column: 4 / span 2;
  }
}

.project-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.project-icon {
  width: 44px;
  height: 44px;
  background: var(--icon-bg);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.project-card:hover .project-icon {
  border-color: var(--border-hover);
}

.project-icon img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: contain;
}

.project-icon--mono {
  color: var(--text-3);
}
.project-card:hover .project-icon--mono {
  color: var(--text-2);
}

.project-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--green);
  letter-spacing: 0.02em;
  padding: 4px 10px;
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  border-radius: 999px;
}

.live-dot {
  width: 6px;
  height: 6px;
  background: var(--green);
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.4);
}

.project-card-body {
  flex: 1;
  margin-bottom: 20px;
}

.project-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-1);
  letter-spacing: -0.015em;
  margin-bottom: 6px;
}

.project-desc {
  font-size: 0.875rem;
  color: var(--text-2);
  line-height: 1.6;
}

.project-card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 6px;
}

.project-tag {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-3);
  background: var(--tag-bg);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  transition: color 0.15s var(--ease);
}
.project-card:hover .project-tag {
  color: var(--text-2);
}

.project-link-icon {
  margin-left: auto;
  color: var(--text-3);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  transition: color 0.18s var(--ease), transform 0.18s var(--ease), background 0.18s var(--ease);
}
.project-card:hover .project-link-icon {
  color: var(--text-1);
  background: var(--hover-fill);
  transform: translate(2px, -2px);
}


.about {
  padding: 88px 0;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 80px;
  align-items: start;
}

.about-text .section-title,
.about-skills .section-title {
  margin-bottom: 20px;
}

.about-text p {
  color: var(--text-2);
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: 16px;
}
.about-text p:last-of-type {
  margin-bottom: 0;
}

.about-contact {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 32px;
}

.skills-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skills-list li {
  font-size: 0.95rem;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.5;
  transition: color 0.15s var(--ease);
}
.skills-list li:hover {
  color: var(--text-1);
}

.skills-list li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-text);
  flex-shrink: 0;
  transform: translateY(-0.5px);
}


.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-2);
}

.footer-copy {
  font-size: 0.825rem;
  color: var(--text-3);
}

.footer-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.footer-link {
  font-size: 0.825rem;
  color: var(--text-3);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.footer-link:hover {
  color: var(--text-1);
  background: var(--hover-fill);
}


.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.48s var(--ease), transform 0.48s var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}


@media (max-width: 1024px) {
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .project-card {
    grid-column: span 1;
  }
  .project-card:nth-child(5) {
    grid-column: 1 / -1;
    max-width: calc(50% - 8px);
    width: 100%;
    justify-self: center;
  }
}


@media (max-width: 768px) {
  .site-nav { display: none; }
  .menu-btn { display: flex; }

  .mobile-menu {
    display: block;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--bg-raised);
    border-bottom: 1px solid transparent;
    overflow: hidden;
    max-height: 0;
    visibility: hidden;
    pointer-events: none;
    transition: max-height 0.28s var(--ease), visibility 0.28s var(--ease), border-color 0.28s var(--ease);
    z-index: 99;
  }
  .mobile-menu.is-open {
    max-height: 320px;
    visibility: visible;
    pointer-events: auto;
    border-bottom-color: var(--border);
  }

  .hero { padding: 72px 0 64px; }
  .hero-heading { letter-spacing: -0.03em; }

  .work { padding: 64px 0; }
  .about { padding: 64px 0; }

  .project-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .project-card {
    grid-column: auto;
  }
  .project-card:nth-child(5) {
    grid-column: auto;
    max-width: 100%;
    justify-self: stretch;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .footer-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
}


@media (max-width: 480px) {
  .container { padding-inline: 16px; }

  .hero { padding: 56px 0 48px; }
  .hero-heading { font-size: 2.25rem; }
  .hero-subtext { font-size: 0.975rem; }
  .hero-actions { gap: 10px; }
  .hero-actions .btn { font-size: 0.85rem; padding: 9px 16px; }

  .section-header { margin-bottom: 32px; }
  .work { padding: 48px 0; }
  .about { padding: 48px 0; }

  .project-card { padding: 20px; }

  .about-contact { flex-direction: column; }
  .about-contact .btn { justify-content: center; }

  .footer-nav { flex-wrap: wrap; }
}


@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
