/* ==========================================================================
   1. reset, base styles and variable system. all must load before any other CSS
   ========================================================================== */

*, *::before, *::after { 
  margin: 0; 
  padding: 0; 
  box-sizing: border-box; 
}

:root, [data-theme="light"] {
  --bg: #ffffff;
  --bg2: #fafafa;
  --bg3: #f5f5f5;
  --card-bg: #f5f5f5;
  --gold: #171717;
  --gold-dim: #525252;
  --cream: #0a0a0a;
  --muted: #5c5c5c;
  --text: #0a0a0a;
  --accent: #1a1a1a;
  --border: rgba(0, 0, 0, 0.1);
  --border-light: rgba(0, 0, 0, 0.08);
  --border-ultra-light: rgba(0, 0, 0, 0.06);
  --nav-bg: rgba(255, 255, 255, 0.97);
  --tag-bg: rgba(0, 0, 0, 0.04);
  --focus-ring: rgba(23, 23, 23, 0.35);
  --radius: 10px;
  --radius-sm: 6px;
}

[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg2: #1a1a1a;
  --bg3: #0a0a0a;
  --card-bg: rgba(255, 255, 255, 0.04);
  --gold: #e5e5e5;
  --gold-dim: #737373;
  --cream: #fafafa;
  --muted: #9a9a9a;
  --text: #fafafa;
  --accent: #1a1a1a;
  --accent-light: #c9a96e;
  --border: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.07);
  --border-ultra-light: rgba(255, 255, 255, 0.06);
  --nav-bg: rgba(10, 10, 10, 0.97);
  --tag-bg: rgba(255, 255, 255, 0.04);
  --focus-ring: rgba(229, 229, 229, 0.4);
}

