/* -----------------------
   Base styles
------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #f9fafb;
  --bg-alt: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #111827;
  --radius-lg: 20px;
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.08);
  --max-width: 1100px;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* -----------------------
   Layout helpers
------------------------ */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 4rem 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-header h2 {
  font-size: 1.8rem;
  margin: 0.35rem 0 0.75rem;
}

.section-subtitle {
  margin: 0;
  color: var(--muted);
  max-width: 520px;
  margin-inline: auto;
}

/* -----------------------
   Navbar
------------------------ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  width: 100%;
}

.nav-container {
  max-width: 100%;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-weight: 600;
  letter-spacing: 0.22em;
  font-size: 0.9rem;
  text-transform: uppercase;
  color: var(--text);
}

/* Mobile nav toggle */
.nav-toggle {
  display: block;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text);
  padding: 0;
  line-height: 1;
}

/* Mobile: hide desktop nav */
.nav-links {
  display: none;
}

/* Mobile: open menu (full-screen dropdown) */
.nav-links.open {
  display: flex;
  position: fixed;
  top: 57px;
  left: 0;
  right: 0;
  bottom: 0;
  background: #ffffff;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 2rem;
  z-index: 40;
}

.nav-links a {
  text-decoration: none;
  font-size: 1.1rem;
  color: var(--text);
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--muted);
}

/* Hide separators on mobile */
.nav-separator {
  display: none;
}

/* Contact button */
.nav-cta {
  border-radius: 999px;
  border: 1px solid var(--text);
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
  display: inline-block;
  margin-top: 1rem;
}

/* -----------------------
   Hero
------------------------ */
.hero {
  padding: 4rem 0;
  background: var(--bg);
}

/* Mobile: stacked layout */
.hero-grid {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

/* Left side: Text content */
.hero-text {
  text-align: center;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 500;
  margin: 0 0 0.75rem;
}

.hero-text h1 {
  font-size: 2rem;
  line-height: 1.15;
  margin: 0 0 1rem;
  color: var(--text);
  font-weight: 700;
}

.hero-subtitle {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 1.5rem;
  max-width: 100%;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
  justify-content: center;
}

.hero-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}

/* Right side: Visual mockup */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-mockup {
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 1.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.08);
}

/* Browser window dots */
.mockup-window-bar {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.mockup-window-bar span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #d1d5db;
}

.mockup-window-bar span:nth-child(1) {
  background: #ef4444;
}

.mockup-window-bar span:nth-child(2) {
  background: #f59e0b;
}

.mockup-window-bar span:nth-child(3) {
  background: #10b981;
}

/* Mockup content area */
.mockup-content {
  background: #f9fafb;
  border-radius: 12px;
  padding: 1.25rem;
  border: 1px solid #f3f4f6;
}

/* Grey bars representing lines */
.mockup-line {
  height: 8px;
  background: #d1d5db;
  border-radius: 999px;
  margin-bottom: 0.65rem;
  width: 100%;
}

.mockup-line.short {
  width: 60%;
}

/* 3 small boxes as projects */
.mockup-boxes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin-top: 1rem;
}

.mockup-boxes > div {
  height: 50px;
  background: #e5e7eb;
  border-radius: 10px;
}

/* -----------------------
   Buttons
------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  font-size: 0.9rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn.primary {
  background: var(--accent);
  color: #ffffff;
}

.btn.ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn.full-width {
  width: 100%;
}

/* -----------------------
   Cards & grids
------------------------ */
.card {
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.03);
}

.grid {
  display: grid;
  gap: 1.5rem;
}

/* -----------------------
   Services Section
------------------------ */
.services-section {
  background: var(--bg);
}

/* Mobile: 1 card per row */
.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-top: 2rem;
}

/* Floating service cards */
.service-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 1.75rem;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 35px rgba(15, 23, 42, 0.1);
}

.service-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 0.65rem;
  color: var(--text);
}

.service-card p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
}

/* -----------------------
   Portfolio Section
------------------------ */
.portfolio-section {
  background: #ffffff;
  padding: 6rem 0;
}

.portfolio-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.portfolio-header .eyebrow {
  display: block;
  margin-bottom: 1.5rem;
}

