/* RESET browser preset styling */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

/* Respect user preference for reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

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

h1 {
  color: var(--secondary-text-color);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

h2 {
  font-size: 2rem;
  color: var(--primary-text-color);
  text-align: center;
  margin-bottom: 1.5rem;
}

h3 {
  font-size: 1.375rem;
  font-weight: 600;
}

p {
  overflow-wrap: break-word;
  font-family: "Poppins", sans-serif;
  color: var(--secondary-text-color);
}

button,
input,
textarea {
  font: inherit;
}

section {
  padding: var(--section-padding);
}

.services-subtitle,
.projects-subtitle,
.contact-subtitle {
  font-size: 1.125rem;
  text-align: center;
  margin-bottom: 1.5rem;
  opacity: 0.8;
  font-family: "Poppins", sans-serif;
  color: var(--secondary-text-color);
}

.projects-subtitle,
.contact-subtitle {
  max-width: 40.625rem;
  margin: 0 auto;
}

/* VARIABLES */

:root {
  /* COLORS */
  --primary-bg-color: #101a2e;
  --secondary-bg-color: #0d1321;
  --primary-text-color: #98bbf5;
  --secondary-text-color: #f8f9fa;

  /* Sections */
  --section-padding: 5rem 1rem;

  /* Cards */
  --card-border-radius: 0.75rem;
  --card-padding: 1.875rem;
  --card-bg-color: #1c304f;
}

.services-grid,
.contact-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18.75rem, 1fr));
  gap: 2.5rem;
  margin-top: 3rem;
}

/* GENERAL STYLES */

body {
  font-family: "Inter", sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  height: 100dvh;
  background-color: var(--primary-bg-color);
  overflow-x: hidden;
}

/* Header */
header {
  background-color: var(--primary-bg-color);
  padding: 1.5rem 0;
  color: var(--secondary-text-color);
  position: fixed;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
  transition: box-shadow 0.3s ease-in-out;
}

.container {
  width: 90%;
  max-width: 75rem;
  margin: 0 auto;
}

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

.logo-text {
  text-decoration: none;
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: 0.05rem;
  color: var(--primary-text-color);
  transition: color 0.3s ease-out;
}

nav ul {
  display: flex;
  list-style: none;
}

nav a {
  text-decoration: none;
  margin-inline: 0.5em;
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--secondary-text-color);
  transition: color 0.3s ease-out;
}

nav a:hover {
  color: var(--primary-text-color);
}

.no-scroll {
  overflow: hidden;
  height: 100dvh;
}

nav .resume-mobile {
  display: none;
}

.resume-button {
  background-color: var(--primary-text-color);
  color: var(--primary-bg-color);
  padding: 0.5rem 1rem;
  text-decoration: none;
  display: inline-block;
  border: none;
  border-radius: 0.5rem;
  font-size: 1.125rem;
  font-weight: 500;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  transition: background-color 0.3s ease-out, box-shadow 0.3s ease-out,
    transform 0.3s ease-out;
}

.resume-button:hover {
  background-color: var(--card-bg-color);
  color: var(--secondary-text-color);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.25);
}

.resume-button:active {
  transform: scale(0.97);
}

/* Hide default checkbox */
#menu-toggle {
  display: none;
}

/* Hamburger icon */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  position: relative;
  z-index: 1000;
}

.hamburger span {
  background-color: var(--secondary-text-color);
  width: 1.875rem;
  height: 0.1875rem;
  margin: 0.1875rem 0;
  transition: 0.3s ease;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 12.5rem 1rem 9.375rem;
}

.hero span {
  color: var(--primary-text-color);
  font-weight: 700;
}

.hero h1 {
  font-size: 3.75rem;
  font-weight: 400;
  max-width: 50rem;
  margin: 0 auto;
  animation: heroHeading 2s forwards;
}

@keyframes heroHeading {
  0% {
    top: -150px;
  }

  100% {
    top: 10px;
  }
}

.hero h1,
.hero p {
  position: relative;
}

.hero p {
  line-height: 1.5;
}

.wave {
  display: inline-block;
  animation: wave 1.5s infinite ease-in-out;
}

@keyframes wave {
  0%,
  50%,
  100% {
    transform: rotate(20deg);
  }

  25%,
  75% {
    transform: rotate(0deg);
  }
}

.hero p {
  font-size: 1.125rem;
  max-width: 37.5rem;
  margin: 2rem auto;
  opacity: 0.8;
  animation: heroSubtext 2s forwards;
}

@keyframes heroSubtext {
  0% {
    left: -1000px;
  }

  100% {
    left: 0;
  }
}

