/* ==========================================================================
   Suyash — Portfolio
   --------------------------------------------------------------------------
   1. Design tokens (themes)
   2. Reset & base
   3. Layout primitives  (.section, glass, cards, buttons)
   4. Ambient background
   5. Components
        5.1  Header / navigation
        5.2  Theme toggle (animated sun & moon)
        5.3  Hamburger + mobile menu
        5.4  Hero
        5.5  About
        5.6  Experience
        5.7  Skills
        5.8  Projects
        5.9  Contact
        5.10 Footer
   6. Motion / reveal
   7. Responsive  (laptop → tablet → mobile → small)
   ========================================================================== */

/* ==========================================================================
   1. DESIGN TOKENS
   ========================================================================== */
:root {
  --font-display: "Sora", sans-serif;
  --font-body: "Manrope", sans-serif;

  --radius-sm: 14px;
  --radius: 22px;
  --radius-lg: 30px;

  --transition: 320ms cubic-bezier(0.4, 0, 0.2, 1);
  --container: 1180px;
}

/* --- Dark theme (default) --- */
html[data-theme="dark"] {
  --bg: #0c0e13;
  --bg-elevated: #14171f;

  --text: #e8eaf0;
  --text-soft: #a4abba;
  --text-muted: #767d8e;

  --glass-bg: rgba(255, 255, 255, 0.045);
  --glass-bg-strong: rgba(28, 32, 42, 0.82);
  --glass-border: rgba(255, 255, 255, 0.09);
  --glass-highlight: rgba(255, 255, 255, 0.16);
  --menu-bg: rgba(20, 23, 31, 0.97);

  --shadow: 0 18px 50px -12px rgba(0, 0, 0, 0.7);
  --shadow-hover: 0 28px 60px -14px rgba(0, 0, 0, 0.55);

  --accent: #6e9bff;
  --accent-2: #9d8bff;
  --accent-3: #4fd6c0;

  --blob-1: rgba(70, 95, 170, 0.32);
  --blob-2: rgba(110, 90, 165, 0.26);
  --blob-3: rgba(55, 150, 135, 0.2);

  --button-solid-bg: #e8eaf0;
  --button-solid-text: #0c0e13;

  --grain-opacity: 0.045;

  /* theme-toggle sky */
  --sky: linear-gradient(160deg, #1b2440, #0e1530);
  --star-opacity: 1;
}

/* --- Light theme --- */
html[data-theme="light"] {
  --bg: #eef1f8;
  --bg-elevated: #e4e8f4;

  --text: #141728;
  --text-soft: #3f4660;
  --text-muted: #6b7390;

  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-bg-strong: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.8);
  --glass-highlight: rgba(255, 255, 255, 0.95);
  --menu-bg: rgba(255, 255, 255, 0.97);

  --shadow: 0 18px 45px -14px rgba(60, 76, 140, 0.32);
  --shadow-hover: 0 28px 55px -16px rgba(60, 76, 140, 0.4);

  --accent: #3f6fe0;
  --accent-2: #7b54e0;
  --accent-3: #14b89a;

  --blob-1: rgba(120, 150, 255, 0.5);
  --blob-2: rgba(170, 130, 255, 0.4);
  --blob-3: rgba(60, 210, 180, 0.38);

  --button-solid-bg: #141728;
  --button-solid-text: #eef1f8;

  --grain-opacity: 0.035;

  /* theme-toggle sky */
  --sky: linear-gradient(160deg, #7fbcff, #d3e8ff);
  --star-opacity: 0;
}

/* ==========================================================================
   2. RESET & BASE
   ========================================================================== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

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

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

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

ul {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* Keyboard skip link — hidden until focused */
.skip-link {
  position: fixed;
  top: 10px;
  left: 50%;
  z-index: 200;
  transform: translateX(-50%) translateY(-150%);
  padding: 0.7rem 1.3rem;
  border-radius: 100px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--button-solid-text);
  background: var(--button-solid-bg);
  transition: transform var(--transition);
}

.skip-link:focus-visible {
  transform: translateX(-50%) translateY(0);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ==========================================================================
   3. LAYOUT PRIMITIVES
   ========================================================================== */

/* --- Section wrapper --- */
.section {
  max-width: var(--container);
  margin-inline: auto;
  padding: 7rem 2rem 4rem;
  position: relative;
}

.section__eyebrow {
  text-align: center;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.section__title {
  text-align: center;
  font-size: clamp(2.2rem, 4vw, 3.1rem);
  font-weight: 800;
  margin-bottom: 3rem;
}

/* --- Glass surface --- */
.glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--glass-border);
}

