/* ============================================
   PORTFOLIO — Muhammad Azka Raki
   Style: Tech / Minimalist · Dark · Red Accent
   ============================================ */

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

:root {
  /* Palette */
  --clr-bg:        #0a0a0f;
  --clr-bg-alt:    #111118;
  --clr-surface:   #16161e;
  --clr-surface-2: #1e1e28;
  --clr-border:    #2a2a35;
  --clr-primary:   #e63946;
  --clr-primary-h: 355;
  --clr-primary-s: 78%;
  --clr-primary-l: 56%;
  --clr-primary-dark: #b82d38;
  --clr-primary-glow: rgba(230, 57, 70, .25);
  --clr-text:      #e8e8ec;
  --clr-text-dim:  #9999a8;
  --clr-text-muted:#66667a;
  --clr-white:     #ffffff;

  /* Typography */
  --ff-sans: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --ff-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --fs-xs:   0.75rem;
  --fs-sm:   0.875rem;
  --fs-base: 1rem;
  --fs-md:   1.125rem;
  --fs-lg:   1.25rem;
  --fs-xl:   1.5rem;
  --fs-2xl:  2rem;
  --fs-3xl:  2.5rem;
  --fs-4xl:  3rem;
  --fs-5xl:  3.75rem;
  --fs-6xl:  4.5rem;
  --fw-regular:  400;
  --fw-medium:   500;
  --fw-semibold: 600;
  --fw-bold:     700;
  --fw-black:    900;

  /* Spacing */
  --sp-xs:   0.25rem;
  --sp-sm:   0.5rem;
  --sp-md:   1rem;
  --sp-lg:   1.5rem;
  --sp-xl:   2rem;
  --sp-2xl:  3rem;
  --sp-3xl:  4rem;
  --sp-4xl:  6rem;
  --sp-section: 7rem;

  /* Layout */
  --max-w:   1200px;
  --nav-h:   72px;

  /* Radius */
  --r-sm:  6px;
  --r-md:  10px;
  --r-lg:  16px;
  --r-xl:  24px;
  --r-full: 9999px;

  /* Transition */
  --ease: cubic-bezier(.4, 0, .2, 1);
  --dur: .3s;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-padding-top: var(--nav-h);
}

body {
  font-family: var(--ff-sans);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: 1.7;
  color: var(--clr-text);
  background-color: var(--clr-bg);
  overflow-x: hidden;
}

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

ul, ol { list-style: none; }

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

::selection {
  background: var(--clr-primary);
  color: var(--clr-white);
}

/* ---------- Utility ---------- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--sp-xl);
}

.section {
  padding: var(--sp-section) 0;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-sm);
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--clr-primary);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: var(--sp-md);
}

.section-label::before {
  content: '';
  width: 24px;
  height: 2px;
  background: var(--clr-primary);
}

.section-title {
  font-size: var(--fs-3xl);
  font-weight: var(--fw-bold);
  line-height: 1.2;
  margin-bottom: var(--sp-lg);
  color: var(--clr-white);
}

.section-subtitle {
  font-size: var(--fs-md);
  color: var(--clr-text-dim);
  max-width: 600px;
  line-height: 1.7;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: 0.85em 1.8em;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  border-radius: var(--r-full);
  transition: all var(--dur) var(--ease);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.btn-primary {
  background: var(--clr-primary);
  color: var(--clr-white);
  box-shadow: 0 0 0 0 var(--clr-primary-glow);
}
.btn-primary:hover {
  background: var(--clr-primary-dark);
  box-shadow: 0 8px 30px var(--clr-primary-glow);
  transform: translateY(-2px);
}

.btn-outline {
  border: 1.5px solid var(--clr-border);
  color: var(--clr-text);
}
.btn-outline:hover {
  border-color: var(--clr-primary);
  color: var(--clr-primary);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 0.55em 1.2em;
  font-size: var(--fs-xs);
}

.btn i, .btn svg { font-size: 1em; }

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-h);
  z-index: 1000;
  transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.nav.scrolled {
  background: rgba(10, 10, 15, .92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 var(--clr-border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-logo {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--clr-white);
  letter-spacing: -0.02em;
}
.nav-logo span {
  color: var(--clr-primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--sp-2xl);
}

.nav-link {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--clr-text-dim);
  transition: color var(--dur) var(--ease);
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--clr-primary);
  transition: width var(--dur) var(--ease);
}
.nav-link:hover,
.nav-link.active {
  color: var(--clr-white);
}
.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-cta {
  margin-left: var(--sp-md);
}

/* Mobile menu toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 28px;
  cursor: pointer;
  z-index: 1001;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--clr-text);
  border-radius: 2px;
  transition: all var(--dur) var(--ease);
}
.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- HERO ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-top: var(--nav-h);
}

/* Decorative background */
.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(230,57,70,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(230,57,70,.04) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 30%, transparent 100%);
}
.hero-bg-glow {
  position: absolute;
  width: 700px;
  height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--clr-primary-glow), transparent 70%);
  top: 20%;
  right: -10%;
  opacity: .35;
  animation: pulse-glow 6s ease-in-out infinite alternate;
}

