/* ══════════════════════════════════════════════════════════════════════
   STYLE.CSS — Portfolio Stylesheet
   ══════════════════════════════════════════════════════════════════════

   TABLE OF CONTENTS
   ─────────────────
   1.  Fonts
   2.  Custom Properties
   3.  Reset & Global
   4.  Scrollbar
   5.  Preloader
   6.  Navbar
   7.  Hero
   8.  Resume Section
   9.  Projects Section
   10. Contact Section
   11. Footer
   12. Responsive Breakpoints
       12a. ≤ 1500px
       12b. ≤ 1100px
       12c. ≤ 870px (mobile)
       12d. ≤ 540px (small mobile)
   ══════════════════════════════════════════════════════════════════════ */

/* ══════════════════════════════
   1. FONTS
══════════════════════════════ */

@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@400..900&family=Montserrat:ital,wght@0,100..900;1,100..900&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Raleway:ital,wght@0,100..900;1,100..900&family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap");

/* ══════════════════════════════
   2. CUSTOM PROPERTIES
══════════════════════════════ */

:root {
  --primary-bg: #020617;
  --secondary-bg: #0f172a;
  --text-clr: #f8fafc;
  --text-hover: #cbd5e1;
  --card-color: #1e293b;
  --card-border: #94a3b8;
  --default-font: "Source Sans 3", serif;
  --para-font: "Montserrat", serif;
  --cinzel-font: "Cinzel", serif;
  --raleway-font: "Raleway", serif;
  --poppins-font: "Poppins", serif;
  /* Disable pinch-zoom on touch devices */
  touch-action: pan-x pan-y;
  height: 100%;
}

/* ══════════════════════════════
   3. RESET & GLOBAL
══════════════════════════════ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--default-font);
}

body {
  background: var(--primary-bg);
}

section h2 {
  text-align: center;
  font-size: 2rem;
  font-family: var(--raleway-font);
}

/* Animated underline on all anchor tags */
a {
  position: relative;
  text-decoration: none;
  color: var(--text-clr);
  transition: color 0.2s;
}

a:hover {
  color: var(--text-hover);
}

a::after {
  content: "";
  position: absolute;
  height: 1.5px;
  right: 0;
  bottom: 0;
  width: 0;
  background: var(--text-hover);
  transition: width 0.2s;
}

a:hover::after {
  width: 100%;
}

/* ══════════════════════════════
   4. SCROLLBAR
══════════════════════════════ */

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-thumb {
  background-color: var(--text-hover);
  border: var(--text-hover);
}

::-webkit-scrollbar-track {
  background-color: var(--primary-bg);
}

/* ══════════════════════════════
   5. PRELOADER
══════════════════════════════ */

#loader {
  position: fixed;
  inset: 0;
  background: #020617;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition:
    opacity 0.5s ease,
    visibility 0.5s ease;
}

#loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-logo {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  opacity: 0;
  transform: scale(0.85);
  animation: fadeScaleIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.3s forwards;
}

.loader-bar-wrap {
  width: 48px;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  opacity: 0;
  animation: fadeIn 0.4s ease 0.8s forwards;
}

.loader-bar {
  height: 100%;
  width: 0%;
  background: #ffffff;
  border-radius: 2px;
  animation: fillBar 1.4s cubic-bezier(0.4, 0, 0.2, 1) 0.9s forwards;
}

.loader-name {
  font-family: Georgia, serif;
  font-size: 11px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 14px;
  opacity: 0;
  animation: fadeIn 0.5s ease 1s forwards;
}

@keyframes fadeScaleIn {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

@keyframes fillBar {
  0% {
    width: 0%;
  }
  60% {
    width: 80%;
  }
  100% {
    width: 100%;
  }
}

/* ══════════════════════════════
   6. NAVBAR
══════════════════════════════ */

header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: transparent;
  backdrop-filter: blur(10px);
  box-shadow: 0px 1px 10px var(--secondary-bg);
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-clr);
  padding: 15px 50px;
}

nav > span > h1 {
  font-family: var(--cinzel-font);
  font-weight: 500;
  font-size: 1.7rem;
}

#navbar {
  list-style: none;
  display: flex;
  gap: 10px;
}

/* Hamburger — hidden on desktop, shown on mobile */
#menu {
  display: none;
}

/* ══════════════════════════════
   7. HERO
══════════════════════════════ */

#hero {
  background-color: var(--secondary-bg);
  color: var(--text-clr);
  height: 50vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 30px 150px;
}

#hero > h1 {
  font-family: var(--raleway-font);
  font-size: 3rem;
  font-weight: 600;
}

#hero > h2 {
  font-family: var(--cinzel-font);
  font-size: 2rem;
  font-weight: 500;
}

#hero > p {
  font-family: var(--para-font);
  margin-top: 15px;
  font-size: 1.1rem;
}

/* ══════════════════════════════
   8. RESUME SECTION
══════════════════════════════ */

#resumesec {
  background-color: var(--primary-bg);
  color: var(--text-clr);
  padding: 50px 50px 50px 150px;
}

