:root {
  --neutral-base: oklch(51.04% 0.15228 262.262);
  --neutral-900: oklch(from var(--neutral-base) 0.15 c h);
  --neutral-800: oklch(from var(--neutral-base) 0.25 c h);
  --neutral-700: oklch(from var(--neutral-base) 0.35 c h);
  --neutral-600: oklch(from var(--neutral-base) 0.45 c h);
  --neutral-500: oklch(from var(--neutral-base) 0.55 c h);
  --neutral-400: oklch(from var(--neutral-base) 0.65 c h);
  --neutral-300: oklch(from var(--neutral-base) 0.75 c h);
  --neutral-200: oklch(from var(--neutral-base) 0.85 c h);
  --neutral-100: oklch(from var(--neutral-base) 0.95 c h);

  /* Accent colors */
  --accent-green: oklch(0.55 0.12 160);
  --accent-beige: oklch(0.75 0.08 80);

  /* Background and text colors from neutral shades */
  --bg-primary: var(--neutral-100);
  --bg-alt: var(--neutral-200);
  --text-body: var(--neutral-900);

  /* Typography */
  --font-family: "Montserrat", sans-serif;
  --font-heading: "Lato", sans-serif;
}

/* GLOBAL STYLES 
------------------------------------*/
html {
  box-sizing: border-box;
}

*,
*:before,
*::after {
  box-sizing: inherit;
}

html,
body {
  block-size: 100%;
}

body {
  background: var(--bg-primary);
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-body);
}

h1,
h2,
h3 {
  font-family: var(--font-heading);
  font-weight: 400;
  margin: 0;
}

h1 {
  font-size: 3rem;
}

h2 {
  font-size: 1.7rem;
}

h3 {
  font-size: 1.5rem;
}

/* Links */
a {
  color: var(--accent-green);
}

a:hover {
  color: var(--accent-beige);
  text-decoration: none;
}

footer a {
  color: var(--accent-beige);
}

footer a:hover {
  color: var(--accent-green);
  text-decoration: none;
}

.btn {
  background: var(--accent-green);
  color: var(--neutral-100);
  text-decoration: none;
  text-transform: uppercase;
  font-size: 0.75rem;
  display: inline-block;
  padding: 0.5rem;
  letter-spacing: 0.1em;
  line-height: 1;
  border-radius: 4px;
  margin: 0.5rem;
  transition: all 0.3s ease-in-out;
}

.btn:hover {
  background-color: var(--accent-beige);
  color: var(--neutral-900);
  transform: scale(1.05);
  box-shadow: 0 4px 10px oklch(from var(--neutral-800) l c h / 0.3);
}

.content-wrapper {
  margin: 0 auto;
  padding: 0.625rem;
  max-inline-size: 56.25rem;
}

/* ############ 3. Navigation ############ */
.logo {
  max-inline-size: 5.625rem;
}

.navWrap {
  position: sticky;
  top: 0;
  z-index: 99;
  block-size: 3rem;
  inline-size: 100%;
  background-color: var(--neutral-800);
  border-block-end: 1px solid var(--neutral-300);
  box-shadow: 0px 1px 8px oklch(from var(--neutral-900) l c h / 0.5);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

input#navToggle {
  display: none;
}

input#navToggle~label {
  position: relative;
  padding: 0.25rem;
  inline-size: 2rem;
  block-size: 1.25rem;
  block-size: 2rem;
}

input#navToggle~label>span,
input#navToggle~label>span::before,
input#navToggle~label>span::after {
  content: "";
  display: block;
  position: absolute;
  inset-block-start: 0.75rem;
  block-size: 0.125rem;
  inline-size: 1.75rem;
  opacity: 1;
  background: var(--neutral-100);
  transition: 0.14s ease-in-out;
}

input#navToggle~label>span::before {
  inset-block-start: -0.5rem;
}

input#navToggle~label>span::after {
  inset-block-start: 0.5rem;
}

#navToggle:checked~label>span {
  inline-size: 0;
  background: oklch(from var(--neutral-100) l c h / 0);
}