.portfolio-header h2 {
  font-size: 2.5rem;
  font-weight: 600;
  margin: 0 0 1.5rem;
  color: var(--text);
  line-height: 1.2;
}

.portfolio-subtitle {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--muted);
  margin: 0;
}

/* Project Grid */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  margin-top: 4rem;
}

.project-item {
  cursor: pointer;
}

/* Project Image */
.project-image-wrapper {
  overflow: hidden;
  border-radius: 18px;
  margin-bottom: 1.25rem;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}

.project-image {
  width: 100%;
  height: 280px;
  background: linear-gradient(135deg, #e5e7eb, #f3f4f6);
  transition: transform 0.4s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.project-item:hover .project-image {
  transform: scale(1.05);
}

/* Project Info */
.project-info {
  padding: 0 0.25rem;
}

.project-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.project-item .project-tags {
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--muted);
  margin: 0;
}

/* -----------------------
   Process
------------------------ */
.process-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-alt);
}

.process-list li {
  display: flex;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.process-list li:last-child {
  border-bottom: none;
}

.process-step {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.14em;
}

/* -----------------------
   About
------------------------ */
/* Mobile: Avatar centered, text below */
.about-grid {
  display: grid;
  gap: 2rem;
}

.about-photo {
  text-align: center;
}

.about-avatar {
  width: 180px;
  height: 180px;
  border-radius: 20px;
  background: linear-gradient(135deg, #e5e7eb, #f3f4f6);
  margin: 0 auto;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.about-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.about-text h2 {
  margin-top: 0.3rem;
}

.about-text p {
  color: var(--muted);
  line-height: 1.6;
}

.about-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  color: var(--muted);
}

.about-list li {
  margin-bottom: 0.5rem;
  padding-left: 1.25rem;
  position: relative;
}

.about-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--muted);
}

/* -----------------------
   Tech stack
------------------------ */
.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.tech-stack span {
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  color: var(--muted);
  background: var(--bg-alt);
}

/* -----------------------
   Contact
------------------------ */
.contact-grid {
  display: grid;
  gap: 3rem;
  align-items: flex-start;
}

.contact-grid h2 {
  font-size: 2rem;
  font-weight: 600;
  margin: 0.5rem 0 1rem;
  line-height: 1.2;
}

.contact-grid p {
  color: var(--muted);
  line-height: 1.7;
  font-size: 1rem;
  margin: 0 0 0.75rem;
}

.contact-alt {
  color: var(--muted);
  margin-top: 1rem;
  font-size: 0.95rem;
}

/* Contact Form Wrapper */
.contact-form-wrapper {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 2rem;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.08);
  transition: box-shadow 0.3s ease;
}

.contact-form-wrapper:hover {
  box-shadow: 0 15px 50px rgba(15, 23, 42, 0.12);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.contact-form button[type="submit"] {
  margin-top: 0.5rem;
  font-weight: 500;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.contact-form button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(17, 24, 39, 0.15);
}

/* -----------------------
   Image Preview Modal
------------------------ */
.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.image-modal.active {
  opacity: 1;
  visibility: visible;
}

/* Close Button */
.modal-close {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 2rem;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  z-index: 1002;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

/* Project Counter */
.modal-counter {
  position: fixed;
  top: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 400;
  z-index: 1002;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 0.5rem 1.25rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.current-project {
  font-weight: 600;
}

/* Navigation Arrows */
.modal-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1002;
  transition: all 0.2s ease;
}

.modal-nav:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-50%) scale(1.05);
}

.modal-prev {
  left: 2rem;
}

.modal-next {
  right: 2rem;
}

.modal-nav svg {
  width: 24px;
  height: 24px;
}

/* Modal Content */
.modal-content {
  max-width: 1000px;
  max-height: 90vh;
  width: 90%;
  overflow-y: auto;
  padding: 1.5rem;
  position: relative;
  z-index: 1001;
}