html { 
  scroll-behavior: smooth;
  scrollbar-width: thin;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  line-height: 1.7;
  font-size: 16px;
  overflow-x: hidden;
  cursor: auto;
  transition: background 0.3s ease, color 0.3s ease;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
.theme-toggle:focus-visible,
.hamburger:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

a, button, input, textarea, select {
  touch-action: manipulation;
}

/* ==========================================================================
   2. TYPOGRAPHY & FONT ASSIGNMENTS
   ========================================================================== */

.hero-name, 
.section-title, 
.contact-big,
.featured-title, 
.nav-logo, 
.footer-logo,
.project-name,
.cert-placeholder-title,
.contact-page-title,
.proj-card-title { 
  font-family: 'Playfair Display', serif; 
}

.hero-name, .contact-big, .cert-placeholder-title, .contact-page-title { font-weight: 700; }
.section-title, .project-name, .proj-card-title { font-weight: 600; }
.featured-title { font-weight: 600; font-size: 1.8rem; line-height: 1.2; }
.project-name { font-size: 1.3rem; }
.hero-name em, .section-title em, .contact-big em, .contact-page-title em { font-style: italic; color: var(--gold); }

.hero-eyebrow, .section-label, .hero-badge, .tag, .stat-label,
.btn-primary, .btn-outline, .contact-link, .featured-link,
.featured-badge, .paid-badge, .hero-scroll-hint, .nav-links a,
.project-group-label, .cert-group-label, .proj-card-badge, .proj-card-link {
  font-family: 'Inter', sans-serif; 
  font-weight: 500;
}

.hero-desc, .about-bio, .project-desc, .featured-desc,
.contact-sub, .projects-header-right, .page-header-desc, 
.cert-placeholder-desc, .contact-page-desc, .proj-card-desc {
  font-family: 'Inter', sans-serif; 
  font-weight: 400; 
  font-size: 0.95rem;
}

.about-bio strong { font-weight: 600; color: var(--cream); }
.stat-num { font-family: 'Playfair Display', serif; font-weight: 700; }

/* ==========================================================================
   3. LAYOUT UTILITIES & CONTAINERS
   ========================================================================== */

.container { 
  max-width: 1200px; 
  margin: 0 auto; 
  padding: 0 60px; 
}

.section-label {
  font-size: 0.75rem; 
  letter-spacing: 0.18em;
  text-transform: uppercase; 
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 18px;
  display: flex; 
  align-items: center; 
  gap: 14px;
}
.section-label::before { 
  content: ''; 
  width: 28px; 
  height: 2px; 
  background: var(--gold-dim); 
}

.section-title {
  font-size: clamp(2.4rem, 3.6vw, 3.4rem);
  line-height: 1.15; 
  color: var(--cream); 
  margin-bottom: 24px;
  letter-spacing: -0.01em;
}

.tag {
  padding: 5px 12px; 
  background: var(--tag-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.68rem; 
  letter-spacing: 0.08em;
  font-weight: 600;
  text-transform: uppercase; 
  color: var(--muted);
}

.paid-badge {
  color: var(--gold); 
  font-size: 0.7rem;
  letter-spacing: 0.08em; 
  text-transform: uppercase; 
  margin-left: 8px;
}

/* ==========================================================================
   4. NAVIGATION COMPONENT
   ========================================================================== */

nav {
  position: fixed; 
  top: 0; 
  left: 0; 
  right: 0;
  z-index: 500;
  display: flex; 
  justify-content: space-between; 
  align-items: center;
  padding: 18px 60px;
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s, border-color 0.3s, transform 0.3s ease;
}
nav.header-hidden {
  transform: translateY(-110%);
}

.nav-logo {
  font-size: 1.1rem; 
  font-weight: 700;
  letter-spacing: 0.12em; 
  text-transform: uppercase;
  color: var(--gold); 
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.2s;
}
.nav-logo:hover { opacity: 0.7; }

.nav-right { 
  display: flex; 
  align-items: center; 
  gap: 36px; 
}

.nav-links { 
  display: flex; 
  gap: 32px; 
  list-style: none; 
}

.nav-links a {
  position: relative;
  text-decoration: none; 
  color: var(--muted);
  font-size: 0.78rem; 
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase; 
  padding-bottom: 4px;
  transition: color 0.2s;
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1.5px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.nav-links a:hover { 
  color: var(--gold); 
}
.nav-links a:hover::after,
.nav-links a.active::after {
  transform: scaleX(1);
}
.nav-links a.active {
  color: var(--gold);
}

.hamburger {
  display: none; 
  flex-direction: column;
  gap: 5px; 
  cursor: pointer; 
  padding: 4px;
  background: none; 
  border: none;
}
.hamburger span {
  display: block; 
  width: 22px; 
  height: 1.5px;
  background: var(--gold);
  transition: all 0.3s ease;
  transform-origin: center;
}
.hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.mobile-nav {
  display: none; 
  flex-direction: column;
  position: fixed; 
  top: 0; 
  left: 0; 
  right: 0; 
  bottom: 0;
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  z-index: 490; 
  padding: 100px 40px 60px;
  gap: 4px; 
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.mobile-nav.open { 
  opacity: 1; 
  pointer-events: all; 
}
.mobile-nav a {
  text-decoration: none; 
  color: var(--muted);
  font-size: 0.95rem; 
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase; 
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  transition: color 0.2s;
}
.mobile-nav a:hover { 
  color: var(--gold); 
}

.theme-toggle {
  background: none; 
  border: 1px solid var(--border);
  cursor: pointer; 
  width: 46px; 
  height: 26px;
  border-radius: 13px; 
  position: relative;
  transition: border-color 0.2s; 
  flex-shrink: 0;
}
.theme-toggle:hover { 
  border-color: var(--gold); 
}
.toggle-thumb {
  position: absolute; 
  top: 3px; 
  left: 3px;
  width: 18px; 
  height: 18px; 
  border-radius: 50%;
  background: var(--gold); 
  transition: transform 0.25s ease;
}
[data-theme="dark"] .toggle-thumb { 
  transform: translateX(20px); 
}
.t-icon {
  position: absolute; 
  font-size: 9px;
  top: 50%; 
  transform: translateY(-50%);
  pointer-events: none; 
  transition: opacity 0.2s;
}
.t-sun { right: 6px; opacity: 1; }
.t-moon { left: 6px; opacity: 0; color: var(--text); }
[data-theme="dark"] .t-sun { opacity: 0; }
[data-theme="dark"] .t-moon { opacity: 1; color: #fafafa; }

/* ==========================================================================
   5. CUSTOM DESKTOP INTERACTIVITY UI (CURSORS) — disabled for usability
   ========================================================================== */

.cursor, .cursor-ring { 
  display: none !important; 
}

/* ==========================================================================
   6. HERO HOME COMPONENT
   ========================================================================== */

#hero {
  min-height: 100vh;
  display: grid; 
  grid-template-columns: 1.1fr 1fr;
  position: relative; 
  overflow: hidden;
}
.hero-left {
  display: flex; 
  flex-direction: column;
  justify-content: center;
  padding: 140px 60px 80px;
  position: relative; 
  z-index: 2;
}
.hero-eyebrow {
  font-size: 0.78rem; 
  letter-spacing: 0.16em;
  font-weight: 600;
  text-transform: uppercase; 
  color: var(--gold);
  margin-bottom: 22px;
  opacity: 0; 
  animation: fadeUp 0.7s ease 0.1s forwards;
}
.hero-name {
  font-size: clamp(3rem, 5.2vw, 5.2rem);
  line-height: 1.08; 
  color: var(--cream); 
  margin-bottom: 28px;
  letter-spacing: -0.01em;
  opacity: 0; 
  animation: fadeUp 0.7s ease 0.2s forwards;
}
.hero-desc {
  color: var(--muted); 
  max-width: 420px;
  font-size: 1.02rem;
  line-height: 1.8; 
  margin-bottom: 32px;
  opacity: 0; 
  animation: fadeUp 0.7s ease 0.3s forwards;
}
.hero-badges {
  display: flex; 
  gap: 8px; 
  flex-wrap: wrap;
  margin-bottom: 40px;
  opacity: 0; 
  animation: fadeUp 0.7s ease 0.35s forwards;
}
.hero-badge {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--tag-bg);
  font-size: 0.7rem; 
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase; 
  color: var(--gold);
}
.hero-cta {
  display: flex; 
  gap: 16px; 
  flex-wrap: wrap;
  opacity: 0; 
  animation: fadeUp 0.7s ease 0.4s forwards;
}

.btn-primary, .btn-outline {
  padding: 15px 34px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.78rem; 
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase; 
  white-space: nowrap;
  transition: opacity 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
}
.btn-primary {
  background: var(--gold); 
  color: #fff;
}
[data-theme="dark"] .btn-primary {
  color: var(--bg);
}
.btn-primary:hover { 
  opacity: 0.85; 
  transform: translateY(-1px);
}
.btn-outline {
  border: 1px solid var(--border);
  color: var(--muted);
}
.btn-outline:hover { 
  border-color: var(--gold); 
  color: var(--gold); 
  transform: translateY(-1px);
}

.hero-right {
  position: relative; 
  display: flex;
  align-items: center; 
  justify-content: center;
}
.hero-img-wrap {
  width: 380px; 
  height: 500px; 
  position: relative;
  opacity: 0; 
  animation: fadeIn 0.8s ease 0.25s forwards;
}
.hero-img-wrap::before {
  content: ''; 
  position: absolute; 
  inset: -1px;
  border: 1px solid var(--border);
}
.hero-img-wrap::after {
  content: ''; 
  position: absolute;
  bottom: -16px; 
  right: -16px;
  width: 100%; 
  height: 100%;
  border: 1px solid var(--border); 
  opacity: 0.5; 
  z-index: -1;
}
.hero-photo { 
  width: 100%; 
  height: 100%; 
  object-fit: cover; 
  display: block; 
}

.hero-scroll-hint {
  position: absolute; 
  bottom: 48px; 
  left: 60px;
  display: flex; 
  align-items: center; 
  gap: 14px;
  font-size: 0.7rem; 
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase; 
  color: var(--muted);
  opacity: 0; 
  animation: fadeIn 0.6s ease 0.8s forwards;
}
.scroll-line {
  width: 40px; 
  height: 1px; 
  background: var(--gold-dim);
  position: relative; 
  overflow: hidden;
}
.scroll-line::after {
  content: ''; 
  position: absolute;
  left: -100%; 
  top: 0; 
  width: 100%; 
  height: 100%;
  background: var(--gold); 
  animation: scrollLine 2.2s ease infinite;
}

.grid-line { 
  position: absolute; 
  inset: 0; 
  pointer-events: none; 
  z-index: 1; 
}
.grid-line::before {
  content: ''; 
  position: absolute;
  top: 0; 
  bottom: 0; 
  left: 50%; 
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--border) 30%, var(--border) 70%, transparent);
}

/* ==========================================================================
   7. PROFILE / ABOUT COMPONENT
   ========================================================================== */

#about { 
  padding: 100px 0; 
  background: var(--bg2); 
  transition: background 0.3s; 
}
.about-grid {
  display: grid; 
  grid-template-columns: 0.85fr 1.15fr;
  gap: 80px; 
  align-items: center;
}
.about-img-wrap { 
  position: relative; 
}
.about-img-frame {
  width: 100%; 
  aspect-ratio: 3/4;
  background: var(--bg3); 
  border-radius: var(--radius);
  position: relative;
  overflow: hidden; 
  transition: background 0.3s;
}
.about-photo { 
  width: 100%; 
  height: 100%; 
  object-fit: cover; 
  display: block; 
}
.about-tag {
  position: absolute; 
  bottom: -20px; 
  right: -20px;
  background: var(--gold); 
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 16px 24px; 
  font-size: 0.72rem;
  letter-spacing: 0.1em; 
  text-transform: uppercase; 
  font-weight: 600;
}
.about-bio { 
  color: var(--muted); 
  line-height: 1.85; 
  font-size: 1rem;
  margin-bottom: 40px; 
}
.about-bio p + p { 
  margin-top: 16px; 
}
.skills-grid {
  display: grid; 
  grid-template-columns: 1fr 1fr;
  gap: 14px; 
  margin-bottom: 44px;
}
.skill-item {
  display: flex; 
  align-items: center;
  gap: 12px; 
  font-size: 0.88rem; 
  font-weight: 500;
  color: var(--text);
}
.skill-dot { 
  width: 6px; 
  height: 6px; 
  background: var(--gold); 
  border-radius: 50%; 
  flex-shrink: 0; 
}
.about-stats {
  display: flex; 
  gap: 48px; 
  flex-wrap: wrap;
  padding-top: 36px; 
  border-top: 1px solid var(--border);
}
.stat-num { 
  font-size: 2.4rem; 
  color: var(--gold); 
  line-height: 1; 
}
.stat-label {
  font-size: 0.72rem; 
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase; 
  color: var(--muted); 
  margin-top: 8px;
}

