/* ============================================================
  1. Design Tokens (CSS Variables)
  ============================================================ */
:root {
  /* Base Palette */
  --clr-bg:         #f8f9fa;
  --clr-card:       rgba(255,255,255,0.95); /* Light glass */
  --clr-text:       #212529;
  --clr-primary:    #9d69cb;
  --clr-heading-bg: var(--clr-primary);
  --clr-heading:    #fff;
  --clr-header-bg:  rgba(255,255,255,0.88);
  --clr-header-text:#212529;
  --clr-h2:         #212529;
  --clr-white:      #fff;
  --radius:         1rem;
  --switch-w: 118px;
  --switch-h: 46px;
  --switch-pad: 6px;
  --sun-size: 20px;
  --bg-color-light: #f0f0e8;
  --bg-color-dark:  #1c2135;
  --border-color-light: #1c2135;
  --border-color-dark:  #f0f0e8;
  --sun-color:   #fabc1c;
  --moon-color:  #fffdf2;
  --day-bg-color:   #0dbdf6;
  --night-bg-color: #272a30;
  --cloud-color: #fffdf2;
  --star-color:  #fffdf2;
  --switch-stroke: 2px;
}


/* Dark Theme Overrides */
html[data-theme="dark"] {
  --clr-bg:         #121212;
  --clr-white:      #1e1e1e;
  --clr-text:       #e9ecef;
  --clr-primary:    #9d69cb;
  --clr-card:       rgba(32,32,35,0.9);
  --clr-h2:         #ffffff;
  --clr-header-bg:  rgba(18,18,18,0.88);
  --clr-header-text:#e9ecef;
}

/* ============================================================
  2. Reset & Base Styles
  ============================================================ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, sans-serif;
}
html {
  background: var(--clr-bg);
}
body {
  background: transparent;
  color: var(--clr-text);
  line-height: 1.6;
}

/* ============================================================
  3. Typography
  ============================================================ */
h2 {
  font-size: 1.25rem;
  margin-bottom: .75rem;
  color: var(--clr-h2);
}
section p + p {
  margin-top: 1.25rem;
}

/* ============================================================
  4. Layout & Containers
  ============================================================ */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
section {
  margin: 3rem auto;
  max-width: 900px;
  padding: 0 1rem;
}

/* ============================================================
  5. Header
  ============================================================ */
header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--clr-header-bg);
  color: var(--clr-header-text);
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 6px rgba(0,0,0,.04);
  border-bottom: 1px solid rgba(0,0,0,.06);
}
header h1,
header nav a {
  color: var(--clr-header-text);
}
header nav a {
  font-weight: 500;
  margin-left: 1.5rem;
  text-decoration: none;
  transition: color .15s;
}
header nav a:hover {
  color: var(--clr-primary);
}

/* Header Responsive */
@media (max-width: 600px) {
  header {
   padding: .75rem 0;
  }
  header nav a {
   margin-left: 0;
   margin-right: 1rem;
  }
}
@media (max-width: 350px) {
  header {
   padding: .55rem 0;
  }
  header nav a {
   font-size: .85rem;
  }
}

/* ============================================================
  6. Footer
  ============================================================ */
footer {
  background: var(--clr-white);
  color: #6c757d;
  font-size: .875rem;
  text-align: center;
  padding: 1.5rem 0;
  border-top: 1px solid #e9ecef;
  box-shadow: 0 2px 4px rgba(0,0,0,.05);
}

/* ============================================================
  7. Cards & Grids
  ============================================================ */
.grid {
  display: grid;
  gap: 1.5rem;
}
@media (min-width: 700px) {
  .grid {
   grid-template-columns: repeat(2, 1fr);
  }
}
.card {
  background: var(--clr-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 2px 6px rgba(0,0,0,.06);
  transition: .2s;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
}

/* ============================================================
  8. Floating “Glass” Text Cards
  ============================================================ */
.text-card {
  background: var(--clr-card);
  backdrop-filter: blur(1px);
  padding: 1.5rem 2rem;
  border-radius: var(--radius);
  box-shadow: 0 4px 14px rgba(0,0,0,.06);
}
@media (max-width: 600px) {
  .text-card {
   padding: 1.25rem;
  }
}
/* About section: extra solid background, no blur */
#about .text-card {
  background: var(--clr-card);
  backdrop-filter: none;
}

/* ============================================================
  9. About Section
  ============================================================ */
.about-flex {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}
.about-img {
  max-width: 350px;
  border-radius: 100%;
  box-shadow: 0 2px 10px rgba(0,0,0,.1);
  flex-shrink: 0;
}
.about-text {
  max-width: 600px;
}
@media (min-width: 768px) {
  .about-flex {
   flex-direction: row;
   align-items: flex-start;
  }
}

/* ============================================================
  10. Resume Section
  ============================================================ */
#resume {
  margin-bottom: 4rem;
}
/* Desktop: show embed, hide button */
.resume-embed {
  width: 100%;
  height: calc(100vh - 12rem);
  border: 1px solid #d9d9d9;
  border-radius: .5rem;
  overflow: hidden;
}
.resume-download {
  display: none;
}
/* Mobile: hide embed, show button */
@media (max-width: 768px) {
  .resume-embed {
   display: none;
  }
  .resume-download {
   display: inline-block;
   margin-top: 1rem;
   width: 100%;
   text-align: center;
   padding: .9rem 1.2rem;
   font-size: 1.05rem;
  }
}

