/* GENERAL - CSS variables for theming */
:root {
  --bg-primary: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
  --bg-card: rgba(255, 255, 255, 0.6);
  --bg-card-hover: rgba(255, 255, 255, 0.85);
  --text-primary: #1a1a1a;
  --text-secondary: rgb(85, 85, 85);
  --accent-start: #2b5876;
  --accent-end: #4e4376;
  --border-subtle: rgba(255, 255, 255, 0.4);
  --shadow-card: 0 8px 32px 0 rgba(31, 38, 135, 0.05);
  --shadow-hover: 0 12px 40px 0 rgba(31, 38, 135, 0.1);
  --nav-bg: rgba(253, 251, 251, 0.9);
  --nav-border: transparent;
}

body.dark {
  --bg-primary: linear-gradient(160deg, #0f0f12 0%, #1a1a24 50%, #12121a 100%);
  --bg-card: rgba(30, 30, 40, 0.7);
  --bg-card-hover: rgba(40, 40, 55, 0.9);
  --text-primary: #e8e8ed;
  --text-secondary: rgba(200, 200, 210, 0.85);
  --accent-start: #5b8def;
  --accent-end: #a78bfa;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 12px 40px 0 rgba(0, 0, 0, 0.4);
  --nav-bg: rgba(15, 15, 18, 0.92);
  --nav-border: rgba(255, 255, 255, 0.06);
}

* {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Poppins", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: background 0.4s ease, color 0.3s ease;
}

html {
  scroll-behavior: smooth;
}

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

/* Skip to main content - visible on focus for accessibility */
.skip-link {
  position: absolute;
  top: -3rem;
  left: 1rem;
  z-index: 1001;
  padding: 0.6rem 1rem;
  background: var(--accent-start);
  color: #fff;
  border-radius: 0.25rem;
  font-weight: 600;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 1rem;
  outline: 2px solid var(--accent-end);
  outline-offset: 2px;
}

/* Theme toggle button */
.theme-toggle {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--accent-start);
  background: var(--bg-card);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.theme-toggle:hover {
  transform: scale(1.08);
  box-shadow: var(--shadow-hover);
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent-start);
  outline-offset: 2px;
}
.theme-icon {
  position: absolute;
  font-size: 1.2rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.theme-icon.sun { opacity: 1; }
body.dark .theme-icon.sun { opacity: 0; }
body.dark .theme-icon.moon { opacity: 1; }

/* TRANSITION */

a,
.btn {
  transition: all 300ms ease;
}

/* DESKTOP NAV - Sticky with blur */
.main-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--nav-border);
  transition: background 0.3s ease, border-color 0.3s ease;
}

nav,
.nav-links {
  display: flex;
}

nav {
  justify-content: space-around;
  align-items: center;
  height: 17vh;
}

.nav-links {
  gap: 2rem;
  list-style: none;
  font-size: 1.5rem;
}

a {
  color: var(--text-primary);
  text-decoration: none;
  text-decoration-color: var(--accent-start);
}
a:focus-visible {
  outline: 2px solid var(--accent-start);
  outline-offset: 2px;
}
a:hover {
  color: var(--accent-start);
  text-decoration: underline;
  text-underline-offset: 0.4rem;
  text-decoration-color: var(--accent-start);
}
.nav-links a.active {
  color: var(--accent-start);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.4rem;
}

.logo {
  font-size: 2rem;
}

.logo:hover {
  cursor: default;
}

/* HAMBURGER MENU */

#hamburger-nav {
  display: none;
}

.hamburger-menu {
  position: relative;
  display: inline-block;
}

.hamburger-icon {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 24px;
  width: 30px;
  cursor: pointer;
}

.hamburger-icon span {
  width: 100%;
  height: 2px;
  background-color: var(--text-primary);
  transition: all 0.3s ease-in-out;
}

.menu-links {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--nav-border);
  border-radius: 0.5rem;
  width: fit-content;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease-in-out;
  box-shadow: var(--shadow-card);
}

.menu-links a {
  display: block;
  padding: 10px;
  text-align: center;
  font-size: 1.5rem;
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.3s ease-in-out;
}

.menu-links li {
  list-style: none;
}

.menu-links.open {
  max-height: 300px;
}

.hamburger-icon.open span:first-child {
  transform: rotate(45deg) translate(10px, 5px);
}

.hamburger-icon.open span:nth-child(2) {
  opacity: 0;
}

.hamburger-icon.open span:last-child {
  transform: rotate(-45deg) translate(10px, -5px);
}

.hamburger-icon span:first-child {
  transform: none;
}

.hamburger-icon span:first-child {
  opacity: 1;
}

.hamburger-icon span:first-child {
  transform: none;
}

/* SECTIONS */

section {
  padding-top: 4vh;
  height: 96vh;
  margin: 0 10rem;
  box-sizing: border-box;
  min-height: fit-content;
}

.section-container {
  display: flex;
}

/* PROFILE SECTION */

#profile {
  display: flex;
  justify-content: center;
  gap: 5rem;
  height: 80vh;
}

.section__pic-container {
  display: flex;
  height: 400px;
  width: 400px;
  margin: auto 0;
}

.section__text {
  align-self: center;
  text-align: center;
}

.section__text p {
  font-weight: 600;
}

.section__text__p1 {
  text-align: center;
}

