/* ========================================
   DESIGN TOKENS
   ======================================== */
:root {
  --color-bg: #0a0a0b;
  --color-bg-alt: #111113;
  --color-surface: #18181b;
  --color-surface-hover: #1f1f23;
  --color-border: #27272a;
  --color-border-hover: #3f3f46;
  --color-text: #fafafa;
  --color-text-secondary: #a1a1aa;
  --color-text-muted: #71717a;
  --color-accent: #6366f1;
  --color-accent-hover: #818cf8;
  --color-accent-glow: rgba(99, 102, 241, 0.15);
  --color-green: #22c55e;
  --color-red: #ef4444;
  --color-yellow: #eab308;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px var(--color-accent-glow);

  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

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

/* ========================================
   UTILITIES
   ======================================== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.accent {
  color: var(--color-accent);
}

/* ========================================
   NAVIGATION
   ======================================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 16px 0;
  transition: var(--transition);
  background: transparent;
}

.nav.scrolled {
  background: rgba(10, 10, 11, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
  padding: 12px 0;
}

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  transition: var(--transition);
}

.nav-logo:hover {
  color: var(--color-accent);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 32px;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: var(--transition);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: var(--transition);
}

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

.nav-links a:hover::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  transition: var(--transition);
  border-radius: 2px;
}

/* ========================================
   HERO SECTION
   ======================================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 120px 0 80px;
}

.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 60% 60% at 50% 40%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 40%, black 20%, transparent 70%);
}

.hero-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  width: 100%;
}

.hero-greeting {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--color-accent);
  margin-bottom: 16px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero-name {
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.hero-title {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 24px;
}

.hero-description {
  font-size: 1rem;
  color: var(--color-text-muted);
  max-width: 440px;
  margin-bottom: 40px;
  line-height: 1.8;
}

.hero-cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--color-accent);
  color: white;
  box-shadow: 0 0 20px var(--color-accent-glow);
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.3);
  transform: translateY(-2px);
}

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

.btn-outline:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  transform: translateY(-2px);
}

/* Hero Code Block */
.hero-visual {
  display: flex;
  justify-content: center;
}

.hero-code-block {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.code-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--color-border);
}

.code-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.code-dot.red { background: var(--color-red); }
.code-dot.yellow { background: var(--color-yellow); }
.code-dot.green { background: var(--color-green); }

.code-filename {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-left: auto;
}

.code-content {
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.9;
  overflow-x: auto;
}

.code-content code {
  font-family: inherit;
}

.code-keyword { color: #c084fc; }
.code-var { color: #60a5fa; }
.code-prop { color: #818cf8; }
.code-string { color: #34d399; }

/* Scroll Indicator */
.scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
}

.scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--color-accent), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.6); }
  50% { opacity: 1; transform: scaleY(1); }
}

/* ========================================
   SECTIONS
   ======================================== */
.section {
  padding: 120px 0;
}

.section-alt {
  background: var(--color-bg-alt);
}

.section-header {
  margin-bottom: 64px;
}

.section-tag {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--color-accent);
  display: block;
  margin-bottom: 12px;
  letter-spacing: 0.05em;
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

/* ========================================
   ABOUT SECTION
   ======================================== */
.about-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 64px;
  align-items: start;
}

.about-photo {
  position: sticky;
  top: 120px;
}

.about-photo-frame {
  position: relative;
  width: 300px;
  height: 370px;
}

.about-photo-border {
  position: absolute;
  top: 16px;
  left: 16px;
  right: -16px;
  bottom: -16px;
  border: 2px solid var(--color-accent);
  border-radius: var(--radius-lg);
  transition: var(--transition);
  opacity: 0.4;
}

.about-photo-dots {
  position: absolute;
  bottom: -30px;
  right: -30px;
  width: 80px;
  height: 80px;
  background-image: radial-gradient(var(--color-accent) 1.5px, transparent 1.5px);
  background-size: 12px 12px;
  opacity: 0.3;
  z-index: 0;
}

.about-photo-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid var(--color-border);
  transition: var(--transition);
}

.about-photo-frame:hover .about-photo-wrapper {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-glow);
  transform: translate(-4px, -4px);
}

.about-photo-frame:hover .about-photo-border {
  opacity: 0.8;
  transform: translate(4px, 4px);
}

.about-photo-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(20%);
  transition: var(--transition);
}

.about-photo-frame:hover .about-photo-wrapper img {
  filter: grayscale(0%);
}



.about-info {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.about-text p {
  color: var(--color-text-secondary);
  margin-bottom: 20px;
  font-size: 1rem;
  line-height: 1.9;
}

.about-text strong {
  color: var(--color-text);
  font-weight: 600;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 28px;
  text-align: center;
  transition: var(--transition);
}

.stat-card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-glow);
  transform: translateY(-4px);
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--color-accent);
  letter-spacing: -0.03em;
}

.stat-suffix {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-accent);
}

