/*! HTML5 Boilerplate v9.0.1 | MIT License | https://html5boilerplate.com/ */

/* main.css 3.0.0 | MIT License | https://github.com/h5bp/main.css#readme */
/*
 * What follows is the result of much research on cross-browser styling.
 * Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
 * Kroc Camen, and the H5BP dev community and team.
 */

/* ==========================================================================
   Base styles: opinionated defaults
   ========================================================================== */

html {
  color: #222;
  font-size: 1em;
  line-height: 1.4;
}

/*
 * Remove text-shadow in selection highlight:
 * https://twitter.com/miketaylr/status/12228805301
 *
 * Customize the background color to match your design.
 */

::-moz-selection {
  background: #b3d4fc;
  text-shadow: none;
}

::selection {
  background: #b3d4fc;
  text-shadow: none;
}

/*
 * A better looking default horizontal rule
 */

hr {
  display: block;
  height: 1px;
  border: 0;
  border-top: 1px solid #ccc;
  margin: 1em 0;
  padding: 0;
}

/*
 * Remove the gap between audio, canvas, iframes,
 * images, videos and the bottom of their containers:
 * https://github.com/h5bp/html5-boilerplate/issues/440
 */

audio,
canvas,
iframe,
img,
svg,
video {
  vertical-align: middle;
}

/*
 * Remove default fieldset styles.
 */

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

/*
 * Allow only vertical resizing of textareas.
 */

textarea {
  resize: vertical;
}

/* ==========================================================================
   Author's custom styles
   ========================================================================== */

/* Global Styles */
:root {
  --primary-color: #8a56c9;
  --secondary-color: #5d3b8f;
  --accent-color: #b78aea;
  --dark-color: #2d1b4a;
  --light-color: #f5f5f5;
  --text-color: #333;
  --border-radius: 12px;
  --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08); /* Reduced shadow intensity */
  --transition: all 0.3s ease;
  --content-bg-color: #f8f7fa; /* Slightly off-white with a hint of purple */
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  margin: 0;
  padding: 0;
  position: relative;
}

/* Background sections that will change on scroll */
.bg-section {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: opacity 0.8s ease-in-out;
  z-index: -1;
  opacity: 0;
}

/* Add an overlay to fade background images and improve text readability */
.bg-section::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8); /* Increased opacity to reduce glare */
}

.bg-section.active {
  opacity: 1;
}

#bg-code {
  background-image: url('../images/code.jpg');
}

#bg-code2 {
  background-image: url('../images/code2.jpg');
}

#bg-deploy {
  background-image: url('../images/deploy.jpg');
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--secondary-color);
}

.btn {
  display: inline-block;
  background-color: var(--primary-color);
  color: white;
  padding: 0.5rem 1.5rem;
  border-radius: var(--border-radius);
  text-decoration: none;
  transition: var(--transition);
  border: 2px solid var(--primary-color);
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
}

.btn:hover {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
  color: white;
}

.btn-outline {
  background-color: transparent;
  color: var(--primary-color);
}

.btn-outline:hover {
  background-color: var(--primary-color);
  color: white;
}

/* Header Styles */
header {
  background-color: var(--content-bg-color);
  box-shadow: var(--box-shadow);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

header h1 {
  margin: 0;
  font-size: 1.8rem;
  color: var(--primary-color);
}

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

nav ul li {
  margin-left: 1.5rem;
}

nav ul li a {
  color: var(--dark-color);
  font-weight: 500;
  padding: 0.5rem;
  transition: var(--transition);
}

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

/* Hero Section */
.hero {
  background-color: var(--dark-color);
  color: white;
  padding: 4rem 0;
  text-align: center;
}

.hero h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.2rem;
  max-width: 700px;
  margin: 0 auto;
  opacity: 0.9;
}

/* About Section */
.about {
  padding: 4rem 0;
}

.about h2 {
  text-align: center;
  margin-bottom: 2rem;
  color: white;
  background-color: rgba(0, 0, 0, 0.8);
  padding: 15px 25px;
  border-radius: var(--border-radius);
  display: inline-block;
  margin-left: auto;
  margin-right: auto;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7); /* Reduced text shadow */
  border: 2px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); /* Reduced box shadow */
  font-weight: 600;
  letter-spacing: 1px;
}

.about-content {
  background-color: var(--content-bg-color);
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: var(--box-shadow);
}

.bio h3 {
  color: var(--primary-color);
  margin-top: 0;
  font-size: 1.6rem;
}

.bio p {
  line-height: 1.8;
  margin-bottom: 0;
}

/* Projects Section */
.projects {
  padding: 4rem 0;
}

.projects h2 {
  text-align: center;
  margin-bottom: 3rem;
  color: white;
  background-color: rgba(0, 0, 0, 0.8);
  padding: 15px 25px;
  border-radius: var(--border-radius);
  display: inline-block;
  margin-left: auto;
  margin-right: auto;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7); /* Reduced text shadow */
  border: 2px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); /* Reduced box shadow */
  font-weight: 600;
  letter-spacing: 1px;
}

