:root {
  --bg: #0a0a12;
  --bg-elevated: #13131f;
  --bg-card: #1c1a2e;
  --bg-card-hover: #242040;
  --border: #2a2740;
  --border-light: #3a3555;
  --text: #f0e6ff;
  --text-soft: #c4b5d4;
  --text-dim: #8b7aa0;
  --accent: #ff6b9d;
  --accent-glow: rgba(255, 107, 157, 0.2);
  --accent-cyan: #89CFF0;
  --gradient-1: linear-gradient(135deg, #ff6b9d, #c084fc);
  --gradient-2: linear-gradient(135deg, #89CFF0, #ff6b9d);
  --radius: 14px;
  --radius-sm: 10px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Instrument Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 17px;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

.header {
  position: relative;
  overflow: hidden;
}

.header-banner {
  max-width: 960px;
  margin: 0 auto;
  height: 220px;
  position: relative;
  overflow: hidden;
  border-radius: 0 0 var(--radius) var(--radius);
}

.banner-image {
  width: 100%;
  height: 100%;
  background: url('assets/banner.jpg') center/cover no-repeat;
  position: relative;
}

.banner-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 10, 18, 0.2) 0%, rgba(10, 10, 18, 0.6) 100%);
}

.header-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
}

.avatar-frame {
  position: relative;
  z-index: 2;
  margin-top: -48px;
  margin-bottom: 16px;
  width: 96px;
}

.avatar-frame::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: var(--bg);
  z-index: -1;
}

.avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 4px solid var(--bg);
}

.header-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.name {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.handle {
  font-family: 'DM Mono', monospace;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-flex;
  padding: 4px 12px;
  font-size: 0.7rem;
  font-weight: 500;
  border-radius: 100px;
  background: rgba(255, 107, 157, 0.08);
  border: 1px solid rgba(255, 107, 157, 0.2);
  color: var(--accent);
  letter-spacing: 0.02em;
}

.bio {
  font-size: 0.95rem;
  color: var(--text-soft);
  max-width: 580px;
  line-height: 1.6;
  margin-top: 10px;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(137, 207, 240, 0.4);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.status-text {
  font-size: 0.82rem;
  color: var(--accent-cyan);
  font-weight: 500;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 200ms ease;
}

.social-link:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  color: var(--text);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--accent-glow);
}

.social-link svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

/* Building Row */
.building-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.building-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(255, 107, 157, 0.4);
  flex-shrink: 0;
}

.building-text {
  font-size: 0.85rem;
  color: var(--text-soft);
  font-style: italic;
}

/* Links Row */
.links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  align-items: flex-start;
}

/* Resume Link */
.resume-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 200ms ease;
}

.resume-link:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  color: var(--text);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--accent-glow);
}

.resume-link svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.main {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px 80px;
  position: relative;
  z-index: 1;
  background: var(--bg);
}

.main::before {
  content: '';
  position: absolute;
  left: 32px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, var(--accent-cyan), var(--border) 30%, var(--border) 70%, transparent);
  opacity: 0.2;
}

.section {
  margin-top: 64px;
  padding-left: 48px;
  position: relative;
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 28px;
  position: relative;
}

.section-header::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.6;
  box-shadow: 0 0 8px rgba(255, 107, 157, 0.3);
}

.section-number {
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
  color: var(--accent-cyan);
  font-weight: 500;
  opacity: 0.8;
  position: absolute;
  left: -48px;
  top: 2px;
  width: 28px;
  text-align: right;
}

.section-header h2 {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Skills */
.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-soft);
  transition: all 200ms ease;
}

.skill-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  color: var(--text);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px var(--accent-glow);
}

.skill-logo {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  object-fit: contain;
}

.skill-logo[src*="express"],
.skill-logo[src*="vercel"] {
  filter: brightness(0) invert(0.7);
}

.skill-item:hover .skill-logo[src*="express"],
.skill-item:hover .skill-logo[src*="vercel"] {
  filter: brightness(0) invert(1);
}