@keyframes pulse-glow {
  0% { transform: scale(1); opacity: .35; }
  100% { transform: scale(1.15); opacity: .2; }
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: var(--sp-3xl);
  width: 100%;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: var(--sp-lg);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-sm);
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-full);
  padding: 0.4em 1em;
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--clr-text-dim);
  width: fit-content;
}
.hero-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--clr-primary);
  animation: dot-pulse 2s ease-in-out infinite;
}
@keyframes dot-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

.hero-name {
  font-size: var(--fs-6xl);
  font-weight: var(--fw-black);
  line-height: 1.05;
  color: var(--clr-white);
  letter-spacing: -0.03em;
}
.hero-name .accent {
  color: var(--clr-primary);
}

.hero-role {
  font-size: var(--fs-xl);
  font-weight: var(--fw-medium);
  color: var(--clr-text-dim);
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}
.hero-role::before {
  content: '//';
  color: var(--clr-primary);
  font-family: var(--ff-mono);
  font-weight: var(--fw-bold);
}

.hero-desc {
  font-size: var(--fs-md);
  color: var(--clr-text-dim);
  max-width: 480px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  margin-top: var(--sp-sm);
}

.hero-stats {
  display: flex;
  gap: var(--sp-2xl);
  margin-top: var(--sp-xl);
  padding-top: var(--sp-xl);
  border-top: 1px solid var(--clr-border);
}
.hero-stat-num {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  color: var(--clr-white);
}
.hero-stat-num span { color: var(--clr-primary); }
.hero-stat-label {
  font-size: var(--fs-xs);
  color: var(--clr-text-muted);
  margin-top: 2px;
}

/* Hero portrait */
.hero-portrait {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.hero-portrait-wrapper {
  position: relative;
  width: 100%;
  max-width: 600px;
  perspective: 1000px;
  transform-style: preserve-3d;
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hero-portrait-img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 20px 60px rgba(0,0,0,.5));
  mask-image: linear-gradient(to bottom, black 75%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 75%, transparent 100%);
  transform: translateZ(40px); /* 3D pop effect */
}

.hero-portrait-backdrop {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 85%;
  height: 70%;
  background: linear-gradient(180deg, transparent, var(--clr-primary-glow) 60%, rgba(230,57,70,.12));
  border-radius: 50% 50% 0 0;
  z-index: 1;
  filter: blur(40px);
}

.hero-portrait-ring {
  position: absolute;
  bottom: 5%;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  aspect-ratio: 1;
  border: 1.5px solid rgba(230,57,70,.15);
  border-radius: 50%;
  z-index: 0;
}
.hero-portrait-ring::after {
  content: '';
  position: absolute;
  inset: -15px;
  border: 1px solid rgba(230,57,70,.07);
  border-radius: 50%;
}

/* Giant background text */
.hero-bg-text {
  position: absolute;
  bottom: 8%;
  right: -5%;
  font-size: 10rem;
  font-weight: var(--fw-black);
  color: rgba(230,57,70,.03);
  letter-spacing: -0.05em;
  line-height: 1;
  user-select: none;
  pointer-events: none;
  z-index: 0;
  white-space: nowrap;
}

/* Scroll indicator */
.hero-scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-sm);
  color: var(--clr-text-muted);
  font-size: var(--fs-xs);
  z-index: 2;
  animation: bounce-down 2s ease-in-out infinite;
}
.hero-scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--clr-primary), transparent);
}