#navToggle:checked~label>span::before {
  transform: rotateZ(45deg);
  inset-block-start: 0;
}

#navToggle:checked~label>span::after {
  transform: rotateZ(-45deg);
  inset-block-start: 0;
}

#navToggle:checked~nav {
  inset-inline-start: 0;
}

nav {
  position: absolute;
  z-index: -1;
  inset-block-start: 3rem;
  inset-inline-start: -110%;
  inline-size: 100%;
  transition: 0.22s ease-in-out;
}

nav::after {
  content: "";
  position: absolute;
  inset-block-start: 0;
  z-index: -1;
  block-size: 100vh;
  inline-size: 100vw;
  background-color: var(--neutral-100);
  background-size: cover;
}

nav ul {
  list-style-type: none;
}

nav ul li a {
  display: inline-block;
  text-decoration: none;
  inline-size: 100%;
  padding: 0.75rem 1rem;
  color: var(--neutral-900);
  border-block-end: solid 1px var(--neutral-400);
  transition: 0.14s ease-in-out;
}

nav ul li a:hover {
  color: var(--accent-beige);
  background: var(--neutral-600);
}

nav ul li:last-of-type::before {
  content: "";
  display: block;
  padding: 0.5rem;
}

nav .btn {
  background: var(--accent-green);
  border-block-end: none;
  border-radius: 10px;
  box-shadow: inset 0 0 5px var(--neutral-300);
  color: var(--neutral-100);
  inline-size: 40%;
  padding: 0.25rem 0.6rem;
  letter-spacing: 1px;
  text-shadow: none;
  display: flex;
  justify-content: center;
  margin: auto;

}

nav .btn:hover {
  background-color: var(--accent-beige);
  box-shadow: inset 0 0 5px var(--neutral-400);
  color: var(--neutral-900);
}

/* Default link styles */
.nav-link {
  text-decoration: none;
  color: var(--neutral-700);
  padding: 0.25rem;
  position: relative;
  transition: color 0.3s ease-in-out;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 0%;
  height: 2px;
  background-color: var(--accent-green);
  transition: width 0.3s ease-in-out;
}

.nav-link:hover {
  color: var(--accent-green);
}

.nav-link:hover::after {
  width: 100%;
}

/* Active link styles */
.nav-link.active {
  background-color: var(--neutral-200);
  color: var(--neutral-800);
  font-weight: bold;
  border-radius: 5px;
}

/* Popover Styles */
[popover] {
  position: fixed;
  background: var(--yellow-500);
  border: 3px solid var(--yellow-900);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 4px 8px oklch(from var(--yellow-800) l c h / 0.3);
  inset-block-start: 50%;
  inset-inline-start: 50%;
  transform: translate(-50%, -25%);
  inline-size: 80%;
  max-inline-size: 100%;
  container-type: inline-size;
}

[popover]::backdrop {
  background: oklch(from var(--yellow-900) l c h / 0.5);
  backdrop-filter: blur(7px);
}

#contact-button {
  anchor-name: --contact-button;
}

#contact-popover {
  position-anchor: --contact-button;
}

.popover-container {
  --popover-max-inline-size: 100%;
  max-inline-size: var(--popover-max-inline-size);
}

.popover-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: center;
  background-color: var(--neutral-600);
  color: var(--neutral-100);
  border-radius: 20px;
}

.popover-image {
  inline-size: 9.4rem;
  block-size: 9.4rem;
  border-radius: 50%;
  margin: 0 auto;
}

.popover-close {
  align-self: flex-end;
  background: var(--accent-olive);
}

.popover-close:hover {
  background: var(--accent-coral);
}

/* Container Query Styles */
@container (min-width: 40rem) {

  /* Large: Two columns, max 1/3 viewport width */
  .popover-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: center;
    inline-size: 100%;
  }

  .popover-image {
    margin: 0 auto;
    justify-content: center;
  }

  .popover-close {
    align-self: flex-end;
  }
}

