/* ============================================
   COSMIC NOIR — Design System
   Aesthetic: Dark cinematic with warm amber glow
   Typography: Syne (display) + DM Sans (body)
   ============================================ */

/* --- CSS Variables --- */
:root {
  /* Color System */
  --bg-deep: #08090d;
  --bg-surface: #0f1117;
  --bg-elevated: #161820;
  --bg-card: #1a1c26;

  --text-primary: #e8e6e1;
  --text-secondary: #9b978e;
  --text-muted: #5c594f;

  --accent: #d4a754;
  --accent-glow: #d4a75440;
  --accent-light: #e8c882;
  --accent-dark: #a07d3a;
  --accent-gradient: linear-gradient(135deg, #d4a754, #e8c882, #d4a754);

  --border: #1f2129;
  --border-hover: #2a2d38;

  /* Typography */
  --font-display: 'Plus Jakarta Sans', sans-serif;
  --font-body: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Spacing rhythm — 8px base */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;
  --space-5xl: 8rem;

  /* Layout */
  --max-width: 1200px;
  --nav-height: 72px;

  /* Effects */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 40px var(--accent-glow);

  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 600ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + var(--space-xl));
}

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

::selection {
  background: var(--accent);
  color: var(--bg-deep);
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-fast);
}

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

ul, ol {
  list-style: none;
}

/* --- Particle Canvas --- */
#particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* --- Cursor Glow --- */
.cursor-glow {
  position: fixed;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

body:hover .cursor-glow {
  opacity: 1;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: var(--space-lg);
  left: var(--space-lg);
  right: var(--space-lg);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-xl);
  background: rgba(8, 9, 13, 0.75);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  z-index: 1000;
  transition: all var(--transition-base);
}

.nav--scrolled {
  top: var(--space-sm);
  background: rgba(8, 9, 13, 0.9);
  box-shadow: var(--shadow-md);
}

.nav__logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  cursor: pointer;
}

.nav__links {
  display: flex;
  gap: var(--space-xl);
}

.nav__link {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  position: relative;
  cursor: pointer;
}

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

.nav__link:hover {
  color: var(--text-primary);
}

.nav__link:hover::after {
  width: 100%;
}

/* Nav right group */
.nav__right {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

/* Language Toggle */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.lang-toggle:hover {
  border-color: var(--accent);
  background: rgba(212, 167, 84, 0.08);
}

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

.lang-toggle__inactive {
  color: var(--text-muted);
}

.lang-toggle__divider {
  color: var(--border);
  font-weight: 400;
}

/* Mobile menu lang link */
.mobile-menu__lang {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent);
  padding: 10px 24px;
  border: 1px solid var(--accent-dark);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
}

.mobile-menu__lang:hover {
  background: rgba(212, 167, 84, 0.1);
  border-color: var(--accent);
}

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

.nav__menu-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: all var(--transition-base);
  border-radius: 2px;
}

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

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

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

/* Mobile Menu */
.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(8, 9, 13, 0.97);
  backdrop-filter: blur(30px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2xl);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-slow);
}

.mobile-menu.active {
  opacity: 1;
  pointer-events: auto;
}

.mobile-menu__link {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
  cursor: pointer;
}

.mobile-menu__link:hover {
  color: var(--accent);
}

/* --- Accent utilities --- */
.accent {
  color: var(--accent);
}

.accent-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #4ade80;
  border-radius: 50%;
  margin-right: var(--space-sm);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.4); }
  50% { opacity: 0.7; box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); }
}

/* --- Hero Section --- */
.hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: var(--space-3xl);
  padding: calc(var(--nav-height) + var(--space-4xl)) var(--space-3xl) var(--space-3xl);
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-xs) var(--space-md);
  background: rgba(74, 222, 128, 0.08);
  border: 1px solid rgba(74, 222, 128, 0.2);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: #4ade80;
  margin-bottom: var(--space-xl);
}

.hero__name {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-lg);
}

.hero__name-line {
  display: block;
  font-size: clamp(3rem, 6vw, 5.5rem);
}

.hero__title {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--space-lg);
}

.hero__subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 520px;
  line-height: 1.8;
  margin-bottom: var(--space-2xl);
}

