/* ===== CSS Variables (Design Tokens) ===== */
:root {
  --color-bg: #FAFAF8;
  --color-bg-alt: #F0EDE8;
  --color-text: #1A1A2E;
  --color-text-secondary: #555568;
  --color-accent: #E07A5F;
  --color-accent-hover: #D16B4F;
  --color-accent-light: rgba(224, 122, 95, 0.1);
  --color-blue: #81B29A;
  --color-gold: #F2CC8F;

  --font-heading: 'Noto Serif SC', serif;
  --font-body: 'Noto Sans SC', sans-serif;
  --font-mono: 'DM Sans', sans-serif;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --shadow-sm: 0 2px 8px rgba(26, 26, 46, 0.06);
  --shadow-md: 0 4px 16px rgba(26, 26, 46, 0.08);
  --shadow-lg: 0 12px 40px rgba(26, 26, 46, 0.12);

  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;

  --max-width: 1200px;
  --navbar-height: 64px;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--navbar-height);
}

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

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

ul {
  list-style: none;
}

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

/* ===== Container ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Section ===== */
.section {
  padding: 100px 0;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  color: var(--color-text);
  text-align: center;
  margin-bottom: 56px;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: var(--color-accent);
  border-radius: 2px;
  margin: 16px auto 0;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

.btn-outline:hover {
  background: var(--color-text);
  color: var(--color-bg);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-icon {
  width: 16px;
  height: 16px;
}

/* ===== Navbar ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--navbar-height);
  z-index: 1000;
  background: rgba(250, 250, 248, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(26, 26, 46, 0.06);
  transition: box-shadow var(--transition-base);
}

.navbar.scrolled {
  box-shadow: var(--shadow-sm);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10%;
  object-fit: cover;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.5px;
}

.nav-brand {
  color: inherit;
  font: inherit;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav-link {
  font-size: 15px;
  font-weight: 400;
  color: var(--color-text-secondary);
  position: relative;
  padding: 4px 0;
  transition: color var(--transition-fast);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  border-radius: 1px;
  transition: width var(--transition-base);
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-accent);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: all var(--transition-base);
}

.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(224, 122, 95, 0.08), transparent),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(129, 178, 154, 0.06), transparent),
    radial-gradient(ellipse 50% 50% at 20% 20%, rgba(242, 204, 143, 0.06), transparent);
  animation: bgPulse 8s ease-in-out infinite;
}

@keyframes bgPulse {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-greeting {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 500;
  color: var(--color-accent);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.hero-name {
  font-family: var(--font-heading);
  font-size: clamp(40px, 8vw, 80px);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.15;
  margin-bottom: 20px;
  letter-spacing: -1px;
}

.hero-tagline {
  font-size: clamp(16px, 2.5vw, 20px);
  color: var(--color-text-secondary);
  margin-bottom: 40px;
  font-weight: 300;
}

.hero-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  animation: bounce 2s ease-in-out infinite;
  color: var(--color-text-secondary);
}

.scroll-indicator svg {
  width: 24px;
  height: 24px;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
  40% { transform: translateX(-50%) translateY(-10px); }
  60% { transform: translateX(-50%) translateY(-5px); }
}

/* ===== About ===== */
.about {
  background: var(--color-bg-alt);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  margin-bottom: 60px;
}

.about-intro {
  font-size: 16px;
  color: var(--color-text-secondary);
  margin-bottom: 16px;
  line-height: 1.8;
}

.about-experience {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.exp-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 20px;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--color-accent);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.exp-item:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

.exp-year {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-accent);
  min-width: 110px;
}

.exp-role {
  font-size: 15px;
  color: var(--color-text);
}

/* Avatar */
.about-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-placeholder {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-accent-light), rgba(129, 178, 154, 0.15));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition-base);
}

.avatar-placeholder:hover {
  transform: scale(1.05);
}

.avatar-icon {
  width: 64px;
  height: 64px;
  color: var(--color-accent);
  opacity: 0.6;
}

/* ===== Skills ===== */
.skills-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 28px;
  color: var(--color-text);
}

.skills-cloud {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.skill-tag {
  display: inline-block;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 20px;
  border-radius: 100px;
  background: var(--color-bg);
  color: var(--color-text-secondary);
  border: 1px solid rgba(26, 26, 46, 0.08);
  transition: all var(--transition-base);
  cursor: default;
}

.skill-tag:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
  background: var(--color-accent-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* ===== Projects ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

/* ===== Project Card ===== */
.project-card {
  background: #fff;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--transition-base);
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

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

.card-thumb-placeholder {
  width: 100%;
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
}

.project-card-body {
  padding: 20px;
}

.project-card-title {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 8px;
}

.project-card-desc {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-card-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tech-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--color-accent-light);
  color: var(--color-accent);
  letter-spacing: 0.3px;
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(26, 26, 46, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 24px 80px rgba(26, 26, 46, 0.25);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(26, 26, 46, 0.06);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  z-index: 1;
}

.modal-close:hover {
  background: rgba(26, 26, 46, 0.12);
}

.modal-close svg {
  width: 18px;
  height: 18px;
  color: var(--color-text);
}

.modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.modal-image {
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
}

.modal-info {
  padding: 40px 36px;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 16px;
}

.modal-description {
  font-size: 15px;
  color: var(--color-text-secondary);
  line-height: 1.8;
  margin-bottom: 24px;
}

.modal-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.modal-link {
  width: 100%;
  justify-content: center;
}

/* ===== Footer ===== */
.footer {
  background: var(--color-text);
  color: rgba(250, 250, 248, 0.7);
  padding: 48px 0;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.footer-social {
  display: flex;
  gap: 20px;
}

.social-link {
  color: rgba(250, 250, 248, 0.6);
  transition: all var(--transition-base);
}

.social-link:hover {
  color: var(--color-accent);
  transform: translateY(-2px);
}

.social-link svg {
  width: 22px;
  height: 22px;
}

.footer-copy {
  font-size: 13px;
  letter-spacing: 0.3px;
}

/* ===== Scroll Reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 1023px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .about-visual {
    order: -1;
  }

  .avatar-placeholder {
    width: 180px;
    height: 180px;
  }

  .modal-body {
    grid-template-columns: 1fr;
  }

  .modal-image {
    aspect-ratio: 16 / 9;
  }

  .modal-info {
    padding: 28px 24px;
  }
}

@media (max-width: 767px) {
  .section {
    padding: 72px 0;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* Mobile Nav */
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    max-width: 300px;
    height: 100vh;
    background: rgba(250, 250, 248, 0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 80px 40px;
    gap: 32px;
    transition: right var(--transition-base);
    box-shadow: -4px 0 24px rgba(26, 26, 46, 0.08);
  }

  .nav-links.active {
    right: 0;
  }

  .hamburger {
    display: flex;
  }

  .hero {
    padding: 100px 20px 60px;
    min-height: 100dvh;
  }

  .hero-cta {
    flex-direction: column;
    gap: 12px;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .about-experience {
    gap: 12px;
  }

  .exp-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .avatar-placeholder {
    width: 150px;
    height: 150px;
  }

  .modal {
    max-height: 95vh;
  }

  .modal-overlay {
    padding: 12px;
    align-items: flex-end;
  }

  .footer {
    padding: 36px 0;
  }
}
