/* theme */
:root {
  --background: #000000;
  --foreground: #fafafa;
  --card: hsl(0, 0%, 7%);
  --card-foreground: #fafafa;
  --muted: hsl(0, 0%, 15%);
  --muted-foreground: #a3a3a3;
  --accent: hsl(210, 100%, 50%);
  --border: hsl(0, 0%, 18%);
  --gradient-accent: linear-gradient(135deg, hsl(210, 100%, 50%), hsl(260, 100%, 60%));
  --shadow-card: 0 8px 32px -8px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 60px -12px hsla(210, 100%, 50%, 0.25);
  --section-padding: clamp(5rem, 12vw, 10rem);
  --section-padding-x: clamp(1.5rem, 5vw, 5rem);
  --max-content: 1024px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--background);
  color: var(--foreground);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: hsla(210, 100%, 50%, 0.3);
  color: var(--foreground);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem var(--section-padding-x);
  background: color-mix(in srgb, var(--background) 80%, transparent);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 30%, transparent);

  /* Animation: slide down + fade in on load */
  animation: navbar-in 0.6s ease-out forwards;
}

@keyframes navbar-in {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.navbar__logo {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--foreground);
}

.navbar__dot {
  background-image: var(--gradient-accent);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.navbar__links {
  display: none;
}

@media (min-width: 768px) {
  .navbar__links {
    display: flex;
    align-items: center;
    gap: 2rem;
  }
}

.navbar__links a {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  transition: color 0.3s ease;
}

.navbar__links a:hover {
  color: var(--foreground);
}

.navbar__github {
  color: var(--muted-foreground);
  transition: color 0.3s ease;
}

.navbar__github:hover {
  color: var(--foreground);
}

/* for hero section */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--section-padding) var(--section-padding-x);
  overflow: hidden;
}

.hero__orb {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 600px;
  height: 600px;
  margin: -300px 0 0 -300px;
  border-radius: 50%;
  background: var(--gradient-accent);
  opacity: 0.2;
  filter: blur(120px);
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 56ch;
  margin: 0 auto;
}

.hero__eyebrow {
  font-size: 0.875rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  margin-bottom: 1.5rem;
  animation: fade-up 0.6s ease-out 0.2s both;
}

.hero__title {
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 0.95;
  margin-bottom: 1.5rem;
  animation: fade-up 0.8s ease-out 0.3s both;
}

.hero__subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--muted-foreground);
  max-width: 42ch;
  margin: 0 auto 3rem;
  line-height: 1.6;
  animation: fade-up 0.6s ease-out 0.5s both;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  animation: fade-in 0.6s ease-out 0.8s both;
}

.hero__scroll {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  margin-left: -10px;
  color: var(--muted-foreground);
  animation: fade-in 0.6s ease-out 1.2s both, float 6s ease-in-out infinite;
  animation-delay: 1.2s, 2s;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 9999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: opacity 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.btn--primary {
  background: var(--foreground);
  color: var(--background);
}

.btn--primary:hover {
  opacity: 0.9;
}

.btn--outline {
  border-color: var(--border);
  color: var(--foreground);
  background: transparent;
}

.btn--outline:hover {
  background: var(--muted);
}

/* section layout (used by all sections) */
.section {
  padding: var(--section-padding) var(--section-padding-x);
}

.section__inner {
  max-width: var(--max-content);
  margin: 0 auto;
}

.section__label {
  font-size: 0.875rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  margin-bottom: 0.5rem;
}

.section__title {
  font-size: clamp(2rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--foreground);
  margin-bottom: 2rem;
}

.section__inner--narrow {
  max-width: 640px;
}

.section__inner--center {
  text-align: center;
}

/* glass card (shared by about, experience, project cards) */
.glass-card {
  background: color-mix(in srgb, var(--card) 85%, transparent);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 1rem;
  border: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
  box-shadow: var(--shadow-card);
}

/* for skills & about sections */
.section#about .section__title {
  margin-bottom: 3rem;
}

.about__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

