/* =============================================
   THEME — change these to restyle everything
   ============================================= */
:root {
  --bg:            #f4f1fe;
  --bg-alt:        #ede9fe;
  --surface:       #ffffff;
  --border:        #ddd6fe;
  --text:          #1e1b4b;
  --muted:         #6b6e8a;
  --accent:        #7c3aed;
  --accent-light:  #ede9fe;
  --accent-glow:   rgba(124, 58, 237, 0.28);

  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono: 'Cascadia Code', 'Fira Code', monospace;
  --radius: 14px;
  --max-w: 1100px;
  --nav-h: 68px;
}

/* =============================================
   RESET
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; }
ul { list-style: none; }
img { display: block; max-width: 100%; }

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

/* =============================================
   LAYOUT
   ============================================= */
.container {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: clamp(1.5rem, 5vw, 3rem);
}
.section { padding-block: clamp(5rem, 10vw, 8rem); }

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.4rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform 0.15s, box-shadow 0.15s;
  white-space: nowrap;
  font-family: var(--font);
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.35);
}
.btn-primary:hover { box-shadow: 0 8px 24px rgba(124, 58, 237, 0.45); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: none;
  font-weight: 500;
}
.btn-ghost:hover { color: var(--accent); }

.btn-outline-dark {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-outline-dark:hover { border-color: var(--accent); color: var(--accent); }

.btn-lg { padding: 0.85rem 1.9rem; font-size: 1rem; }
.btn-full { width: 100%; justify-content: center; }

/* =============================================
   NAV
   ============================================= */
.nav {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: clamp(1.5rem, 5vw, 3rem);
  background: rgba(244, 241, 254, 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  transition: box-shadow 0.3s;
}

.nav-logo {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.03em;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* =============================================
   HEXAGON
   ============================================= */
.hex-wrapper {
  position: relative;
  width: 300px;
  height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hex-glow {
  position: absolute;
  inset: -24px;
  background: radial-gradient(ellipse at center, var(--accent-glow) 0%, transparent 72%);
  pointer-events: none;
}

.hex-frame {
  width: 260px;
  height: 300px;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  overflow: hidden;
  position: relative;
  z-index: 1;
  border-radius: 20px;
  background: var(--accent-light);
}

.hex-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.hex-wrapper--sm { width: 240px; height: 275px; }
.hex-frame--sm { width: 210px; height: 242px; }

/* =============================================
   HERO
   ============================================= */
.hero {
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 4rem;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: clamp(1.5rem, 5vw, 3rem);
  padding-top: var(--nav-h);
  padding-bottom: 5rem;
  position: relative;
}

.hero-left { max-width: 580px; }

.hero-headline {
  font-size: clamp(2.2rem, 5vw, 3.75rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 1.25rem;
}

.hero-sub {
  color: var(--muted);
  font-size: 1rem;
  max-width: 52ch;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.hero-right {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--muted), transparent);
}

/* =============================================
   ABOUT
   ============================================= */
.about-layout {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5rem;
  align-items: start;
}

.about-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.skill-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  max-width: 230px;
}

.skill-chips span {
  font-size: 0.74rem;
  font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  white-space: nowrap;
}

.about-hello {
  font-size: 2rem;
  font-weight: 900;
  color: var(--accent);
  margin-bottom: 1.25rem;
  letter-spacing: -0.03em;
}

.about-text p {
  color: var(--muted);
  margin-bottom: 1rem;
  max-width: 60ch;
}

.about-text p:last-child { margin-bottom: 0; }

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

/* =============================================
   PROJECTS
   ============================================= */
.section-projects {
  background: var(--surface);
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.projects-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 2.5rem;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.projects-subtitle {
  color: var(--muted);
  font-size: 0.95rem;
}

.project-filters {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.38rem 1rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.18s;
  font-family: inherit;
}

.filter-btn:hover { border-color: var(--accent); color: var(--accent); }

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* PROJECT SCREENSHOT */
.project-screenshot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 1;
}

.project-screenshot.loaded { opacity: 1; }

.project-card-overlay,
.featured-badge {
  z-index: 2;
}

/* Featured card */
.project-featured {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 1.25rem;
  transition: transform 0.22s, box-shadow 0.22s;
}

.project-featured:hover {
  transform: translateY(-5px);
  box-shadow: 0 24px 60px rgba(124, 58, 237, 0.13);
}

.project-featured-visual {
  position: relative;
  min-height: 340px;
  overflow: hidden;
}

.featured-badge {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  z-index: 2;
  background: var(--accent);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.25rem 0.8rem;
  border-radius: 999px;
}

.project-featured-info {
  padding: 2.75rem 2.5rem;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
}

.project-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.project-num {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--mono);
}

.project-cat-tag {
  font-size: 0.73rem;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
}

.project-title {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text);
  line-height: 1.2;
}

.project-desc {
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.65;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.project-tags li {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-light);
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
}

.project-tags--sm li { font-size: 0.72rem; }

.project-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

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

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 44px rgba(124, 58, 237, 0.12);
}