@container (min-width: 25rem) and (max-width: 39.99rem) {

  /* Medium: Two columns, no biographical description, flexible width */
  .popover-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: center;
    inline-size: 80%;
  }

  .popover-image {
    margin: 0 auto;
    align-items: center;
  }

  .popover-close {
    align-self: flex-end;
  }

  .popover-content p:nth-child(3) {
    display: none;
  }

  .popover-container {
    --popover-max-inline-size: 80%;
    max-inline-size: var(--popover-max-width);
  }
}

@container (max-width: 24.99rem) {

  /* Small: One stacked column, fill viewport */
  .popover-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: center;
    inline-size: 100%;
  }

  .popover-image {
    margin: 0 auto;
  }

  .popover-close {
    align-self: flex-end;
  }

  .popover-container {
    --popover-max-inline-size: 100vw;
    max-inline-size: var(--popover-max-inline-size);
    inline-size: 100%;
  }
}

/* Logo Animation */
.logo {
  display: inline-block;
  font-size: 2rem;
  color: var(--neutral-100);
  animation: logoEntrance 1.5s ease-out forwards;
}

@keyframes logoEntrance {
  0% {
    opacity: 0;
    transform: translateY(-20px) scale(0.8);
  }

  60% {
    opacity: 1;
    transform: translateY(10px) scale(1.05);
  }

  100% {
    transform: translateY(0) scale(1);
  }
}

/* HOME
------------------------------------*/
.home {
  background: url(../images/index-bg-image.jpg) no-repeat;
  background-size: cover;
  display: flex;
  flex-direction: column;
}

.home .content-wrapper {
  flex: 1 0 auto;
}

.content-bg {
  background: oklch(from var(--neutral-100) l c h / 0.9);
  padding: 1.25rem;
}

/* RESUME
------------------------------------*/
.resume header::before {
  background: url(../images/resume-bg-image.png) center;
  background-size: cover;
  content: "";
  display: block;
  block-size: 12.5rem;
}

.resume-section {
  margin-block-end: 3.125rem;
}

.resume-section h2 {
  border-bottom: 2px dashed var(--neutral-300);
}

/* PROJECTS
------------------------------------*/
/* Style individual project cards */

.project-wrapper {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: subgrid;
  gap: 1.5rem;
}

.project-item {
  margin-block: 2rem 0;
  background: var(--bg-alt);
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px oklch(from var(--neutral-900) l c h / 0.1);
  grid-template-rows: subgrid;
  grid-row: span 4;
}

.project-item img {
  inline-size: 100%;
  margin-block-end: 0.7rem;
  border-radius: 4px;
  grid-row: 1;
}

.project-item h3 {
  margin-block-end: 0;
  grid-row: 2;
}

.project-item p {
  margin-block: 0;
  grid-row: 3;
}

.project-item .btn {
  grid-row: 4;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* WORK EXPERIENCE
------------------------------------*/
.work-item {
  margin-block: 2rem;
}

.work-details p {
  margin: 0;
}

.work-summary p:first-child {
  margin-block-start: 0;
}

/* EDUCATION
------------------------------------*/
.education-item {
  margin-block: 2rem;
}

.education-item p {
  margin: 0;
}

/* FOOTER
------------------------------------*/
footer {
  background: var(--neutral-800);
  color: var(--neutral-300);
  text-align: center;
  padding: 0.7rem;
}

.socials {
  list-style-type: none;
  padding: 0;
}

.socials li {
  display: inline-block;
  margin-inline-start: 1.25rem;
}

.socials img {
  inline-size: 2rem;
}

.socials img:hover {
  opacity: 0.5;
}

/* ANIMATIONS PAGE STYLES
------------------------------------*/
.animation-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-block: 2rem;
}

.anim-cell {
  background: var(--bg-alt);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  box-shadow: 0 4px 10px oklch(from var(--neutral-900) l c h / 0.2);
  transition: transform 0.3s ease;
}

.anim-cell:hover {
  transform: scale(1.03);
}

/* Animation demo box (visual area) */
.animation-demo {
  width: 100%;
  height: 180px;
  border-radius: 10px;
  margin-bottom: 1rem;
  overflow: hidden;
}
/* Clip-Mask Animation (Brand Colors) */
.clip-mask-animation .animation-demo {
  background: linear-gradient(135deg, var(--accent-green), var(--accent-beige));
  animation: moveMask 5s infinite alternate ease-in-out;
  clip-path: circle(60% at 50% 50%);
}