.hero-buttons a {
  padding: 0.75rem 1.5rem;
  margin: 0 0.5rem;
  border-radius: 0.5rem;
  font-size: 1.0625rem;
  font-weight: 500;
  text-decoration: none;
  display: inline-block;
  opacity: 0;
  transition: background-color 0.3s ease-out, color 0.3s ease-out,
    box-shadow 0.3s ease-out, transform 0.3s ease-out;
  animation: heroButton 2s forwards 2s;
}

.hero-buttons i {
  margin-right: 0.25rem;
}

@keyframes heroButton {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

.contact-me-btn {
  border: 2px solid var(--primary-text-color);
  color: var(--primary-text-color);
  box-shadow: 0 4px 6px rgba(152, 187, 245, 0.2);
}

.view-projects-btn {
  background-color: var(--primary-text-color);
  color: var(--card-bg-color);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.hero-buttons a:hover {
  background-color: var(--card-bg-color);
  color: var(--secondary-text-color);
  border: var(--primary-bg-color);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.25);
  transform: translateY(-2px);
}

.hero-buttons a:active {
  transform: scale(0.97);
}

/* Services Section (What I Build + Tools) */
#services-skills {
  text-align: center;
}

.services-subtitle {
  font-weight: 400;
}

.service-card {
  border-radius: var(--card-border-radius);
  border-right: none;
  border-left: none;
  border-top: 5px solid var(--primary-text-color);
  border-bottom: 5px solid var(--primary-text-color);
  padding: var(--card-padding);
  box-shadow: 0 4px 6px rgba(152, 187, 245, 0.2);
  transition: transform 0.3s ease-in-out;
}

/* Hover lift for devices that support hover */
@media (hover: hover) {
  .service-card:hover {
    transform: scale(1.05);
  }
}

/* Tap feedback on all devices */
.service-card:active {
  transform: scale(1.05);
}

.service-card i {
  font-size: 2rem;
  color: var(--primary-text-color);
  margin-bottom: 1rem;
}

.service {
  font-size: 1.375rem;
  margin-bottom: 0.875rem;
  color: var(--secondary-text-color);
}

.service-description {
  font-size: 0.9875rem;
  opacity: 0.8;
}

/* Skills */
.skills-title {
  text-align: center;
  color: var(--primary-text-color);
  font-size: 1.75rem;
  margin-top: 3rem;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.skill-card {
  background-color: var(--card-bg-color);
  border: var(--primary-bg-color);
  border-radius: var(--card-border-radius);
  padding: var(--card-padding);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.3s ease-in-out;
}

/* Hover lift for devices that support hover */
@media (hover: hover) {
  .skill-card:hover {
    transform: translateY(-5px);
  }
}

/* Tap feedback on all devices */
.skill-card:active {
  transform: translateY(-5px);
}

.skill-card img {
  margin-bottom: 1rem;
}

.skill {
  color: var(--secondary-text-color);
}

/* Projects Section */
#projects {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.projects-subtitle {
  font-weight: 400;
}

.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 3rem;
}

.project-card {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem;
  padding: var(--card-padding);
}

.project-card img {
  width: 100%;
  height: auto;
  border-radius: 0.5rem;
}

.project-name {
  margin-bottom: 1rem;
  font-size: 1.375rem;
  color: var(--secondary-text-color);
}

.project-name:hover {
  color: var(--primary-text-color);
}

.project-description {
  color: var(--primary-text-color);
  font-size: 0.9875rem;
  margin-bottom: 1rem;
  text-align: justify;
  opacity: 0.8;
}

.project-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.project-tools span {
  padding: 0.3125rem 0.625rem;
  color: var(--primary-text-color);
  border: 1px solid var(--primary-text-color);
  border-radius: 0.5rem;
  font-size: 0.8125rem;
}

.project-link-buttons {
  display: flex;
  gap: 1rem;
}

.project-link-buttons a {
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  text-decoration: none;
  font-weight: 500;
  margin-top: 1.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  transition: background-color 0.3s ease-out, box-shadow 0.3s ease-out,
    transform 0.3s ease-out;
}

.project-link-buttons i {
  margin-right: 0.1875rem;
}

.live-link-btn {
  background-color: var(--card-bg-color);
  color: var(--secondary-text-color);
}

.github-link-btn {
  background-color: #d16748;
  color: #000;
}

.project-link-buttons a:hover {
  background-color: var(--primary-text-color);
  color: var(--card-bg-color);
  border: var(--primary-bg-color);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.25);
  transform: translateY(-2px);
}

.project-link-buttons a:active {
  transform: scale(0.97);
}

/* About Section */
#about p {
  opacity: 0.8;
}