.stat-label {
  display: block;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* ========================================
   SKILLS SECTION
   ======================================== */
.skills-category {
  margin-bottom: 48px;
}

.skills-category:last-child {
  margin-bottom: 0;
}

.skills-category-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.category-icon {
  color: var(--color-accent);
  font-size: 0.75rem;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.skill-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 28px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.skill-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-hover));
  opacity: 0;
  transition: var(--transition);
}

.skill-card:hover {
  border-color: var(--color-border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.skill-card:hover::before {
  opacity: 1;
}

.skill-card-featured {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-glow);
}

.skill-card-featured::before {
  opacity: 1;
}

.skill-icon {
  width: 40px;
  height: 40px;
  color: var(--color-accent);
  margin-bottom: 16px;
}

.skill-icon svg {
  width: 100%;
  height: 100%;
}

.skill-name {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.skill-desc {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

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

.skill-tag {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 100px;
  padding: 8px 18px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: var(--transition);
  cursor: default;
}

.skill-tag:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: var(--color-accent-glow);
}

/* ========================================
   TIMELINE
   ======================================== */
.timeline {
  position: relative;
  padding-left: 40px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--color-accent), var(--color-border));
}

.timeline-item {
  position: relative;
  margin-bottom: 48px;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: -40px;
  top: 8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-bg);
  border: 3px solid var(--color-accent);
  box-shadow: 0 0 10px var(--color-accent-glow);
}

.timeline-content {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 28px;
  transition: var(--transition);
}

.timeline-content:hover {
  border-color: var(--color-border-hover);
  box-shadow: var(--shadow-md);
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--color-accent);
  font-weight: 500;
}

.timeline-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: 8px;
}

.timeline-place {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin-top: 4px;
}

.timeline-desc {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-top: 12px;
  line-height: 1.8;
}

/* ========================================
   CONTACT SECTION
   ======================================== */
.contact-content {
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}

.contact-text {
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  margin-bottom: 48px;
  line-height: 1.8;
}

.contact-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.contact-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 28px 20px;
  text-align: center;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.contact-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

.contact-icon {
  width: 32px;
  height: 32px;
  color: var(--color-accent);
}

.contact-icon svg {
  width: 100%;
  height: 100%;
}

.contact-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  font-weight: 500;
}

.contact-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
  padding: 48px 0;
  border-top: 1px solid var(--color-border);
}

.footer-content {
  text-align: center;
}

.footer-quote {
  font-style: italic;
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.8;
}

.footer-ref {
  color: var(--color-text-muted);
  font-style: normal;
  font-size: 0.85rem;
}

.footer-divider {
  width: 40px;
  height: 2px;
  background: var(--color-border);
  margin: 24px auto;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* ========================================
   ANIMATIONS
   ======================================== */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-delay-1 { transition-delay: 0.1s; }
.fade-in-delay-2 { transition-delay: 0.2s; }
.fade-in-delay-3 { transition-delay: 0.3s; }

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--color-surface);
    flex-direction: column;
    padding: 80px 32px 32px;
    gap: 24px;
    transition: var(--transition-slow);
    border-left: 1px solid var(--color-border);
    z-index: 999;
  }

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

  .nav-toggle {
    display: flex;
    z-index: 1001;
  }

  .nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

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

  .nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .hero-content {
    grid-template-columns: 1fr;
    gap: 48px;
    text-align: center;
  }

  .hero-description {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-cta {
    justify-content: center;
  }

  .hero-visual {
    order: -1;
  }

  .hero-code-block {
    max-width: 360px;
  }

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

  .about-photo {
    position: static;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .about-photo-frame {
    width: 240px;
    height: 300px;
  }

  .about-stats {
    grid-template-columns: repeat(3, 1fr);
  }

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

  .contact-cards {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 80px 0;
  }

  .section-header {
    margin-bottom: 40px;
  }
}

@media (max-width: 480px) {
  .hero-name {
    font-size: 2.5rem;
  }

  .about-stats {
    grid-template-columns: 1fr;
  }

  .about-photo-frame {
    width: 200px;
    height: 250px;
  }

  .about-photo-dots {
    display: none;
  }

  .code-content {
    font-size: 0.7rem;
    padding: 16px;
  }

  .hero {
    padding: 100px 0 60px;
  }
}

/* ========================================
   SELECTION & SCROLLBAR
   ======================================== */
::selection {
  background: var(--color-accent);
  color: white;
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

/* ========================================
   404 PAGE
   ======================================== */
.notfound-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 0 80px;
}

.notfound-content {
  text-align: center;
  max-width: 500px;
  margin: 0 auto;
}

.notfound-code {
  margin-bottom: 40px;
}

.notfound-code .hero-code-block {
  max-width: 340px;
  margin: 0 auto;
}

.notfound-title {
  font-size: clamp(4rem, 10vw, 8rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--color-text), var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.notfound-text {
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  margin-bottom: 12px;
  line-height: 1.6;
}

.notfound-redirect {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 32px;
}
