@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
  --bg-color: #081b29;
  --second-bg-color: #0c2b3f;
  --text-color: #ededed;
  --main-color: #00abf0;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

html {
  font-size: 62.5%;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  background: var(--bg-color);
  color: var(--text-color);
  position: relative;
}

/* ===== 3D background canvas ===== */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  transition: opacity 0.4s ease;
}

header, section, footer {
  position: relative;
  z-index: 2;
}

::selection {
  color: var(--bg-color);
  background: var(--main-color);
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--main-color);
  border-radius: 5px;
}

a {
  text-decoration: none;
}

li {
  list-style: none;
}

/* ===== header ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 2rem 9%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(8, 27, 41, 0.75);
  backdrop-filter: blur(10px);
  z-index: 100;
  transition: 0.3s;
  border-bottom: 1px solid rgba(0, 171, 240, 0.15);
}

.logo {
  font-size: 2.5rem;
  color: var(--text-color);
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
}

.logo:hover {
  transform: scale(1.05);
}

.navbar {
  display: flex;
  align-items: center;
}

.navbar a {
  font-size: 1.7rem;
  color: var(--text-color);
  margin-left: 4rem;
  font-weight: 500;
  transition: 0.3s;
  border-bottom: 3px solid transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar a:hover,
.navbar a#active {
  color: var(--main-color);
  border-bottom: 3px solid var(--main-color);
}

#menuicon {
  font-size: 3.6rem;
  color: var(--text-color);
  display: none;
  cursor: pointer;
}

#lightTheam {
  cursor: pointer;
}

/* ===== home ===== */
section {
  min-height: 100vh;
  padding: 10rem 9% 2rem;
}

.home {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  flex-wrap: wrap-reverse;
}

.home-content {
  max-width: 60rem;
}

.home-content h3 {
  font-size: 3.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.home-content h1 {
  font-size: 6rem;
  font-weight: 700;
  line-height: 1.1;
  margin: 0.5rem 0;
  background: linear-gradient(90deg, var(--text-color), var(--main-color));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.multiple-text {
  color: var(--main-color);
}

.home-content p {
  font-size: 1.6rem;
  line-height: 1.7;
  color: #c7d3da;
  margin: 1.5rem 0 2.5rem;
  max-width: 55rem;
}

.social-media {
  display: flex;
  align-items: center;
  margin-bottom: 3rem;
}

.social-media a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 4.2rem;
  height: 4.2rem;
  background: transparent;
  border: 2px solid var(--main-color);
  border-radius: 50%;
  font-size: 2rem;
  color: var(--main-color);
  margin-right: 1.5rem;
  transition: 0.4s ease;
}

.social-media a:hover {
  background: var(--main-color);
  color: var(--bg-color);
  transform: translateY(-6px) rotate(6deg);
  box-shadow: 0 0 20px var(--main-color);
}

.btn {
  display: inline-block;
  padding: 1.2rem 2.8rem;
  background: var(--main-color);
  border-radius: 4rem;
  box-shadow: 0 0 1rem var(--main-color);
  font-size: 1.6rem;
  color: var(--bg-color);
  letter-spacing: 0.1rem;
  font-weight: 600;
  border: 2px solid transparent;
  transition: 0.3s ease;
  cursor: pointer;
}

.btn:hover {
  transform: scale(1.04);
  box-shadow: 0 0 2rem var(--main-color);
}

.home-img {
  display: flex;
  justify-content: center;
  align-items: center;
}

.home-img img {
  width: 30rem;
  border-radius: 50%;
  box-shadow: 0 0 3rem var(--main-color);
  animation: float 4s ease-in-out infinite;
  transition: transform 0.3s ease;
}

.home-img img:hover {
  transform: scale(1.03) rotate(1deg);
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1.5rem); }
}

/* ===== about ===== */
.about {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5rem;
  background: var(--second-bg-color);
  flex-wrap: wrap;
}

.about img {
  width: 30rem;
  border-radius: 2rem;
  box-shadow: 0 0 2rem rgba(0, 171, 240, 0.4);
  transition: transform 0.4s ease;
}

.about img:hover {
  transform: perspective(800px) rotateY(8deg) rotateX(4deg);
}

.about-content {
  max-width: 55rem;
}

.heading {
  text-align: center;
  font-size: 4.5rem;
  margin-bottom: 2rem;
}

.about-content .heading {
  text-align: left;
}

.heading span {
  color: var(--main-color);
}

.about-content h3 {
  font-size: 2.6rem;
  margin-bottom: 1.5rem;
}

.about-content p {
  font-size: 1.6rem;
  line-height: 1.7;
  color: #c7d3da;
  margin-bottom: 2rem;
}

/* ===== services ===== */
.service {
  background: var(--bg-color);
}

.service h2 {
  margin-bottom: 5rem;
}

.service-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
}

.service-box {
  background: var(--second-bg-color);
  padding: 4rem 3rem;
  border-radius: 2rem;
  text-align: center;
  border: 1px solid rgba(0, 171, 240, 0.15);
  transform-style: preserve-3d;
  transition: transform 0.15s ease-out, box-shadow 0.3s ease, border-color 0.3s ease;
  will-change: transform;
}

