:root {
  --white: #f9faff;
  --platinum: #e3e4e8;
  --windsurfing: #32779b;
  --marina: #5a91c7;
  --gray: #9a9a9a;
  --onyx: #3c3d44;
  --charcoal: #343c47;
  --ld-bkgd: light-dark(var(--platinum), var(--charcoal));
  --ld-text: light-dark(var(--onyx), var(--white));
  --ld-projects: light-dark(var(--white), #2e313d);
  --ld-blue: light-dark(var(--windsurfing), #6dadd0);
  --corners: 60px;
  --corners-sm: 10px;
  --base-font-size: 1rem;
}

html {
  box-sizing: border-box;
  color-scheme: light dark;
}

html:has(#mode-switcher #light:checked) {
  color-scheme: light;
}

html:has(#mode-switcher #dark:checked) {
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

.wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

body {
  font-size: var(--base-font-size);
  font-family: "Inter", sans-serif;
  background-color: var(--ld-bkgd);
  color: var(--ld-text);
  padding-top: 100px;
  margin: 0;
}

.portfolioimg {
    max-width: 300px;
    width: 100%;
    height: auto !important; 
    aspect-ratio: auto !important; 
    object-fit: contain !important;
    border-radius: var(--corners);
}

img {
  max-width: 100%;
  border-radius: var(--corners);
}

h1 {
  font-size: calc(var(--base-font-size) * 2.9);
  margin: 0;
}

h2 {
  font-size: var(--base-font-size);
  text-transform: uppercase;
  color: var(--ld-blue);
  letter-spacing: 0.25em;
  margin: 0;
}

h3 {
  margin: 0;
}

p {
  line-height: 1.5;
}

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

a:hover {
  color: var(--marina);
}

@layer switch {
  .radio-switch {
    border: none;
    padding: 0;
    white-space: nowrap;
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
  }
  .radio-switch legend {
    font-size: 2px;
    opacity: 0;
    position: absolute;
  }
  .radio-switch label {
    display: inline-block;
    line-height: 2;
    font-size: 0.9rem;
    position: relative;
    z-index: 2;
  }
  .radio-switch input {
    opacity: 0;
    position: absolute;
  }
  .radio-switch label:first-of-type {
    padding-right: 5em;
  }
  .radio-switch label:last-child {
    margin-left: -4.25em;
    padding-left: 5em;
  }
  .radio-switch:focus-within label:first-of-type::after {
    box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--marina);
  }
  .radio-switch label:first-of-type::before,
  .radio-switch label:first-of-type::after {
    border: 1px solid var(--onyx);
    content: "";
    height: 2em;
    overflow: hidden;
    pointer-events: none;
    position: absolute;
    vertical-align: middle;
  }
  .radio-switch label:first-of-type:before {
    background: var(--white);
    border: 1px solid var(--onyx);
    border-radius: 100%;
    position: absolute;
    right: -0.075em;
    transform: translateX(0em);
    transition: transform 0.2s ease-in-out;
    width: 2em;
    z-index: 2;
  }
  .radio-switch label:first-of-type:after {
    background: #777;
    border-radius: 1em;
    margin: 0 1em;
    transition: background 0.2s ease-in-out;
    width: 4em;
  }
  .radio-switch input:first-of-type:checked ~ label:first-of-type:after {
    background: var(--marina);
  }
  .radio-switch input:first-of-type:checked ~ label:first-of-type:before {
    transform: translateX(-2em);
  }
  .radio-switch input:last-of-type:checked ~ label:last-of-type {
    z-index: 1;
  }
}

.icons {
  list-style-type: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-flow: row wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 2rem;
}


.github { aspect-ratio: 1.026; clip-path: shape(from 33.45% 80.52%,curve by -1.05% 0.74% with 0% 0.41%/-0.46% 0.74%,curve by -1.13% -0.74% with -0.67% 0.06%/-1.13% -0.27%,curve by 1.05% -0.74% with 0% -0.41%/0.46% -0.74%,curve by 1.13% 0.74% with 0.6% -0.06%/1.13% 0.27%,close,move by -6.27% -0.93%,curve by 0.87% 1.01% with -0.14% 0.41%/0.26% 0.89%,curve by 1.25% -0.41% with 0.52% 0.21%/1.13% 0%,smooth by -0.87% -1.08% with -0.26% -0.89%,curve by -1.25% 0.48% with -0.52% -0.14%/-1.11% 0.06%,close,move by 8.91% -0.35%,curve by -0.93% 1.01% with -0.58% 0.14%/-0.99% 0.54%,curve by 1.19% 0.54% with 0.06% 0.41%/0.58% 0.68%,curve by 0.93% -0.95% with 0.58% -0.14%/0.99% -0.54%,curve by -1.19% -0.6% with -0.06% -0.39%/-0.6% -0.66%,close,move to 49.35% 0%,curve to 0% 50.45% with 21.39% 0%/0% 21.77%,curve by 34.17% 49.46% with 0% 22.93%/14.07% 42.56%,curve by 3.49% -2.5% with 2.58% 0.48%/3.49% -1.16%,curve by -0.06% -12.7% with 0% -1.28%/-0.06% -8.35%,curve by -17.08% -6.16% with 0% 0%/-14.11% 3.1%,curve by -5.6% -7.57% with 0% 0%/-2.3% -6.02%,curve by 0.32% -3.18% with 0% 0%/-4.62% -3.25%,curve by 7.78% 5.33% with 0% 0%/5.02% 0.41%,curve by 14.7% 4.32% with 4.42% 7.98%/11.81% 5.69%,curve by 3.23% -6.97% with 0.46% -3.31%/1.77% -5.6%,curve by -22.64% -22.85% with -11.27% -1.28%/-22.64% -2.96%,curve by 4.76% -12.18% with 0% -5.69%/1.53% -8.54%,curve by 0.52% -14.04% with -0.52% -1.34%/-2.24% -6.89%,curve by 13.91% 5.58% with 4.21% -1.34%/13.91% 5.58%,curve by 12.66% -1.76% with 4.03% -1.16%/8.37% -1.76%,smooth by 12.66% 1.76% with 8.63% 0.6%,curve by 13.91% -5.58% with 0% 0%/9.7% -6.95%,curve by 0.52% 14.04% with 2.76% 7.18%/1.05% 12.7%,curve by 5.2% 12.18% with 3.23% 3.66%/5.2% 6.51%,curve by -23.15% 22.85% with 0% 19.95%/-11.88% 21.55%,curve by 3.43% 9.59% with 1.85% 1.63%/3.43% 4.74%,curve by -0.06% 17.29% with 0% 6.97%/-0.06% 15.59%,curve by 3.49% 2.5% with 0% 1.34%/0.93% 2.98%,curve to 100% 50.45% with 86.33% 93.01%/100% 73.39%,curve to 49.35% 0% with 100% 21.77%/77.32% 0%,close,move to 19.6% 71.32%,curve by 0.14% 1.08% with -0.26% 0.21%/-0.2% 0.68%,curve by 1.05% 0.21% with 0.32% 0.33%/0.79% 0.48%,curve by -0.14% -1.08% with 0.26% -0.21%/0.2% -0.68%,curve by -1.05% -0.21% with -0.32% -0.33%/-0.79% -0.48%,close,move by -2.18% -1.67%,curve by 0.46% 0.81% with -0.14% 0.27%/0.06% 0.6%,curve by 0.87% -0.14% with 0.32% 0.21%/0.73% 0.14%,curve by -0.46% -0.81% with 0.14% -0.27%/-0.06% -0.6%,curve by -0.87% 0.14% with -0.4% -0.12%/-0.73% -0.06%,close,move by 6.53% 7.36%,curve by 0.26% 1.28% with -0.32% 0.27%/-0.2% 0.89%,curve by 1.31% 0.21% with 0.46% 0.48%/1.05% 0.54%,curve by -0.26% -1.28% with 0.26% -0.27%/0.14% -0.89%,curve by -1.31% -0.21% with -0.44% -0.48%/-1.05% -0.54%,close,move by -2.3% -3.04%,curve by 0% 1.22% with -0.32% 0.21%/-0.32% 0.74%,curve by 1.13% 0.48% with 0.32% 0.48%/0.87% 0.68%,curve by 0% -1.28% with 0.32% -0.27%/0.32% -0.81%,curve by -1.13% -0.41% with -0.28% -0.48%/-0.81% -0.68%,close); }
.linkedin { aspect-ratio: 1; clip-path: shape(from 92.86% 0%,hline to 7.12%,curve to 0% 7.21% with 3.19% 0%/0% 3.24%,vline by 85.58%,curve to 7.12% 100% with 0% 96.76%/3.19% 100%,hline to 92.86%,curve by 7.14% -7.21% with 3.93% 0%/7.14% -3.24%,vline to 7.21%,curve by -7.14% -7.21% with 0% -3.97%/-3.21% -7.21%,close,move to 30.22% 85.71%,hline to 15.4%,vline to 37.99%,hline by 14.84%,vline to 85.71%,close,move by -7.41% -54.24%,curve by -8.59% -8.59% with -4.75% 0%/-8.59% -3.86%,smooth to 22.81% 14.29% with 18.06% 14.29%,curve by 8.59% 8.59% with 4.73% 0%/8.59% 3.86%,curve by -8.59% 8.59% with 0% 4.75%/-3.84% 8.59%,close,move by 62.97% 54.24%,hline by -14.82%,vline to 62.5%,curve by -7.7% -12.66% with 0% -5.54%/-0.11% -12.66%,curve by -8.91% 12.25% with -7.72% 0%/-8.91% 6.03%,vline to 85.71%,hline by -14.82%,vline to 37.99%,hline by 14.22%,vline by 6.52%,hline by 0.2%,curve by 14.04% -7.7% with 1.99% -3.75%/6.83% -7.7%,curve by 17.79% 22.75% with 15% 0%/17.79% 9.89%,vline to 85.71%,close); }
.email { aspect-ratio: 1.333; clip-path: shape(from 9.38% 0%,curve to 0% 12.5% with 4.2% 0%/0% 5.6%,curve by 3.75% 10% with 0% 3.93%/1.39% 7.63%,line to 46.25% 65%,curve by 7.5% 0% with 2.23% 2.21%/5.27% 2.21%,line to 96.25% 22.5%,curve by 3.75% -10% with 2.36% -2.37%/3.75% -6.07%,curve by -9.38% -12.5% with 0% -6.9%/-4.2% -12.5%,line to 9.38% 0%,close,move to 0% 29.17%,line to 0% 83.33%,curve by 12.5% 16.67% with 0% 9.19%/5.61% 16.67%,line by 75% 0%,curve by 12.5% -16.67% with 6.89% 0%/12.5% -7.47%,line by 0% -54.17%,line to 57.5% 71.67%,curve by -15% 0% with -4.45% 4.45%/-10.55% 4.45%,line to 0% 29.17%,close); }

.social {
  background-color: var(--ld-blue);
  height: 36px;
  fill: var(--ld-blue);
}

.social:hover {
  background-color: var(--marina);
  fill: var(--marina);
}

ul svg {
  width: 36px;
  height: 36px;
}

.footer-text .social {
  fill: var(--ld-text);
}

.footer-text .social:hover {
  fill: var(--marina);
}

.main-article {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  text-align: center;
}

.main-article img {
  object-fit: cover;
  object-position: top;
  height: 175px;
  width: 300px;
  overflow: hidden;
  margin: 0 auto;
}

main {
  margin-top: 5rem;
  margin-bottom: 3rem;
  text-align: center;
}

.projects {
  display: flex;
  flex-flow: column nowrap;
  gap: 3rem;
}

/* FIXED: Entire project box is now clickable */
.project {
  background-color: var(--ld-projects);
  padding: 3rem;
  border-radius: var(--corners);
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  text-decoration: none;
  color: var(--ld-text);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  color: var(--ld-text);
}

.project h3 {
  color: var(--ld-text);
}

.project:hover h3 {
  color: var(--ld-text);
}

.project ul {
  margin: 0;
  padding: 0;
  list-style-type: none;
  display: flex;
  flex-flow: row wrap;
  justify-content: center;
  gap: 1rem;
}

.project li {
  background-color: var(--marina);
  color: var(--white);
  padding: 0.5rem;
  border-radius: var(--corners-sm);
  font-size: calc(var(--base-font-size) * 0.85);
}

/* FIXED: Uniform image container */
.project-image {
  width: 100%;
  height: 280px;
  overflow: hidden;
  border-radius: var(--corners);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0,0,0,0.02);
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: var(--corners);
  transition: transform 0.4s ease;
}

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

.img-border {
  border: 1px solid var(--onyx);
}

footer {
  text-align: center;
}

.footer-text {
  color: var(--ld-text);
  line-height: 1.5;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.footer-text h3 {
  font-size: calc(var(--base-font-size) * 0.85);
}

.footer-text-box ul {
  font-size: calc(var(--base-font-size) * 0.85);
  list-style-type: none;
  margin: 0;
  padding: 0;
}

.footer-text-box li {
  line-height: 2;
}

.h2-footer {
  margin: 2rem 0;
}

.pill-nav {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background-color: var(--ld-projects);
  border: 1px solid var(--platinum);
  border-radius: 50px;
  padding: 0.5rem 1.5rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.nav-items {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  color: var(--ld-text);
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-link svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  transition: fill 0.2s ease, transform 0.2s ease;
}

.nav-link:hover svg {
  fill: var(--ld-blue);
  transform: translateY(-2px);
}

.nav-divider {
  width: 1px;
  height: 24px;
  background-color: var(--gray);
  opacity: 0.3;
}

@media (prefers-color-scheme: dark) {
  .pill-nav {
    border-color: var(--onyx);
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  }
}

.section-toggle {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-bottom: 3rem;
}

.toggle-btn {
  background: none;
  border: none;
  font-family: "Inter", sans-serif;
  font-size: var(--base-font-size);
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--marina);
  cursor: pointer;
  padding: 0;
  transition: color 0.3s ease;
}

.toggle-btn:hover {
  color: var(--marina);
}

.toggle-btn.active {
  color: var(--windsurfing);
  font-weight: 700;
}

.divider {
  font-size: 1.2rem;
  color: var(--marina);
}

/* FIXED: Certificate grid with smaller, uniform width */
.cert-grid {
    display: flex;
    flex-direction: column; 
    align-items: center; 
    gap: 2rem; 
    max-width: 500px;
    margin: 0 auto; 
}
  
.cert-item {
    width: 100%;
    background: transparent;
    padding: 0;
}
  
.cert-item a {
    display: block;
    text-align: center;
}
  
.cert-item img {
    width: 100%;
    height: 280px;
    object-fit: contain; 
    border-radius: var(--corners-sm) !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: transparent;
}
  
.cert-item img:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    cursor: pointer;
}

@media (min-width: 750px) {
  :root {
    --base-font-size: 1.125rem;
  }
  h1 {
    margin-left: -3px;
  }
  .wrapper {
    padding: 5rem;
  }
  .radio-switch {
    justify-content: flex-end;
  }
  .main-article {
    grid-template-columns: 1fr 1fr;
    align-items: center;
    text-align: left;
  }
  .main-article img {
    max-height: 400px;
    margin: 0 0 0 auto;
    object-fit: none;
    object-position: none;
    height: auto;
    width: auto;
    overflow: auto;
  }
  .icons {
    justify-content: flex-start;
  }
  footer {
    text-align: left;
  }
  .footer-text {
    grid-template-columns: repeat(3, 1fr);
  }
  .footer-text .icons {
    grid-column: 1/4;
  }
  
  .section-toggle {
    justify-content: center;
  }
}

@media (min-width: 850px) {
  main {
    text-align: left;
  }
  .project {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }
  
  .project-image {
    height: 300px;
  }
  
  .project ul {
    justify-content: flex-start;
  }
}