/* ==========================================================================
   8. INDEX PORTFOLIO FEATURED WORKS COMPONENT
   ========================================================================== */

#projects { 
  padding: 100px 0; 
  background: var(--bg); 
  transition: background 0.3s; 
}
.projects-header {
  display: flex; 
  justify-content: space-between;
  align-items: flex-end; 
  margin-bottom: 64px;
}
.projects-header-right {
  color: var(--muted); 
  max-width: 280px;
  text-align: right; 
  line-height: 1.8;
}

.project-featured {
  margin-bottom: 24px;
  background: var(--bg3); 
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: grid; 
  grid-template-columns: 1fr 1fr;
  transition: background 0.3s, border-color 0.3s;
}
.project-featured-img {
  min-height: 340px; 
  position: relative;
  overflow: hidden; 
  background: var(--bg2);
}
.featured-screenshot {
  width: 100%; 
  height: 100%;
  object-fit: cover; 
  object-position: top;
  position: absolute; 
  inset: 0; 
  display: block;
}
.screenshot-placeholder {
  width: 100%; 
  height: 100%;
  display: flex; 
  flex-direction: column;
  align-items: center; 
  justify-content: center;
  gap: 12px; 
  color: var(--muted);
  font-size: 0.72rem; 
  letter-spacing: 0.1em;
  text-transform: uppercase; 
  text-align: center; 
  padding: 20px;
  position: absolute; 
  inset: 0;
}
.project-featured-content {
  padding: 56px; 
  display: flex;
  flex-direction: column; 
  justify-content: center;
}
.featured-badge {
  font-size: 0.7rem; 
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase; 
  color: var(--gold); 
  margin-bottom: 18px;
}
.featured-desc { 
  color: var(--muted); 
  line-height: 1.8; 
  margin-bottom: 32px; 
}
.featured-links { 
  display: flex; 
  gap: 16px; 
  flex-wrap: wrap; 
}
.featured-link {
  display: inline-flex; 
  align-items: center; 
  gap: 10px;
  color: var(--gold); 
  text-decoration: none;
  font-size: 0.78rem; 
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase; 
  transition: gap 0.2s;
}
.featured-link:hover { 
  gap: 14px; 
}