/* ============================================================
  11. Contact Section
  ============================================================ */
.contact-list {
  list-style: none;
  margin: 1rem 0 2rem;
  padding-left: 0;
}
.contact-list li {
  margin-bottom: .5rem;
}
.contact-form label,
.contact-form input,
.contact-form textarea {
  display: block;
  width: 100%;
  margin-bottom: 1rem;
}
.contact-form input,
.contact-form textarea {
  padding: .5rem;
  border: 1px solid #ccc;
  border-radius: .25rem;
}
.contact-form button {
  padding: .6rem 1.2rem;
  background: var(--clr-primary);
  color: #fff;
  border: none;
  border-radius: .25rem;
  cursor: pointer;
  transition: background .2s;
}
.contact-form button:hover {
  background: #9d69cb;
}
/* Inline feedback */
#formStatus {
  margin-top: .75rem;
  font-weight: 600;
  color: var(--clr-primary);
}
#formStatus.error {
  color: #d9534f;
}

/* ============================================================
  12. Utilities
  ============================================================ */
.btn {
  display: inline-block;
  background: var(--clr-primary);
  color: #fff;
  padding: .65rem 1.25rem;
  border-radius: .4rem;
  text-decoration: none;
  font-weight: 600;
  transition: background .2s;
}
.btn:hover {
  background: #9c77bd;;
}
.contact-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}
.contact-btn {
  background-color: #343a40;
  font-size: 0.95rem;
}
.contact-btn:hover {
  background-color: #495057;
}
@media (max-width: 600px) {
  .contact-buttons {
   flex-direction: column;
   align-items: center;
  }
}
.centered {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

/* ============================================================
  13. Miscellaneous
  ============================================================ */
/* Full-viewport canvas for three.js background */
#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  display: block;
  pointer-events: none;
}
header, main, footer {
  position: relative;
  z-index: 1;
}
/* Embedded objects (e.g. PDF) */
object {
  border: 1px solid #ccc;
  border-radius: .5rem;
  margin-top: 1rem;
}



/* button footprint */
/* button footprint */
.theme-switcher-grid {
  width: var(--switch-w);
  height: var(--switch-h);
  padding: var(--switch-pad);
  display: grid;
  grid-template-columns: repeat(54, 1fr); /* scale with button */
  grid-template-rows: repeat(24, 1fr);
  border-radius: calc(var(--switch-h) / 2);
  background: var(--day-bg-color);
  /* border: 1.5px solid var(--switch-border-light); */
  cursor: pointer;
  position: relative;
  overflow: hidden; /* keep balls/stars inside pill */
  line-height: 0;   /* remove inline baseline wiggle */
}
.theme-switcher-grid { border: 0; box-shadow: inset 0 0 0 2px var(--switch-border-light); }
.theme-switcher-grid.night-theme { box-shadow: inset 0 0 0 2px var(--switch-border-dark); }



.theme-switcher-grid.night-theme{
  background-color: var(--night-bg-color);
  border-color: var(--border-color-dark);
}
header .theme-switcher-grid{ margin-left: 12px; }

/* Sun / Moon */
.sun{
  grid-column: 4 / 22;
  grid-row:    4 / 22;
  width: 100%;
  height: 100%;            /* no fixed 20px -> centers correctly */
  border-radius: 50%;
  background: var(--sun-color);
  transition: grid-column 1s ease, background-color 1s ease;
}

.theme-switcher-grid.night-theme .sun{
  grid-column: 33 / 51;
  background-color: var(--moon-color);
}

/* The crescent cutout — sits on top of the sun */
.moon-overlay{
  grid-column: 38 / 50;
  grid-row:    6  / 18;
  border-radius: 50%;
  background: var(--day-bg-color);
  opacity: 0;              /* hidden in day */
  transition: opacity 1s ease, background-color 1s ease;
  z-index: 1;
}

.theme-switcher-grid.night-theme .moon-overlay{
  background: var(--night-bg-color);
  opacity: 1;
}

/* Clouds (day) -> tiny dots (night) */
.cloud-ball{
  --d: calc(var(--switch-h) * .22);
  width: var(--d); height: var(--d);
  border-radius: 50%;
  background: var(--cloud-color);
  transition: all 1s ease;
  z-index: 2;
}
#ball1{ grid-column: 12/15; grid-row: 11/14; }
#ball2{ grid-column: 16/19; grid-row: 11/14; }
#ball3{ grid-column: 20/23; grid-row: 11/14; }
#ball4{ grid-column: 15/18; grid-row:  8/11; }

.theme-switcher-grid.night-theme #ball1,
.theme-switcher-grid.night-theme #ball2,
.theme-switcher-grid.night-theme #ball3,
.theme-switcher-grid.night-theme #ball4{
  width: 2px; height: 2px; background: var(--star-color);
}


/* Stars (night) */
.star{
  width: 2px; height: 2px; border-radius: 50%;
  background: var(--star-color);
  opacity: 0; transition: opacity 1s ease;
}
#star1{ grid-column: 27/28; grid-row:  6/7; }
#star2{ grid-column: 31/32; grid-row: 11/12; }
#star3{ grid-column: 38/39; grid-row:  8/9; }
#star4{ grid-column: 42/43; grid-row: 15/16; }

.theme-switcher-grid.night-theme .star{ opacity: 1; }