.service-box:hover {
  border-color: var(--main-color);
  box-shadow: 0 1rem 3rem rgba(0, 171, 240, 0.25);
}

.service-box i {
  font-size: 5.5rem;
  color: var(--main-color);
  margin-bottom: 2rem;
  transform: translateZ(30px);
}

.service-box h3 {
  font-size: 2.4rem;
  margin-bottom: 1.2rem;
  transform: translateZ(20px);
}

.service-box p {
  font-size: 1.5rem;
  color: #c7d3da;
  line-height: 1.6;
  margin-bottom: 2rem;
  transform: translateZ(10px);
}

/* ===== portfolio ===== */
.portfolio {
  background: var(--second-bg-color);
}

.portfolio h2 {
  margin-bottom: 5rem;
}

.portfolio-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
}

.portfolio-box {
  position: relative;
  border-radius: 2rem;
  overflow: hidden;
  box-shadow: 0 0 1rem rgba(0, 0, 0, 0.3);
  transform-style: preserve-3d;
  transition: transform 0.15s ease-out;
  will-change: transform;
}

.portfolio-box img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.portfolio-box:hover img {
  transform: scale(1.1);
}

.portfolio-layer {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 3rem 2rem;
  background: linear-gradient(180deg, transparent 40%, rgba(8, 27, 41, 0.95) 100%);
  opacity: 0;
  transform: translateY(2rem);
  transition: 0.4s ease;
}

.portfolio-box:hover .portfolio-layer {
  opacity: 1;
  transform: translateY(0);
}

.portfolio-layer h4 {
  font-size: 2.2rem;
  margin-bottom: 1rem;
}

.portfolio-layer p {
  font-size: 1.4rem;
  color: #c7d3da;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.portfolio-layer a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 4.5rem;
  height: 4.5rem;
  background: var(--main-color);
  border-radius: 50%;
  font-size: 2rem;
  color: var(--bg-color);
}

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

.contact h2 {
  margin-bottom: 3rem;
}

.contact form {
  max-width: 70rem;
  margin: 0 auto;
  text-align: center;
}

.contact form .input-box {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}

.contact form .input-box input,
.contact form textarea {
  width: 100%;
  padding: 1.5rem;
  font-size: 1.6rem;
  color: var(--text-color);
  background: var(--second-bg-color);
  border-radius: 1rem;
  margin: 0.7rem 0;
  border: 1px solid rgba(0, 171, 240, 0.2);
  transition: border-color 0.3s ease;
}

.contact form .input-box input {
  width: 49%;
}

.contact form .input-box input:focus,
.contact form textarea:focus {
  outline: none;
  border-color: var(--main-color);
}

.contact form textarea {
  resize: none;
}

.contact form .btn {
  margin-top: 2rem;
  cursor: pointer;
}

/* ===== footer ===== */
footer {
  min-height: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2rem 9%;
  background: var(--second-bg-color);
}

.footer-text p {
  font-size: 1.4rem;
  color: #c7d3da;
}

.footer-iconTop a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 4rem;
  height: 4rem;
  background: var(--main-color);
  border-radius: 0.8rem;
  transition: 0.4s ease;
}

.footer-iconTop a:hover {
  transform: translateY(-6px);
}

.footer-iconTop a i {
  font-size: 2.4rem;
  color: var(--bg-color);
}

/* ===== light theme ===== */
body.light {
  --bg-color: #f4f9fc;
  --second-bg-color: #e4eff5;
  --text-color: #081b29;
}

body.light .header {
  background: rgba(244, 249, 252, 0.8);
}

body.light .home-content p,
body.light .about-content p,
body.light .service-box p,
body.light .portfolio-layer p,
body.light .footer-text p {
  color: #33474f;
}

body.light #bg-canvas {
  opacity: 0.35;
}

/* ===== reveal base ===== */
.reveal {
  opacity: 0;
}

/* ===== responsive ===== */
@media (max-width: 1200px) {
  html { font-size: 55%; }
}

@media (max-width: 991px) {
  .header { padding: 2rem 4%; }
  section { padding: 10rem 4% 2rem; }
  .service-container,
  .portfolio-container { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  #menuicon { display: block; }

  .navbar {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    padding: 1rem 4%;
    background: var(--second-bg-color);
    flex-direction: column;
    clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
    transition: 0.3s ease;
  }

  .navbar.active {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  }

  .navbar a {
    display: block;
    margin: 1.5rem 0;
    font-size: 2rem;
  }

  .home { flex-direction: column-reverse; text-align: center; }
  .home-content h1 { font-size: 4.5rem; }
  .about { flex-direction: column; text-align: center; }
  .about-content .heading { text-align: center; }
  .service-container,
  .portfolio-container { grid-template-columns: 1fr; }
  .contact form .input-box input { width: 100%; }
  footer { flex-direction: column; gap: 1.5rem; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
/* ===== small additions ===== */
.navbar a.current {
  color: var(--main-color);
  border-bottom: 3px solid var(--main-color);
}

.contact-alt {
  margin-top: 2.5rem;
  font-size: 1.5rem;
  text-align: center;
  opacity: 0.85;
}

.contact-alt a {
  color: var(--main-color);
}

body.light .contact-alt a {
  color: #0077b6;
}