.project-featured.thesis-card,
.proj-card.thesis-card { 
  border-color: var(--gold-dim); 
}

/* ==========================================================================
   8b. INDEX INTERACTIVE WIDGET INTROS (AI CHAT + PYTHON COMPILER SECTIONS)
   ========================================================================== */
.section-intro {
  max-width: 620px;
  margin: 0 auto 52px;
  text-align: center;
}
.section-intro .section-label {
  justify-content: center;
}
.section-intro .section-title {
  font-size: clamp(2rem, 3.2vw, 2.7rem);
}
.section-intro-desc {
  color: var(--muted);
  line-height: 1.8;
  font-size: 0.98rem;
  margin-top: -6px;
}

/* ==========================================================================
   9. SUB-PAGES SYSTEM CORE LAYOUT & ARCHITECTURE
   ========================================================================== */

.page-header {
  padding: 140px 0 48px;
}
.page-header-content {
  max-width: 680px;
}
.page-header-desc {
  line-height: 1.8;
  color: var(--muted);
  opacity: 1;
  margin-top: 16px;
  max-width: 600px;
}

.project-group { 
  margin-bottom: 72px; 
}
.project-group-label {
  font-size: 0.75rem; 
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase; 
  color: var(--muted);
  margin-bottom: 28px; 
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  display: flex; 
  align-items: center; 
  gap: 14px;
}
.project-group-label::before { 
  content: ''; 
  width: 22px; 
  height: 2px; 
  background: var(--gold-dim); 
}