.hero__cta {
  display: flex;
  gap: var(--space-md);
}

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

.hero__avatar-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero__avatar {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 38%, rgba(212, 167, 84, 0.22), transparent 58%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.01)),
    var(--bg-card);
  border: 3px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  z-index: 2;
}

.hero__company-mark {
  width: 72%;
  height: 72%;
  object-fit: contain;
  filter: drop-shadow(0 18px 34px rgba(212, 167, 84, 0.28));
}

.hero__avatar-placeholder {
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__avatar-ring {
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  border: 1px solid var(--accent-glow);
  animation: ring-rotate 12s linear infinite;
  z-index: 1;
}

.hero__avatar-ring::before {
  content: '';
  position: absolute;
  top: -3px;
  left: 50%;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--accent);
}

.hero__avatar-ring--delay {
  width: 360px;
  height: 360px;
  animation-duration: 18s;
  animation-direction: reverse;
  border-color: rgba(212, 167, 84, 0.15);
}

@keyframes ring-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Scroll indicator */
.hero__scroll-indicator {
  position: absolute;
  bottom: var(--space-2xl);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

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

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

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-base);
  letter-spacing: 0.02em;
}

.btn--primary {
  background: var(--accent);
  color: var(--bg-deep);
}

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

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

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

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

/* --- Section Layout --- */
.section {
  padding: var(--space-5xl) var(--space-3xl);
  position: relative;
  z-index: 2;
}

.section__container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section__header {
  display: flex;
  align-items: baseline;
  gap: var(--space-lg);
  margin-bottom: var(--space-3xl);
}

.section__number {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.section__title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* --- About Section --- */
.about__grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: var(--space-4xl);
  align-items: start;
}

.about__lead {
  font-size: 1.2rem;
  color: var(--text-primary);
  line-height: 1.8;
  margin-bottom: var(--space-lg);
}

.about__text p:not(.about__lead) {
  color: var(--text-secondary);
  line-height: 1.8;
}

.about__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  text-align: center;
  transition: all var(--transition-base);
}

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

.stat-card__number {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent);
  display: inline;
}

.stat-card__plus {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-dark);
}

.stat-card__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: var(--space-xs);
}

/* --- Skills Section --- */
.skills__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xl);
}

.skill-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  transition: all var(--transition-base);
}

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

.skill-group__icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(212, 167, 84, 0.1);
  border-radius: var(--radius-sm);
  color: var(--accent);
  margin-bottom: var(--space-lg);
}

.skill-group__title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: var(--space-lg);
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.skill-tag {
  padding: var(--space-xs) var(--space-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.skill-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(212, 167, 84, 0.05);
}

/* --- Projects Section --- */
.projects__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-base);
  cursor: pointer;
}

.project-card:hover {
  border-color: var(--accent-dark);
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}

.project-card--featured {
  border-color: rgba(212, 167, 84, 0.3);
}

.project-card__image {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.project-card__placeholder {
  color: var(--text-muted);
  opacity: 0.5;
}

.project-card__body {
  padding: var(--space-xl);
}

.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.project-card__tags span {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.project-card__title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.project-card__desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-lg);
}

.project-card__links {
  display: flex;
  gap: var(--space-lg);
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.project-link:hover {
  color: var(--accent);
}

/* --- Experience / Timeline --- */
.timeline {
  position: relative;
  padding-left: var(--space-3xl);
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  left: 11px;
  width: 1px;
  height: 100%;
  background: linear-gradient(to bottom, var(--accent), var(--border), transparent);
}

.timeline__item {
  position: relative;
  padding-bottom: var(--space-3xl);
}

.timeline__item:last-child {
  padding-bottom: 0;
}

.timeline__dot {
  position: absolute;
  left: calc(-1 * var(--space-3xl) + 6px);
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg-deep);
  box-shadow: 0 0 0 2px var(--accent-dark);
  z-index: 2;
}

.timeline__content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-xl) var(--space-2xl);
  transition: all var(--transition-base);
}

.timeline__content:hover {
  border-color: var(--accent-dark);
  box-shadow: var(--shadow-sm);
}

.timeline__date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.timeline__role {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  margin: var(--space-sm) 0 var(--space-xs);
}