@media (min-width: 768px) {
  .about__grid {
    grid-template-columns: 1.2fr 1fr;
    gap: 5rem;
  }
}

.about__text {
  animation: fade-up 0.7s ease-out 0.1s both;
}

.about__text p {
  font-size: 1.125rem;
  color: var(--muted-foreground);
  line-height: 1.7;
}

.about__text p + p {
  margin-top: 1.5rem;
}

.about__cards {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: fade-up 0.7s ease-out 0.3s both;
}

.about__card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem;
}

.about__icon {
  flex-shrink: 0;
  margin-top: 0.25rem;
  color: var(--accent);
}

.about__card-title {
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 0.25rem;
}

.about__card-meta {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

/* for skills */
.section#skills .section__title {
  margin-bottom: 4rem;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  animation: fade-in 0.5s ease-out 0.1s both;
}

@media (min-width: 640px) {
  .skills-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (min-width: 768px) {
  .skills-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 2rem;
  }
}

@media (min-width: 1024px) {
  .skills-grid {
    grid-template-columns: repeat(8, 1fr);
  }
}

.skill-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 1rem;
  background: color-mix(in srgb, var(--card) 60%, transparent);
  backdrop-filter: blur(24px);
  border: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
  box-shadow: var(--shadow-card);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  animation: scale-in 0.4s ease-out both;
}

.skills-grid .skill-item:nth-child(1) { animation-delay: 0.05s; }
.skills-grid .skill-item:nth-child(2) { animation-delay: 0.1s; }
.skills-grid .skill-item:nth-child(3) { animation-delay: 0.15s; }
.skills-grid .skill-item:nth-child(4) { animation-delay: 0.2s; }
.skills-grid .skill-item:nth-child(5) { animation-delay: 0.25s; }
.skills-grid .skill-item:nth-child(6) { animation-delay: 0.3s; }
.skills-grid .skill-item:nth-child(7) { animation-delay: 0.35s; }
.skills-grid .skill-item:nth-child(8) { animation-delay: 0.4s; }
.skills-grid .skill-item:nth-child(9) { animation-delay: 0.45s; }
.skills-grid .skill-item:nth-child(10) { animation-delay: 0.5s; }
.skills-grid .skill-item:nth-child(11) { animation-delay: 0.55s; }
.skills-grid .skill-item:nth-child(12) { animation-delay: 0.6s; }
.skills-grid .skill-item:nth-child(13) { animation-delay: 0.65s; }
.skills-grid .skill-item:nth-child(14) { animation-delay: 0.7s; }
.skills-grid .skill-item:nth-child(15) { animation-delay: 0.75s; }
.skills-grid .skill-item:nth-child(16) { animation-delay: 0.8s; }
.skills-grid .skill-item:nth-child(17) { animation-delay: 0.85s; }
.skills-grid .skill-item:nth-child(18) { animation-delay: 0.9s; }
.skills-grid .skill-item:nth-child(19) { animation-delay: 0.95s; }
.skills-grid .skill-item:nth-child(20) { animation-delay: 1s; }

@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.skill-item:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-glow);
}

.skill-item__icon {
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.skill-item__icon i {
  font-size: 1.75rem;
}

.skill-item span {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  text-align: center;
  transition: color 0.3s ease;
}

.skill-item:hover span {
  color: var(--foreground);
}

/* experiences */
.section#experience .section__title {
  margin-bottom: 4rem;
}

.experience-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.experience-card {
  padding: 2rem;
  animation: fade-up 0.6s ease-out both;
}

.experience-card:nth-child(1) { animation-delay: 0.2s; }
.experience-card:nth-child(2) { animation-delay: 0.35s; }
.experience-card:nth-child(3) { animation-delay: 0.5s; }

@media (min-width: 768px) {
  .experience-card {
    padding: 2.5rem;
  }
}

.experience-card__header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .experience-card__header {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }
}