/* ==========================================================================
   10. PRODUCTION RECORD GRID ARCHITECTURE (PROJECTS PAGE)
   ========================================================================== */

.projects-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 16px;
}

.proj-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: background 0.3s, border-color 0.3s, transform 0.2s, box-shadow 0.2s;
  cursor: default;
}
.proj-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}
[data-theme="dark"] .proj-card:hover {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.proj-card-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  height: auto;
  position: relative;
  overflow: hidden;
  background: var(--bg2);
  flex-shrink: 0;
}
.proj-card-img img {
  width: 100%; 
  height: 100%;
  object-fit: cover; 
  object-position: top;
  display: block;
  transition: transform 0.4s ease;
}
.proj-card:hover .proj-card-img img { 
  transform: scale(1.03); 
}

.proj-card-body {
  padding: 26px 28px 30px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.proj-card-badge {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}
.proj-card-title {
  font-size: 1.25rem;
  line-height: 1.3;
  margin-bottom: 12px;
}
.proj-card-desc {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 22px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(0.9rem * 1.75 * 5);
}
.proj-card-tags {
  display: flex; 
  flex-wrap: wrap;
  gap: 8px; 
  margin-bottom: 24px;
}
.proj-card-links {
  display: flex; 
  gap: 12px; 
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-ultra-light);
}
.proj-card-link {
  display: inline-flex; 
  align-items: center; 
  gap: 8px;
  color: var(--gold); 
  text-decoration: none;
  font-size: 0.76rem; 
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: gap 0.2s;
}
.proj-card-link:hover { 
  gap: 13px; 
}
.proj-card-link.dim { 
  opacity: 0.55; 
}

/* ==========================================================================
   8c. INDEX FEATURED PROJECTS TEASER (SCALED-DOWN 3-COLUMN PREVIEW)
   ========================================================================== */