@keyframes bounce-down {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* ---------- PROJECTS ---------- */
.projects {
  background: var(--clr-bg);
}

.projects-header {
  margin-bottom: var(--sp-3xl);
}

.projects-grid {
  display: grid;
  gap: var(--sp-2xl);
}

/* Featured project - large card */
.project-card {
  position: relative;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: all var(--dur) var(--ease);
}
.project-card:hover {
  border-color: rgba(230,57,70,.3);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0,0,0,.3), 0 0 40px var(--clr-primary-glow);
}

.project-card-featured {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.project-card-visual {
  position: relative;
  background: var(--clr-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-2xl);
  min-height: 300px;
  overflow: hidden;
}

.project-card-visual-icon {
  font-size: 4rem;
  opacity: .15;
  color: var(--clr-primary);
}

.project-card-number {
  position: absolute;
  top: var(--sp-lg);
  left: var(--sp-lg);
  font-family: var(--ff-mono);
  font-size: var(--fs-5xl);
  font-weight: var(--fw-black);
  color: rgba(230,57,70,.08);
  line-height: 1;
}

.project-card-visual-pattern {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 2px 2px, rgba(230,57,70,.06) 1px, transparent 1px);
  background-size: 24px 24px;
}

.project-card-body {
  padding: var(--sp-2xl);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--sp-md);
}

.project-card-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  color: var(--clr-primary);
  font-weight: var(--fw-medium);
  width: fit-content;
}
.project-card-tag i { font-size: .85em; }

.project-card-title {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: var(--clr-white);
  line-height: 1.3;
}

.project-card-desc {
  font-size: var(--fs-sm);
  color: var(--clr-text-dim);
  line-height: 1.7;
}

.project-card-result {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  font-size: var(--fs-sm);
  color: var(--clr-primary);
  font-weight: var(--fw-medium);
}
.project-card-result i { font-size: .85em; }

.project-card-techs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-sm);
}

.project-tech-tag {
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  padding: 0.3em 0.8em;
  background: var(--clr-bg);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-full);
  color: var(--clr-text-dim);
  transition: all var(--dur) var(--ease);
}
.project-card:hover .project-tech-tag {
  border-color: rgba(230,57,70,.2);
}

/* Smaller project cards in grid */
.projects-secondary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-xl);
  margin-top: var(--sp-xl);
}

.project-card-compact {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-lg);
  padding: var(--sp-xl);
  display: flex;
  flex-direction: column;
  gap: 0; /* Changed from var(--sp-md) for accordion effect */
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  overflow: hidden;
}
.project-card-compact:hover {
  border-color: rgba(230,57,70,.3);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,.2);
}

.project-card-compact .project-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.project-card-compact .project-card-title {
  margin-top: var(--sp-md);
  margin-bottom: 0;
  transition: margin-bottom 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.project-card-compact:hover .project-card-title {
  margin-bottom: var(--sp-md);
}

.project-card-compact .project-card-desc,
.project-card-compact .project-card-techs {
  max-height: 0;
  opacity: 0;
  visibility: hidden;
  margin: 0;
  transform: translateY(-10px);
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.project-card-compact:hover .project-card-desc {
  max-height: 200px;
  opacity: 1;
  visibility: visible;
  margin-bottom: var(--sp-md);
  transform: translateY(0);
}

.project-card-compact:hover .project-card-techs {
  max-height: 100px;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.project-card-compact .project-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  background: rgba(230,57,70,.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-primary);
  font-size: var(--fs-lg);
}

.project-card-compact .project-card-num {
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  color: var(--clr-text-muted);
}

/* ---------- ABOUT ---------- */
.about {
  background: var(--clr-bg-alt);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4xl);
  align-items: start;
}

.about-text {
  display: flex;
  flex-direction: column;
  gap: var(--sp-lg);
}

.about-text p {
  font-size: var(--fs-md);
  color: var(--clr-text-dim);
  line-height: 1.8;
}

.about-highlight {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-md);
  margin-top: var(--sp-md);
}

.about-highlight-item {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-md);
  padding: var(--sp-lg);
  text-align: center;
  transition: all var(--dur) var(--ease);
}
.about-highlight-item:hover {
  border-color: rgba(230,57,70,.3);
}

.about-highlight-num {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  color: var(--clr-primary);
}

.about-highlight-label {
  font-size: var(--fs-xs);
  color: var(--clr-text-muted);
  margin-top: 4px;
}