.modal-image-wrapper {
  background: #ffffff;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

/* Modal Image - Sizes for different project types */
.modal-image {
  width: 100%;
  min-height: 1000px;
  background: linear-gradient(135deg, #e5e7eb, #f3f4f6);
  border-radius: 8px;
  /* For actual images:
     Featured projects: max-width: 1400px
     Normal grid: max-width: 1000px
     Use PNG or WebP format */
}

/* Custom scrollbar for modal */
.modal-content::-webkit-scrollbar {
  width: 8px;
}

.modal-content::-webkit-scrollbar-track {
  background: transparent;
}

.modal-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .modal-close {
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    font-size: 1.75rem;
  }

  .modal-counter {
    top: 1rem;
    font-size: 0.8rem;
    padding: 0.4rem 1rem;
  }

  .modal-nav {
    width: 40px;
    height: 40px;
  }

  .modal-prev {
    left: 1rem;
  }

  .modal-next {
    right: 1rem;
  }

  .modal-content {
    width: 95%;
    padding: 1rem;
  }

  .modal-image-wrapper {
    padding: 1.25rem;
  }
}

/* -----------------------
   Footer
------------------------ */
.footer {
  padding: 1.5rem 0 2rem;
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

.footer p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 1rem;
}

.footer-links a {
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--muted);
}

/* -----------------------
   RESPONSIVE BREAKPOINTS
------------------------ */

/* >= 640px */
@media (min-width: 640px) {
  .hero-card {
    max-width: 480px;
  }
}

/* >= 768px: tablets & small laptops */
@media (min-width: 768px) {
  /* Tablet & Desktop navbar */
  .nav-toggle {
    display: none;
  }

  .nav-links {
    display: flex;
    position: static;
    flex-direction: row;
    align-items: center;
    gap: 1.2rem;
    padding: 0;
    background: transparent;
  }

  .nav-links.open {
    position: static;
    background: transparent;
    padding: 0;
  }

  .nav-separator {
    display: inline;
    color: var(--border);
    user-select: none;
  }

  .nav-cta {
    margin-top: 0;
    margin-left: 0.3rem;
  }

  .nav-links a {
    font-size: 0.9rem;
  }

  /* Hero: 2 columns, narrower spacing */
  .hero-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 2.5rem;
    align-items: center;
  }

  .hero-text {
    text-align: left;
  }

  .hero-buttons {
    justify-content: flex-start;
  }

  .hero-text h1 {
    font-size: 2.4rem;
  }

  .hero-mockup {
    max-width: 380px;
  }

  /* Services: 2 columns × 3 rows */
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .portfolio-section {
    padding: 7rem 0;
  }

  .portfolio-header h2 {
    font-size: 3rem;
  }

  /* Project grid: 2 columns */
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
  }

  .project-image {
    height: 300px;
  }

  .about-grid {
    grid-template-columns: 0.9fr 1.4fr;
    align-items: center;
  }

  .about-avatar {
    margin-left: 0;
  }

  .contact-grid {
    grid-template-columns: 1.1fr 1.1fr;
  }

  .footer-inner {
    flex-direction: row;
  }
}

/* >= 1024px: laptops & desktops */
@media (min-width: 1024px) {
  .nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
  }

  .nav-links {
    gap: 1.5rem;
  }

  .section {
    padding: 5rem 0;
  }

  .hero {
    padding: 5rem 0;
  }

  .hero-grid {
    grid-template-columns: 1.2fr 1fr;
    gap: 3.5rem;
  }

  .hero-text h1 {
    font-size: 2.8rem;
  }

  .hero-mockup {
    max-width: 450px;
  }

  /* Services: 3 columns × 2 rows */
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.75rem;
  }

  .portfolio-section {
    padding: 8rem 0;
  }

  .portfolio-header h2 {
    font-size: 3.5rem;
  }

  .portfolio-subtitle {
    font-size: 1.1rem;
  }

  /* Project grid: 3 columns */
  .projects-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2.75rem;
  }

  .project-image {
    height: 320px;
  }
}

/* >= 1280px: big desktops */
@media (min-width: 1280px) {
  :root {
    --max-width: 1200px;
  }

  .hero-text h1 {
    font-size: 3.2rem;
  }

  .hero-mockup {
    max-width: 480px;
  }
}