.project-grid {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.project-card {
  background-color: var(--content-bg-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow);
  transition: var(--transition);
  display: flex;
  flex-direction: row;
  opacity: 0;
  width: 100%;
  margin-bottom: 2rem;
}

/* Left side animation */
.project-card-left {
  transform: translateX(-100px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Right side animation */
.project-card-right {
  transform: translateX(100px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.project-card.animate {
  opacity: 1;
  transform: translateX(0);
}

.project-card:hover {
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.project-image {
  flex: 0 0 40%;
  background-color: var(--primary-color);
  position: relative;
  overflow: hidden;
}

.project-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.project-card:hover .project-img {
  transform: scale(1.05);
}

.project-content {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.project-content h3 {
  margin-top: 0;
  color: var(--dark-color);
  font-size: 1.4rem;
}

.project-content p {
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.project-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.project-features span {
  background-color: var(--light-color);
  padding: 0.3rem 0.8rem;
  border-radius: 30px;
  font-size: 0.8rem;
  color: var(--dark-color);
}

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

/* Footer Styles */
footer {
  background-color: var(--dark-color);
  color: white;
  padding: 3rem 0 1rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.footer-info {
  max-width: 400px;
}

.footer-info h3 {
  margin-top: 0;
  font-size: 1.5rem;
}

.footer-info a {
  color: #d4c5f7; /* Softer lavender color that's still visible but less glarey */
  font-weight: 500;
  text-decoration: underline;
}

.footer-info a:hover {
  color: #ffffff; /* White on hover for additional effect */
}

.footer-social {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.footer-social a {
  color: white;
  font-size: 1.5rem;
  transition: var(--transition);
}

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

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1rem;
  text-align: center;
  font-size: 0.9rem;
  opacity: 0.7;
}

/* Responsive Styles */
/* Mid-size screens and 1080p screens */
@media (min-width: 769px) and (max-width: 1200px) {
  .project-card {
    flex-direction: column;
  }

  .project-image {
    flex: 0 0 250px;
  }

  /* Adjust animations for mid-size screens */
  .project-card-left,
  .project-card-right {
    transform: translateY(50px);
  }

  .project-card.animate {
    transform: translateY(0);
  }
}

/* Mobile screens */
@media (max-width: 768px) {
  .project-card {
    flex-direction: column;
  }

  .project-image {
    flex: 0 0 200px;
  }

  /* Adjust animations for mobile */
  .project-card-left,
  .project-card-right {
    transform: translateY(50px);
  }

  .project-card.animate {
    transform: translateY(0);
  }

  .footer-content {
    flex-direction: column;
    gap: 2rem;
  }

  .footer-social {
    justify-content: flex-start;
  }

  .hero h2 {
    font-size: 2rem;
  }

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

/* ==========================================================================
   Helper classes
   ========================================================================== */

/*
 * Hide visually and from screen readers
 */

.hidden,
[hidden] {
  display: none !important;
}

/*
 * Hide only visually, but have it available for screen readers:
 * https://snook.ca/archives/html_and_css/hiding-content-for-accessibility
 *
 * 1. For long content, line feeds are not interpreted as spaces and small width
 *    causes content to wrap 1 word per line:
 *    https://medium.com/@jessebeach/beware-smushed-off-screen-accessible-text-5952a4c2cbfe
 */

.visually-hidden {
  border: 0;
  clip: rect(0, 0, 0, 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
  /* 1 */
}

/*
 * Extends the .visually-hidden class to allow the element
 * to be focusable when navigated to via the keyboard:
 * https://www.drupal.org/node/897638
 */

.visually-hidden.focusable:active,
.visually-hidden.focusable:focus {
  clip: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  position: static;
  white-space: inherit;
  width: auto;
}

/*
 * Hide visually and from screen readers, but maintain layout
 */

.invisible {
  visibility: hidden;
}

/*
 * Clearfix: contain floats
 *
 * The use of `table` rather than `block` is only necessary if using
 * `::before` to contain the top-margins of child elements.
 */

.clearfix::before,
.clearfix::after {
  content: "";
  display: table;
}

.clearfix::after {
  clear: both;
}

/* ==========================================================================
   EXAMPLE Media Queries for Responsive Design.
   These examples override the primary ('mobile first') styles.
   Modify as content requires.
   ========================================================================== */

@media only screen and (min-width: 35em) {
  /* Style adjustments for viewports that meet the condition */
}

@media print,
  (-webkit-min-device-pixel-ratio: 1.25),
  (min-resolution: 1.25dppx),
  (min-resolution: 120dpi) {
  /* Style adjustments for high resolution devices */
}

/* ==========================================================================
   Print styles.
   Inlined to avoid the additional HTTP request:
   https://www.phpied.com/delay-loading-your-print-css/
   ========================================================================== */

@media print {
  *,
  *::before,
  *::after {
    background: #fff !important;
    color: #000 !important;
    /* Black prints faster */
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }

  abbr[title]::after {
    content: " (" attr(title) ")";
  }

  /*
   * Don't show links that are fragment identifiers,
   * or use the `javascript:` pseudo protocol
   */
  a[href^="#"]::after,
  a[href^="javascript:"]::after {
    content: "";
  }

  pre {
    white-space: pre-wrap !important;
  }

  pre,
  blockquote {
    border: 1px solid #999;
    page-break-inside: avoid;
  }

  tr,
  img {
    page-break-inside: avoid;
  }

  p,
  h2,
  h3 {
    orphans: 3;
    widows: 3;
  }

  h2,
  h3 {
    page-break-after: avoid;
  }
}

