/* ===========================
   CSS CUSTOM PROPERTIES
=========================== */
:root {
  --bg: #0d1117;
  --bg-surface: #161b22;
  --bg-elevated: #21262d;
  --accent: #58a6ff;
  --accent-hover: #79c0ff;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --border: #30363d;
  --radius: 8px;
  --radius-lg: 12px;
  --transition: 0.2s ease;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  --max-width: 1100px;
  --section-pad: 80px 24px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  color: var(--accent-hover);
}

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

ul {
  list-style: none;
}

/* ===========================
   UTILITY
=========================== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}

.section-divider {
  width: 48px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  margin-bottom: 48px;
}

/* Fade-in on scroll */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* ===========================
   NAVBAR
=========================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: 60px;
  display: flex;
  align-items: center;
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.navbar-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
}

.navbar-logo span {
  color: var(--accent);
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.navbar-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition);
}

.navbar-links a:hover,
.navbar-links a.active {
  color: var(--text);
}

.navbar-resume {
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  color: var(--accent) !important;
  border: 1px solid var(--accent);
  padding: 6px 16px;
  border-radius: var(--radius);
  transition: background var(--transition), color var(--transition) !important;
}

.navbar-resume:hover {
  background: var(--accent) !important;
  color: var(--bg) !important;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav */
.mobile-nav {
  display: none;
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px 24px;
  z-index: 99;
  flex-direction: column;
  gap: 4px;
}

.mobile-nav.open {
  display: flex;
}

.mobile-nav a {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  transition: color var(--transition);
}

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

.mobile-nav a:last-child {
  border-bottom: none;
  color: var(--accent);
}

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

.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(88, 166, 255, 0.07) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent);
  margin-bottom: 20px;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.1s forwards;
}

.hero-name {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 16px;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.2s forwards;
}

.hero-title {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 400;
  color: var(--text-muted);
  margin-bottom: 24px;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.3s forwards;
}

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

.hero-desc {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 540px;
  line-height: 1.7;
  margin-bottom: 40px;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.4s forwards;
}

.hero-ctas {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.5s forwards;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
  text-decoration: none;
  font-family: var(--font-sans);
}

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

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--bg);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(88, 166, 255, 0.25);
}

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

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

/* ===========================
   ABOUT
=========================== */
#about {
  padding: var(--section-pad);
  border-top: 1px solid var(--border);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.about-bio {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.8;
}

.about-bio p + p {
  margin-top: 16px;
}

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

.about-facts {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.fact-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.fact-value {
  font-size: 0.9375rem;
  color: var(--text);
  font-weight: 500;
}

.fact-value a {
  color: var(--accent);
}

.fact-value a:hover {
  color: var(--accent-hover);
}

/* ===========================
   SKILLS
=========================== */
#skills {
  padding: var(--section-pad);
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
}

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

.skill-group-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 14px;
}

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

.skill-tag {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 20px;
  transition: border-color var(--transition), color var(--transition);
  cursor: default;
}

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

/* ===========================
   EXPERIENCE
=========================== */
#experience {
  padding: var(--section-pad);
  border-top: 1px solid var(--border);
}

.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 0;
  width: 2px;
  background: var(--border);
  border-radius: 2px;
}

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

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

.timeline-item::before {
  content: '';
  position: absolute;
  left: -33px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.timeline-role {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text);
}

.timeline-date {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.timeline-company {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 12px;
}

.timeline-bullets {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.timeline-bullets li {
  font-size: 0.9rem;
  color: var(--text-muted);
  padding-left: 16px;
  position: relative;
  line-height: 1.6;
}

.timeline-bullets li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.7rem;
  top: 4px;
}

/* ===========================
   PROJECTS
=========================== */
#projects {
  padding: var(--section-pad);
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.project-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.project-img-wrap {
  width: 100%;
  height: 160px;
  overflow: hidden;
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.project-card:hover .project-img-wrap img {
  transform: scale(1.04);
}

.project-img-wrap.dual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}

.project-img-wrap.dual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.project-card:hover .project-img-wrap.dual img {
  transform: scale(1.04);
}

.project-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
}

.ferpa-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #d29922;
  background: rgba(210, 153, 34, 0.1);
  border: 1px solid rgba(210, 153, 34, 0.3);
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 2px;
}

