/* --------------------------------- */
/* ----- Basic Setup -----*/
/* --------------------------------- */

@font-face {
  font-family: "Mona Sans";
  src: url("assets/fonts/Mona-Sans.woff2") format("woff2 supports variations"),
    url("assets/fonts/Mona-Sans.woff2") format("woff2-variations");
  font-display: swap;
  font-weight: 200 900;
  font-stretch: 75% 125%;
}

:root {
  --h1: 3.5rem;
  --h2: 3rem;
  --h3: 2.145rem;
  --h4: 1.5rem;
  --text-large: 1.6rem;
  --text-medium: 1.275rem;
  --text-small: 1.125rem;

  --gradient-brand: radial-gradient(
      at 60% 31%,
      rgb(255, 131, 139) 0px,
      transparent 50%
    ),
    radial-gradient(at 48% 98%, rgba(0, 255, 166, 0.707) 0px, transparent 50%),
    radial-gradient(at 84% 67%, rgb(255, 129, 125) 0px, transparent 50%),
    radial-gradient(at 16% 47%, rgb(255, 90, 112) 0px, transparent 50%),
    radial-gradient(at 73% 11%, rgb(115, 255, 225) 0px, transparent 50%),
    radial-gradient(at 49% 37%, rgba(255, 249, 89, 0.695) 0px, transparent 50%),
    radial-gradient(at 70% 21%, rgba(58, 255, 186, 0.715) 0px, transparent 50%);
  --easing: cubic-bezier(0.86, 0, 0.07, 1);

  --site-max-width: 1280px;
  --gutter-nano: 0.5rem;
  --gutter-micro: 1rem;
  --gutter-x-small: 1.5rem;
  --gutter-small: 2rem;
  --gutter-medium: 2.5rem;
  --gutter-large: 3rem;
  --gutter-x-large: 6rem;
  --gutter-huge: 12rem;

  --scroll-padding: 4.375rem;
  --radius: 85px;
}