.about-content {
  display: flex;
  gap: 2.5rem;
  justify-content: space-between;
  align-items: center;
}

.about-text {
  flex: 1 1 50%;
}

.about-title {
  text-align: start;
}

.about-description {
  font-size: 1.15rem;
  margin-bottom: 1rem;
  text-align: justify;
}

.about-description span {
  color: var(--primary-text-color);
  font-weight: 600;
}

.dotcampus-link {
  color: var(--primary-text-color);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}

.dotcampus-link:hover,
.dotcampus-link:focus {
  border-bottom-color: var(--primary-text-color);
  outline: none;
}

.about-image-container {
  width: 300px; /* Keep it consistent with image size */
  height: 400px;
  perspective: 1000px; /* Adds 3D depth */
}

/* Inner wrapper for flipping */
.about-image-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s ease-in-out;
  will-change: transform; /* prevents image blur */
}

.about-image-container:hover .about-image-inner {
  transform: rotateY(180deg);
}

.about-image {
  width: 300px;
  height: 400px;
  border: var(--primary-bg-color);
  border-radius: 0.625rem;
  object-fit: cover;
  position: absolute;
  backface-visibility: hidden;
}

.back-image {
  transform: rotateY(180deg);
}

/* Contact Section */
#contact {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.contact-info {
  align-items: start;
}

.contact-card {
  background-color: var(--secondary-bg-color);
  border-radius: var(--card-border-radius);
  padding: var(--card-padding);
  max-width: 37.5rem;
  width: 100%;
  margin: 0 auto;
}

.contact-card h3,
.contact-card h4 {
  font-weight: 600;
}

.contact-card h3 {
  margin-bottom: 2rem;
}

.contact-card h4 {
  margin: 2rem 0 0.5rem;
  font-size: 1.375rem;
}

.contact-card .location {
  opacity: 0.8;
  font-size: 0.9875rem;
}

.contact-card h3,
.contact-card h4,
.contact-card p {
  color: var(--primary-text-color);
}

.social-links {
  list-style: none;
  padding: 0;
}

.social-links li {
  margin-bottom: 1rem;
}

.social-links li,
.social-links li a {
  color: var(--primary-text-color);
}

.social-links li a {
  text-decoration: none;
}

.social-links li a:hover {
  text-decoration: underline;
}

.social-links i {
  margin-right: 0.625rem;
  font-size: 1.25rem;
}

#contact-form {
  max-width: 37.5rem;
  margin: 0 auto;
  width: 100%;
}

.form-group {
  display: flex;
  flex-direction: column;
  text-align: left;
}

#contact-form label {
  color: var(--primary-text-color);
  font-size: 1.125rem;
  font-weight: 500;
}

#contact-form input,
#contact-form textarea {
  padding: 0.75rem;
  border: none;
  border-radius: 0.5rem;
  width: 100%;
  font-size: 0.9375rem;
  margin: 0.3125rem 0 0.625rem;
  background-color: var(--secondary-bg-color);
  color: var(--secondary-text-color);
  outline: none;
}

#contact-form textarea {
  resize: vertical;
  min-height: 3.75rem;
}

#contact-form input:focus,
#contact-form textarea:focus {
  border: 2px solid var(--primary-text-color);
}

#contact-form button {
  border: var(--primary-bg-color);
  border-radius: 0.5rem;
  padding: 0.75rem 1.5rem;
  margin-top: 0.75rem;
  cursor: pointer;
  width: 100%;
  font-size: 1.0625rem;
  font-weight: 500;
  background-color: var(--primary-text-color);
  color: var(--card-bg-color);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  transition: background-color 0.3s ease-out, box-shadow 0.3s ease-out,
    transform 0.3s ease-out;
}

#contact-form button:hover {
  background-color: #6d96db;
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.25);
}

#contact-form button:active {
  transform: scale(0.97);
}

/* Contact Form error-message */
.error-message {
  color: red;
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

/* Footer */
footer {
  padding: 2.5rem 1rem 1.25rem;
  background-color: var(--secondary-bg-color);
  color: var(--secondary-text-color);
  position: relative;
}

.footer-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15.625rem, 1fr));
  gap: 2rem;
  max-width: 75rem;
  margin: 0 auto;
}

.footer-section h3 {
  margin-bottom: 1rem;
}