.experience-card__head {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.experience-card__icon {
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.experience-card__company {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 0.25rem;
}

.experience-card__role {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent);
}

.experience-card__meta {
  margin-left: 3.5rem;
  margin-top: 0.25rem;
}

@media (min-width: 768px) {
  .experience-card__meta {
    margin-left: 0;
    margin-top: 0;
    text-align: right;
  }
}

.experience-card__meta p {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.experience-card__bullets {
  list-style: none;
  margin-left: 3.5rem;
}

@media (min-width: 768px) {
  .experience-card__bullets {
    margin-left: 3.5rem;
  }
}

.experience-card__bullets li {
  position: relative;
  padding-left: 1rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.experience-card__bullets a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.experience-card__bullets a:hover {
  color: color-mix(in srgb, var(--accent) 85%, var(--foreground));
}

.experience-card__bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

/* for project section */
.section#projects .section__title {
  margin-bottom: 4rem;
}

.projects-list {
  display: flex;
  flex-direction: column;
  gap: 5rem;
}

.project-card {
  overflow: hidden;
  animation: fade-up 0.7s ease-out both;
}

.project-card:nth-child(1) { animation-delay: 0.2s; }
.project-card:nth-child(2) { animation-delay: 0.4s; }

.project-card__image-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

/* RepoScanner: GIF plays when hovering the preview (thumbnail fades) */
.project-card__image-wrap--hover-gif .project-card__media-link {
  position: absolute;
  inset: 0;
  display: block;
}

.project-card__image-wrap--hover-gif .project-card__media-link > .project-card__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-card__image-wrap--hover-gif .project-card__image--hover-bg {
  z-index: 0;
}

.project-card__image-wrap--hover-gif .project-card__image--hover-fg {
  z-index: 1;
  transition: opacity 0.35s ease;
}

.project-card:has(.project-card__image-wrap--hover-gif):hover .project-card__image--hover-fg {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .project-card:has(.project-card__image-wrap--hover-gif):hover .project-card__image--hover-fg {
    opacity: 1;
  }
}

.project-card__image-wrap--placeholder {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 25%, var(--card)), var(--card));
}

.project-card__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 1.5rem;
  z-index: 1;
}

.project-card__placeholder-label {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--foreground) 80%, transparent);
  margin-bottom: 0.5rem;
}

.project-card__placeholder h3 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--foreground);
}

.project-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s ease;
}

.project-card:hover .project-card__image {
  transform: scale(1.05);
}

.project-card__image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--card), transparent 30%, transparent 70%);
  pointer-events: none;
}

.project-card__body {
  padding: 2rem;
}

@media (min-width: 768px) {
  .project-card__body {
    padding: 2.5rem;
  }
}

.project-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.project-card__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.project-card__title {
  font-size: clamp(1.5rem, 2.5vw, 1.875rem);
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 0.25rem;
}

.project-card__period {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.project-card__link {
  color: var(--muted-foreground);
  padding: 0.5rem;
  transition: color 0.3s ease;
  flex-shrink: 0;
}

.project-card__link:hover {
  color: var(--foreground);
}

.project-card__description {
  font-size: 1rem;
  color: var(--muted-foreground);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.project-card__tags span {
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background: var(--muted);
  color: var(--muted-foreground);
  border: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
}

/* contact */
.contact__intro {
  font-size: 1.125rem;
  color: var(--muted-foreground);
  max-width: 36ch;
  margin: 0 auto 3rem;
  line-height: 1.6;
  animation: fade-up 0.6s ease-out 0.2s both;
}

.contact__btn {
  margin-bottom: 3rem;
  animation: fade-up 0.6s ease-out 0.3s both;
}

.contact__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  animation: fade-in 0.6s ease-out 0.5s both;
}

.contact__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  transition: color 0.3s ease;
}

.contact__link:hover {
  color: var(--foreground);
}

.contact__link svg {
  flex-shrink: 0;
}

/* footer */
.footer {
  margin-top: 6rem;
  padding-top: 2rem;
  border-top: 1px solid color-mix(in srgb, var(--border) 30%, transparent);
  text-align: center;
}

.footer p {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}