/* Sticky section heading + download link */
.container {
  display: flex;
}

.items {
  width: 70%;
}

.heading {
  width: fit-content;
  height: fit-content;
  position: sticky;
  top: 50px;
  left: 0;
  padding-top: 50px;
}

.heading > h2 {
  text-align: left;
}

.heading > a {
  font-family: var(--para-font);
}

/* Experience & Education cards */
#experience {
  background-color: var(--card-color);
  color: var(--text-clr);
  border-top: 4px solid var(--card-border);
  min-width: 500px;
  max-width: 65%;
  margin-inline: auto;
  padding: 30px 20px 40px 20px;
  margin-bottom: 40px;
}

#experience > h2 {
  margin-bottom: 30px;
}

#experience > .resumeitem:nth-child(2) {
  padding-bottom: 0;
}

#education {
  background-color: var(--card-color);
  color: var(--text-clr);
  border-top: 4px solid var(--card-border);
  min-width: 500px;
  max-width: 65%;
  margin-inline: auto;
  padding: 30px 20px 40px 20px;
}

#education > h2 {
  margin-bottom: 30px;
}

/* Timeline items — left-border + dot indicator */
.resumeitem {
  padding: 0 0 35px 25px;
  position: relative;
  border-left: 2px solid var(--card-border);
  left: 15px;
  top: 0;
}

.resumeitem:nth-child(3) {
  padding-bottom: 0;
}

.resumeitem::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50px;
  left: -11px;
  top: 0;
  background: var(--card-border);
  border: 2px solid var(--card-border);
}

.resumeitem > h4 {
  font-family: var(--para-font);
  font-size: 1.3rem;
  margin-bottom: 4px;
}

.resumeitem > h3 {
  font-family: var(--raleway-font);
  font-size: 1.7rem;
  margin-bottom: 4px;
}

.resumeitem > h5 {
  font-family: var(--poppins-font);
  font-weight: 400;
  color: #999999;
  font-size: 1.2rem;
}

/* ══════════════════════════════
   9. PROJECTS SECTION
══════════════════════════════ */

#prjsec {
  background-color: var(--secondary-bg);
  color: var(--text-clr);
  padding: 50px 50px 50px 150px;
}

/* Project links inside resume items */
.prjdemo {
  position: absolute;
  right: 5px;
  top: 15px;
}

.prjdemo a {
  margin-right: 5px;
  font-family: var(--poppins-font);
  font-size: 0.9rem;
}

.heading > p {
  font-family: var(--para-font);
}

.heading {
  width: 30%;
}

.img img {
  width: 450px;
}

/* Hover-dimming card group: non-hovered cards fade to 0.5 opacity */
.cards {
  width: fit-content;
  max-width: 950px;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid var(--card-border);
  padding: 10px;
  margin-bottom: 40px;
  transition: opacity 0.2s ease-in-out;
}

#cardsContainer {
  width: max-content;
  margin: auto;
}

#cardsContainer:hover .cards:not(:hover) {
  opacity: 0.5;
}

.cards:hover {
  opacity: 1;
}

.cards:last-child {
  margin-bottom: 0;
}

.content {
  position: relative;
  padding: 20px;
}

.content > h5 {
  font-family: var(--poppins-font);
}

.content > h3 {
  font-family: var(--raleway-font);
  font-size: 1.7rem;
  margin-bottom: 8px;
}

.content > p {
  font-family: var(--para-font);
  line-height: 1.5rem;
}

/* ══════════════════════════════
   10. CONTACT SECTION
══════════════════════════════ */

#contactsec {
  background-color: var(--primary-bg);
  color: var(--text-clr);
  padding: 50px 50px 50px 150px;
}

#reachout {
  width: 65%;
  margin-inline: auto;
  margin-bottom: 40px;
}

#reachout > h3 {
  font-size: 1.5rem;
  font-family: var(--raleway-font);
  margin-bottom: 10px;
}

#sociallinks {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  font-family: var(--para-font);
  font-size: 1.2rem;
}

/* Contact form */
#sendmsg {
  width: 65%;
  margin-inline: auto;
}

#sendmsg > h3 {
  font-size: 1.5rem;
  font-family: var(--raleway-font);
}

input,
textarea {
  outline: none;
  background: transparent;
  border: none;
  width: 100%;
  height: 100%;
  color: var(--text-clr);
  font-size: 1em;
  font-weight: 600;
  padding: 0 35px 0 5px;
  border-bottom: 2px solid var(--text-clr);
}

.input-box,
.message-box {
  width: 100%;
  margin: 30px 0;
  position: relative;
}

.input-box {
  height: 50px;
}

textarea {
  resize: none;
}

/* Floating labels — animate upward on focus or valid input */
.input-box label,
.message-box label {
  position: absolute;
  left: 2%;
  transform: translateY(-50%);
  font-size: 1em;
  font-weight: 500;
  opacity: 0.5;
  pointer-events: none;
  transition: all 0.5s;
  font-family: var(--raleway-font);
}

