/* =============================
   RESET & BASE
   ============================= */

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

:root {
  --bg: #fafafa;
  --bg-secondary: #f5f5f5;
  --text: #1a1a1a;
  --text-secondary: #666;
  --text-tertiary: #999;
  --border: #e5e5e5;
  --accent: #0066cc;
  --profile-size: 210px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
}

[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-secondary: #141414;
  --text: #fafafa;
  --text-secondary: #a0a0a0;
  --text-tertiary: #666;
  --border: #262626;
  --accent: #4d9fff;
}

html {
  scroll-behavior: smooth;
}

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

/* =============================
   LAYOUT
   ============================= */

header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

section {
  padding: 4rem 0;
  border-bottom: 1px solid var(--accent);
}

section:last-of-type {
  border-bottom: none;
}

footer {
  border-top: 1px solid var(--border);
  padding: 3rem 2rem;
  text-align: center;
}

/* =============================
   TYPOGRAPHY
   ============================= */

h1 {
  font-size: clamp(1.5rem, 2.2vw, 2.8rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

h2 {
  font-size: 2rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

p.profile-txt {
  margin-bottom: 1.5rem;
}
/* =============================
   NAVIGATION
   ============================= */

.logo img {
  height: 32px;
  width: auto;
  display: block;
}

/* Navbar layout */
nav {
  display: flex;
  align-items: center;

  padding-left: 2rem;
  padding-right: 1.3rem;
}

/* Right side container */
.nav-right {
  display: flex;
  align-items: center;
  gap: 2rem;

  margin-left: auto;
}

/* Navigation links */
.nav-menu {
  display: flex;
  gap: 2rem;
  list-style: none;
}

/* Buttons group */
.nav-actions {
  display: flex;
  gap: 1rem;
}

/* Link styling */
.nav-menu a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s;
}

.nav-menu a:hover {
  color: var(--text);
}

#theme-toggle {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1.25rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

#menu-toggle {
  display: none;
  border: none;
  background: none;
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
}

/* =============================
   HERO
   ============================= */

#hero {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-bottom: none;
  padding: 6rem 0;
  background:
    radial-gradient(circle, var(--text-tertiary) 1px, transparent 1px),
    linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg) 100%);
  background-size:
    24px 24px,
    cover;
  margin-inline: -2rem;
  margin-top: 6rem;
  padding-left: 2rem;
  padding-right: 2rem;
}

/* --- Desktop --- */
.name-and-title {
  display: flex;
  align-items: stretch;
  gap: 2rem;
}

.name {
  font-size: clamp(2.5rem, 7vw, 6rem);
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}

.right-space {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  transform: translateY(-20px);
}

.upper-space {
  flex: 1;
}

.line {
  border-top: 1.7px solid var(--accent);
  height: 0;
  width: 100%;
}

.title {
  margin-top: 0.5rem;
  font-size: 1.5rem;
  color: var(--text-secondary);
  text-align: left;
}

/* --- Tagline --- */
.tagline {
  font-size: 1.5rem;
  color: var(--text-tertiary);
  transform: translateY(-25px);
  text-align: center;
  align-self: center;
}

/* =============================
   ABOUT
   ============================= */

.about-content {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.profile-container {
  width: var(--profile-size);
  aspect-ratio: 1 / 1;

  border-radius: 8px;
  overflow: hidden;

  flex-shrink: 0;
}

.profile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;

  display: block;
}

.about-text {
  max-width: auto;
}

.about-text p {
  color: var(--text-secondary);
  font-size: 1.125rem;
  line-height: 1.7;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.skills span {
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.certifications {
  margin-top: 2rem;
}

.cert-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  margin-bottom: 0.5rem;
}

.certifications ul {
  list-style: disc;
  padding-left: 1.25rem;
}

.certifications li {
  color: var(--text-secondary);
  font-size: 1.125rem;
  margin-bottom: 0.25rem;
}

.resume-link {
  display: inline-block;
  margin-top: 2rem;
  font-size: 0.875rem;
  color: var(--accent);
  text-decoration: none;
}

.resume-link:hover {
  text-decoration: underline;
}

/* =============================
   PROJECTS
   ============================= */

.filter-buttons {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-buttons button {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.875rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-buttons button:hover {
  border-color: var(--text-secondary);
}

.filter-buttons button.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.projects-carousel {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.carousel-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  background: var(--bg);                
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.carousel-btn:hover {
  border-color: var(--text);
  color: var(--text);
}

.carousel-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.projects-track {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  flex: 1;
  
}

.project-item {
  background: var(--bg-secondary);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s;
}

.project-item:hover {
  transform: translateY(-2px);
}

.project-image {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  display: block;
}

.project-content {
  padding: 1.25rem;
}

.project-title {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.project-description {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.project-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 0.75rem;
}

.project-skills span {
  font-size: 0.6875rem;
  color: var(--text-tertiary);
  padding: 0.25rem 0.5rem;
  background: var(--bg);
  border-radius: 3px;
}

.project-links {
  display: flex;
  gap: 1rem;
}

.project-links a {
  font-size: 0.75rem;
  color: var(--accent);
  text-decoration: none;
}

.project-links a:hover {
  text-decoration: underline;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-tertiary);
  padding: 3rem 0;
}

/* =============================
   WRITING
   ============================= */

#blog-container {
  list-style: none;
  max-width: 600px;
}

.blog-item {
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--border);
}

.blog-item:last-child {
  border-bottom: none;
}

.blog-item a {
  text-decoration: none;
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: color 0.2s;
}

.blog-item a::before {
  content: var(--num);
  font-size: 0.75rem;
  color: var(--text-tertiary);
  font-weight: 500;
  font-family: monospace;
}

.blog-item a::after {
  content: "→";
  margin-left: auto;
  color: var(--text-tertiary);
  transition:
    transform 0.2s,
    color 0.2s;
}

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

.blog-item a:hover::after {
  transform: translateX(4px);
  color: var(--accent);
}

/* =============================
   FOOTER
   ============================= */

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.social-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s;
}

.social-links a:hover {
  color: var(--text);
}

.copyright {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

/* =============================
   RESPONSIVE
   ============================= */

@media (max-width: 768px) {
  nav {
    padding: 1rem;
  }

  main {
    padding: 0 1rem;
  }

  section {
    padding: 3rem 0;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    flex-direction: column;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    gap: 1rem;
  }

  .nav-menu.active {
    display: flex;
  }

  #menu-toggle {
    display: block;
  }

  #hero {
    min-height: 50vh;
    padding: 3rem 1rem;
    margin: 0 -1rem;
  }

  .about-content {
    flex-direction: column;
    gap: 1.5rem;
  }

  .profile-img {
    width: 200px;
    height: 200px;
  }

  .projects-track {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .carousel-btn {
    display: none;
  }

  .projects-carousel {
    display: block;
  }

  .filter-buttons {
    margin-bottom: 1.5rem;
  }

  .name-and-title {
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
  }

  .right-space {
    flex-direction: column;
    gap: 0.25rem;
    justify-content: flex-start;
    width: 100%;
  }

  .upper-space {
    display: none;
  }

  .line {
    display: none;
  }
  .title {
    font-size: 1rem;
    text-align: center;
  }

  .tagline {
    padding-left: 0;
    font-size: 1rem;
    text-align: center;
  }
}