/* About */
.about-content {
  display: grid;
  gap: 16px;
}

.about-content p {
  font-size: 1rem;
  color: var(--text-soft);
  max-width: 640px;
  line-height: 1.7;
}

.about-content strong {
  color: var(--text);
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.project-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: all 250ms ease;
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 0% 20%, rgba(255, 107, 157, 0.08), transparent 60%),
    radial-gradient(ellipse 60% 50% at 100% 80%, rgba(137, 207, 240, 0.06), transparent 50%),
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(192, 132, 252, 0.05), transparent 50%);
  opacity: 0.6;
  z-index: 0;
  pointer-events: none;
  animation: liquid-shift 8s ease-in-out infinite alternate;
}

@keyframes liquid-shift {
  0% {
    background:
      radial-gradient(ellipse 80% 60% at 0% 20%, rgba(255, 107, 157, 0.08), transparent 60%),
      radial-gradient(ellipse 60% 50% at 100% 80%, rgba(137, 207, 240, 0.06), transparent 50%),
      radial-gradient(ellipse 50% 40% at 50% 50%, rgba(192, 132, 252, 0.05), transparent 50%);
  }
  33% {
    background:
      radial-gradient(ellipse 70% 50% at 30% 60%, rgba(255, 107, 157, 0.07), transparent 55%),
      radial-gradient(ellipse 65% 55% at 70% 30%, rgba(137, 207, 240, 0.07), transparent 50%),
      radial-gradient(ellipse 45% 35% at 20% 80%, rgba(192, 132, 252, 0.06), transparent 45%);
  }
  66% {
    background:
      radial-gradient(ellipse 75% 55% at 80% 40%, rgba(255, 107, 157, 0.06), transparent 55%),
      radial-gradient(ellipse 55% 45% at 10% 70%, rgba(137, 207, 240, 0.08), transparent 50%),
      radial-gradient(ellipse 60% 50% at 60% 10%, rgba(192, 132, 252, 0.05), transparent 50%);
  }
  100% {
    background:
      radial-gradient(ellipse 80% 60% at 0% 20%, rgba(255, 107, 157, 0.08), transparent 60%),
      radial-gradient(ellipse 60% 50% at 100% 80%, rgba(137, 207, 240, 0.06), transparent 50%),
      radial-gradient(ellipse 50% 40% at 50% 50%, rgba(192, 132, 252, 0.05), transparent 50%);
  }
}

.project-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.03) 45%, rgba(255, 255, 255, 0.06) 50%, rgba(255, 255, 255, 0.03) 55%, transparent 70%);
  background-size: 200% 100%;
  background-position: 100% 0;
  opacity: 0;
  transition: opacity 400ms ease;
  z-index: 2;
  pointer-events: none;
}

.project-card:hover::after {
  opacity: 1;
  animation: shimmer 1.5s ease-out forwards;
}

.project-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3), 0 0 20px rgba(255, 107, 157, 0.1);
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.project-card-img {
  width: 100%;
  height: 180px;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}

.project-card-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 107, 157, 0.25), rgba(192, 132, 252, 0.18));
  mix-blend-mode: overlay;
  pointer-events: none;
}

.project-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 300ms ease;
}

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

.project-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
  position: relative;
  z-index: 2;
}

.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.project-num {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.project-tag {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 100px;
  background: rgba(255, 107, 157, 0.1);
  color: var(--accent);
  border: 1px solid rgba(255, 107, 157, 0.15);
}

.project-card-body h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 8px;
  transition: color 200ms ease;
}

.project-card-body:hover h3 {
  color: var(--accent);
}

.project-card-body p {
  font-size: 0.88rem;
  color: var(--text-soft);
  line-height: 1.6;
  flex: 1;
}

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

.project-meta {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: 'DM Mono', monospace;
}