/* --- Card --- */
.card {
  position: relative;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.7rem;
  transition: transform var(--transition), background var(--transition),
    border-color var(--transition), box-shadow var(--transition);
}

/* subtle bevel highlight */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    145deg,
    var(--glass-highlight),
    transparent 45%,
    transparent 70%,
    var(--glass-highlight)
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.55;
  pointer-events: none;
}

.card:hover {
  transform: translateY(-6px);
  background: var(--glass-bg-strong);
  box-shadow: var(--shadow-hover);
}

.card--center {
  text-align: center;
}
.card--left {
  text-align: left;
}

.card h3 {
  font-size: 1.12rem;
  margin-bottom: 0.45rem;
}

.card p {
  font-size: 0.95rem;
}

.card__meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.card__meta b {
  color: var(--accent);
}

/* --- Buttons --- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85rem 1.6rem;
  border-radius: 100px;
  border: 1px solid transparent;
  transition: transform var(--transition), box-shadow var(--transition),
    background var(--transition), color var(--transition),
    border-color var(--transition);
}

.button:hover {
  transform: translateY(-3px);
}

.button--glass {
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-color: var(--glass-border);
  color: var(--text);
}

.button--glass:hover {
  border-color: var(--accent);
  box-shadow: 0 10px 30px -8px var(--blob-1);
}

.button--solid {
  background: var(--button-solid-bg);
  color: var(--button-solid-text);
}

.button--solid:hover {
  box-shadow: 0 12px 32px -8px var(--blob-2);
}

.button--sm {
  padding: 0.55rem 1.1rem;
  font-size: 0.85rem;
}

.button-row {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* --- Role accent --- */
.hero__role-accent {
  color: var(--accent);
  font-weight: 700;
}

/* invert dark-mode icon assets so they read on dark backgrounds */
html[data-theme="dark"] .social-link img,
html[data-theme="dark"] .contact__icon {
  filter: invert(1) brightness(1.7);
}

/* ==========================================================================
   4. AMBIENT BACKGROUND
   ========================================================================== */
.background {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background: radial-gradient(
    120% 120% at 50% 0%,
    var(--bg-elevated) 0%,
    var(--bg) 60%
  );
}

.background__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.7;
  will-change: transform;
}

.background__blob--1 {
  width: 46vw;
  height: 46vw;
  background: var(--blob-1);
  top: -12vw;
  left: -8vw;
  animation: drift-1 22s ease-in-out infinite alternate;
}

.background__blob--2 {
  width: 40vw;
  height: 40vw;
  background: var(--blob-2);
  top: 38vh;
  right: -12vw;
  animation: drift-2 26s ease-in-out infinite alternate;
}

.background__blob--3 {
  width: 36vw;
  height: 36vw;
  background: var(--blob-3);
  bottom: -14vw;
  left: 28vw;
  animation: drift-3 30s ease-in-out infinite alternate;
}

@keyframes drift-1 {
  to {
    transform: translate(8vw, 10vh) scale(1.15);
  }
}
@keyframes drift-2 {
  to {
    transform: translate(-10vw, -6vh) scale(1.1);
  }
}
@keyframes drift-3 {
  to {
    transform: translate(6vw, -8vh) scale(0.9);
  }
}