/* ---------- BACKGROUND ---------- */
.background {
  background: var(--clr-bg);
}

.background-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4xl);
}

.bg-column {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2xl);
}

.bg-group-title {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--clr-white);
  margin-bottom: var(--sp-lg);
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}
.bg-group-title i {
  color: var(--clr-primary);
  font-size: 1em;
}

/* Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: var(--sp-xl);
  position: relative;
  padding-left: var(--sp-xl);
}
.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 1px;
  background: linear-gradient(to bottom, var(--clr-primary), var(--clr-border));
}

.timeline-item {
  position: relative;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--sp-xl));
  top: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--clr-primary);
  border: 2px solid var(--clr-bg);
  box-shadow: 0 0 0 3px rgba(230,57,70,.2);
}

.timeline-date {
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  color: var(--clr-primary);
  margin-bottom: 4px;
}

.timeline-title {
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  color: var(--clr-white);
}

.timeline-org {
  font-size: var(--fs-sm);
  color: var(--clr-text-dim);
  margin-top: 2px;
}

.timeline-desc {
  font-size: var(--fs-sm);
  color: var(--clr-text-muted);
  margin-top: var(--sp-sm);
  line-height: 1.6;
}

/* Skills */
.skills-grid {
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
}

.skill-item {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-md);
  padding: var(--sp-md) var(--sp-lg);
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  transition: all var(--dur) var(--ease);
}
.skill-item:hover {
  border-color: rgba(230,57,70,.3);
  transform: translateX(4px);
}

.skill-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  background: rgba(230,57,70,.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-primary);
  font-size: var(--fs-sm);
  flex-shrink: 0;
}

.skill-name {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--clr-text);
}

/* Education */
.edu-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-lg);
  padding: var(--sp-xl);
  transition: all var(--dur) var(--ease);
}
.edu-card:hover {
  border-color: rgba(230,57,70,.3);
}
.edu-card + .edu-card {
  margin-top: var(--sp-md);
}

.edu-degree {
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  color: var(--clr-white);
}
.edu-school {
  font-size: var(--fs-sm);
  color: var(--clr-text-dim);
  margin-top: 4px;
}
.edu-year {
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  color: var(--clr-primary);
  margin-top: var(--sp-sm);
}
.edu-gpa {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: var(--sp-sm);
  padding: 0.3em 0.8em;
  background: rgba(230,57,70,.1);
  border-radius: var(--r-full);
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  color: var(--clr-primary);
  font-weight: var(--fw-semibold);
}

/* ---------- ACHIEVEMENTS ---------- */
.achievements {
  background: var(--clr-bg-alt);
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-xl);
  margin-top: var(--sp-2xl);
}

.achievement-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-lg);
  padding: var(--sp-xl);
  display: flex;
  gap: var(--sp-lg);
  transition: all var(--dur) var(--ease);
}
.achievement-card:hover {
  border-color: rgba(230,57,70,.3);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,.2);
}

.achievement-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--r-md);
  background: rgba(230,57,70,.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-primary);
  font-size: var(--fs-xl);
  flex-shrink: 0;
}

.achievement-body { flex: 1; }

.achievement-title {
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  color: var(--clr-white);
  line-height: 1.4;
}

.achievement-desc {
  font-size: var(--fs-sm);
  color: var(--clr-text-dim);
  margin-top: var(--sp-xs);
  line-height: 1.6;
}

.achievement-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: var(--sp-sm);
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  color: var(--clr-primary);
  font-weight: var(--fw-medium);
}

/* ---------- CONTACT ---------- */
.contact {
  background: var(--clr-bg);
  position: relative;
  overflow: hidden;
}

.contact-bg-glow {
  position: absolute;
  bottom: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--clr-primary-glow), transparent 70%);
  opacity: .2;
  pointer-events: none;
}

.contact-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}

.contact-title {
  font-size: var(--fs-3xl);
  font-weight: var(--fw-bold);
  color: var(--clr-white);
  margin-bottom: var(--sp-md);
}

.contact-desc {
  font-size: var(--fs-md);
  color: var(--clr-text-dim);
  margin-bottom: var(--sp-2xl);
  line-height: 1.7;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: var(--sp-md);
  margin-bottom: var(--sp-2xl);
}

