/* RESET */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* DESIGN SYSTEM */
:root {
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-muted: #86868b;
  --accent: #0071e3;
  --surface: #ffffff;
  --surface-soft: #f5f5f7;
  --border-subtle: #e5e5e7;

  --space-xs: clamp(8px, 1vw, 12px);
  --space-sm: clamp(16px, 2vw, 24px);
  --space-md: clamp(32px, 4vw, 48px);
  --space-lg: clamp(64px, 6vw, 96px);
  --space-xl: clamp(96px, 8vw, 140px);

  --transition-smooth: 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* BASE */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(16px, 1vw + 14px, 18px);
  line-height: 1.75;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  background-color: var(--surface);

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

h1, h2, h3 {
  margin-bottom: var(--space-sm);
}

p {
  margin-bottom: var(--space-sm);
  color: var(--text-secondary);
}

a {
  text-decoration: none;
  color: inherit;
}

/* HEADER */
header {
  position: sticky;
  top: 0;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
  padding: var(--space-sm) 0;
  z-index: 1000;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-weight: 600;
  font-size: clamp(20px, 1.5vw, 26px);
}

nav ul {
  list-style: none;
  display: flex;
  gap: var(--space-sm);
}

nav a {
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition-smooth);
}

nav a:hover {
  color: var(--accent);
}

/* HERO */
#hero {
  display: flex;
  align-items: center;
  min-height: 90vh;
  padding: var(--space-xl) 0;
  text-align: center;
}

.hero-content {
  max-width: 720px;
  margin: 0 auto;
}

#hero h1 {
  font-size: clamp(36px, 5vw, 72px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

#hero p {
  font-size: clamp(16px, 1.2vw + 14px, 20px);
}

.hero-buttons {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

/* BUTTONS */
.btn {
  padding: 14px 32px;
  border-radius: 50px;
  font-weight: 500;
  font-size: 15px;
  transition: all var(--transition-smooth);
  display: inline-block;
}

.btn-primary {
  background: var(--text-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent);
  transform: translateY(-2px);
}

.btn-secondary {
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ABOUT */

/* #about {
  padding: var(--space-xl) 0;
} */

#about h2 {
  font-size: clamp(24px, 2.5vw, 40px);
  font-weight: 600;
}

/* layout */

.about-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  margin-top: var(--space-md);
}

/* text */

.about-text {
  flex: 1;
  max-width: 620px;
}

.about-text p {
  margin-bottom: 1.5rem;
  line-height: 1.7;
  font-size: 1.05rem;
}

/* profile image */

.about-image {
  flex: 0 0 160px;
}

.about-image img {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--surface);
}

/* WORK */
#work {
  padding: var(--space-xl) 0;
}

#work h2 {
  font-size: clamp(24px, 2.5vw, 40px);
  font-weight: 600;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 2 items per row */
  gap: var(--space-md);
  margin-top: var(--space-md);
}

@media (max-width: 768px) {

  .portfolio-grid {
    grid-template-columns: 1fr; /* 1 per row on mobile */
  }

}

.portfolio-item {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  overflow: hidden;
  transition: transform var(--transition-smooth),
              box-shadow var(--transition-smooth);
}

.portfolio-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.05);
}

.portfolio-item img {
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  border-radius:6px;
}

.portfolio-item h3 {
  font-size: clamp(18px, 1.5vw, 22px);
  font-weight: 600;
  padding: var(--space-sm);
}

.portfolio-item p {
  padding: 0 var(--space-sm) var(--space-sm);
  font-size: clamp(14px, 0.8vw + 12px, 16px);
  color: var(--text-muted);
}

.portfolio-placeholder {
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: 14px;
  color: white;
  letter-spacing: 0.05em;
}

.placeholder-1 {
  background: linear-gradient(135deg, #0071e3, #6e6e73);
}

.placeholder-2 {
  background: linear-gradient(135deg, #1d1d1f, #86868b);
}

.placeholder-3 {
  background: linear-gradient(135deg, #444, #0071e3);
}

/* DESIGN */
#design {
  padding: var(--space-xl) 0;
}

#design h2 {
  font-size: clamp(24px, 2.5vw, 40px);
  font-weight: 600;
}

/* SKILLS */

#skills {
  padding: var(--space-xl) 0;
  background: var(--surface-soft);
  text-align: center;
}