.footer-logo {
  display: inline-block;
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.05rem;
  margin-bottom: 1rem;
  color: var(--primary-text-color);
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-section p,
.footer-links a {
  font-size: 0.95rem;
  opacity: 0.8;
}

.footer-links a {
  text-decoration: none;
  color: var(--secondary-text-color);
  transition: color 0.3s ease-out;
}

.footer-links,
.social-icons {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links a:hover,
.social-icons a:hover {
  color: var(--primary-text-color);
}

.social-icons {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

.social-icons a {
  color: var(--secondary-text-color);
  font-size: 1.25rem;
  transition: color 0.3s ease-out;
}

.copyright {
  font-size: 0.875rem;
  opacity: 0.7;
  text-align: center;
  margin-top: 3rem;
}

.back-to-top-btn {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  z-index: 1000;
  text-decoration: none;
  background-color: var(--primary-text-color);
  color: var(--card-bg-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.back-to-top-btn:hover {
  opacity: 0.8;
}

.back-to-top-btn:active {
  transform: scale(0.97);
}

/* RESPONSIVENESS */

/* Media Queries */
@media (max-width: 767px) {
  .logo-text {
    font-size: 1.5rem;
  }

  .hamburger {
    display: flex;
  }

  nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 80%;
    height: 100dvh;
    background-color: var(--secondary-bg-color);
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    opacity: 0;
    text-align: center;
    padding: 7.5rem 0;
  }

  nav ul {
    flex-direction: column;
  }

  nav li {
    margin: 0.625rem 0;
  }

  nav .resume-mobile {
    display: block;
    margin: auto;
    width: auto;
    max-width: fit-content;
    box-sizing: border-box;
    padding: 0.625rem 1.25rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease-out, color 0.3s ease-out,
      box-shadow 0.3s ease-out, transform 0.3s ease-out;
  }

  nav .resume-mobile:hover {
    background-color: var(--card-bg-color);
    color: var(--clr-neutral-white);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.25);
  }

  nav .resume-mobile:active {
    transform: scale(0.97);
  }

  .resume-desktop {
    display: none;
  }

  /* Show menu when checkbox is checked */
  #menu-toggle:checked + .hamburger + nav {
    transform: translateX(0);
    opacity: 1;
  }

  /* Animate Hamburger icon */
  #menu-toggle:checked + .hamburger span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 5px);
  }

  #menu-toggle:checked + .hamburger span:nth-child(2) {
    opacity: 0;
  }

  #menu-toggle:checked + .hamburger span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -5px);
  }

  .hero h1 {
    font-size: 2.25rem;
    line-height: 1.4;
  }

  .hero p {
    font-size: 1rem;
  }

  .hero-buttons {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  .about-content {
    flex-direction: column-reverse;
  }

  .about-title {
    text-align: center;
  }

  .services-grid,
  .project-card,
  .contact-info {
    grid-template-columns: 1fr;
  }

  .project-card {
    gap: 1.5rem;
    padding: var(--card-padding) 0;
  }
}

@media (min-width: 768px) and (max-width: 1199px) {
  .logo-text {
    font-size: 1.625rem;
  }

  .hamburger {
    display: flex;
  }

  nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 80%;
    height: 100dvh;
    background-color: var(--secondary-bg-color);
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    opacity: 0;
    text-align: center;
    padding: 7.5rem 0;
  }

  nav ul {
    flex-direction: column;
  }

  nav li {
    margin: 0.625rem 0;
  }

  nav .resume-mobile {
    display: block;
    margin: auto;
    width: auto;
    max-width: fit-content;
    box-sizing: border-box;
    padding: 0.625rem 1.25rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease-out, color 0.3s ease-out,
      box-shadow 0.3s ease-out, transform 0.3s ease-out;
  }

  nav .resume-mobile:hover {
    background-color: var(--card-bg-color);
    color: var(--clr-neutral-white);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.25);
  }

  nav .resume-mobile:active {
    transform: scale(0.97);
  }

  .resume-desktop {
    display: none;
  }

  /* Show menu when checkbox is checked */
  #menu-toggle:checked + .hamburger + nav {
    transform: translateX(0);
    opacity: 1;
  }

  /* Animate Hamburger icon */
  #menu-toggle:checked + .hamburger span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 5px);
  }

  #menu-toggle:checked + .hamburger span:nth-child(2) {
    opacity: 0;
  }

  #menu-toggle:checked + .hamburger span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -5px);
  }

  .hero h1 {
    font-size: 2.5rem;
    max-width: 40.625rem;
    line-height: 1.4;
  }

  .hero p {
    font-size: 1.0625rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  .about-content {
    flex-direction: column-reverse;
  }

  .about-title {
    text-align: center;
  }

  .services-subtitle,
  .projects-subtitle,
  .contact-subtitle {
    max-width: 37.5rem;
    margin: 0 auto;
  }

  .project-card,
  .contact-info {
    grid-template-columns: 1fr;
  }

  .project-card {
    gap: 1.5rem;
  }
}