body.dark {
  --bg-color-primary: #0c0a0a;
  --bg-color-secondary: #161211;
  --important: #fff;
  --sub: #c3c3c3;
  --body: #989898;
  --border: #c0c0c015;
  --border-dark: #c0c0c02f;
  --gradient-border: linear-gradient(to left bottom, #777, #0e0d0d);
  --shadow: 0 1rem 1rem #00000040;
}

body.light {
  --bg-color-primary: #fbfbfb;
  --bg-color-secondary: #ffffff;
  --important: #000;
  --sub: #111;
  --body: #585b63;
  --border: #62626234;
  --border-dark: #5e5e5e1f;
  --gradient-border: linear-gradient(to left bottom, #000000c6, #0e0d0d00);
  --shadow: 0 1rem 1rem rgba(0, 0, 0, 0.25);
}

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

html {
  font-family: "Mona Sans", sans-serif;
  box-sizing: border-box;
  scroll-padding-top: var(--scroll-padding);
  overflow-x: hidden;
  max-width: 100%;
}

body {
  overflow-x: hidden;
  max-width: 100%;
  position: relative;
}

@media (max-width: 1200px) {
  html {
    font-size: 90%;
  }
}

@media (max-width: 645px) {
  html {
    font-size: 80%;
  }
}

body {
  font-size: var(--text-medium);
  color: var(--body);
  background-color: var(--bg-color-primary);
  line-height: 1.4;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Improve media defaults */

picture,
svg,
img {
  display: block;
  max-inline-size: 100%;
  object-fit: contain;
}

textarea {
  resize: none;
}

/* --------------------------------- */
/* ----- Typography -----*/
/* --------------------------------- */

input,
textarea,
button {
  font: inherit;
}

p,
h1,
h2,
h3,
.h4 {
  overflow-wrap: break-word;
}

img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
.h4 {
  font-stretch: 125%;
  line-height: 1.2;
  color: var(--important);
}

.h1 {
  font-size: var(--h1);
}

.h2 {
  font-size: var(--h2);
  text-align: center;
}

.h3 {
  font-size: var(--h3);
}

.h4 {
  font-size: var(--h4);
}

@media (max-width: 845px) {
  :root {
    --h1: 2.845rem;
    --h2: 2.45rem;
    --h3: 1.85rem;
  }
}

@media (max-width: 700px) {
  :root {
    --h1: 2.545rem;
  }
}

@media (max-width: 545px) {
  :root {
    --h1: 2.4rem;
    --text-large: 1.5rem;
  }
}

@media (max-width: 485px) {
  :root {
    --h1: 2.145rem;
    --h2: 1.875rem;
    --h3: 1.6rem;
    --text-large: 1.345rem;
  }
}

/* --------------------------------- */
/* ----- Utilities -----*/
/* --------------------------------- */

/* Center and constrain the width of page sections */

.container {
  max-inline-size: var(--site-max-width);
  margin-inline: auto;
}

@media (max-width: 1375px) {
  :root {
    --site-max-width: 1160px;
  }
}

@media (max-width: 1275px) {
  .container {
    padding-inline: var(--gutter-small);
  }
}

@media (max-width: 1200px) {
  .container {
    padding-inline: var(--gutter-medium);
  }
}

@media (max-width: 575px) {
  .container {
    padding-inline: var(--gutter-x-small);
  }
}

@media (max-width: 420px) {
  .container {
    padding-inline: var(--gutter-micro); /* 1rem padding for very small screens */
  }
}

/* disable scroll when menu is opened */

.lock-screen {
  overflow-y: hidden;
}

/* hides visually and removes from accessibility tree  */

.hidden {
  visibility: hidden;
  transform: translateX(-100%);
}

.transform {
  transform: translateY(6rem);
  opacity: 0;
}

.shown {
  transition: 0.1s;
  color: lightgrey;
}

/* --------------------------------- */
/* ----- Components -----*/
/* --------------------------------- */

.btn {
  font-size: 1.35rem;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  padding: 18px 60px;
  border-radius: var(--gutter-nano);
  transition: 0.3s all ease-in-out;
  cursor: pointer;
}

@media (max-width: 700px) {
  .btn {
    padding: 16px 48px;
  }
}

@media (max-width: 485px) {
  .btn {
    font-size: 1.2rem;
    padding: 14px 38px;
  }
}

.btn-cta {
  color: var(--bg-color-primary);
  background-color: var(--important);
}

body.dark .btn-cta:hover,
body.dark .btn-cta:focus {
  box-shadow: #ffffff40 0 0 0 var(--gutter-nano);
}

body.light .btn-cta:hover,
body.light .btn-cta:focus {
  box-shadow: #07070733 0 0 0 var(--gutter-nano);
}

.btn-secondary {
  border: 1px solid var(--border-dark);
  color: var(--important);
}

.btn-secondary:hover,
.btn-secondary:focus {
  border-color: var(--important);
}

.link {
  display: inline-block;
  font-weight: 600;
  font-size: var(--text-small);
  padding: var(--gutter-nano) 0;
  text-decoration: none;
  color: var(--important);
  position: relative;
}

.link::after,
.link::before {
  content: "";
  width: 100%;
  height: 1px;
  margin-block-start: var(--gutter-nano);
  position: absolute;
  bottom: -1px;
  left: 0;
  transition: 300ms;
}

body.dark .link::before {
  background-color: #d3d3d357;
}

body.dark .link::after {
  background-color: white;
}

body.light .link::before {
  background-color: lightgray;
}

body.light .link::after {
  background-color: black;
}

.link::after {
  background-color: white;
  transform-origin: left;
  transform: scaleX(0);
}

.link:hover::after,
.link:focus::after {
  transform: scaleX(1);
}

/* --------------------------------- */
/* ----- Layout -----*/
/* --------------------------------- */

section:not(:first-child) {
  padding-block-start: var(--gutter-huge);
}

section:first-child {
  padding-block-start: 7rem;
}

@media (max-width: 885px) {
  :root {
    --gutter-huge: 8rem;
    --gutter-x-large: 4rem;
  }
}

main {
  border-top: 1px solid var(--border);
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
  background-color: var(--bg-color-primary);
  transform: translateY(calc(-1 * var(--radius)));
}

@media (max-width: 1185px) {
  :root {
    --radius: 45px;
  }
}

/* --------------------------------- */
/* ----- Menu Button -----*/
/* --------------------------------- */

.menu-btn-container {
  position: fixed;
  width: 100%;
  top: var(--gutter-x-small);
  left: 0;
  z-index: 4;
}

.menu-btn {
  display: block;
  margin-inline-start: auto;
  border: 1px solid var(--border-dark);
  inline-size: 132px;
  padding-block: var(--gutter-nano);
  border-radius: var(--gutter-large);
  text-decoration: none;
  background-color: var(--bg-color-secondary);
  color: var(--important);
  cursor: pointer;
}

.menu-btn,
.nav-items a {
  font-stretch: 125%;
  font-weight: 900;
}

/* --------------------------------- */
/* ----- Navigation -----*/
/* --------------------------------- */

/* Mobile Nav Container */
.nav {
  min-block-size: 100vh;
  position: fixed;
  width: 100%;
  background-color: var(--bg-color-primary);
  background-image: none;
  transition: 450ms var(--easing);
  z-index: 3;
}

/* Desktop Styles */
@media (min-width: 768px) {
  .menu-btn-container {
    display: none !important;
  }
  
  .nav {
    min-block-size: auto;
    background: transparent;
    background-image: none;
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    transform: none;
    visibility: visible;
    display: flex;
    justify-content: flex-end;
    padding: 2rem 5%;
  }

  .nav.hidden {
    transform: none;
    visibility: visible;
  }

  .nav-items {
    position: static;
    transform: none;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 2rem;
  }

  .nav-item:not(:last-child) {
    margin-block-end: 0;
  }

  .nav-item a {
    font-size: 1rem;
    color: var(--important);
    text-decoration: none;
    font-weight: 600;
  }

  .theme-toggle-item {
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
  }
}

.nav-items {
  position: absolute;
  top: 50%;
  left: 15%;
  transform: translateY(-50%) translateX(-15%);
  list-style-type: none;
}

.nav-item:not(:last-child) {
  margin-block-end: var(--gutter-x-small);
}

.nav-item a {
  display: inline-block;
  font-size: var(--h2);
  text-decoration: none;
  color: #fff;
}

.nav-item a::after {
  content: "";
  display: block;
  block-size: var(--gutter-nano);
  width: 100%;
  transform: scale(0);
  transform-origin: left;
  background-color: white;
  transition: transform 250ms var(--easing);
}

.nav-item a:hover::after,
.nav-item a:focus::after {
  transform: scale(1);
}

/* --------------------------------- */
/* ----- Header -----*/
/* --------------------------------- */

.header {
  min-block-size: calc(100vh + var(--radius));
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}

body.dark .header {
  background-image: linear-gradient(#0000008b, #000000e6),
    url("assets/images/hero-bg.webp");
}

body.light .header {
  background-image: linear-gradient(#ffffffa2, #ffffffe6),
    url("assets/images/hero-bg-light.webp");
}

.header-textbox {
  position: absolute;
  top: 30%;
  transform: translateY(-50%);
}

@media (max-width: 768px) {
  .header-textbox {
    padding-inline: 1rem;
    width: 100%;
    box-sizing: border-box;
  }
}


.h1 span {
  display: block;
}

.header-text {
  font-size: var(--text-large);
  font-weight: 400;
  max-inline-size: 745px;
  margin-block-start: var(--gutter-micro);
  margin-block-end: var(--gutter-medium);
}

@media (max-width: 1200px) {
  .header-text {
    max-inline-size: 685px;
  }
}

@media (max-width: 845px) {
  .header-text {
    max-inline-size: 585px;
  }
}

.header-btns {
  display: inline-flex;
  gap: var(--gutter-x-small);
}

@media (max-width: 400px) {
  .header-textbox {
    left: 0;
    text-align: center;
    padding-inline: 0.6rem;
  }
  .header-btns {
    flex-direction: column;
    width: 80%;
  }
}

/* --------------------------------- */
/* ----- Clients -----*/
/* --------------------------------- */

.logos {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding-block-start: var(--gutter-x-large);
  flex-wrap: wrap; /* allow wrapping on small screens */
  gap: 2rem;
}


/* --------------------------------- */
/* ----- Logo Visibility & Scaling -----*/
/* --------------------------------- */

/* Base Logo Style */
.logo {
  display: block;
  max-block-size: 70px; /* Slightly taller to accommodate EKHA */
  max-inline-size: 160px;
  height: auto;
  width: auto;
  transition: all 0.3s ease;
  /* Default (Light Mode): Grayscale for uniformity */
  filter: grayscale(100%) opacity(0.7); 
}

.logo:hover {
  filter: grayscale(0%) brightness(1) opacity(1);
  transform: scale(1.05);
}

/* Specific Logo Sizing */
/* Specific Logo Sizing & Overrides */
.logo[src*="ekiti"], 
.logo[src*="ekhoa"] {
  max-inline-size: 220px; /* Significantly larger */
  max-block-size: 90px;
}

/* 
  Override reversed-logo behavior for EKHOA if needed 
  (User requested "leave as is on light mode")
*/
.logo.reversed-logo[src*="ekhoa"] {
  filter: grayscale(100%) opacity(0.7); /* Cancel invert */
}
.logo.reversed-logo[src*="ekhoa"]:hover {
  filter: grayscale(0%) opacity(1);
}

body.dark .logo.reversed-logo[src*="ekhoa"] {
  /* Invert to white in dark mode */
  filter: invert(1) grayscale(100%) opacity(0.8) brightness(1.5); 
}
body.dark .logo.reversed-logo[src*="ekhoa"]:hover {
  filter: invert(1) grayscale(0%) opacity(1) brightness(1.5);
}
.logo[src*="kinplus"] {
  max-inline-size: 140px;
}

/* 
  REVERSED LOGOS (e.g. Debug Lab - White Text)
  In Light Mode: Must invert to become Black.
*/
.logo.reversed-logo {
  filter: invert(1) grayscale(100%) opacity(0.8);
}
.logo.reversed-logo:hover {
   /* Invert to black on hover */
  filter: invert(1) opacity(1);
}

/* 
  DARK MODE 
*/
body.dark .logo {
  /* Invert black logos to white */
  filter: invert(1) grayscale(100%) opacity(0.8);
}
body.dark .logo:hover {
  filter: invert(1) grayscale(0%) opacity(1);
}

/* 
  REVERSED LOGOS IN DARK MODE
  Since they are white, we do NOT invert them. 
*/
body.dark .logo.reversed-logo {
  filter: grayscale(100%) opacity(0.9);
}
body.dark .logo.reversed-logo:hover {
  filter: grayscale(0%) opacity(1);
}



/* Cleaned up duplicate blocks */

/* --------------------------------- */
/* ----- Work -----*/
/* --------------------------------- */

.work-boxes {
  padding-block-start: var(--gutter-x-large);
}

.work-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

@media (max-width: 1045px) {
  .work-boxes {
    max-inline-size: fit-content;
    margin-inline: auto;
  }

  .work-box {
    flex-direction: column-reverse;
    align-items: flex-start;
  }

  .work-img {
    margin-block-end: var(--gutter-medium);
  }
}

.work-box:not(:last-child) {
  margin-block-end: var(--gutter-medium); /* Reduced to 2.5rem */
}

@media (max-width: 1285px) {
  .work-box:not(:last-child) {
    margin-block-end: 3rem; /* Tighter on smaller screens */
  }
}


.work-img,
.work-textbox {
  flex-basis: 49%;
}

.work-img {
  max-inline-size: 785px;
  transition: 0.6s all;
}

body.light .work-img {
  box-shadow: var(--shadow);
}

.work-textbox {
  max-inline-size: 445px;
}

@media (max-width: 885px) {
  .work h2 {
    margin-block-start: 45px;
  }
}

@media (max-width: 485px) {
  .work h2 {
    margin-block-start: 0;
  }
}

.work-text {
  margin-block: var(--gutter-micro);
}

.work-technologies {
  list-style-position: inside;
  list-style-type: disc;
  margin-block-end: var(--gutter-x-small);
}

.work-links {
  display: inline-flex;
  align-items: center;
  gap: var(--gutter-x-small);
}

.work-links img {
  block-size: 28px;
  inline-size: 28px;
}

body.dark .work-links img {
  filter: invert(1);
}

/* Github icon */

.work-links > a:last-child {
  transition: 0.3s transform ease-in;
}

.work-links > a:last-child:hover,
.work-links > a:last-child:focus {
  transform: scale(1.1);
}

.work-text,
.contact-text,
.work-technologies {
  font-weight: 300;
}

.work-textbox h3,
.impact-statement,
.work-tags,
.work-links {
  --delay: 0.2s;
  animation: slide-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-play-state: paused;
}

.impact-statement {
  animation-delay: var(--delay);
}

.work-tags {
  animation-delay: calc(var(--delay) * 1.5);
}

.work-links {
  animation-delay: calc(var(--delay) * 2);
}

@keyframes slide-up {
  from {
    transform: translateY(45px);
    opacity: 0;
  }

  to {
    transform: none;
    opacity: 1;
  }
}

/* --------------------------------- */
/* ----- Articles -----*/
/* --------------------------------- */

.article-boxes {
  display: flex;
  flex-flow: row wrap;
  gap: 3.5%;
  margin-block-start: var(--gutter-x-large);
}

.article-box {
  flex-basis: 31%;
  border: 1px solid var(--border);
  padding: var(--gutter-medium) var(--gutter-small);
  border-radius: var(--gutter-nano);
  background-color: var(--bg-color-secondary);
}

.article-textbox {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.article-text {
  font-size: var(--text-small);
  margin-block: var(--gutter-x-small);
}

.article-info {
  display: flex;
  justify-content: space-between;
  margin-block-start: auto;
}

.reaction-count {
  display: inline-flex;
  align-items: center;
  gap: var(--gutter-nano);
  font-size: initial;
}

@media (max-width: 985px) {
  .article-boxes {
    max-inline-size: 685px;
    margin-inline: auto;
    justify-content: center;
    gap: 4%;
  }

  .article-box:nth-of-type(2),
  .article-box:nth-of-type(3) {
    flex-basis: 48%;
  }

  .article-box:last-child {
    display: none;
  }
}

@media (max-width: 650px) {
  .article-box:nth-child(2),
  .article-box:nth-child(3),
  .article-box:last-child {
    flex-basis: 100%;
  }

  .featured-article {
    margin-block-end: 0;
  }

  .article-box:not(:last-child) {
    margin-block-end: var(--gutter-x-small);
  }

  .article-box:last-child {
    display: block;
  }
}

/* --------------------------------- */
/* ----- Featured article -----*/
/* --------------------------------- */

.featured-article {
  flex-basis: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-block-end: 44.8px;
}

@media (max-width: 985px) {
  .featured-article {
    margin-block-end: 24.4px;
    flex-direction: column-reverse;
    gap: var(--gutter-small); /* Add spacing between image and text */
  }
  
  .featured-article .article-textbox,
  .featured-article .article-illustration {
    flex-basis: auto;
    width: 100%;
    max-width: 100%;
  }

  /* Reset alignment since it's now column */
  .featured-article {
    align-items: stretch; 
  }
}

.featured-article .article-textbox {
  flex-basis: 44%;
}

.featured-article h3 {
  margin-block-start: var(--gutter-x-small);
}

.featured-article .article-illustration {
  flex-basis: 50%;
}

.article-illustration img {
  border-radius: var(--gutter-nano);
}

.featured-article .article-text {
  font-size: var(--text-medium);
}

.featured-article .article-info {
  justify-content: flex-start;
  gap: var(--gutter-medium);
}

/* --------------------------------- */
/* ----- Testimonials -----*/
/* --------------------------------- */

.testimonials {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-block-start: var(--gutter-x-large);
  list-style-type: none;
  background-image: linear-gradient(
    rgba(88, 88, 88, 0.297),
    rgba(214, 214, 214, 0.082)
  );
}

@media (max-width: 1100px) {
  .testimonials {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 645px) {
  .testimonials {
    grid-template-columns: 1fr;
  }
}

.testimonial {
  display: flex;
  flex-direction: column;
  padding: var(--gutter-small);
  background-color: var(--bg-color-primary);
}

.testimonial-text {
  font-size: var(--text-small);
  margin-block-end: var(--gutter-x-small);
}

.testimonial-author {
  margin-block-start: auto;
  display: flex;
  align-items: center;
  gap: var(--gutter-micro);
}

.testimonial-author-name {
  margin-block-end: 0.3rem;
}

.testimonial-author-name,
.testimonial-author-job {
  font-size: initial;
}

.testimonial-author > img {
  block-size: 52px;
  inline-size: 52px;
  border-radius: 50%;
  background-color: var(--bg-color-secondary);
}

/* --------------------------------- */
/* ----- Skills -----*/
/* --------------------------------- */

.skills-imgs {
  display: flex;
  flex-flow: row wrap;
  justify-content: center;
  gap: var(--gutter-x-large);
  padding-block-start: var(--gutter-x-large);
}

.skills-img {
  block-size: 135px;
  inline-size: 135px;
}

@media (max-width: 1100px) {
  .skills-img {
    block-size: 100px;
    inline-size: 100px;
  }
}

@media (max-width: 810px) {
  .skills-img {
    block-size: 85px;
    inline-size: 85px;
  }
}

@media (max-width: 675px) {
  .skills-imgs {
    gap: var(--gutter-large);
  }
  .skills-img {
    block-size: 70px;
    inline-size: 70px;
  }
}

@media (max-width: 340px) {
  .skills-img {
    block-size: 55px;
    inline-size: 55px;
  }
}

/* --------------------------------- */
/* ----- Contact -----*/
/* --------------------------------- */

.contact-content {
  display: grid;
  grid-template-columns: minmax(245px, 35%) 1fr;
  margin-block: var(--gutter-x-large);
  border: 1px solid var(--border);
  border-radius: var(--gutter-nano);
}

@media (max-width: 1032px) {
  .contact-content {
    display: flex;
    flex-direction: column-reverse;
    max-inline-size: 845px;
    margin-inline: auto;
  }
}

.contact-textbox,
.contact-form {
  padding: var(--gutter-large) var(--gutter-small);
}

.hire-alert {
  display: inline-flex;
  align-items: center;
  gap: var(--gutter-nano);
  font-size: initial;
  padding: var(--gutter-nano) var(--gutter-micro);
  border-radius: var(--gutter-small);
  position: relative;
  z-index: 1;
  margin-block-end: var(--gutter-small);
  color: var(--important);
}

.hire-alert::before,
.hire-alert::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.hire-alert::after {
  background-image: var(--gradient-border);
  z-index: -2;
}

.hire-alert::before {
  background-color: var(--bg-color-primary);
  inset: 1px;
  z-index: -1;
}

.indicator {
  display: inline-block;
  block-size: var(--gutter-nano);
  inline-size: var(--gutter-nano);
  border-radius: 50%;
  background-color: red;
  animation: blink 550ms alternate infinite var(--easing);
}

@keyframes blink {
  100% {
    opacity: 0;
  }
}

.contact-text {
  margin-block-end: var(--gutter-small);
}

.signatures {
  inline-size: 150px;
}

body.light .signatures {
  filter: invert(1);
}

.contact-form {
  background-color: var(--bg-color-secondary);
  border-top-right-radius: var(--gutter-nano);
  border-bottom-right-radius: var(--gutter-nano);
}

.form-field label,
.form-field input,
.form-field textarea {
  display: block;
  width: 100%;
}

.form-field label {
  color: var(--important);
}

.form-field input,
.form-field textarea {
  font-size: var(--text-small);
  color: var(--sub);
  border: none;
  outline: none;
  border-bottom: 1px solid var(--border);
  background-color: transparent;
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: #888;
}

.form-field input,
.form-field textarea {
  margin-block-end: var(--gutter-small);
  padding: var(--gutter-nano);
  margin-inline: var(--gutter-nano);
}

.form-field label {
  font-size: var(--text-small);
  margin-block-end: var(--gutter-nano);
  margin-inline-start: var(--gutter-nano);
}

.contact-form button[type="submit"] {
  border: none;
}

/* --------------------------------- */
/* ----- Footer -----*/
/* --------------------------------- */

.footer {
  border-top: 1px solid var(--border);
  padding-block: var(--gutter-x-large);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

@media (max-width: 875px) {
  .footer-content {
    flex-direction: column-reverse;
    gap: var(--gutter-small);
  }
  .footer-text {
    text-align: center;
  }
}

.footer-text {
  font-size: var(--text-small);
}

.footer-text a {
  color: var(--sub);
}

.footer-links {
  display: flex;
  gap: var(--gutter-small);
  list-style-type: none;
}

@media (max-width: 1040px) {
  .footer-links {
    gap: var(--gutter-micro);
  }
}

.footer-link img {
  block-size: 32px;
  inline-size: 32px;
}

.footer-link a {
  opacity: 0.875;
  transition: 225ms ease-in opacity;
}

.footer-link a:hover {
  opacity: 1;
}

body.dark .footer-link img {
  filter: invert(1);
}

.theme-switch {
  /* Track */

  --track-size: calc(var(--thumb-size) * 2);
  --track-padding: 0.225rem;
  --track-inactive: hsl(80 0% 80%);
  --track-active: #d7aefb;

  --track-color-inactive: var(--track-inactive);
  --track-color-active: var(--track-active);

  /* Thumb */

  --thumb-position: 0%;
  --thumb-size: 1.2rem;
  --thumb: hsl(0 0% 100%);
  --thumb-highlight: hsla(0, 0%, 0%, 0.056);

  --thumb-color: var(--thumb);
  --thumb-color-highlight: var(--thumb-highlight);
}

.theme-switch {
  display: flex;
  align-items: center;
  gap: 2ch;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.theme-switch > span,
.theme-switch > input {
  cursor: pointer;
}

.theme-switch span {
  font-size: 1rem;
  color: var(--sub);
}

.theme-switch > input {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  box-sizing: content-box;
  inline-size: var(--track-size);
  block-size: var(--thumb-size);
  padding: var(--track-padding);
  background-color: var(--track-color-inactive);
  border-radius: var(--track-size);
}

.theme-switch > input::after {
  display: block;
  content: "";
  inline-size: var(--thumb-size);
  block-size: var(--thumb-size);
  background-color: var(--thumb-color);
  border-radius: 50%;
  transform: translateX(var(--thumb-position));
  transition: 500ms all cubic-bezier(0.45, 0.05, 0.22, 1.3);
}

input:checked {
  --thumb-position: 100%;
  background-color: var(--track-active);
}

/* --------------------------------- */
/* ----- Agent Updates -----*/
/* --------------------------------- */

/* Hero Updates */
.gradient-text {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
  display: block; /* Ensure it takes full width if needed or inline-block */
}

.micro-line {
  display: block;
  font-size: var(--text-small);
  color: var(--sub);
  margin-block-start: var(--gutter-small); /* Below buttons */
  font-weight: 500;
  opacity: 0.9;
}

/* Portfolio Card Updates */
/* Updating work-box to look like a card */
.work-box {
  background-color: var(--bg-color-secondary);
  padding: var(--gutter-medium);
  border-radius: var(--gutter-small);
  transition: transform 0.3s var(--easing), box-shadow 0.3s var(--easing);
  border: 1px solid var(--border);
  /* Ensure flex layout persists as per original or adjusted */
}

.work-box:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.3);
}

.impact-statement {
  display: block;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  color: var(--sub);
  margin-block-end: var(--gutter-nano);
  font-weight: 600;
  font-family: inherit;
}

.work-outcome {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--important) !important; /* Enforce high contrast (Black/White) */
  margin-block-end: var(--gutter-small);
  font-weight: 400;
  opacity: 1;
}

.work-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-block-end: var(--gutter-small);
}

.tag {
  font-size: 0.85rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background-color: var(--bg-color-primary);
  color: var(--body);
  border: 1px solid var(--border);
  font-weight: 500;
}

.btn-primary-small {
  padding: 12px 28px;
  font-size: 1rem;
  font-weight: 700;
  background-color: var(--important);
  color: var(--bg-color-primary);
  border-radius: var(--gutter-nano);
  text-decoration: none;
  transition: 0.3s all ease-in-out;
  display: inline-block;
}

body.dark .btn-primary-small:hover {
    box-shadow: #ffffff40 0 0 0 4px;
}
body.light .btn-primary-small:hover {
    box-shadow: #07070733 0 0 0 4px;
}

.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 50%;
  transition: background-color 0.2s;
}
.icon-link:hover {
  background-color: var(--border-dark);
}

.icon-link img {
  width: 24px;
  height: 24px;
  display: block;
}

/* CTA Banner */
.cta-banner {
  text-align: center;
  padding-block: var(--gutter-huge);
  background-color: var(--bg-color-secondary);
  border-top: 1px solid var(--border);
  margin-block-start: var(--gutter-huge);
  border-radius: var(--radius); /* Matching main border radius style */
  margin-inline: var(--gutter-small); /* To mimic container or main style */
}

.cta-banner h2 {
  font-size: var(--h2);
  margin-block-end: var(--gutter-medium);
  max-width: 800px;
  margin-inline: auto;
}

/* Performance / Skeleton */
.img-skeleton {
    background-color: var(--border-dark);
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}


/* --------------------------------- */
/* ----- Storytelling Updates -----*/
/* --------------------------------- */

/* Hero Advanced Styling */
.header h1 span:first-child {
  display: block;
  font-size: 0.5em; /* Smaller "Engineered For Impact" */
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
  color: var(--sub);
  font-weight: 700;
}

.gradient-text {
  font-size: 1.2em;
  background: linear-gradient(90deg, #FA709A 0%, #FEE140 100%); /* Stronger contrast gradient */
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
  position: relative;
}

/* Typewriter Cursor */
.gradient-text::after {
  content: '|';
  display: inline-block;
  margin-left: 2px;
  animation: blink 1s step-end infinite;
  color: var(--important); 
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

body.dark .gradient-text {
    background: linear-gradient(90deg, #ff838b, #73ffe1);
}

/* Hero Background Animation */
.header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 50%, rgba(115, 255, 225, 0.05) 0%, transparent 60%);
  animation: pulse-bg 10s ease-in-out infinite;
  z-index: 0;
  pointer-events: none;
}

@keyframes pulse-bg {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* Fade In Animations */
.fade-in {
  opacity: 0;
  animation: fadeIn 0.8s ease-out forwards;
}
.fade-in-delay-1 { animation-delay: 0.2s; }
.fade-in-delay-2 { animation-delay: 0.4s; }
.fade-in-delay-3 { animation-delay: 0.6s; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Value Proposition Section */
.value-prop {
  padding-block: var(--gutter-x-large);
  border-bottom: 1px solid var(--border);
}

.vp-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gutter-medium);
  margin-top: var(--gutter-large);
}

.vp-card {
  background: var(--bg-color-secondary);
  padding: var(--gutter-medium);
  border-radius: var(--gutter-small);
  border: 1px solid var(--border);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.vp-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px -10px rgba(0,0,0,0.2);
}

.vp-icon {
  color: var(--important); /* Use theme color */
  margin-bottom: var(--gutter-small);
}

.vp-icon svg {
  width: 48px;
  height: 48px;
}

@media (max-width: 900px) {
  .vp-columns {
    grid-template-columns: 1fr;
  }
}

/* Work Card Enhancements */
.work-outcome {
  font-size: 0.9rem;
  color: #73ffe1; /* Highlight color */
  margin-bottom: var(--gutter-small);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.work-outcome::before {
  content: "→";
}

/* Philosophy Section */
.philosophy {
  padding-block: var(--gutter-huge);
  text-align: center;
  background: linear-gradient(180deg, var(--bg-color-primary) 0%, var(--bg-color-secondary) 100%);
}

.philosophy-content {
  max-width: 800px;
  margin: 0 auto;
}

.philosophy .h3 {
  font-size: 2.5rem;
  margin-bottom: var(--gutter-medium);
  line-height: 1.3;
}

.philosophy-text {
  font-size: 1.2rem;
  line-height: 1.8;
  color: var(--sub);
}


/* --------------------------------- */
/* ----- Engineering Polish -------*/
/* --------------------------------- */

/* Approach Section */
.approach {
  background-color: var(--bg-color-secondary);
  padding-block: var(--gutter-large);
  border-bottom: 1px solid var(--border);
}

/* My Approach Section */
.approach .h2 {
  text-align: right;
  margin-bottom: var(--gutter-medium);
}

.approach-intro {
  max-width: 700px;
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--sub);
  margin-bottom: var(--gutter-large);
  margin-left: auto; /* Align intro text right as well */
  text-align: right;
}

.process-flow {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--gutter-medium);
  overflow-x: auto;
  padding-bottom: var(--gutter-small);
}

.process-step {
  flex: 1;
  min-width: 200px;
}

.step-number {
  display: block;
  font-size: 3rem;
  font-weight: 800;
  color: var(--border-dark);
  line-height: 1;
  margin-bottom: var(--gutter-nano);
}

.process-step .h4 {
  color: var(--important);
  margin-bottom: var(--gutter-nano);
}

.process-arrow {
  font-size: 2rem;
  color: var(--sub);
  opacity: 0.3;
  align-self: center; /* Center arrow vertically with steps */
  margin-top: -2rem; /* subtle nudge up to align with numbers */
}

@media (max-width: 768px) {
  .process-flow {
    flex-direction: column;
    gap: var(--gutter-large);
  }
  .process-arrow {
    transform: rotate(90deg);
    align-self: center;
    padding: 0;
  }
}

/* Engineering Stack Grid */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gutter-large);
  margin-top: var(--gutter-medium);
}

.skill-category {
  background: var(--bg-color-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--gutter-medium);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s;
}

.skill-category:hover {
  transform: translateY(-2px);
  border-color: var(--border-dark);
}

.skill-category h3 {
  margin-bottom: var(--gutter-medium);
  font-size: 1.1rem;
  color: var(--important);
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.5rem;
  display: inline-block;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.skill-tag {
  background: var(--bg-color-secondary);
  color: var(--sub);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.skill-tag:hover {
  background: var(--important);
  color: var(--bg-color-primary);
  transform: translateY(-1px);
}

/* Premium CTA Banner */
.premium-cta {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 6rem 1rem;
  background: linear-gradient(135deg, var(--bg-color-secondary) 0%, var(--bg-color-primary) 100%);
  border-top: 1px solid var(--border);
}

.premium-cta::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, rgba(115, 255, 225, 0.03) 0%, transparent 50%);
  animation: pulse-bg 15s infinite linear;
  pointer-events: none;
}

.cta-subtitle {
  font-size: 1.25rem;
  color: var(--sub);
  margin-bottom: 2rem;
  max-width: 600px;
  margin-inline: auto;
}

/* Global Polish */
html {
  scroll-behavior: smooth;
}

.section, section {
  padding-block: var(--gutter-x-large); /* Harmonized shorter vertical spacing */
}

/* Fade in on scroll class (JS to toggle opacity) */
.fade-in-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}


/* --------------------------------- */
/* ----- Global Visual Polish -----*/
/* --------------------------------- */

/* Consistent Border Radius */
.work-box, .vp-card, .skill-category, .article-box, .cta-banner {
  border-radius: 1.5rem; /* ~24px for a modern, friendly feel */
}

/* Soft Layered Shadows */
.work-box:hover, .vp-card:hover, .skill-category:hover, .article-box:hover {
  box-shadow: 
    0 10px 15px -3px rgba(0, 0, 0, 0.1), 
    0 4px 6px -2px rgba(0, 0, 0, 0.05),
    0 20px 25px -5px rgba(0, 0, 0, 0.1); /* Deeper shadow on hover */
}

/* Subtle Hover Effects */
a, button, .btn {
  transition: all 0.3s ease-in-out;
}

/* Improved Vertical Rhythm */
section {
  padding-block: var(--gutter-huge);
}

/* Sticky Navbar with Blur */
.header .menu-btn-container {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(var(--bg-color-primary-rgb), 0.8); /* Requires RGB var or fallback */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-block: 1rem;
}

/* Skeleton Loading Polish */
.img-skeleton {
  background: linear-gradient(90deg, var(--bg-color-secondary) 25%, var(--border) 50%, var(--bg-color-secondary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}


/* --------------------------------- */
/* ----- Menu Refactor -----*/
/* --------------------------------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}



/* Desktop Navigation (>= 768px) */
@media (min-width: 768px) {
  /* Hide the toggle button */
  .menu-btn-container {
    display: none;
  }

  /* Reset Nav Container */
  .nav {
    position: absolute; /* Place over hero background */
    top: 0;
    left: 0;
    width: 100%;
    min-block-size: auto; /* Remove full height */
    background: transparent; /* Remove solid background */
    background-image: none; /* Remove gradient */
    padding: var(--gutter-medium) var(--gutter-large);
    z-index: 10;
    transform: none !important; /* Override .hidden */
    visibility: visible !important; /* Override .hidden */
    display: flex;
    justify-content: flex-end; /* Align right */
  }

  /* Reset Nav Items List */
  .nav-items {
    position: static; /* Remove absolute centering */
    transform: none;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--gutter-medium);
  }

  .nav-item:not(:last-child) {
    margin-block-end: 0; /* Remove vertical spacing */
  }

  /* Link Styling */
  .nav-item a {
    font-size: 1.1rem; /* Smaller font for desktop menu */
    font-weight: 500;
    color: var(--important); /* Use theme text color */
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }
  
  /* Theme Toggle Item Alignment */
  .theme-toggle-item {
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 1px solid var(--border-dark);
    display: flex;
    align-items: center;
  }
}

/* Gradient Text Removal */
.gradient-text {
  background: none !important;
  -webkit-text-fill-color: var(--important) !important;
  color: var(--important) !important;
  font-family: monospace; /* Typewriter font style */
}


/* --------------------------------- */
/* ----- Menu Item Container Fix -----*/
/* --------------------------------- */
/* Fix for nav-items being absolute on mobile but static on desktop */
@media (min-width: 768px) {
  .nav-items {
    top: auto;
    left: auto;
    transform: none;
    width: auto;
  }
}
@media (max-width: 767px) {
  .nav {
    display: block; /* ensure block on mobile so hidden works */
  }
  .nav.hidden {
    transform: translateX(-100%);
    visibility: hidden;
  }
  .nav-items {
    padding-top: 5rem;
    top: 0;
    left: 0;
    transform: none;
    width: 100%;
    padding-left: 1.5rem;
  }
  .nav-item {
    margin-bottom: 1.25rem;
  }
}


/* --------------------------------- */
/* ----- Availability Badge -----*/
/* --------------------------------- */

.availability-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-color-primary);
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-size: 0.95rem;
  color: var(--important);
  font-weight: 500;
  margin-bottom: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.pulse-dot {
  position: relative;
  display: block;
  width: 10px;
  height: 10px;
  background-color: #22c55e;
  border-radius: 50%;
}

.pulse-dot::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  background-color: #22c55e;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: pulse-ring 2s cubic-bezier(0.25, 0.8, 0.25, 1) infinite;
}

@keyframes pulse-ring {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.8;
  }
  100% {
    transform: translate(-50%, -50%) scale(2.5);
    opacity: 0;
  }
}

/* Ensure footer content flows well */
/* Initial footer layout maintenance */
.footer-content {
  text-align: center;
}
