/* ================================
   CSS VARIABLES & FOUNDATION
   ================================ */

@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 {
  /* Typography Scale */
  --h1: 3.5rem;
  --h2: 3rem;
  --h3: 2.145rem;
  --h4: 1.5rem;
  --text-large: 1.6rem;
  --text-medium: 1.275rem;
  --text-small: 1.125rem;

  /* Design System */
  --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);

  /* Layout */
  --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;
}

/* Theme Variables */
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);
}

/* ================================
   RESET & BASE STYLES
   ================================ */

*,
*::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);
}

/* ADD FIX 9 HERE - after the html selector */
html {
  font-family: "Mona Sans", sans-serif;
  box-sizing: border-box;
  scroll-padding-top: var(--scroll-padding);
  /* ADD THIS: */
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--scroll-padding) - 1rem); /* Adjust padding */
}

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;
}

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

textarea {
  resize: none;
}

input,
textarea,
button {
  font: inherit;
}

/* ================================
   TYPOGRAPHY
   ================================ */

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

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); }
.h5 { font-size: var(--h3); text-align: center; }

/* ================================
   RESPONSIVE TYPOGRAPHY
   ================================ */

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

@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: 645px) {
  html { font-size: 80%; }
}

@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;
  }
}

/* ================================
   UTILITY CLASSES
   ================================ */

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

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

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

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

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

/* ================================
   RESPONSIVE CONTAINER
   ================================ */

@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-small); }
}

/* ================================
   BUTTON 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;
}

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

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

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

/* CTA Button Hover Effects */
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);
}

/* ================================
   LINK COMPONENT
   ================================ */

.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);
}

/* ================================
   RESPONSIVE BUTTONS
   ================================ */

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

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

/* ================================
   LAYOUT STRUCTURE
   ================================ */

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

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

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: 885px) {
  :root {
    --gutter-huge: 8rem;
    --gutter-x-large: 4rem;
  }
}

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

/* ================================
   NAVIGATION & MENU
   ================================ */

.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;
}

.nav {
  min-block-size: 100vh;
  position: fixed;
  width: 100%;
  background-color: #ff5e99;
  background-image: var(--gradient-brand);
  transition: 450ms var(--easing);
  z-index: 3;
}

.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 SECTION
   ================================ */

.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: 50%;
  transform: translateY(-50%);
}

.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);
}

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

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

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

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

/* ================================
   CLIENT LOGOS SECTION
   ================================ */

.logos {
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  padding-block-start: var(--gutter-x-large);
}

.logo-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.logo {
  position: absolute;
  top: 0;
  max-block-size: 60px;
  max-inline-size: 150px;
  transition: all 2.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.logo.hide { opacity: 0; }
.logo.to-top { transform: scale(0.4) translateY(-150px); }
.logo.to-bottom { transform: scale(0.4) translateY(150px); }

body.dark .logo { filter: invert(97%) grayscale(100%) opacity(0.6); }
body.light .logo { filter: grayscale(100%) opacity(0.6); }

/* Logo Responsive */
@media (max-width: 885px) {
  .logos { padding-block-start: calc(var(--gutter-x-large) + var(--gutter-x-large) - 2rem); }
}

@media (max-width: 845px) {
  .logo { max-inline-size: 100px; }
  .logo-group:last-child { display: none; }
}

@media (max-width: 400px) {
  .logo { max-inline-size: 85px; }
}

/* ================================
   WORK SECTION
   ================================ */

.work-tabs {
  display: flex;
  justify-content: center;
  gap: var(--gutter-small);
  margin-bottom: var(--gutter-large);
}

/* Fix 5: Improve tab button states */
.work-tab-btn {
  background: none;
  border: none;
  color: var(--sub);
  cursor: pointer;
  font-size: var(--text-large);
  padding: var(--gutter-nano) var(--gutter-micro);
  transition: all 0.2s ease; /* Faster transition */
  border-radius: var(--gutter-nano);
  position: relative;
}

.work-tab-btn:focus {
  outline: none;
  background-color: var(--border);
}

.work-tab-btn.active {
  color: var(--important);
  background-color: var(--border);
}

.work-tab-btn.active::after {
  display: none; /* This will hide the underline */
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 2px;
  background-color: var(--important);
  border-radius: 1px;
}

.work-tab-content {
  display: none;
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
}

.work-tab-content.active {
  display: block;
  opacity: 1;
}

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

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

.work-box:not(:last-child) {
  margin-block-end: var(--gutter-huge);
}

.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;
}