@keyframes moveMask {
  0% { clip-path: circle(30% at 30% 40%); }
  50% { clip-path: circle(45% at 70% 50%); }
  100% { clip-path: circle(30% at 40% 60%); }
}

/*  Filter Animation (Soft Blur Pulse) */
.filter-animation .animation-demo {
  background: radial-gradient(circle at center, var(--accent-green), var(--neutral-700));
  animation: blurPulse 4s ease-in-out infinite;
}

@keyframes blurPulse {
  0%, 100% { filter: blur(0px) brightness(1); transform: scale(1); }
  50% { filter: blur(6px) brightness(1.3); transform: scale(1.05); }
}

/*  Blend-Mode Animation (Moving Gradient Flow) */
.blend-mode-animation .animation-demo {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--accent-green), var(--accent-beige));
  animation: gradientMove 3s linear infinite;
  mix-blend-mode: screen;
}

@keyframes gradientMove {
  0% {
    background-position: 0% 50%;
    filter: hue-rotate(0deg);
  }
  50% {
    background-position: 100% 50%;
    filter: hue-rotate(60deg);
  }
  100% {
    background-position: 0% 50%;
    filter: hue-rotate(120deg);
  }
}

/* Responsive Layout */
@media (max-width: 41rem) {
  .animation-grid {
    grid-template-columns: 1fr;
  }
}


/* MEDIA QUERIES FOR LARGER SCREENS
------------------------------------*/
/* Tablet and above: Adjust content wrapper padding and width */
@media screen and (min-width: 41rem) {
  .content-wrapper {
    padding: 1.875rem;
    max-inline-size: 56.25rem;
  }

  .content-bg {
    padding: 1.875rem;
  }

  .project-wrapper {
    grid-template-columns: repeat(2, 1fr);
  }

  .navWrap {
    display: grid;
    justify-content: center;
    grid-template-columns: 6.25rem minmax(auto, 69rem);
    block-size: auto;
    background-color: var(--neutral-800);
    border-block-end: 1px solid var(--neutral-300);
    box-shadow: 0px 1px 8px oklch(from var(--neutral-900) l c h / 0.5);
  }

  .navToggleLabel {
    display: none;
  }

  nav {
    position: initial;
  }

  nav ul {
    display: flex;
    justify-content: flex-end;
    align-items: center;
  }

  nav ul li a {
    border-block-end: none;
    color: var(--neutral-100);
    padding: 0.5rem 1rem;
  }

  nav ul li a:hover {
    background: transparent;
    color: var(--accent-beige);
  }

  nav::after,
  nav ul li:last-of-type::before {
    display: none;
    padding: initial;
  }

  nav .btn {
    inline-size: auto;
    background: var(--accent-green);
    color: var(--neutral-100);
    letter-spacing: normal;
    text-shadow: none;
    box-shadow: none;
    padding: 0.5rem 1rem;
    margin: 0 0.5rem;
  }

  nav .btn:hover {
    background-color: var(--accent-beige);
    color: var(--neutral-900);
    box-shadow: inset 0 0 5px var(--neutral-400);
  }

  .nav-link {
    text-decoration: none;
    color: var(--neutral-100);
    padding: 0.25rem;
  }
}

/* Adjust header image height and typography for larger screens */
@media screen and (min-width: 31.25rem) {
  .resume header::before {
    block-size: 23.5rem;
  }

  h1 {
    font-size: 4.375rem;
    line-height: 1.5;
  }

  h2 {
    font-size: 2.25rem;
  }
}

/* Desktop: 3-column grid for projects and float layout for images */
@media screen and (min-width: 54rem) {

  .project-wrapper {
    grid-template-columns: repeat(3, 1fr);
  }

  .work-item {
    display: grid;
    grid-template-columns: 19rem 1fr;
    gap: 1.25rem;
  }

  footer {
    display: flex;
    justify-content: space-between;
    padding: 0 1.25rem;
  }
}