.section__text__p2 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.title {
  font-family: "Outfit", sans-serif;
  font-size: 3rem;
  text-align: center;
  background: linear-gradient(45deg, var(--accent-start), var(--accent-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

#socials-container {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
  gap: 1rem;
}

/* ICONS */

.icon {
  cursor: pointer;
  height: 2rem;
}

/* BUTTONS */

.btn-container {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.btn {
  font-weight: 600;
  transition: all 300ms ease;
  padding: 1rem;
  width: 8rem;
  border-radius: 2rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.btn-color-1,
.btn-color-2 {
  border: 2px solid var(--accent-start);
  color: var(--text-primary);
}

.btn-color-1:hover,
.btn-color-2:hover {
  cursor: pointer;
}

.btn-color-1,
.btn-color-2:hover {
  background: var(--accent-start);
  color: #fff;
}

.btn-color-1:hover {
  background: var(--accent-end);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(43, 88, 118, 0.35);
}

.btn-color-2 {
  background: transparent;
}

.btn-color-2:hover {
  border-color: var(--accent-end);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(78, 67, 118, 0.2);
}

.btn:focus-visible {
  outline: 2px solid var(--accent-start);
  outline-offset: 2px;
}

.btn-container {
  gap: 1rem;
}

/* ABOUT SECTION */

#about {
  position: relative;
}

.about-containers {
  gap: 2rem;
  margin-bottom: 2rem;
  margin-top: 2rem;
}

.about-details-container {
  justify-content: center;
  flex-direction: column;
}

.about-containers,
.about-details-container {
  display: flex;
}

/* About section: fixed portrait frame so the photo isn't stretched */
.about__pic-container {
  width: 320px;
  height: 400px;
  min-width: 320px;
  min-height: 400px;
  border-radius: 2rem;
  overflow: hidden;
}

.about-pic {
  border-radius: 2rem;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.arrow {
  position: absolute;
  right: -5rem;
  bottom: 2.5rem;
}

.details-container {
  padding: 1.5rem;
  flex: 1;
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border-radius: 2rem;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.details-container:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
  background: var(--bg-card-hover);
}

.section-container {
  gap: 4rem;
  height: 80%;
}

.section__pic-container {
  height: 400px;
  width: 400px;
  margin: auto 0;
}

#about .section__pic-container.about__pic-container {
  width: 320px;
  height: 400px;
}

/* EXPERIENCE SECTION */

#experience {
  position: relative;
}

.experience-sub-title {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 1.75rem;
  margin-bottom: 2rem;
}

.experience-details-container {
  display: flex;
  justify-content: center;
  flex-direction: column;
}

.article-container {
  display: flex;
  text-align: initial;
  flex-wrap: wrap;
  flex-direction: row;
  gap: 2.5rem;
  justify-content: space-around;
}

article {
  display: flex;
  width: 10rem;
  justify-content: space-around;
  gap: 0.5rem;
}

article .icon {
  cursor: default;
}

/* PROJECTS SECTION */

#projects {
  position: relative;
}

.color-container {
  border-color: var(--border-subtle);
  background: var(--bg-card);
}

.project-img {
  border-radius: 2rem;
  width: 90%;
  height: 90%;
  transition: transform 0.3s ease;
}

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

.project-title {
  margin: 1rem;
  color: var(--text-primary);
}

.project-btn {
  color: var(--text-primary);
  border-color: var(--accent-start);
}

.profile-img {
  border-radius: 50%;
  object-fit: cover;
  object-position: center 38%;
  width: 400px;
  height: 400px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.project-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: center;
  margin: 0.5rem 0 1rem;
  line-height: 1.4;
  max-width: 100%;
}

.project-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  width: 100%;
}

.more-projects {
  text-align: center;
  margin-top: 1rem;
  font-size: 1rem;
}

.more-projects a {
  color: var(--accent-start);
  font-weight: 600;
}

/* ACHIEVEMENTS */
#achievements {
  position: relative;
}

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

.achievement-list {
  text-align: left;
  list-style: none;
  padding-left: 0;
  color: var(--text-secondary);
  line-height: 1.7;
}

.achievement-list li {
  margin-bottom: 0.75rem;
  padding-left: 1.25rem;
  position: relative;
}

.achievement-list li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--accent-start);
  font-weight: bold;
}

/* CONTACT */

#contact {
  display: flex;
  justify-content: center;
  flex-direction: column;
  height: 70vh;
  min-height: 420px;
}

.contact-info-upper-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  border-radius: 2rem;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(10px);
  margin: 2rem auto;
  padding: 0.5rem;
  transition: transform 0.3s ease, background 0.3s ease;
}

.contact-info-upper-container:hover {
  transform: translateY(-5px);
}

.contact-info-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 1rem;
}

.contact-info-container p {
  font-size: larger;
}

.contact-icon {
  cursor: default;
}

.email-icon {
  height: 2.5rem;
}

/* FOOTER SECTION */

footer {
  height: 26vh;
  margin: 0 1rem;
}

footer p {
  text-align: center;
  color: var(--text-secondary);
}

/* Scroll-triggered reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .reveal.revealed { opacity: 1; }
}

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 999;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-start);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: bold;
  text-decoration: none;
  box-shadow: var(--shadow-hover);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease, background 0.2s ease;
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--accent-end);
  color: #fff;
  transform: translateY(-3px);
}
.back-to-top:focus-visible {
  outline: 2px solid var(--accent-end);
  outline-offset: 2px;
}