.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);
}

.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 Animation */
/* ADD FIX 6 HERE - Alternative approach */
.work-tab-content.active .work-textbox h3,
.work-tab-content.active .work-text,
.work-tab-content.active .work-technologies,
.work-tab-content.active .work-links {
  animation: none; /* Completely remove animations for instant loading */
  opacity: 1;
  transform: none;
}

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

/* ADD FIX 8 HERE - Remove webkit focus styles */
.work *:focus {
  -webkit-tap-highlight-color: transparent;
}

/* Work Responsive */
@media (max-width: 1285px) {
  .work-box:not(:last-child) { margin-block-end: 8rem; }
}

@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); }
}

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

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

/* ADD FIX 7 HERE - after the work responsive section */
/* Fix 7: Ensure work section doesn't get focus styles when scrolling */
.work {
  scroll-margin-top: var(--scroll-padding);
}

.work:target {
  outline: none;
  box-shadow: none;
}

/* ================================
   ARTICLES SECTION
   ================================ */

.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;
}

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

.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);
}

/* Articles Responsive */
@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; }
  .featured-article {
    margin-block-end: 24.4px;
    flex-direction: column-reverse;
  }
}

@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; }
}

/* ================================
   TESTIMONIALS SECTION
   ================================ */

.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)
  );
}

.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);
}

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

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

/* ================================
   SKILLS SECTION
   ================================ */

.skills-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gutter-large);
  margin-top: var(--gutter-large);
}

.skills-category {
  border: 1px solid var(--border);
  padding: var(--gutter-medium);
  border-radius: var(--gutter-nano);
}

.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;
}

.skills-list {
  list-style: none;
  padding: 0;
}

.skills-list li {
  font-size: var(--text-medium);
  margin-bottom: var(--gutter-micro);
}

/* Other Skills Word Cloud */
.other-skills-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 15px 25px;
  padding: var(--gutter-medium);
  margin: 0;
  min-height: 200px;
  text-align: center;
}

.skill-text {
  font-weight: bold;
  transition: transform 0.3s ease, color 0.3s ease;
  cursor: default;
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  color: #fff !important;
}

.skill-text:nth-child(1) { font-size: 1.8rem; }
.skill-text:nth-child(2) { font-size: 2.2rem; }
.skill-text:nth-child(3) { font-size: 1.6rem; }
.skill-text:nth-child(4) { font-size: 2.4rem; }
.skill-text:nth-child(5) { font-size: 2rem; }

.skill-text:hover {
  transform: scale(1.1);
  filter: brightness(1.2);
}

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

@media (max-width: 810px) {
  .skills-grid { grid-template-columns: 1fr; }
  .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;
  }
  .other-skills-list {
    gap: 10px 15px;
    padding: var(--gutter-small);
    min-height: 150px;
  }
  .skill-text:nth-child(1) { font-size: 1.4rem; }
  .skill-text:nth-child(2) { font-size: 1.8rem; }
  .skill-text:nth-child(3) { font-size: 1.2rem; }
  .skill-text:nth-child(4) { font-size: 2rem; }
  .skill-text:nth-child(5) { font-size: 1.6rem; }
}

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

/* ================================
   ROLES SECTION
   ================================ */

.roles {
  padding-block: var(--gutter-huge);
  padding-block-end: var(--gutter-large);
}

.roles-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--gutter-large);
  margin-top: var(--gutter-large);
}