.background__grain {
  position: absolute;
  inset: -200%;
  opacity: var(--grain-opacity);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ==========================================================================
   5. COMPONENTS
   ========================================================================== */

/* ---- 5.1 Header / navigation ------------------------------------------- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 74px;
  padding: 0 2rem;
  margin: 14px auto 0;
  max-width: var(--container);
  width: calc(100% - 2.5rem);
  border-radius: 100px;
}

#mobile-nav {
  display: none;
}

.navbar__logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.navbar__logo span {
  color: var(--accent);
}

.navbar__links {
  display: flex;
  gap: 2rem;
  font-size: 0.98rem;
  font-weight: 500;
}

.navbar__links a {
  position: relative;
  color: var(--text-soft);
  padding: 4px 2px;
}

.navbar__links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width var(--transition);
}

.navbar__links a:hover {
  color: var(--text);
}

.navbar__links a:hover::after {
  width: 100%;
}

.navbar__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* ---- 5.2 Theme toggle (animated sun & moon) ---------------------------- */
/*
   Structure:
   .theme-toggle            – the <button>
     .theme-toggle__sky     – the rounded track (day / night sky)
       .theme-toggle__stars – star field, visible only at night
       .theme-toggle__body  – the celestial body, slides left↔right via `left`
         .theme-toggle__sun   – sun disc + rays
         .theme-toggle__moon  – full moon disc + craters
   The horizontal slide is a CSS transition on `left`; the rise/set arc is a
   keyframe (`celestial-arc`) played only while `.is-animating` is present,
   so `transform` is free for the vertical dip and never fights the slide.
*/
.theme-toggle {
  padding: 0;
  border-radius: 100px;
}

.theme-toggle__sky {
  position: relative;
  display: block;
  width: 66px;
  height: 32px;
  border-radius: 100px;
  background: var(--sky);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  transition: background var(--transition), border-color var(--transition);
}

.theme-toggle:hover .theme-toggle__sky {
  border-color: var(--accent);
}

/* star field */
.theme-toggle__stars,
.theme-toggle__stars::before,
.theme-toggle__stars::after {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #fff;
}

.theme-toggle__stars {
  top: 8px;
  right: 12px;
  opacity: var(--star-opacity);
  transition: opacity var(--transition);
  box-shadow: 0 0 0 0 #fff;
}

.theme-toggle__stars::before {
  content: "";
  top: 9px;
  left: -5px;
  transform: scale(0.8);
}

.theme-toggle__stars::after {
  content: "";
  top: -3px;
  left: -12px;
  transform: scale(0.6);
}

/* celestial body wrapper – horizontal slide lives here */
.theme-toggle__body {
  position: absolute;
  top: 50%;
  left: 4px;
  width: 24px;
  height: 24px;
  margin-top: -12px;
  transition: left var(--transition);
}

html[data-theme="light"] .theme-toggle__body {
  left: calc(100% - 28px);
}

/* play the rise/set arc while toggling */
.theme-toggle.is-animating .theme-toggle__body {
  animation: celestial-arc var(--transition) ease-in-out;
}

@keyframes celestial-arc {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(11px); /* dips below the horizon mid-travel */
  }
  100% {
    transform: translateY(0);
  }
}

/* sun + moon are stacked; opacity crossfades by theme */
.theme-toggle__sun,
.theme-toggle__moon {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  transition: opacity var(--transition);
}

/* full sun: glowing disc + radiating rays */
.theme-toggle__sun {
  background: radial-gradient(circle, #ffe07a 36%, #ffb13c 60%, #ff9d2e 70%);
  box-shadow: 0 0 10px 1px rgba(255, 180, 70, 0.75);
  opacity: 0;
}

.theme-toggle__sun::before {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: repeating-conic-gradient(
    #ffc83d 0deg 7deg,
    transparent 7deg 45deg
  );
  -webkit-mask: radial-gradient(circle, transparent 56%, #000 58%);
  mask: radial-gradient(circle, transparent 56%, #000 58%);
}

html[data-theme="light"] .theme-toggle__sun {
  opacity: 1;
}

/* full moon: pale disc + craters */
.theme-toggle__moon {
  background: radial-gradient(circle at 38% 32%, #ffffff, #c7ccdd 75%);
  box-shadow: 0 0 8px 1px rgba(180, 190, 220, 0.55);
  opacity: 1;
}

html[data-theme="light"] .theme-toggle__moon {
  opacity: 0;
}

.theme-toggle__crater {
  position: absolute;
  border-radius: 50%;
  background: rgba(120, 128, 150, 0.45);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.15);
}

.theme-toggle__crater--a {
  width: 6px;
  height: 6px;
  top: 5px;
  left: 12px;
}
.theme-toggle__crater--b {
  width: 4px;
  height: 4px;
  top: 13px;
  left: 6px;
}
.theme-toggle__crater--c {
  width: 5px;
  height: 5px;
  top: 14px;
  left: 14px;
}

/* ---- 5.3 Hamburger + mobile menu --------------------------------------- */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 26px;
  height: 18px;
}

.hamburger span {
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform var(--transition), opacity var(--transition);
}

.hamburger.is-open span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.hamburger.is-open span:nth-child(2) {
  opacity: 0;
}
.hamburger.is-open span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.mobile-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 210px;
  max-height: 0;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--menu-bg);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  backdrop-filter: blur(30px) saturate(180%);
  box-shadow: var(--shadow);
  transition: max-height var(--transition), padding var(--transition);
}