.timeline__company {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.timeline__desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-top: var(--space-md);
}

/* --- Contact Section --- */
.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4xl);
  align-items: start;
}

.contact__lead {
  font-size: 1.2rem;
  color: var(--text-primary);
  line-height: 1.8;
  margin-bottom: var(--space-2xl);
}

.contact__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.contact__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-md);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color var(--transition-fast);
}

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

.contact__link svg {
  flex-shrink: 0;
}

/* Form */
.contact__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.form-group label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.form-group input,
.form-group textarea {
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color var(--transition-fast);
  outline: none;
  resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* --- Footer --- */
.footer {
  position: relative;
  z-index: 2;
  padding: var(--space-3xl) var(--space-3xl);
  border-top: 1px solid var(--border);
}

.footer__container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer__text {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.footer__text strong {
  color: var(--text-primary);
}

.footer__copy {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* --- Reveal Animation --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Stagger delays */
.reveal:nth-child(2) { transition-delay: 0.1s; }
.reveal:nth-child(3) { transition-delay: 0.2s; }
.reveal:nth-child(4) { transition-delay: 0.3s; }

/* --- Noise Overlay --- */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  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='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.4;
}

/* --- Background glow orbs --- */
.about::before {
  content: '';
  position: absolute;
  top: -200px;
  right: -150px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(212, 167, 84, 0.06) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.skills::before {
  content: '';
  position: absolute;
  bottom: -200px;
  left: -150px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(212, 167, 84, 0.04) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   5 tiers: 1440 / 1024 / 768 / 480 / 375
   ============================================ */

/* --- Large Desktop (≤ 1440px) --- */
@media (max-width: 1440px) {
  :root {
    --max-width: 1100px;
  }
}

/* --- Tablet Landscape / Small Desktop (≤ 1024px) --- */
@media (max-width: 1024px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--space-2xl);
  }

  .hero__subtitle {
    margin-left: auto;
    margin-right: auto;
  }

  .hero__cta {
    justify-content: center;
  }

  .hero__visual {
    order: -1;
  }

  .hero__avatar {
    width: 220px;
    height: 220px;
  }

  .hero__avatar-placeholder {
    font-size: 3rem;
  }

  .hero__avatar-ring {
    width: 260px;
    height: 260px;
  }

  .hero__avatar-ring--delay {
    width: 300px;
    height: 300px;
  }

  .about__grid {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }

  .about__stats {
    grid-template-columns: repeat(4, 1fr);
  }

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

  .contact__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
  }

  .section {
    padding: var(--space-4xl) var(--space-xl);
  }
}

/* --- Tablet Portrait (≤ 768px) --- */
@media (max-width: 768px) {
  .nav {
    top: var(--space-sm);
    left: var(--space-sm);
    right: var(--space-sm);
    padding: 0 var(--space-lg);
    height: 60px;
  }

  .nav__links {
    display: none;
  }

  .nav__menu-btn {
    display: flex;
  }

  .section {
    padding: var(--space-3xl) var(--space-lg);
  }

  .hero {
    padding: calc(var(--nav-height) + var(--space-xl)) var(--space-lg) var(--space-2xl);
    min-height: auto;
  }

  .hero__name-line {
    font-size: clamp(2.4rem, 8vw, 3.5rem);
  }

  .hero__title {
    font-size: 1rem;
  }

  .hero__subtitle {
    font-size: 1rem;
  }

  .hero__badge {
    font-size: 0.75rem;
  }

  .section__title {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
  }

  .section__header {
    margin-bottom: var(--space-2xl);
  }

  .skills__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
  }

  .skill-group {
    padding: var(--space-xl);
  }

  .skill-group__title {
    font-size: 1.1rem;
  }

  .skill-tag {
    font-size: 0.75rem;
    padding: var(--space-xs) var(--space-sm);
  }

  .projects__grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .project-card__title {
    font-size: 1.15rem;
  }

  .about__stats {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
  }

  .stat-card {
    padding: var(--space-lg);
  }

  .stat-card__number {
    font-size: 2rem;
  }

  .about__lead {
    font-size: 1.05rem;
  }

  .contact__grid {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }

  .contact__lead {
    font-size: 1.05rem;
  }

  .timeline {
    padding-left: var(--space-2xl);
  }

  .timeline__dot {
    left: calc(-1 * var(--space-2xl) + 6px);
  }

  .timeline__content {
    padding: var(--space-lg);
  }

  .timeline__role {
    font-size: 1.15rem;
  }

  .footer__container {
    flex-direction: column;
    gap: var(--space-sm);
    text-align: center;
  }

  .footer {
    padding: var(--space-2xl) var(--space-lg);
  }

  .hero__scroll-indicator {
    display: none;
  }

  .mobile-menu__link {
    font-size: 1.6rem;
  }
}