.project-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.project-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.65;
  flex: 1;
}

.project-desc.clamped {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: unset;
}

.desc-toggle {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-sans);
  text-align: left;
  transition: color var(--transition);
}

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

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

.project-tag {
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--accent);
  background: rgba(88, 166, 255, 0.1);
  padding: 3px 9px;
  border-radius: 4px;
}

.project-links {
  display: flex;
  gap: 14px;
  margin-top: 4px;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color var(--transition);
}

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

/* ===========================
   CONTACT
=========================== */
#contact {
  padding: var(--section-pad);
  border-top: 1px solid var(--border);
}

.contact-inner {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}

.contact-inner .section-divider {
  margin: 0 auto 48px;
}

.contact-desc {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 40px;
}

.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 28px;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
  margin-bottom: 10px;
  font-family: var(--font-sans);
  width: 100%;
  justify-content: center;
}

.contact-email:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.copy-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 36px;
}

.contact-socials {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
}

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

/* ===========================
   FOOTER
=========================== */
footer {
  padding: 28px 24px;
  border-top: 1px solid var(--border);
  text-align: center;
}

footer p {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

footer a {
  color: var(--text-muted);
  transition: color var(--transition);
}

footer a:hover {
  color: var(--accent);
}

/* ===========================
   COPY TOAST
=========================== */
.copy-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(60px);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  z-index: 9999;
  pointer-events: none;
}

.copy-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ===========================
   RESPONSIVE
=========================== */
@media (max-width: 768px) {
  :root {
    --section-pad: 60px 0;
  }

  .navbar-links {
    display: none;
  }

  .hamburger {
    display: flex;
  }

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

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

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

  .hero-ctas {
    flex-direction: column;
    align-items: flex-start;
  }

  .contact-socials {
    flex-direction: column;
    align-items: stretch;
  }

  .social-link {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .skills-groups {
    grid-template-columns: 1fr;
  }
}

/* ===========================
   PROJECT DETAIL PAGE
=========================== */
.project-detail-page {
  padding-top: 60px;
}

.project-hero {
  padding: 64px 24px 48px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}

.project-hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 28px;
  transition: color var(--transition);
}

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

.project-hero-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 12px;
}

.project-hero-subtitle {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 680px;
  line-height: 1.7;
  margin-bottom: 24px;
}

.project-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.disclaimer-banner {
  background: rgba(210, 153, 34, 0.08);
  border: 1px solid rgba(210, 153, 34, 0.3);
  border-radius: var(--radius);
  padding: 14px 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: var(--max-width);
  margin: 32px auto 0;
}

.disclaimer-banner svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: #d29922;
}

.disclaimer-banner p {
  font-size: 0.875rem;
  color: #d29922;
  line-height: 1.6;
}

.disclaimer-banner strong {
  font-weight: 700;
}

.project-section {
  padding: 72px 24px;
  border-bottom: 1px solid var(--border);
}

.project-section:nth-child(even) {
  background: var(--bg-surface);
}

.project-section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}

.project-section-inner.reverse {
  direction: rtl;
}

.project-section-inner.reverse > * {
  direction: ltr;
}

.project-section-inner.full {
  grid-template-columns: 1fr;
  max-width: 900px;
}

.screenshot-frame {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.screenshot-frame img {
  width: 100%;
  display: block;
}

.feature-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.feature-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 14px;
  line-height: 1.3;
}

.feature-desc {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.75;
}

.feature-bullets {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feature-bullets li {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding-left: 16px;
  position: relative;
  line-height: 1.6;
}

.feature-bullets li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.7rem;
  top: 4px;
}

.project-overview {
  padding: 72px 24px;
  border-bottom: 1px solid var(--border);
}

.project-overview-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

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

.overview-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
}

.overview-card-icon {
  color: var(--accent);
  margin-bottom: 12px;
}

.overview-card h4 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.overview-card p {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.tech-stack-section {
  padding: 72px 24px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}

.tech-stack-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.project-back-section {
  padding: 56px 24px;
  text-align: center;
}

@media (max-width: 768px) {
  .project-section-inner,
  .project-section-inner.reverse {
    grid-template-columns: 1fr;
    direction: ltr;
    gap: 32px;
  }

  .project-section-inner.reverse > * {
    direction: ltr;
  }
}