.contact-link-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-sm);
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-lg);
  padding: var(--sp-xl) var(--sp-2xl);
  min-width: 140px;
  transition: all var(--dur) var(--ease);
}
.contact-link-card:hover {
  border-color: var(--clr-primary);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,.2);
}

.contact-link-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--r-md);
  background: rgba(230,57,70,.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-primary);
  font-size: var(--fs-xl);
}

.contact-link-name {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--clr-text);
}

.contact-link-value {
  font-size: var(--fs-xs);
  color: var(--clr-text-muted);
}

/* Contact form */
.contact-form {
  margin-top: var(--sp-2xl);
  display: grid;
  gap: var(--sp-md);
  text-align: left;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-md);
}

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

.form-label {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--clr-text-dim);
}

.form-input,
.form-textarea {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-md);
  padding: 0.85em 1em;
  font-family: var(--ff-sans);
  font-size: var(--fs-sm);
  color: var(--clr-text);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  outline: none;
}
.form-input:focus,
.form-textarea:focus {
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px var(--clr-primary-glow);
}
.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--clr-text-muted);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.contact-form .btn-primary {
  margin-top: var(--sp-sm);
  justify-content: center;
  width: 100%;
}

/* ---------- FOOTER ---------- */
.footer {
  background: var(--clr-bg-alt);
  border-top: 1px solid var(--clr-border);
  padding: var(--sp-2xl) 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-md);
}

.footer-copy {
  font-size: var(--fs-sm);
  color: var(--clr-text-muted);
}
.footer-copy span {
  color: var(--clr-primary);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: var(--sp-lg);
}

.footer-link {
  font-size: var(--fs-lg);
  color: var(--clr-text-muted);
  transition: color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.footer-link:hover {
  color: var(--clr-primary);
  transform: translateY(-2px);
}

/* ---------- Scroll Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(40px) scale(0.95);
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ---------- Back-to-top ---------- */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: var(--r-full);
  background: var(--clr-primary);
  color: var(--clr-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-lg);
  box-shadow: 0 4px 20px var(--clr-primary-glow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
  transition: all var(--dur) var(--ease);
  z-index: 900;
  cursor: pointer;
}
.back-to-top.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--clr-primary-dark);
  transform: translateY(-4px);
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 1024px) {
  :root {
    --sp-section: 5rem;
    --fs-6xl: 3.25rem;
    --fs-5xl: 2.75rem;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--sp-2xl);
  }
  .hero-content {
    align-items: center;
    order: 2;
  }
  .hero-portrait {
    order: 1;
    justify-content: center;
  }
  .hero-portrait-wrapper {
    max-width: 320px;
  }
  .hero-desc {
    max-width: 520px;
    margin: 0 auto;
  }
  .hero-role {
    justify-content: center;
  }
  .hero-actions {
    justify-content: center;
  }
  .hero-stats {
    justify-content: center;
  }
  .hero-bg-text {
    font-size: 6rem;
    bottom: auto;
    top: 12%;
    right: auto;
    left: 50%;
    transform: translateX(-50%);
  }

  .project-card-featured {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 768px) {
  :root {
    --sp-section: 4rem;
    --fs-6xl: 2.5rem;
    --fs-5xl: 2rem;
    --fs-4xl: 1.75rem;
    --fs-3xl: 1.75rem;
    --fs-2xl: 1.5rem;
    --sp-xl: 1.25rem;
  }

  .container {
    padding: 0 var(--sp-lg);
  }

  /* Mobile nav */
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--clr-surface);
    flex-direction: column;
    justify-content: center;
    gap: var(--sp-xl);
    padding: var(--sp-2xl);
    transition: right var(--dur) var(--ease);
    box-shadow: -8px 0 40px rgba(0,0,0,.4);
    border-left: 1px solid var(--clr-border);
  }
  .nav-links.open {
    right: 0;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-cta {
    margin-left: 0;
  }

  .hero-portrait-wrapper {
    max-width: 260px;
  }
  .hero-stats {
    flex-wrap: wrap;
    gap: var(--sp-lg);
  }

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

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

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

  .contact-links {
    flex-direction: column;
    align-items: center;
  }
  .contact-link-card {
    width: 100%;
    max-width: 320px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  :root {
    --fs-6xl: 2rem;
    --fs-5xl: 1.75rem;
    --fs-3xl: 1.5rem;
  }

  .hero-bg-text {
    font-size: 3.5rem;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }
  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }
}