#skills h2 {
  font-size: clamp(24px, 2.5vw, 40px);
  font-weight: 600;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.skill-item h3 {
  font-size: clamp(18px, 1.5vw, 22px);
  font-weight: 600;
}

.skill-item p {
  font-size: clamp(14px, 0.8vw + 12px, 16px);
}

.skill-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-sm);
  color: var(--text-primary);
}

.skill-icon svg {
  width: 100%;
  height: 100%;
  stroke-width: 1.5;
}

/* CTA */

.cta-section {
  padding: var(--space-xl) var(--space-sm);
  text-align: center;
}

.cta-section h2 {
  font-size: clamp(24px, 2.5vw, 40px);
  font-weight: 600;
}

.cta-section p {
  color: var(--text-muted);
}

/* FOOTER */

footer {
  padding: var(--space-lg) 0;
  text-align: center;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
}

/* MOBILE */

@media (max-width: 768px) {

  .hero-buttons {
    flex-direction: column;
  }

  .header-container {
    flex-direction: column;
    gap: var(--space-xs);
  }

  /* ABOUT MOBILE */

  .about-wrapper {
    flex-direction: column;
    text-align: center;
  }

  .about-image {
    margin-top: var(--space-sm);
    display: flex;
    justify-content: center;
  }

  /* .about-image img {
    width: clamp(110px, 40vw, 160px);
    height: clamp(110px, 40vw, 160px);
  } */

}

/* SCROLL PROGRESS BAR */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--accent);
  z-index: 2000;
  transition: width 0.1s linear;
}

/* HERO PARALLAX */

.hero-parallax {
  will-change: transform;
}

/* TEXT REVEAL */

.reveal-text {
  opacity: 0;
  transform: translateY(50px);
  filter: blur(8px);
  transition:
    opacity 900ms cubic-bezier(0.16,1,0.3,1),
    transform 900ms cubic-bezier(0.16,1,0.3,1),
    filter 900ms cubic-bezier(0.16,1,0.3,1);
}

.reveal-text.visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

/* FADE UP */

.fade-up {
  opacity: 0;
  transform: translateX(-60px);
  transition:
    opacity 900ms cubic-bezier(0.16,1,0.3,1),
    transform 900ms cubic-bezier(0.16,1,0.3,1);
}

.fade-up.visible {
  opacity: 1;
  transform: translateX(0);
}

/* BLUR REVEAL */

.blur-reveal {
  opacity: 0;
  filter: blur(10px);
  transform: scale(0.98);
  transition:
    opacity 1s cubic-bezier(0.16,1,0.3,1),
    filter 1s cubic-bezier(0.16,1,0.3,1),
    transform 1s cubic-bezier(0.16,1,0.3,1);
}

.blur-reveal.visible {
  opacity: 1;
  filter: blur(0);
  transform: scale(1);
}

/* MOBILE MENU */

.menu-toggle {
  width: 28px;
  height: 14px;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  z-index: 2001;
}

.menu-toggle span {
  height: 2px;
  width: 100%;
  background: var(--text-primary);
  transition: all 0.4s cubic-bezier(0.16,1,0.3,1);
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translateY(8px);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translateY(-8px);
}

@media (max-width: 768px) {

  .menu-toggle {
    display: flex;
  }

  nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    height: 100vh;
    background: white;
    padding-top: 120px;
    transition: right 0.5s cubic-bezier(0.16,1,0.3,1);
    box-shadow: -10px 0 40px rgba(0,0,0,0.08);
  }

  nav.active {
    right: 0;
  }

  nav ul {
    flex-direction: column;
    align-items: center;
    gap: 40px;
  }

  nav a {
    font-size: 22px;
  }

}

/* PAGE LOADER */

.loader {
  transform: translateZ(0);
}