#featured-projects {
  padding: 100px 0 84px;
  background: var(--bg3);
  transition: background 0.3s;
}
#ai-assistant {
  background: var(--bg2);
  padding: 100px 0;
  transition: background 0.3s;
}
#py-compiler {
  background: var(--bg3);
  padding: 100px 0;
  transition: background 0.3s;
}
#featured-projects .projects-card-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 1080px;
  margin: 0 auto;
}
#featured-projects .proj-card {
  background: var(--bg2);
}
#featured-projects .proj-card-img {
  aspect-ratio: 16 / 10;
}
#featured-projects .proj-card-body {
  padding: 20px 22px 24px;
}
#featured-projects .proj-card-badge {
  font-size: 0.6rem;
  margin-bottom: 8px;
}
#featured-projects .proj-card-title {
  font-size: 1.05rem;
  margin-bottom: 10px;
}
#featured-projects .proj-card-desc {
  font-size: 0.83rem;
  line-height: 1.7;
  margin-bottom: 16px;
  -webkit-line-clamp: 4;
  min-height: calc(0.83rem * 1.7 * 4);
}
#featured-projects .proj-card-tags {
  gap: 6px;
  margin-bottom: 18px;
}
#featured-projects .proj-card-tags .tag {
  font-size: 0.62rem;
  padding: 4px 9px;
}
#featured-projects .proj-card-links {
  padding-top: 12px;
}
#featured-projects .proj-card-link {
  font-size: 0.7rem;
}
.featured-view-all {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}

/* ==========================================================================
   11. PROFESSIONAL CERTIFICATIONS ENGINE
   ========================================================================== */

#certifications {
  padding: 72px 0 120px;
}
.cert-group {
  margin-bottom: 64px;
}
.cert-group-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
}
.cert-group-label::before {
  content: '';
  width: 22px;
  height: 2px;
  background: var(--gold-dim);
}
.cert-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}
.cert-card-grid .proj-card-img {
  aspect-ratio: 4 / 3;
  height: auto;
  min-height: unset;
  overflow: hidden;
  padding: 0;
}
.cert-card-grid .proj-card-img img {
  height: 100%;
  width: 100%;
  max-height: unset;
  max-width: unset;
  margin: 0;
  object-fit: cover;
  object-position: center top;
}
.cert-card-grid .proj-card:hover .proj-card-img img {
  transform: none;
}
.cert-card-grid .proj-card-body {
  padding: 8px 24px 26px;
  text-align: center;
  align-items: center;
}
.cert-card-grid .proj-card-links {
  justify-content: center;
  border-top: none;
  padding-top: 4px;
}
.cert-card-grid .proj-card-desc {
  font-size: 0.82rem;
  line-height: 1.65;
  margin-bottom: 14px;
  flex: 0 1 auto;
  -webkit-line-clamp: 3;
  min-height: unset;
}

/* ==========================================================================
   12. CENTRALIZED INQUIRY & COMMUNICATIONS MODULE
   ========================================================================== */

#contact { 
  padding: 100px 0; 
  background: var(--bg2); 
  text-align: center; 
  transition: background 0.3s; 
}
.contact-inner { 
  max-width: 700px; 
  margin: 0 auto; 
}
.contact-big {
  font-size: clamp(2.6rem, 5vw, 4.6rem); 
  color: var(--cream); 
  line-height: 1.1; 
  margin-bottom: 28px;
}
.contact-sub { 
  color: var(--muted); 
  margin-bottom: 48px; 
  line-height: 1.85; 
}
.contact-links { 
  display: flex; 
  justify-content: center; 
  gap: 12px; 
  flex-wrap: wrap; 
}
.contact-link {
  display: flex; 
  align-items: center; 
  gap: 10px;
  text-decoration: none; 
  color: var(--muted);
  font-size: 0.8rem; 
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 15px 26px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--tag-bg); 
  transition: border-color 0.2s, color 0.2s;
}
.contact-link:hover { 
  border-color: var(--gold); 
  color: var(--gold); 
}

.contact-page-section {
  padding: 140px 0 120px;
}
.contact-page-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}
.contact-page-left { 
  display: flex; 
  flex-direction: column; 
  gap: 32px; 
}
.contact-page-title {
  font-size: clamp(2.1rem, 3.6vw, 2.9rem);
  line-height: 1.2;
  margin: 8px 0 16px;
}
.contact-page-desc { 
  line-height: 1.8; 
  color: var(--muted);
  max-width: 440px; 
}

.socials-card, .inquiry-card {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
}

