/* ===================================================================
   VARIABLES & RESET
   =================================================================== */

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a2e;
  --bg-card-hover: #1f1f35;
  --bg-elevated: #16213e;
  --bg-modal: #111119;

  --accent: #00d4ff;
  --accent-glow: rgba(0, 212, 255, 0.15);
  --accent-dim: rgba(0, 212, 255, 0.6);
  --accent-secondary: #00ff88;

  --text-primary: #e0e0e0;
  --text-secondary: #8892a4;
  --text-muted: #4a5568;

  --syntax-keyword: #c678dd;
  --syntax-string: #98c379;
  --syntax-operator: #56b6c2;
  --syntax-comment: #5c6370;
  --syntax-punctuation: #abb2bf;

  --border: rgba(255, 255, 255, 0.06);
  --border-accent: rgba(0, 212, 255, 0.25);

  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --nav-height: 64px;
  --container-max: 1200px;
  --radius: 8px;
  --radius-lg: 12px;

  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.15s ease;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
  overscroll-behavior: none;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--accent);
  color: var(--bg-primary);
}

a {
  color: inherit;
  text-decoration: none;
}

img, video {
  display: block;
  max-width: 100%;
}

ul {
  list-style: none;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ===================================================================
   SECTION HEADING
   =================================================================== */

.section-heading {
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 500;
  margin-bottom: 48px;
  color: var(--text-primary);
}

.section-heading__prompt {
  color: var(--accent);
}

.section-heading__flag {
  color: var(--syntax-string);
}

/* ===================================================================
   BUTTONS
   =================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn--primary {
  background: var(--accent);
  color: var(--bg-primary);
  border-color: var(--accent);
}

.btn--primary:hover {
  background: transparent;
  color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn--outline {
  background: transparent;
  color: var(--accent);
  border-color: var(--border-accent);
}

.btn--outline:hover {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

/* ===================================================================
   NAVIGATION
   =================================================================== */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: var(--transition);
}

.nav--scrolled {
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

.nav__logo {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  user-select: none;
}

.nav__logo-bracket {
  color: var(--accent);
}

.nav__logo-text {
  color: var(--text-primary);
  margin: 0 2px;
}

.nav__links {
  display: flex;
  gap: 8px;
}

.nav__link {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 8px 16px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  transition: var(--transition-fast);
  position: relative;
}

.nav__link:hover,
.nav__link.active {
  color: var(--accent);
}

.nav__link.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 16px;
  right: 16px;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 10;
}

.nav__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition);
}

.nav__toggle.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav__toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav__toggle.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ===================================================================
   HERO
   =================================================================== */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-height) + 40px) 24px 40px;
  overflow: hidden;
}

.hero__bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 30%, transparent 100%);
}

.hero__content {
  position: relative;
  max-width: 720px;
  text-align: left;
}

.hero__comment {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--syntax-comment);
}

.hero__greeting {
  margin-bottom: 16px;
}

.hero__name {
  font-family: var(--font-mono);
  font-size: clamp(1.4rem, 5vw, 2.6rem);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 16px;
}

.hero__keyword {
  color: var(--syntax-keyword);
}

.hero__operator {
  color: var(--syntax-operator);
}

.hero__string {
  color: var(--syntax-string);
}

.hero__punctuation {
  color: var(--syntax-punctuation);
}

.hero__title {
  font-family: var(--font-mono);
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  margin-bottom: 12px;
  color: var(--text-primary);
}

.hero__chevron {
  color: var(--accent);
  margin-right: 4px;
}

.hero__subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 36px;
  max-width: 500px;
}

.hero__cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero__scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  animation: scrollBounce 2s ease-in-out infinite;
  transition: opacity 0.4s ease;
}

.hero__scroll-indicator.hidden {
  opacity: 0;
  pointer-events: none;
}

.hero__scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--accent-dim), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(10px); }
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.6); }
  50% { opacity: 1; transform: scaleY(1); }
}

/* ===================================================================
   ABOUT
   =================================================================== */

.about {
  padding: 100px 0;
  position: relative;
}

.about__content {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 60px;
  align-items: start;
}

.about__text p {
  margin-bottom: 16px;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.8;
}

.about__text strong {
  color: var(--accent);
  font-weight: 500;
}

.about__note {
  color: var(--text-muted) !important;
  font-size: 0.9rem !important;
  border-left: 2px solid var(--border-accent);
  padding-left: 16px;
  margin-top: 8px;
}

.about__sidebar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.about__portrait {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--border-accent);
  box-shadow: 0 0 30px var(--accent-glow), 0 8px 32px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.about__portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about__stats {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 32px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.about__stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.about__stat-number {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.about__stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ===================================================================
   PROJECTS
   =================================================================== */

.projects {
  padding: 100px 0;
  background: var(--bg-secondary);
  position: relative;
}

.projects::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-accent), transparent);
}

.projects__tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 40px;
  background: var(--bg-primary);
  padding: 4px;
  border-radius: var(--radius);
  width: fit-content;
}

.projects__tab {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 10px 24px;
  background: transparent;
  border: none;
  border-radius: calc(var(--radius) - 2px);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.projects__tab:hover {
  color: var(--text-primary);
}

.projects__tab.active {
  background: var(--bg-card);
  color: var(--accent);
}

.projects__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* ===================================================================
   PROJECT CARD
   =================================================================== */

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  opacity: 0;
  transform: translateY(30px);
}

.project-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.project-card:hover {
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: 0 8px 40px rgba(0, 212, 255, 0.08);
}