.mobile-menu.is-open {
  max-height: 360px;
  padding: 6px 0;
}

.mobile-menu a {
  display: block;
  padding: 13px 20px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-soft);
  border-bottom: 1px solid var(--glass-border);
}

.mobile-menu li:last-child a {
  border-bottom: none;
}

.mobile-menu a:hover {
  color: var(--text);
  background: var(--glass-bg);
}

/* ---- 5.4 Hero ---------------------------------------------------------- */
.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5rem;
  min-height: calc(100vh - 110px);
  padding-top: 3rem;
}

.hero__photo {
  position: relative;
  flex-shrink: 0;
  width: 360px;
  height: 360px;
}

.hero__photo img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
}

.hero__photo-glow {
  position: absolute;
  inset: -14%;
  border-radius: 50%;
  filter: blur(36px);
  opacity: 0.55;
  background: conic-gradient(
    from 0deg,
    var(--accent),
    var(--accent-2),
    var(--accent-3),
    var(--accent)
  );
  animation: spin 14s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.hero__text {
  max-width: 460px;
  text-align: center;
  margin-inline: auto;
}

.hero__name {
  font-size: clamp(3rem, 6vw, 4.4rem);
  font-weight: 800;
}

.hero__role {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0.3rem 0 0.8rem;
}

.hero__summary {
  color: var(--text-muted);
  font-size: 0.98rem;
  margin-bottom: 1.8rem;
}

/* --- Socials --- */
.social-row {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  margin-top: 1.6rem;
}

.social-link {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: transform var(--transition), border-color var(--transition);
}

.social-link:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.social-link img {
  width: 22px;
  height: 22px;
}

/* ---- 5.5 About --------------------------------------------------------- */
.about {
  display: flex;
  align-items: center;
  gap: 3.5rem;
}

.about__photo {
  flex-shrink: 0;
  width: 380px;
  height: 380px;
}

.about__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
}

.about__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.about__cards {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.about__cards .card {
  flex: 1;
  min-width: 220px;
}

.about__bio p {
  text-align: justify;
  font-size: 0.97rem;
}

/* ---- 5.6 Experience ---------------------------------------------------- */
.experience-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

/* ---- 5.7 Skills -------------------------------------------------------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.skill-group {
  padding: 1.8rem;
}

.skill-group__head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.4rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--glass-border);
}

.skill-group__head h3 {
  font-size: 1.08rem;
  font-weight: 700;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.chip {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-soft);
  padding: 0.45rem 0.85rem;
  border-radius: 100px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  transition: color var(--transition), border-color var(--transition),
    background var(--transition), transform var(--transition);
}

.chip:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--glass-bg-strong);
  transform: translateY(-2px);
}

/* ---- 5.8 Projects ------------------------------------------------------ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.project {
  display: flex;
  flex-direction: column;
  padding: 1.8rem;
}

.project__title {
  font-size: 1.15rem;
  margin-bottom: 0.7rem;
}

.project__desc {
  flex: 1;
  font-size: 0.9rem;
  margin-bottom: 1.4rem;
}

.project__link {
  width: 100%;
}

/* ---- 5.9 Contact ------------------------------------------------------- */
.contact {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem 2.5rem;
  max-width: 640px;
  margin-inline: auto;
  padding: 1.4rem 2rem;
}

.contact__item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-soft);
  font-size: 1rem;
}

.contact__item:hover {
  color: var(--accent);
}

.contact__icon {
  width: auto;
  height: 1.5rem;
}

/* ---- 5.10 Footer ------------------------------------------------------- */
.footer {
  max-width: var(--container);
  margin: 2rem auto 0;
  padding: 2.5rem 2rem 3rem;
  border-top: 1px solid var(--glass-border);
  text-align: center;
}

.footer__links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1.2rem;
  font-size: 0.98rem;
  font-weight: 500;
}

.footer__links a {
  color: var(--text-soft);
}

.footer__links a:hover {
  color: var(--text);
}

.footer__copy {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ---- 5.11 Résumé modal ------------------------------------------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.modal[hidden] {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 14, 0.6);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: modal-fade var(--transition) ease;
}

.modal__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(860px, 100%);
  height: min(90vh, 1100px);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  overflow: hidden;
  animation: modal-rise var(--transition) cubic-bezier(0.4, 0, 0.2, 1);
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--glass-border);
}