.project-card-visual {
  position: relative;
  height: 190px;
  overflow: hidden;
}

.project-card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(30, 27, 75, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.22s;
  z-index: 2;
}

.project-card:hover .project-card-overlay { opacity: 1; }

.overlay-btn {
  color: #fff;
  font-weight: 700;
  font-size: 0.88rem;
  border: 2px solid rgba(255,255,255,0.55);
  padding: 0.5rem 1.2rem;
  border-radius: 8px;
  transition: background 0.18s;
  background: transparent;
}

.overlay-btn:hover { background: rgba(255,255,255,0.15); }

.project-card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
}

.project-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.project-card-desc {
  font-size: 0.87rem;
  color: var(--muted);
  line-height: 1.6;
  flex: 1;
}

/* Gradient covers */
.pg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.pg::before, .pg::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}
.pg::before { width: 180px; height: 180px; top: -50px; right: -40px; }
.pg::after  { width: 90px;  height: 90px;  bottom: -25px; left: 24px; }

.pg-1 { background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 50%, #0ea5e9 100%); }
.pg-2 { background: linear-gradient(135deg, #10b981 0%, #0ea5e9 100%); }
.pg-3 { background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%); }
.pg-4 { background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%); }
.pg-5 { background: linear-gradient(135deg, #14b8a6 0%, #3b82f6 100%); }
.pg-6 { background: linear-gradient(135deg, #f97316 0%, #eab308 100%); }

/* =============================================
   CONTACT
   ============================================= */
.section-contact {
  background: var(--bg);
}

.contact-content {
  max-width: 640px;
  margin-inline: auto;
  text-align: center;
}

.contact-title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 1.25rem;
}

.contact-sub {
  color: var(--muted);
  font-size: 1rem;
  max-width: 44ch;
  margin-inline: auto;
  margin-bottom: 2rem;
}

.social-links {
  display: flex;
  gap: 2rem;
  justify-content: center;
  margin-top: 2rem;
}

.social-links a {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
  transition: color 0.18s;
}

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

/* =============================================
   FOOTER
   ============================================= */
.footer {
  text-align: center;
  padding: 2rem;
  font-size: 0.8rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: var(--bg);
}

/* =============================================
   FADE-IN
   ============================================= */
.fade-in {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

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

.fade-in-delay-1 { transition-delay: 0.1s; }
.fade-in-delay-2 { transition-delay: 0.2s; }

/* =============================================
   MODAL
   ============================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30, 27, 75, 0.55);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal-card {
  background: var(--surface);
  border-radius: var(--radius);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2.5rem;
  position: relative;
  transform: translateY(16px) scale(0.98);
  transition: transform 0.25s ease;
  box-shadow: 0 24px 60px rgba(30, 27, 75, 0.2);
}

.modal-overlay.open .modal-card {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg);
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
  font-family: inherit;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text);
  background: var(--border);
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.modal-subtitle {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1.75rem;
}

/* Form */
.modal-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color 0.15s;
  -webkit-appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
}

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

.form-group select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b6e8a' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.5rem;
}

.form-group textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.5;
}

.form-error {
  font-size: 0.82rem;
  color: #c0392b;
  min-height: 1.2em;
  margin-top: -0.25rem;
}

/* Success state */
.modal-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
  padding: 2rem 0 1rem;
}

.success-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #dcfce7;
  color: #16a34a;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.modal-success h3 {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.modal-success p {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    padding-bottom: 6rem;
  }
  .hero-right { display: none; }

  .about-layout {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .about-left { align-items: flex-start; }

  .project-featured {
    grid-template-columns: 1fr;
  }
  .project-featured-visual { min-height: 240px; }

  .projects-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .projects-grid { grid-template-columns: 1fr; }
  .projects-header { align-items: flex-start; }
  .modal-card { padding: 1.75rem 1.5rem; }
}