.role-item {
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.role-item h3 {
  color: #111;
  margin-bottom: 10px;
}

.role-item p {
  color: #444;
  line-height: 1.6;
}

.role-item ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.role-item li {
  color: #444;
  margin-bottom: 8px;
}

/* ================================
   CONTACT SECTION
   ================================ */

.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);
}

.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;
  margin-right: 1rem;
}

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

/* ================================
   FOOTER SECTION
   ================================ */

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

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

.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;
}

.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);
}

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

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

/* ================================
   THEME SWITCH
   ================================ */

.theme-switch {
  /* CSS Custom Properties for Switch */
  --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-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);

  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);
}

/* ================================
   TOOLKIT SECTION
   ================================ */

.skills {
  padding-block-start: 0;
}

.toolkit {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
}

.toolkit-section {
  flex: 1;
  min-width: 250px;
}

/* ================================
   SECTION SPACING OVERRIDES
   ================================ */

/* Work Section Spacing */
.work .work-boxes {
  padding-block-start: 0 !important;
  margin-block-start: var(--gutter-x-large);
  margin-block-end: 0;
}

.work-box:not(:last-child) {
  margin-block-end: var(--gutter-large) !important;
}

@media (max-width: 1285px) {
  .work-box:not(:last-child) {
    margin-block-end: 4rem !important;
  }
}

/* Article Section Spacing */
.work + .article {
  padding-block-start: var(--gutter-large) !important;
}

.article .article-boxes {
  margin-block-start: var(--gutter-medium) !important;
}

/* Work Tab Content */
.work-tab-content {
  /* Default hidden state handled by JS */
}

.work-tab-content.active {
  display: block;
}

/* ADD FIX 10 HERE - Modify the existing work spacing */
.work .work-boxes {
  padding-block-start: 0 !important;
  margin-block-start: var(--gutter-large); /* Changed from var(--gutter-x-large) */
  margin-block-end: 0;
  min-height: 400px; /* ADD THIS - Prevent layout shift */
}