.loader {
  position: fixed;
  inset: 0;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity .6s ease, visibility .6s ease;
}

.loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-inner {
  position: relative;
  width: clamp(80px, 20vw, 120px);
  height: clamp(80px, 20vw, 120px);
}

/* center text */

.loader-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: clamp(22px, 6vw, 32px);
  color: #1d1d1f;
  opacity: 0;
  animation: loaderText 1s ease forwards;
}

/* square animation */

.loader-square {
  width: 100%;
  height: 100%;
  display: block;
}

.loader-square rect {
  fill: none;
  stroke: #1d1d1f;
  stroke-width: 2;
  stroke-dasharray: 320;
  stroke-dashoffset: 320;
  animation: squareDraw 1.4s ease forwards;
  animation-delay: .4s;
}

/* animations */

@keyframes loaderText {
  to {
    opacity: 1;
  }
}

@keyframes squareDraw {
  to {
    stroke-dashoffset: 0;
  }
}


/* ==========================
   CASE STUDY MODAL
   Cleaned + Responsive
========================== */

.case-study-modal {

  position: fixed;
  inset: 0;

  background: rgba(255,255,255,.92);

  backdrop-filter: blur(10px);

  opacity: 0;
  visibility: hidden;

  transition: opacity .35s ease;

  z-index: 9999;

}

.case-study-modal.active {

  opacity: 1;
  visibility: visible;

}


/* ==========================
   MODAL CONTENT
========================== */

.case-study-content {

  position: relative;

  width: 92%;
  max-width: 1300px;

  margin: 60px auto;

  background: #ffffff;

  border-radius: 14px;

  overflow-y: auto;

  max-height: 85vh;

  box-shadow:
    0 30px 80px rgba(0,0,0,.08);

  transform:
    translateY(40px)
    scale(.98);

  transition:
    transform .35s ease;

}

.case-study-modal.active
.case-study-content {

  transform:
    translateY(0)
    scale(1);

}


/* ==========================
   CLOSE BUTTON
========================== */

.case-close {

  position: absolute;

  top: 18px;
  right: 20px;

  font-size: 28px;

  background: none;
  border: none;

  color: #222;

  cursor: pointer;

  transition: opacity .2s ease;

}

.case-close:hover {

  opacity: .5;

}


/* ==========================
   HERO IMAGE
========================== */

.case-hero img {

  width: 100%;
  height: auto;

  display: block;

  border-radius: 14px 14px 0 0;

}


/* ==========================
   BODY
========================== */

.case-body {

  padding: 48px;

}


/* ==========================
   TYPOGRAPHY
========================== */

.case-body h2 {

  font-size: 32px;

  font-weight: 600;

  margin-bottom: 24px;

}

.case-body h3 {

  font-size: 18px;

  font-weight: 600;

  margin-bottom: 12px;

  color: #111;

}

.case-body p {

  color: #555;

  line-height: 1.7;

  font-size: 16px;

}


/* ==========================
   SECTION SPACING
========================== */

.case-section {

  margin-bottom: 40px;

}

.case-section + .case-section {

  border-top: 1px solid #eee;

  padding-top: 40px;

}


/* ==========================
   GALLERY
========================== */

.case-gallery {

  display: grid;

  grid-template-columns:
    repeat(2,1fr);

  gap: 20px;

}

.case-gallery img {

  width: 100%;

  border-radius: 10px;

  box-shadow:
    0 10px 30px rgba(0,0,0,.06);

  transition: transform .25s ease;

  aspect-ratio: 16 / 10;

  object-fit: cover;

}

.case-gallery img:hover {

  transform: scale(1.02);

}


/* ==========================
   BUTTON
========================== */

.case-section .btn {

  margin-top: 10px;

}


/* ==========================
   TABLET
========================== */

@media (max-width: 1024px) {

  .case-study-content {

    width: 94%;

    margin: 40px auto;

  }

  .case-body {

    padding: 40px;

  }

  .case-body h2 {

    font-size: 28px;

  }

}