.project-footer svg {
  color: var(--text-dim);
  transition: all 200ms ease;
}

.project-card:hover .project-footer svg {
  color: var(--accent);
  transform: translate(2px, -2px);
}

/* GitHub Section */
.github-note {
  font-size: 0.9rem;
  color: var(--text-soft);
  margin-bottom: 24px;
}

.repo-stats {
  display: flex;
  gap: 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.repo-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 8px rgba(255, 107, 157, 0.3));
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-family: 'DM Mono', monospace;
}

.contrib-chart-wrap {
  width: 100%;
  overflow-x: auto;
  padding: 8px 0;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.contrib-chart {
  display: block;
  max-width: 720px;
  margin: 0 auto;
  filter: invert(1) hue-rotate(160deg) saturate(1.2) brightness(1.1);
  border-radius: 4px;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: 32px 24px;
}

.footer-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer p {
  font-size: 0.82rem;
  color: var(--text-dim);
}

.footer-note {
  font-family: 'DM Mono', monospace;
}

/* Sakura Petals */
.sakura-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.petal {
  position: absolute;
  top: -20px;
  width: 14px;
  height: 10px;
  border-radius: 50% 0 50% 0;
  background: var(--accent);
  opacity: 0.2;
  filter: blur(1.5px);
  animation: petal-fall linear infinite;
}

@keyframes petal-fall {
  0% {
    transform: translateY(0) rotate(0deg) translateX(0);
    opacity: 0.2;
  }
  10% {
    opacity: 0.35;
  }
  90% {
    opacity: 0.15;
  }
  100% {
    transform: translateY(100vh) rotate(720deg) translateX(80px);
    opacity: 0;
  }
}

/* Philosophy Link */
.philosophy-link {
  display: inline-block;
  text-decoration: none;
  width: fit-content;
  transition: opacity 200ms ease;
}

.philosophy-link:hover {
  opacity: 0.7;
}

.ph-box {
  display: block;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--text-soft);
}

.ph-line {
  display: block;
  white-space: pre;
  font-family: 'DM Mono', 'Courier New', monospace;
  letter-spacing: 0.02em;
  font-weight: 400;
}

/* Contact */
.contact-content p {
  font-size: 1rem;
  color: var(--text-soft);
  max-width: 640px;
  line-height: 1.7;
}

.inline-link {
  color: var(--accent);
  text-decoration: none;
  transition: color 200ms ease;
}

.inline-link:hover {
  color: var(--text);
}

.inline-code {
  font-family: 'DM Mono', monospace;
  font-size: 0.9em;
  color: var(--text);
  background: var(--bg-card);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 300ms ease, visibility 300ms ease;
}

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

.modal-container {
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95) translateY(12px);
  transition: transform 300ms ease;
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  font-family: 'DM Mono', monospace;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  transition: opacity 200ms ease;
  border: none;
  cursor: pointer;
}

.modal-download-btn:hover {
  opacity: 0.85;
}

.modal-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 200ms ease;
}

.modal-close-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  color: var(--text);
}

.modal-body {
  flex: 1;
  min-height: 0;
  background: var(--bg);
}

.pdf-viewer {
  width: 100%;
  height: 70vh;
  border: none;
  display: block;
}

body.modal-open {
  overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
  .header-banner {
    height: 140px;
  }

  .avatar-frame {
    margin-top: -36px;
    width: 72px;
  }

  .avatar {
    width: 72px;
    height: 72px;
    border-width: 3px;
  }

  .header-content {
    padding: 0 16px;
  }

  .social-links {
    flex-direction: column;
  }

  .social-link {
    width: 100%;
  }

  .main {
    padding: 0 20px 60px;
    background: var(--bg);
  }

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

  .repo-stats {
    gap: 20px;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}@media (max-width: 480px) {
  .section {
    margin-top: 40px;
  }

  .section-header h2 {
    font-size: 1.2rem;
  }

  .name {
    font-size: 1.4rem;
  }
}