/* FIXES FROM HERE */
/* Additional fix for tab content visibility and focus issues */
.work-tab-content:not(.active) {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

.work-tab-content:focus,
.work-tab-content:focus-visible,
.work-section:focus,
.work-section:target {
  outline: none !important;
  box-shadow: none !important;
}

.work:focus,
.work:focus-visible {
  outline: none;
  box-shadow: none;
}

.work-box:focus,
.work-textbox:focus,
.work-img:focus {
  outline: none;
  box-shadow: none;
}

/* ========== MOBILE FIXES (paste near end of style.css) ========== */

/* Use modern viewport height on supporting browsers, and fall back to 100vh.
   Avoid oversizing the header on small screens and remove fixed background. */
.header {
  /* fallback for older browsers */
  min-block-size: 100vh;
  /* modern unit that avoids browser chrome issues where supported */
  min-block-size: 100svh;
  background-attachment: scroll; /* prevent mobile painting/positioning issues */ 
  padding-block-end: calc(var(--radius) / 2);
}

/* Reduce main upward shift on small viewports so content doesn't overlap awkwardly */
@media (max-width: 700px) {
  main {
    transform: translateY(calc(-1 * var(--radius) / 2));
  }
}

/* Reduce huge vertical spacing used between work boxes on phones */
@media (max-width: 700px) {
  :root {
    --gutter-huge: 2.5rem; /* much smaller gap on phones */
    --gutter-x-large: 2rem;
    --gutter-large: 1.2rem;
  }

  /* Ensure work items stack cleanly with reasonable gaps */
  .work-box:not(:last-child) {
    margin-block-end: 1.6rem !important;
  }

  .work-box {
    gap: 0.6rem;
  }

  .work-img,
  .work-textbox {
    flex-basis: 100%;
    max-inline-size: 100%;
  }

  .work-img { margin-block-end: 1rem; }
}

/* Ensure header textbox centers nicely and fits on small screens */
@media (max-width: 480px) {
  .header-textbox {
    left: 1rem;
    right: 1rem;
    width: auto;
    position: relative; /* let textbox flow within header on very small screens */
    top: auto;
    transform: none;
    text-align: center;
    padding-inline: 0.5rem;
    margin-block-start: 1.4rem;
  }

  .header-btns {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    width: 100%;
    align-items: center;
  }

  .header-text {
    max-inline-size: 100%;
    margin-block-end: 1rem;
  }
}

/* Make menu button and nav centering better on mobiles */
@media (max-width: 700px) {
  .menu-btn {
    inline-size: 100px;
    padding-inline: 0.6rem;
    margin-inline-start: auto;
  }

  .nav-items {
    left: 50%;
    transform: translateY(-50%) translateX(-50%);
    padding-inline: 1rem;
    text-align: center;
    width: 100%;
  }

  .nav-item a { font-size: 1.6rem; line-height: 1.25; }
}

/* Prevent overly tall logo / spacing causing pushes on tiny screens */
@media (max-width: 420px) {
  :root {
    --radius: 36px;
  }
  .logo { max-inline-size: 75px; max-block-size: 48px; }
}

/* Prevent large focus/tap highlight issues */
* { -webkit-tap-highlight-color: transparent; }

/* Optional: force images to never overflow (defensive) */
img, picture { max-width: 100%; height: auto; object-fit: cover; }

/* End mobile fixes */

/* MOBILE: make tabs horizontally scrollable so no tab is clipped */
@media (max-width: 760px) {
  .work-tabs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* smooth native scrolling on iOS */
    padding-inline: 0.75rem;           /* give room for the first/last tabs */
    scrollbar-width: thin;             /* firefox */
    justify-content: flex-start;       /* don't center, show beginning */
  }

  /* keep each tab sized to its content (no shrinking to zero) */
  .work-tab-btn {
    flex: 0 0 auto;
    white-space: nowrap;               /* prevent wrapping inside button */
    font-size: 1.05rem;                /* slightly smaller on phones */
    padding: 0.45rem 0.65rem;
  }

  /* optional: hide native scrollbar but keep scrollability (webkit) */
  .work-tabs::-webkit-scrollbar { height: 8px; }
  .work-tabs::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(0,0,0,0.12); }
}

/* =========================
   Mobile: contact form buttons
   ========================= */

/* Make contact form buttons responsive and avoid spillover.
   Layout: side-by-side when space allows, stack on very small screens. */
/* ========================
   Contact form button fix
   ======================== */

/* On very small screens, stack buttons neatly full-width */
@media (max-width: 420px) {
  .contact-form .btn,
  .contact-form a.btn {
    display: block;
    width: 100%;
    padding: 14px 0;   /* smaller padding so text still fits */
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
  }

  /* keep spacing consistent */
  .contact-form .btn:last-child {
    margin-bottom: 0;
  }
}

/* =========================
   Mobile: reduce header gap before body
   ========================= */

/* Gentle reduction of header height and the main upward shift for smaller viewports.
   Keeps desktop behaviour intact while preventing too-large gaps on phones. */
@media (max-width: 900px) {
  .header {
    /* prefer svh where supported but a smoothed reduction for phones */
    min-block-size: calc(100svh - 2.25rem);
    padding-block-end: calc(var(--radius) / 2.6);
    background-attachment: scroll; /* already recommended earlier — safer on mobile */
  }

  /* Reduce the upward translate so stacked content doesn't visually overlap */
  main {
    transform: translateY(calc(-1 * var(--radius) / 2.6));
  }
}

/* Extra shrink for very small phones */
@media (max-width: 420px) {
  :root { --radius: 36px; } /* slightly smaller radius helps the header/body spacing */
  .header { min-block-size: calc(100svh - 3.1rem); padding-block-end: calc(var(--radius) / 3.2); }
  main { transform: translateY(calc(-1 * var(--radius) / 3.2)); }
  .header-textbox { padding-inline: 0.6rem; left: auto; right: auto; width: auto; transform: none; position: relative; text-align: center; }
}