.socials-card { 
  padding: 32px; 
}
.socials-card-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 22px;
  letter-spacing: 0.01em;
}
.social-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-ultra-light);
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s;
}
.social-row:last-child { border-bottom: none; padding-bottom: 0; }
.social-row:first-of-type { padding-top: 0; }
.social-row:hover { opacity: 0.65; }

.social-icon-wrap {
  width: 36px; 
  height: 36px;
  border-radius: 8px;
  background: var(--accent);
  display: flex; 
  align-items: center; 
  justify-content: center;
  flex-shrink: 0;
}
[data-theme="dark"] .social-icon-wrap { 
  background: rgba(255, 255, 255, 0.12); 
}
.social-icon-wrap svg { 
  color: #fff; 
}
.social-info { 
  display: flex; 
  flex-direction: column; 
  gap: 2px; 
}
.social-platform { 
  font-size: 0.7rem; 
  font-weight: 600; 
  opacity: 0.5; 
  letter-spacing: 0.08em; 
  text-transform: uppercase; 
}
.social-handle { 
  font-size: 0.92rem; 
  font-weight: 500; 
}

.location-block { 
  margin-top: 4px; 
}
.location-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
[data-theme="dark"] .location-label { 
  color: var(--accent-light); 
}
.location-name { 
  font-size: 1rem; 
  font-weight: 500; 
}

.inquiry-card { 
  padding: 40px; 
}
.inquiry-title { 
  font-size: 1.4rem; 
  font-weight: 700; 
  margin-bottom: 26px; 
}
.inquiry-field {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.92rem;
  background: var(--bg);
  color: var(--text);
  margin-bottom: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
  outline: none;
  display: block;
}
[data-theme="dark"] .inquiry-field {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: #f0ede8;
}
.inquiry-field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
[data-theme="dark"] .inquiry-field:focus {
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
textarea.inquiry-field { 
  resize: vertical; 
  min-height: 130px; 
}

.inquiry-submit {
  width: 100%;
  padding: 15px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  margin-top: 4px;
}
[data-theme="dark"] .inquiry-submit { color: var(--bg); }
.inquiry-submit:hover { opacity: 0.85; transform: translateY(-1px); }
.inquiry-submit:active { transform: translateY(0); }

.inquiry-success {
  display: none;
  text-align: center;
  padding: 20px 0 8px;
  font-size: 0.95rem;
  font-weight: 500;
  color: #2e7d32;
}
[data-theme="dark"] .inquiry-success { 
  color: #81c784; 
}

/* ==========================================================================
   13. FOOTER SIGNATURE & BRAND COMPONENT
   ========================================================================== */

footer {
  padding: 32px 60px; 
  background: var(--bg2);
  display: flex; 
  justify-content: space-between; 
  align-items: center;
  border-top: 1px solid var(--border);
  transition: background 0.3s, border-color 0.3s;
  flex-wrap: wrap; 
  gap: 12px;
}
footer p { 
  font-size: 0.72rem; 
  color: var(--muted); 
  letter-spacing: 0.06em; 
  line-height: 1.6;
}
.footer-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.footer-logo {
  font-size: 0.9rem; 
  font-weight: 700;
  letter-spacing: 0.14em; 
  text-transform: uppercase; 
  color: var(--gold);
}

.footer-icons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 10px 0;
}
.footer-icon-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--muted);
  transition: color 0.2s, border-color 0.2s, transform 0.2s;
}
.footer-icon-link:hover {
  color: var(--text);
  border-color: var(--gold);
  transform: translateY(-2px);
}

/* ==========================================================================
   14. MOTION & SCROLL REVEAL TIMINGS
   ========================================================================== */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn { 
  from { opacity: 0; } 
  to   { opacity: 1; } 
}
@keyframes scrollLine { 
  to { left: 100%; } 
}

.reveal { 
  opacity: 0; 
  transform: translateY(18px); 
  transition: opacity 0.5s ease, transform 0.5s ease; 
}
.reveal.visible { 
  opacity: 1; 
  transform: translateY(0); 
}
.reveal-delay-1 { transition-delay: 0.06s; }
.reveal-delay-2 { transition-delay: 0.12s; }
.reveal-delay-3 { transition-delay: 0.18s; }
.reveal-delay-4 { transition-delay: 0.24s; }