/* ==========================
   MOBILE
========================== */

@media (max-width: 768px) {

  .case-study-content {

    width: 96%;

    margin: 20px auto;

    border-radius: 12px;

  }

  .case-body {

    padding: 24px;

  }

  .case-body h2 {

    font-size: 24px;

  }

  .case-body h3 {

    font-size: 16px;

  }

  .case-body p {

    font-size: 15px;

  }

  .case-gallery {

    grid-template-columns: 1fr;

    gap: 16px;

  }

  .case-close {

    top: 12px;
    right: 14px;

    font-size: 26px;

  }

  .case-section .btn {

    width: 100%;

    text-align: center;

    padding: 16px;

  }

}


/* ==========================
   SMALL PHONES
========================== */

@media (max-width: 480px) {

  .case-body {

    padding: 20px;

  }

  .case-body h2 {

    font-size: 22px;

  }

  .case-section {

    margin-bottom: 32px;

  }

}


/* ==========================
   BODY LOCK
========================== */

body.modal-open {

  overflow: hidden;

}


/* ==========================
   ADVANCED CASE STUDY LAYOUT
   (Traina-Style Structure)
========================== */


/* TITLE BLOCK */

.case-title-block {

  padding: 80px 8%;
  max-width: 1100px;
  margin: auto;

}

.case-title-block h1 {

  font-size: clamp(36px, 5vw, 56px);
  font-weight: 600;

}

.case-subtitle {

  font-size: 18px;
  color: var(--text-muted);

}


/* META GRID */

.case-meta {

  display: grid;

  grid-template-columns:
    repeat(4,1fr);

  gap: 40px;

  padding: 60px 8%;

  max-width: 1100px;
  margin: auto;

  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);

}

.meta-item h4 {

  font-size: 12px;

  text-transform: uppercase;

  color: var(--text-muted);

  margin-bottom: 6px;

}

.meta-item p {

  font-size: 16px;

  color: var(--text-primary);

}


/* STANDARD CONTENT BLOCK */

.case-section {

  padding: 100px 8%;

  max-width: 900px;
  margin: auto;

}

.case-section h2 {

  font-size: 32px;

}

.case-section p {

  font-size: 18px;

  line-height: 1.7;

}


/* FULL WIDTH IMAGE */

.case-image-full img {

  width: 100%;
  display: block;

}


/* SPLIT LAYOUT */

.case-split {

  display: grid;

  grid-template-columns:
    1fr 1fr;

  gap: 60px;

  padding: 100px 8%;

  max-width: 1300px;
  margin: auto;

}

.split-image img {

  width: 100%;
  display: block;

  border-radius: 12px;

}


/* STACKED IMAGE SYSTEM */

.case-image-stack {

  padding: 60px 8%;

}

.case-image-stack img {

  width: 100%;

  display: block;

  margin-bottom: 40px;

  border-radius: 12px;

}


/* RESULTS LIST */

.case-results ul {

  list-style: none;

  padding: 0;

}

.case-results li {

  font-size: 18px;

  margin-bottom: 14px;

  padding-left: 24px;

  position: relative;

}

.case-results li::before {

  content: "•";

  position: absolute;

  left: 0;

  color: var(--accent);

}


/* TABLET */

@media (max-width: 1024px) {

  .case-meta {

    grid-template-columns:
      repeat(2,1fr);

  }

}


/* MOBILE */

@media (max-width: 768px) {

  .case-split {

    grid-template-columns: 1fr;

    gap: 40px;

  }

  .case-section {

    padding: 60px 8%;

  }

}


.case-study-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  margin-top: 1rem;
  margin-left: 1rem;
  margin-bottom: 1rem;

  padding: 12px 18px;

  background: #111;
  color: #fff;

  border: none;
  border-radius: 999px;

  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;

  cursor: pointer;

  transition: all .3s ease;
}

.case-study-btn span {
  transition: transform .3s ease;
}

.case-study-btn:hover {
  background: #222;
  transform: translateY(-2px);
}

.case-study-btn:hover span {
  transform: translateX(4px);
}