.modal__title {
  font-size: 1.15rem;
}

.modal__actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.modal__close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-soft);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  transition: color var(--transition), border-color var(--transition),
    transform var(--transition);
}

.modal__close:hover {
  color: var(--text);
  border-color: var(--accent);
  transform: rotate(90deg);
}

.modal__body {
  flex: 1;
  background: #fff; /* PDF viewers expect a light surface */
}

.modal__pdf {
  width: 100%;
  height: 100%;
  border: none;
}

@keyframes modal-fade {
  from {
    opacity: 0;
  }
}

@keyframes modal-rise {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
  }
}

/* ==========================================================================
   6. MOTION / REVEAL
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .background__blob,
  .hero__photo-glow {
    animation: none;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .theme-toggle.is-animating .theme-toggle__body {
    animation: none;
  }
  .modal__backdrop,
  .modal__panel {
    animation: none;
  }
}

/* ==========================================================================
   7. RESPONSIVE   laptop → tablet → mobile → small
   ========================================================================== */

/* ---- Laptop (≤ 1200px) ---- */
@media (max-width: 1200px) {
  :root {
    --container: 1000px;
  }
  .hero {
    gap: 3rem;
  }
  .hero__photo {
    width: 320px;
    height: 320px;
  }
  .skill-group {
    padding: 1.4rem;
  }
}

/* ---- Tablet (≤ 1024px) ---- */
@media (max-width: 1024px) {
  #desktop-nav {
    display: none;
  }
  #mobile-nav {
    display: flex;
  }

  .section {
    padding: 6rem 1.75rem 4rem;
  }

  .hero {
    flex-direction: column;
    gap: 2.5rem;
    min-height: auto;
    padding-top: 2.5rem;
  }

  .about {
    flex-direction: column;
    gap: 2rem;
  }
  .about__photo {
    width: 320px;
    height: 320px;
  }
  .about__content {
    width: 100%;
  }

  .experience-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .skills-grid {
    grid-template-columns: 1fr;
  }
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---- Large mobile (≤ 768px) ---- */
@media (max-width: 768px) {
  .section {
    padding: 5.5rem 1.5rem 3.5rem;
  }
  .section__title {
    margin-bottom: 2.2rem;
  }

  .experience-grid,
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .about__cards {
    flex-direction: column;
  }
  .contact {
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
  }
}

/* ---- Mobile (≤ 600px) ---- */
@media (max-width: 600px) {
  .section {
    padding: 5rem 1.15rem 3rem;
  }

  .navbar {
    height: 64px;
    padding: 0 1rem;
    width: calc(100% - 1.4rem);
    margin-top: 10px;
  }
  .navbar__logo {
    font-size: 1.3rem;
  }

  .hero__photo,
  .about__photo {
    width: 240px;
    height: 240px;
  }
  .hero__name {
    font-size: 2.6rem;
  }
  .section__title {
    font-size: 2rem;
  }
  .hero__role {
    font-size: 1.3rem;
  }
  .hero__summary {
    font-size: 0.92rem;
  }

  .button {
    padding: 0.8rem 1.4rem;
    font-size: 0.9rem;
  }

  .card,
  .skill-group,
  .project {
    padding: 1.4rem;
  }
  .mobile-menu {
    width: 190px;
  }
  .footer__links {
    gap: 1.2rem;
    flex-wrap: wrap;
  }

  /* Performance: shrink blur surfaces and drop the blend-mode grain —
     large blurred elements + mix-blend-mode are costly on mobile GPUs. */
  .background__blob {
    filter: blur(80px);
  }
  .background__blob--1 {
    width: 70vw;
    height: 70vw;
  }
  .background__blob--2,
  .background__blob--3 {
    width: 65vw;
    height: 65vw;
  }
  .background__grain {
    display: none;
  }

  .modal {
    padding: 0.75rem;
  }
  .modal__panel {
    height: 92vh;
  }
}

/* ---- Small mobile (≤ 380px) ---- */
@media (max-width: 380px) {
  .hero__photo,
  .about__photo {
    width: 200px;
    height: 200px;
  }
  .hero__name {
    font-size: 2.2rem;
  }
  .hero__role {
    font-size: 1.1rem;
  }
  .button-row {
    flex-direction: column;
    width: 100%;
  }
  .button {
    width: 100%;
  }
  .chip {
    font-size: 0.78rem;
    padding: 0.4rem 0.7rem;
  }
}