/* --- Large Phones (≤ 480px) --- */
@media (max-width: 480px) {
  :root {
    --space-3xl: 2.5rem;
    --space-4xl: 3.5rem;
    --space-5xl: 5rem;
  }

  .hero {
    padding-top: calc(60px + var(--space-xl));
  }

  .hero__name-line {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .hero__avatar {
    width: 180px;
    height: 180px;
  }

  .hero__avatar-placeholder {
    font-size: 2.8rem;
  }

  .hero__avatar-ring {
    width: 220px;
    height: 220px;
  }

  .hero__avatar-ring--delay {
    width: 260px;
    height: 260px;
  }

  .hero__cta {
    flex-direction: column;
    width: 100%;
  }

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

  .btn {
    padding: 14px var(--space-lg);
    font-size: 0.85rem;
    min-height: 48px;
  }

  .skills__grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .about__stats {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
  }

  .stat-card__number {
    font-size: 1.8rem;
  }

  .stat-card__label {
    font-size: 0.65rem;
  }

  .project-card__body {
    padding: var(--space-lg);
  }

  .project-card__desc {
    font-size: 0.85rem;
  }

  .section__title {
    font-size: clamp(1.6rem, 7vw, 2rem);
  }

  .section__number {
    font-size: 0.75rem;
  }

  .contact__link {
    font-size: 0.8rem;
  }

  .form-group input,
  .form-group textarea {
    font-size: 16px; /* prevents iOS zoom on focus */
    padding: 14px var(--space-md);
  }

  .nav {
    left: var(--space-xs);
    right: var(--space-xs);
    padding: 0 var(--space-md);
    height: 56px;
  }

  .nav__logo {
    font-size: 1.25rem;
  }
}

/* --- Small Phones (≤ 375px) --- */
@media (max-width: 375px) {
  .hero__name-line {
    font-size: clamp(1.8rem, 11vw, 2.5rem);
  }

  .hero__avatar {
    width: 150px;
    height: 150px;
  }

  .hero__avatar-placeholder {
    font-size: 2.2rem;
  }

  .hero__avatar-ring {
    width: 190px;
    height: 190px;
  }

  .hero__avatar-ring--delay {
    width: 230px;
    height: 230px;
  }

  .section {
    padding: var(--space-2xl) var(--space-md);
  }

  .stat-card {
    padding: var(--space-md);
  }

  .stat-card__number {
    font-size: 1.5rem;
  }

  .timeline__role {
    font-size: 1rem;
  }

  .timeline__desc {
    font-size: 0.85rem;
  }

  .mobile-menu__link {
    font-size: 1.4rem;
  }

  .contact__lead {
    font-size: 0.95rem;
  }

  .about__lead {
    font-size: 0.95rem;
  }

  .about__text p:not(.about__lead) {
    font-size: 0.9rem;
  }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    transition: none;
    opacity: 1;
    transform: none;
  }

  .hero__avatar-ring {
    animation: none;
  }

  .scroll-line {
    animation: none;
  }

  .pulse-dot {
    animation: none;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ============================================
   Avatar photo + project cover art (added)
   ============================================ */

/* Real photo inside the circular hero avatar */
.hero__avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Rich gradient cover art for project cards */
.project-card__image {
  position: relative;
}
.project-card__image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 42%, var(--cover-glow, rgba(212, 167, 84, 0.32)), transparent 62%);
  z-index: 0;
}
.project-card__image::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000, transparent 78%);
          mask-image: radial-gradient(circle at 50% 50%, #000, transparent 78%);
  z-index: 0;
}
.project-card__image .project-card__placeholder {
  position: relative;
  z-index: 1;
  opacity: 1;
  color: var(--cover-accent, var(--accent));
  filter: drop-shadow(0 6px 18px var(--cover-glow, rgba(212, 167, 84, 0.5)));
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.project-card__image .project-card__placeholder svg {
  width: 74px;
  height: 74px;
}
.project-card:hover .project-card__placeholder {
  transform: scale(1.08) translateY(-2px);
}

/* Per-project cover themes */
.cover--atay   { background: linear-gradient(135deg, #0c1f1a, #16332b); --cover-accent: #4ade80; --cover-glow: rgba(74, 222, 128, 0.28); }
.cover--film   { background: linear-gradient(135deg, #1a0f2e, #3a1659); --cover-accent: #c084fc; --cover-glow: rgba(192, 132, 252, 0.32); }
.cover--arcana { background: linear-gradient(135deg, #161143, #2b1d52); --cover-accent: #a5b4fc; --cover-glow: rgba(165, 180, 252, 0.30); }
.cover--rag    { background: linear-gradient(135deg, #0a1830, #13314f); --cover-accent: #60a5fa; --cover-glow: rgba(96, 165, 250, 0.30); }
.cover--flow   { background: linear-gradient(135deg, #06232a, #0d3b44); --cover-accent: #22d3ee; --cover-glow: rgba(34, 211, 238, 0.30); }
.cover--ebook  { background: linear-gradient(135deg, #2a1c08, #4a3110); --cover-accent: #fbbf24; --cover-glow: rgba(251, 191, 36, 0.32); }

/* ============================================
   SVG UI mockups (NDA-safe — no real data) + NDA labelling
   ============================================ */
.project-card__image { overflow: hidden; }
.project-card__image .mockup {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: block;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.project-card:hover .project-card__image .mockup {
  transform: scale(1.045);
}

/* Lock badge over the cover */
.nda-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #f3f0e8;
  background: rgba(8, 9, 14, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
}
.nda-badge svg { width: 11px; height: 11px; }

/* Detailed highlight list inside cards */
.project-card__highlights {
  list-style: none;
  margin: var(--space-md) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.project-card__highlights li {
  position: relative;
  padding-left: 18px;
  font-size: 0.84rem;
  color: var(--text-secondary, #8a877d);
  line-height: 1.5;
}
.project-card__highlights li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cover-accent, var(--accent));
  box-shadow: 0 0 8px var(--cover-glow, var(--accent-glow));
}

/* NDA-locked link (non-clickable) */
.project-link--locked {
  color: var(--text-muted);
  cursor: default;
}
.project-link--locked:hover { color: var(--text-muted); }

/* NDA note under the Projects header */
.projects__note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  max-width: 760px;
  margin: 0 0 var(--space-2xl);
  padding: var(--space-md) var(--space-lg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  background: var(--bg-card);
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text-secondary, #8a877d);
}
.projects__note svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--accent);
  margin-top: 1px;
}
.projects__note strong { color: var(--accent-light); font-weight: 600; }

/* ============================================
   Extra cover themes + open-source labelling (added)
   ============================================ */
.cover--wiki    { background: linear-gradient(135deg, #14132e, #25244f); --cover-accent: #818cf8; --cover-glow: rgba(129, 140, 248, 0.30); }
.cover--shop    { background: linear-gradient(135deg, #2a0f17, #4a1426); --cover-accent: #fb7185; --cover-glow: rgba(251, 113, 133, 0.30); }
.cover--license { background: linear-gradient(135deg, #08231f, #0e3a33); --cover-accent: #2dd4bf; --cover-glow: rgba(45, 212, 191, 0.28); }
.cover--prompt  { background: linear-gradient(135deg, #2a1708, #4a2a0c); --cover-accent: #fb923c; --cover-glow: rgba(251, 146, 60, 0.30); }
.cover--kalite  { background: linear-gradient(135deg, #08202e, #0f3a4f); --cover-accent: #38bdf8; --cover-glow: rgba(56, 189, 248, 0.30); }
.cover--htmlvid { background: linear-gradient(135deg, #1a1030, #34195a); --cover-accent: #a78bfa; --cover-glow: rgba(167, 139, 250, 0.30); }
.cover--vdeokit { background: linear-gradient(135deg, #08241c, #0e3d2e); --cover-accent: #34d399; --cover-glow: rgba(52, 211, 153, 0.30); }

/* Open-source badge (green) — used instead of the NDA lock */
.nda-badge--oss {
  color: #062a16;
  background: rgba(52, 211, 153, 0.92);
  border-color: rgba(255, 255, 255, 0.25);
}

/* "Contributor / built on" note inside a card */
.project-card__attrib {
  margin: var(--space-md) 0 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--text-muted);
  font-style: italic;
}
.project-card__attrib strong { color: var(--text-secondary, #8a877d); font-style: normal; font-weight: 600; }

/* ============================================
   Founder contact card
   ============================================ */
.founder {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: var(--space-lg);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.founder__photo {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  border: 2px solid var(--accent);
}
.founder__name {
  display: block;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary, #f3f0e8);
}
.founder__role {
  display: block;
  margin-top: 2px;
  font-size: 0.82rem;
  color: var(--text-secondary, #8a877d);
}

/* ============================================
   Strategic partners strip
   ============================================ */
.partners {
  padding-top: 0;
}
.partners__label {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: var(--space-xl);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.partners__label::before,
.partners__label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.partners__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
}
.partner-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  text-decoration: none;
  transition: transform 0.3s ease, border-color 0.3s ease;
}
.partner-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}
.partner-card__logobox {
  width: 100%;
  height: 76px;
  background: #f6f3ec;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
.partner-card__logobox img {
  max-height: 52px;
  max-width: 78%;
  object-fit: contain;
}
.partner-card__name {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text-primary, #f3f0e8);
}
.partner-card__desc {
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--text-secondary, #8a877d);
}
.partner-card__role {
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--accent-light);
}
@media (max-width: 900px) {
  .partners__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .partners__grid { grid-template-columns: 1fr; }
}

/* Divider separating own NDA work from deployed open-source tools */
.projects__divider {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: var(--space-lg);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.projects__divider::before,
.projects__divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ============================================
   Project cards: short outside, full in modal
   ============================================ */
.projects__grid .project-card { cursor: pointer; }

/* Clamp the outside description to ~3 lines */
.projects__grid .project-card__desc {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Hide the detail bits on the grid — they show only in the modal */
.projects__grid .project-card__highlights,
.projects__grid .project-card__links,
.projects__grid .project-card__attrib { display: none; }

/* "View details" affordance at the bottom of each card */
.projects__grid .project-card__body::after {
  content: "View details \2192";
  display: block;
  margin-top: var(--space-md);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}
html[lang="vi"] .projects__grid .project-card__body::after {
  content: "Xem chi ti\1EBF t \2192";
}

/* ============================================
   Project detail modal
   ============================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}
.modal.is-open { opacity: 1; visibility: visible; }
.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 6, 10, 0.78);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
}
.modal__dialog {
  position: relative;
  z-index: 1;
  width: min(660px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-hover);
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  transform: translateY(18px) scale(0.98);
  transition: transform 0.28s ease;
}
.modal.is-open .modal__dialog { transform: none; }
.modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-hover);
  background: rgba(8, 9, 14, 0.6);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
  color: var(--text-primary, #f3f0e8);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.modal__close:hover { border-color: var(--accent); color: var(--accent); }

/* Reuse the card markup inside the modal, but flattened (no border/clamp/hide) */
.modal__content .project-card {
  border: none;
  background: transparent;
  cursor: default;
  margin: 0;
}
.modal__content .reveal { opacity: 1; transform: none; }
.modal__content .project-card__image {
  border-radius: 20px 20px 0 0;
  aspect-ratio: 16 / 9;
}
.modal__content .project-card__body { padding: var(--space-xl); }
.modal__content .project-card__desc {
  display: block;
  overflow: visible;
}
.modal__content .project-card__highlights,
.modal__content .project-card__links,
.modal__content .project-card__attrib { display: block; }
.modal__content .project-card__links { display: flex; }
.modal__content .project-card__body::after { content: none; }

body.modal-open { overflow: hidden; }