.project-card__thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.project-card__thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.project-card:hover .project-card__thumb img {
  transform: scale(1.05);
}

.project-card__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--bg-elevated), var(--bg-card));
  font-family: var(--font-mono);
  font-size: 2rem;
  color: var(--accent-dim);
}

.project-card__body {
  padding: 20px;
}

.project-card__category {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  margin-bottom: 8px;
}

.project-card__title {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.project-card__date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.project-card__snippet {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===================================================================
   MODAL
   =================================================================== */

.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal.open {
  opacity: 1;
  pointer-events: auto;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.modal__container {
  position: relative;
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  background: var(--bg-modal);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-y: auto;
  transform: translateY(20px) scale(0.98);
  transition: transform 0.3s ease;
}

.modal.open .modal__container {
  transform: translateY(0) scale(1);
}

.modal__close {
  position: sticky;
  top: 16px;
  float: right;
  margin: 16px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 1.4rem;
  cursor: pointer;
  transition: var(--transition-fast);
  z-index: 10;
}

.modal__close:hover {
  color: var(--accent);
  border-color: var(--border-accent);
}

.modal__gallery {
  padding: 24px 24px 0;
}

.modal__gallery-main {
  position: relative;
  background: var(--bg-primary);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal__gallery-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.modal__gallery-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.modal__gallery-prev,
.modal__gallery-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 15, 0.7);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-primary);
  font-size: 1.4rem;
  cursor: pointer;
  transition: var(--transition-fast);
  backdrop-filter: blur(4px);
}

.modal__gallery-prev:hover,
.modal__gallery-next:hover {
  background: var(--bg-card);
  border-color: var(--border-accent);
  color: var(--accent);
}

.modal__gallery-prev { left: 12px; }
.modal__gallery-next { right: 12px; }

.modal__gallery-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.modal__gallery-thumbs::-webkit-scrollbar {
  height: 4px;
}

.modal__gallery-thumbs::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

.modal__gallery-thumbs::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 2px;
}

.modal__thumb {
  width: 72px;
  height: 48px;
  border-radius: 4px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition-fast);
  opacity: 0.5;
}

.modal__thumb:hover,
.modal__thumb.active {
  border-color: var(--accent);
  opacity: 1;
}

.modal__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal__info {
  padding: 28px 24px 32px;
}

.modal__category {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  display: inline-block;
  padding: 4px 12px;
  background: var(--accent-glow);
  border-radius: 4px;
  margin-bottom: 12px;
}

.modal__title {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.modal__date {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 16px;
}

.modal__description {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 24px;
}

.modal__features h4 {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.modal__features ul {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.modal__features li {
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding-left: 18px;
  position: relative;
}

.modal__features li::before {
  content: '▹';
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* ===================================================================
   CONTACT
   =================================================================== */

.contact {
  padding: 100px 0;
  position: relative;
}

.contact::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-accent), transparent);
}

.contact__content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}

.contact__info p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 32px;
}

.contact__details {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact__detail {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.contact__detail:hover {
  color: var(--accent);
}

.contact__detail-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1.1rem;
}

.contact__form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact__form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contact__form-group label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.contact__form-group input,
.contact__form-group textarea {
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  outline: none;
  transition: var(--transition-fast);
  resize: vertical;
}

.contact__form-group input:focus,
.contact__form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.contact__form-group input::placeholder,
.contact__form-group textarea::placeholder {
  color: var(--text-muted);
}

/* ===================================================================
   FOOTER
   =================================================================== */

.footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer__copy {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer__comment {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--syntax-comment);
}

/* ===================================================================
   SCROLL ANIMATIONS
   =================================================================== */

.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===================================================================
   RESPONSIVE
   =================================================================== */

@media (max-width: 1024px) {
  .projects__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .nav__toggle {
    display: flex;
  }

  .nav__links {
    position: fixed;
    top: 0;
    right: 0;
    width: 260px;
    height: 100vh;
    height: 100dvh;
    flex-direction: column;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    padding: calc(var(--nav-height) + 24px) 24px 24px;
    gap: 4px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }

  .nav__links.open {
    transform: translateX(0);
  }

  .nav__link.active::after {
    display: none;
  }

  .hero__content {
    text-align: center;
  }

  .hero__subtitle {
    margin-left: auto;
    margin-right: auto;
  }

  .hero__cta {
    justify-content: center;
  }

  .about__content {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .about__sidebar {
    flex-direction: row;
    align-items: center;
    gap: 32px;
  }

  .about__portrait {
    width: 120px;
    height: 120px;
  }

  .about__stats {
    flex-direction: row;
    justify-content: center;
  }

  .projects__grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .projects__tabs {
    width: 100%;
  }

  .projects__tab {
    flex: 1;
    text-align: center;
  }

  .contact__content {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .modal__container {
    width: 95%;
    max-height: 95vh;
  }

  .modal__features ul {
    grid-template-columns: 1fr;
  }

  .footer__inner {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding: calc(var(--nav-height) + 24px) 24px 24px;
  }

  .hero__scroll-indicator {
    display: none;
  }

  .hero__subtitle {
    margin-bottom: 20px;
  }

  .about,
  .projects,
  .contact {
    padding: 60px 0;
  }

  .section-heading {
    margin-bottom: 32px;
  }
}

@media (max-width: 480px) {
  .hero__name {
    font-size: 1.2rem;
  }

  .btn {
    padding: 10px 20px;
    font-size: 0.8rem;
  }

  .about__stats {
    flex-direction: column;
    align-items: stretch;
  }

  .section-heading {
    font-size: 1.3rem;
  }
}