.input-box label {
  top: 50%;
}

.message-box label {
  top: 10%;
}

.input-box input:focus ~ label,
.input-box input:valid ~ label {
  top: -1px;
}

.message-box textarea:focus ~ label,
.message-box textarea:valid ~ label {
  top: -10px;
}

/* Submit button */
#result {
  width: 100%;
  height: 40px;
  background-color: var(--card-color);
  color: var(--text-clr);
  font-family: var(--para-font);
  border: none;
  outline: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

#result:hover {
  background-color: var(--secondary-bg);
}

/* Prevent autofill from overriding text color */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Inline form validation feedback */
.invalid-feedback,
.empty-feedback {
  display: none;
}

.was-validated :placeholder-shown:invalid ~ .empty-feedback {
  display: block;
}

.was-validated :not(:placeholder-shown):invalid ~ .invalid-feedback {
  display: block;
}

.is-invalid,
.was-validated :invalid {
  border-bottom: 2px solid #dc3545;
}

.empty-feedback p,
.invalid-feedback p {
  position: absolute;
  right: 0;
  top: 0;
  color: var(--text-hover);
  font-size: 0.8em;
  font-style: italic;
  font-family: var(--para-font);
  text-transform: capitalize;
}

/* ══════════════════════════════
   11. FOOTER
══════════════════════════════ */

footer {
  height: 100px;
  background-color: var(--primary-bg);
  color: var(--text-clr);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#socials > a {
  color: var(--text-clr);
  font-size: 1.5rem;
  transition: color 0.2s;
}

#socials > a:hover {
  color: var(--text-hover);
}

/* ══════════════════════════════
   12. RESPONSIVE BREAKPOINTS
══════════════════════════════ */

/* 12a. ≤ 1500px — wrap project cards to single column */
@media only screen and (max-width: 1500px) {
  .cards {
    flex-wrap: wrap;
    max-width: 500px;
  }
}

/* 12b. ≤ 1100px — add gap between resume columns */
@media only screen and (max-width: 1100px) {
  .container {
    gap: 40px;
  }
}

/* 12c. ≤ 870px — mobile layout, hamburger menu, stacked sections */
@media only screen and (max-width: 870px) {
  /* Hamburger open/close animations */
  @keyframes fade {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  @keyframes fadeOut {
    from {
      opacity: 1;
      transform: translateY(0);
    }
    to {
      opacity: 0;
      transform: translateY(-10px);
    }
  }

  /* Nav links hidden until menu opens */
  #navbar li a {
    display: none;
  }

  #menu {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5em;
  }

  #menu-close {
    display: none;
  }

  #menu-open {
    display: flex;
    justify-content: center;
    align-items: center;
  }

  nav,
  nav.navactive > span,
  #navbar li a,
  #menu-close {
    animation: fade 0.4s ease-in-out;
  }

  /* Expanded nav state */
  nav.navactive {
    flex-direction: column;
    gap: 10px;
    height: 100%;
  }

  nav.navactive #menu-open {
    display: none;
  }

  nav.navactive #menu-close {
    display: flex;
    justify-content: center;
    align-items: center;
  }

  nav.navactive #navbar li a {
    display: flex;
  }

  /* Hero — centered on mobile */
  #hero {
    align-items: center;
    padding: 50px;
  }

  /* Stacked layout for resume + projects */
  .container {
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  #resumesec {
    padding: 50px;
  }

  #prjsec {
    padding: 50px;
  }

  #contactsec {
    padding: 50px;
  }

  .heading h2, p {
    text-align: center;
  }

  .heading {
    width: 100%;
    position: relative;
    text-align: center;
    margin-bottom: 40px;
  }

  /* Scale down cards and resume blocks to fit narrow screens */
  #experience {
    margin-inline: 0;
    transform: scale(0.8);
    margin-bottom: 0;
  }

  #education {
    margin-inline: 0;
    transform: scale(0.8);
  }

  .items {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  .cards {
    transform: scale(0.8);
    margin: 0 0 -50px 0;
  }

  .cards p {
    text-align: left;
  }

  #cardsContainer {
    margin-inline: 0;
  }

  #reachout {
    margin-inline: 0;
    width: 100%;
  }

  #sendmsg {
    margin-inline: 0;
    width: 100%;
  }
}

/* 12d. ≤ 540px — small mobile adjustments */
@media only screen and (max-width: 540px) {
  nav {
    padding: 15px 40px;
  }

  #hero h1 {
    font-size: 2rem;
  }

  #hero p {
    margin-top: 10px;
    font-size: 0.95rem;
  }

  .heading {
    padding: 0;
  }

  #experience,
  #education {
    min-width: 440px;
  }

  #cardsContainer {
    width: 100%;
  }

  .cards {
    width: 100%;
    margin: 0 0 -50px 0;
  }

  .cards img {
    width: 100%;
  }

  #prjsec {
    padding: 0 0 50px 0;
  }

  #resumesec {
    padding: 0 0 50px 0;
  }

  #contactsec {
    padding: 30px;
  }
}