/* ==========================================================================
   15. RESPONSIVE MEDIA QUERIES (BREAKPOINTS CASCADE)
   ========================================================================== */

@media (max-width: 1024px) {
  nav { padding: 16px 36px; }
  .container { padding: 0 36px; }
  .hero-left { padding: 120px 36px 64px; }
  .hero-img-wrap { width: 300px; height: 400px; }
  .project-featured-content { padding: 36px; }
  .about-grid { grid-template-columns: 1fr 1fr; gap: 48px; }
  .featured-title { font-size: 1.5rem; }
  #featured-projects .projects-card-grid { grid-template-columns: repeat(2, 1fr); max-width: 100%; }
}

@media (max-width: 860px) {
  .contact-page-grid { grid-template-columns: 1fr; gap: 40px; }
  .inquiry-card { padding: 28px 20px; }
  .socials-card { padding: 24px 20px; }
  .projects-card-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  nav { padding: 16px 24px; }
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .mobile-nav { display: flex; }
  .nav-right { gap: 20px; }
  
  #hero { grid-template-columns: 1fr; min-height: auto; padding-bottom: 0; }
  .hero-left { padding: 110px 24px 60px; justify-content: flex-end; }
  .hero-right { display: none; }
  .hero-name { font-size: clamp(2.6rem, 11vw, 3.8rem); }
  .hero-desc { max-width: 100%; }
  .hero-scroll-hint { left: 24px; bottom: 24px; }
  .grid-line::before { display: none; }
  
  .container { padding: 0 24px; }
  #about { padding: 64px 0; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .about-img-frame { aspect-ratio: 4/3; }
  .about-tag { display: none; }
  .about-stats { gap: 24px; }
  .stat-num { font-size: 2rem; }
  
  #projects { padding: 64px 0; }
  #featured-projects { padding: 64px 0 48px; }
  #certifications { padding: 48px 0 80px; }
  .section-intro { margin-bottom: 36px; }
  .projects-header { flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 36px; }
  .projects-header-right { text-align: left; max-width: 100%; }
  .project-featured { grid-template-columns: 1fr; }
  .project-featured-img { min-height: 220px; }
  .project-featured-content { padding: 28px 24px; }
  .featured-title { font-size: 1.4rem; }

  #featured-projects .projects-card-grid {
    display: flex !important;
    grid-template-columns: none !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    flex-wrap: nowrap !important;
    scroll-snap-type: x mandatory;
    scroll-padding-left: 24px;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    overscroll-behavior-x: contain;
    gap: 16px;
    padding: 4px 4px 20px;
    margin-bottom: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    mask-image: linear-gradient(to right, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
  }
  #featured-projects .projects-card-grid::-webkit-scrollbar {
    display: none;
  }
  #featured-projects .proj-card {
    flex: 0 0 82% !important;
    width: 82% !important;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  }
  [data-theme="dark"] #featured-projects .proj-card {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
  }
  #featured-projects .proj-card-img {
    aspect-ratio: 16 / 10 !important;
    height: auto !important;
  }
  
  #contact { padding: 64px 0; }
  .contact-links { flex-direction: column; align-items: stretch; }
  .contact-link { justify-content: center; }
  .inquiry-field { font-size: 16px; }
  
  footer { padding: 24px; flex-direction: column; text-align: center; gap: 10px; }
  .footer-left { align-items: center; }
}

@media (max-width: 640px) {
  .proj-card-img { aspect-ratio: 4 / 3; height: auto; }
  .proj-card-body { padding: 22px 20px 26px; }
  .skills-grid { grid-template-columns: 1fr; }

  #featured-projects .proj-card-img { aspect-ratio: 16 / 10 !important; }
  #featured-projects .proj-card-desc {
    -webkit-line-clamp: 3;
    min-height: calc(0.83rem * 1.7 * 3);
    margin-bottom: 14px;
  }
}

@media (max-width: 600px) {
  .cert-card-grid { grid-template-columns: 1fr; }
  .page-header { padding: 110px 0 36px; }
}

@media (max-width: 400px) {
  .hero-badge { font-size: 0.65rem; padding: 5px 12px; }
  .btn-primary, .btn-outline { padding: 13px 26px; font-size: 0.72rem; }
  .hero-cta { gap: 12px; }
}