/* latin-ext */
@font-face {
  font-family: 'Lato';
  font-style: italic;
  font-weight: 400;
  src: local('Lato Italic'), local('Lato-Italic'), url(https://fonts.gstatic.com/s/lato/v15/S6u8w4BMUTPHjxsAUi-qNiXg7eU0.woff2) format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Lato';
  font-style: italic;
  font-weight: 400;
  src: local('Lato Italic'), local('Lato-Italic'), url(https://fonts.gstatic.com/s/lato/v15/S6u8w4BMUTPHjxsAXC-qNiXg7Q.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Lato';
  font-style: italic;
  font-weight: 700;
  src: local('Lato Bold Italic'), local('Lato-BoldItalic'), url(https://fonts.gstatic.com/s/lato/v15/S6u_w4BMUTPHjxsI5wq_FQftx9897sxZ.woff2) format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Lato';
  font-style: italic;
  font-weight: 700;
  src: local('Lato Bold Italic'), local('Lato-BoldItalic'), url(https://fonts.gstatic.com/s/lato/v15/S6u_w4BMUTPHjxsI5wq_Gwftx9897g.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 400;
  src: local('Lato Regular'), local('Lato-Regular'), url(https://fonts.gstatic.com/s/lato/v15/S6uyw4BMUTPHjxAwXiWtFCfQ7A.woff2) format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 400;
  src: local('Lato Regular'), local('Lato-Regular'), url(https://fonts.gstatic.com/s/lato/v15/S6uyw4BMUTPHjx4wXiWtFCc.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 700;
  src: local('Lato Bold'), local('Lato-Bold'), url(https://fonts.gstatic.com/s/lato/v15/S6u9w4BMUTPHh6UVSwaPGQ3q5d0N7w.woff2) format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 700;
  src: local('Lato Bold'), local('Lato-Bold'), url(https://fonts.gstatic.com/s/lato/v15/S6u9w4BMUTPHh6UVSwiPGQ3q5d0.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Dark mode styles */
:root {
  --bg-color: #ffffff;
  --text-color: #333333;
  --card-bg: #f9f9f9;
  --border-color: #eaeaea;
  --link-color: #e86d5e;
  --link-hover: #e86d5e;
  --shadow-color: rgba(0, 0, 0, 0.1);
  --button-bg: #e86d5e;
  --button-text: white;
  --modal-bg: white;
}

[data-theme="dark"] {
  --bg-color: #121212;
  --text-color: #e0e0e0;
  --card-bg: #1e1e1e;
  --border-color: #333333;
  --link-color: #ff8a7a;
  --link-hover: #ff8a7a;
  --shadow-color: rgba(0, 0, 0, 0.3);
  --button-bg: #ff8a7a;
  --button-text: #121212;
  --modal-bg: #1e1e1e;
}

body {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14px;
  margin: 0;
  padding: 0;
  background-color: var(--bg-color);
  line-height: 1.5;
  color: var(--text-color);
  transition: background-color 0.3s ease, color 0.3s ease;
  display: flex;
  justify-content: center;
}

a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.2s ease-out;
}

a:focus,
a:hover {
  color: var(--link-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

body,
td,
th,
tr,
p,
a {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14px;
}

strong {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14px;
}

h2 {
  margin: 0;
  font-weight: normal;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 22px;
  margin-top: 0;
  margin-bottom: 1em;
}

button,
input,
textarea,
select {
  font-family: inherit;
}

.papertitle {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
}

.name {
  padding-top: 20px;
  margin: 0;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 32px;
  text-align: center;
}

.container {
  position: relative;
  max-width: 900px;
  margin: 50px 0;
  padding: 40px;
  background-color: var(--bg-color);
  box-shadow: 0 0 10px var(--shadow-color);
  border-radius: 8px;
  box-sizing: border-box;
  margin-left: 0;
}

.header {
  display: flex;
  align-items: center;
  gap: 40px;
  margin-bottom: 30px;
  padding-bottom: 30px;
  border-bottom: none;
}

.header-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 0 0 60px 0;
}

.content {
  flex: 1;
  max-width: 600px;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.profile-image {
  width: 250px;
  height: 250px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #f0f0f0;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  align-self: center;
  margin-top: 20px;
  transition: transform 0.4s ease-out;
}

.links {
  margin-top: 20px;
  text-align: left;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.links a {
  margin-right: 0;
}

.section {
  margin-bottom: 60px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--border-color);
  transition: opacity 0.3s ease;
}

.section:first-of-type {
  display: none; /* Hide the empty about section */
}

.section:last-of-type {
  border-bottom: none;
  margin-bottom: 20px;
}

.project-grid {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.project-card {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  background-color: var(--card-bg);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 5px var(--shadow-color);
  transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
}

.project-image {
  flex: 0 0 auto;
  width: 160px;
  margin-right: 20px;
  position: relative;
}

.project-image img,
.project-image video {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 5px;
}

.project-content {
  flex: 1;
}

.one {
  position: relative;
  width: 100%;
  height: 100%;
  /* Safari: make the rounded clip apply to the hardware-composited video layer */
  isolation: isolate;
  -webkit-mask-image: -webkit-radial-gradient(white, black);
}

.two {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.4s ease-out;
}

.two video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* Safari draws dark hairlines at the edges of a scaled-down video; push the
     edges just outside the clip and match the video's light grey background */
  transform: scale(1.03);
  background-color: #eeeeee;
}

.one img {
  width: 100%;
  display: block;
}

.project-card:hover .two {
  opacity: 1;
}

.project-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}

span.highlight {
  background-color: #ffffd0;
}

.colored-box {
    color: black;
    padding: 20px;
    display: inline-block;
    border-radius: 10px;
}

.papertitle {
  font-size: 16px;
  font-weight: 700;
  color: #222222;
}

.name {
  font-size: 36px;
  font-weight: bold;
  margin-bottom: 15px;
  color: #222222;
  text-align: left;
}

@media (max-width: 768px) {
  .container {
    margin: 20px auto;
    padding: 20px;
    padding-left: 20px;
  }
  
  .header {
    flex-direction: column;
    gap: 20px;
    text-align: left;
  }
  
  .profile-image {
    width: 180px;
    height: 180px;
    margin: 0 auto 20px;
  }
  
  .project-card {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    padding: 15px;
  }
  
  .project-image {
    width: 100%;
    max-width: 200px;
    margin: 0 0 15px 0;
  }
  
  .project-content {
    padding-top: 0;
    width: 100%;
    text-align: left;
  }
  
  /* Improve links section for mobile */
  .links {
    justify-content: flex-start;
    gap: 8px;
    margin-top: 15px;
    flex-wrap: wrap;
    text-align: left;
  }
  
  .links a {
    margin-right: 0;
    padding: 3px 0;
  }
  
  /* Consistent font sizes for mobile */
  body, td, th, tr, p, a, strong, .links, .links a, .project-content p {
    font-size: 16px;
    line-height: 1.5;
  }
  
  h2 {
    font-size: 22px;
    margin-bottom: 15px;
    text-align: left;
  }
  
  .name {
    font-size: 28px;
    margin-bottom: 15px;
    text-align: left;
  }
  
  .papertitle {
    font-size: 18px;
    margin-bottom: 5px;
    text-align: left;
  }
  
  /* Adjust header divider for mobile */
  .header-divider {
    margin: 0 0 40px 0;
  }
  
  /* Adjust section spacing for mobile */
  .section {
    margin-bottom: 40px;
    padding-bottom: 20px;
    text-align: left;
  }
  
  /* Adjust dark mode toggle position and size for mobile */
  .header-utilities {
    top: 15px;
    right: 15px;
  }
  
  #darkModeToggle {
    font-size: 20px;
    width: 36px;
    height: 36px;
  }
}

/* Even smaller screens */
@media (max-width: 480px) {
  .profile-image {
    width: 150px;
    height: 150px;
  }
  
  .project-image {
    width: 100%;
    max-width: 250px;
    margin: 0 auto 15px;
  }
  
  /* Slightly smaller fonts for very small screens */
  body, td, th, tr, p, a, strong, .links, .links a, .project-content p {
    font-size: 15px;
  }
  
  h2 {
    font-size: 20px;
  }
  
  .name {
    font-size: 26px;
  }
  
  .papertitle {
    font-size: 16px;
  }
  
  /* Adjust container padding */
  .container {
    padding: 15px 12px;
  }
}

/* Smooth scrolling for better UX */
html {
  scroll-behavior: smooth;
}

/* Improve link hover states */
a:hover {
  color: var(--link-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Add subtle animation to profile image */
.header:hover .profile-image {
  transform: scale(1.01);
}

/* Improve typography spacing */
p {
  line-height: 1.6;
}

/* Substack Integration Styles */
.loading-indicator {
  text-align: center;
  padding: 20px;
  color: #777;
  font-style: italic;
}

.error-message {
  background-color: #f8f8f8;
  border-left: 3px solid var(--link-color);
  padding: 15px;
  margin: 20px 0;
  border-radius: 4px;
}

/* Smooth image loading */
.project-image img {
  transition: opacity 0.3s ease;
}

/* Placeholder for images while loading */
.project-image img[src="images/substack-placeholder.jpg"] {
  background-color: #f0f0f0;
  min-height: 100px;
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: var(--modal-bg);
  padding: 30px;
  border-radius: 8px;
  max-width: 500px;
  width: 90%;
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.close-button {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 24px;
  cursor: pointer;
  color: #666;
}

.close-button:hover {
  color: var(--link-color);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-family: inherit;
  font-size: 15px;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: all 0.3s ease;
  box-sizing: border-box;
}

/* Add subtle highlight on hover */
.form-group input:hover,
.form-group textarea:hover {
  border-color: rgba(232, 109, 94, 0.4);
}

/* Enhanced focus state with salmon accent - without background color */
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--link-color);
  box-shadow: 0 0 0 3px rgba(232, 109, 94, 0.1);
}

/* Dark mode adjustments */
[data-theme="dark"] .form-group input:hover,
[data-theme="dark"] .form-group textarea:hover {
  border-color: rgba(255, 138, 122, 0.4);
}

[data-theme="dark"] .form-group input:focus,
[data-theme="dark"] .form-group textarea:focus {
  border-color: var(--link-color);
  box-shadow: 0 0 0 3px rgba(255, 138, 122, 0.1);
}

.form-group button {
  background-color: var(--link-color);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.3s ease;
  width: auto;
  min-width: 140px;
}

.form-group button:hover {
  background-color: var(--link-hover);
  transform: translateY(-1px);
}

/* Button states */
.form-group button:disabled,
.form-group button:hover:disabled {
  background-color: var(--border-color);
  cursor: not-allowed;
  transform: none;
  opacity: 0.7;
}

/* Dark mode button states */
[data-theme="dark"] .form-group button:disabled,
[data-theme="dark"] .form-group button:hover:disabled {
  background-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.5);
}

/* Remove default button styling on mobile */
.form-group button {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* Create a header utility section */
.header-utilities {
  position: absolute;
  top: 20px;
  right: 40px;
  z-index: 10;
}

/* Adjust the toggle button styling */
#darkModeToggle {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  transition: background-color 0.3s;
  position: relative;
}

#darkModeToggle:hover {
  transform: scale(1.1);
}

#darkModeToggle .sun,
#darkModeToggle .moon {
  position: absolute;
  transition: opacity 0.3s ease, transform 0.5s ease;
}

[data-theme="dark"] #darkModeToggle .sun {
  opacity: 0;
  transform: translateY(20px);
}

[data-theme="dark"] #darkModeToggle .moon {
  opacity: 1;
  transform: translateY(0);
}

[data-theme="light"] #darkModeToggle .sun {
  opacity: 1;
  transform: translateY(0);
}

[data-theme="light"] #darkModeToggle .moon {
  opacity: 0;
  transform: translateY(-20px);
}

/* Add this to your dark mode styles */
[data-theme="dark"] .name {
  color: #ffffff; /* Bright white for the name in dark mode */
}

/* You might also want to adjust other header text for better contrast */
[data-theme="dark"] .header p {
  color: #e0e0e0; /* Light gray for paragraph text in the header */
}

/* Refined dark mode container styling */
[data-theme="dark"] .container {
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
  border: 1px solid;
  border-color: #333333 #3a3a3a #3a3a3a #333333;
  border-radius: 12px; /* Slightly softer radius to match profile image aesthetic */
  background: linear-gradient(
    145deg,
    rgba(24, 24, 24, 1) 0%,
    rgba(18, 18, 18, 1) 100%
  ); /* Very subtle gradient for depth */
}

/* Ensure light mode maintains its style */
[data-theme="light"] .container {
  border-radius: 8px; /* Keep original or match the new radius */
}

/* Improve shadow visibility in dark mode for project cards */
[data-theme="dark"] .project-card {
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
  border: 1px solid #2a2a2a;
}

/* Add subtle hover effect to enhance depth perception */
[data-theme="dark"] .container:hover {
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  transition: box-shadow 0.3s ease;
}

/* Enhanced profile image styling for both modes */
.profile-image {
  border: 3px solid #f0f0f0;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

[data-theme="dark"] .profile-image {
  border: 3px solid #2a2a2a;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

/* Fix for dark mode section titles (h2) */
[data-theme="dark"] h2 {
  color: #ffffff;
}

/* Fix for dark mode project titles (papertitle class) */
[data-theme="dark"] .papertitle {
  color: #ffffff;
}

/* Fix for any other text elements that might need contrast adjustment */
[data-theme="dark"] .project-content p,
[data-theme="dark"] .section p {
  color: #e0e0e0;
}

/* Ensure links maintain good visibility in dark mode */
[data-theme="dark"] .project-content a {
  color: var(--link-color);
  font-weight: 500;
}

/* Mobile optimizations */
@media (max-width: 768px) {
  /* Reposition profile image to top for mobile */
  .profile-container {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
}

/* Create a proper sidebar */
.vertical-nav {
  position: fixed;
  left: calc(50% - 560px);
  top: 30%;
  transform: translateY(-30%);
  height: auto;
  width: 80px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 30px;
  text-align: right;
  z-index: 100;
  background-color: transparent;
}

/* Style the nav links */
.vertical-nav a {
  display: block;
  text-decoration: none;
  color: var(--text-color);
  opacity: 0.4;
  font-size: 15px;
  font-weight: 400;
  transition: all 0.3s ease;
  padding-right: 0;
  padding-left: 0;
  text-align: right;
}

.vertical-nav a:hover {
  opacity: 0.7;
  transform: none;
}

.vertical-nav a.active {
  opacity: 0.9;
  color: #555555;
  font-weight: 500;
}

.vertical-nav a span {
  position: relative;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

/* Dark mode adjustments */
[data-theme="dark"] .vertical-nav a {
  color: var(--text-color);
}

[data-theme="dark"] .vertical-nav a.active {
  color: #a0a0a0;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .vertical-nav {
    left: 20px;
  }
}

/* Form status messages - updated colors to match site theme */
.success-message {
  background-color: rgba(232, 109, 94, 0.08);
  color: var(--link-color);
  padding: 12px 15px;
  border-radius: 6px;
  margin-top: 15px;
  font-size: 14px;
  border-left: 3px solid var(--link-color);
  letter-spacing: 0.02em;
}

[data-theme="dark"] .success-message {
  background-color: rgba(255, 138, 122, 0.1);
  color: var(--link-color);
  border-left: 3px solid var(--link-color);
}

.error-message {
  background-color: rgba(244, 67, 54, 0.08);
  color: #e57373;
  padding: 12px 15px;
  border-radius: 6px;
  margin-top: 15px;
  font-size: 14px;
  border-left: 3px solid #e57373;
  letter-spacing: 0.02em;
}

[data-theme="dark"] .error-message {
  background-color: rgba(244, 67, 54, 0.1);
  color: #ff8a7a;
  border-left: 3px solid #ff8a7a;
}

/* Form improvements - consistent padding */
.modal-content {
  padding: 30px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-color);
  padding: 0 2px; /* Subtle padding for labels */
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 15px; /* Consistent horizontal padding */
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-family: inherit;
  font-size: 15px;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: all 0.3s ease;
  box-sizing: border-box; /* Ensure padding doesn't affect width */
}

/* Mobile responsiveness for form */
@media (max-width: 768px) {
  .modal-content {
    width: 100%;
    max-width: none;
    border-radius: 8px;
    padding: 20px;
    margin: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    position: relative;
  }
  
  /* Improved close button positioning for mobile */
  .close-button.mobile-position {
    position: fixed;
    top: 15px;
    left: 15px;
    right: auto;
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--card-bg);
    border-radius: 50%;
    box-shadow: 0 2px 5px var(--shadow-color);
    z-index: 1002;
  }
  
  /* Hide hamburger when modal is open */
  .mobile-nav-toggle.hidden-by-modal {
    display: none !important;
  }
  
  /* Add a cancel button at the bottom of the form */
  .form-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
  }
  
  .cancel-button {
    flex: 1;
    background-color: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
  }
  
  .submit-button {
    flex: 1;
    background-color: var(--link-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
  }
  
  /* Prevent scrolling of background when modal is open */
  body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
  }
}

/* Desktop styles for form actions */
.form-actions {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
}

.cancel-button {
  background-color: var(--card-bg);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  padding: 12px 24px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.cancel-button:hover {
  background-color: var(--border-color);
}

.submit-button {
  background-color: var(--link-color);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.3s ease;
  flex-grow: 1;
}

.submit-button:hover {
  background-color: var(--link-hover);
  transform: translateY(-1px);
}

/* Mobile Navigation Fixes */
@media (max-width: 1100px) {
  /* Ensure mobile toggle button is visible */
  .mobile-nav-toggle {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }
  
  /* Make mobile nav visible when active */
  .mobile-nav {
    display: block !important;
  }
  
  /* Container adjustments */
  .container {
    margin: 20px auto;
    padding: 20px;
    width: calc(100% - 40px);
  }
  
  /* Hide desktop vertical nav */
  .vertical-nav {
    display: none;
  }
  
  /* Reset body flex layout for mobile */
  body {
    display: block;
    justify-content: initial;
  }
}

/* Ensure mobile nav is properly styled and visible when active */
.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  height: 100%;
  background-color: var(--bg-color);
  z-index: 999;
  padding: 70px 20px 20px;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  box-shadow: -2px 0 10px var(--shadow-color);
}

.mobile-nav.active {
  transform: translateX(0);
}

/* Ensure mobile nav links are visible */
.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 30px;
}

/* Improve mobile nav links with consistent accent color */
.mobile-nav-links a {
  display: block !important;
  padding: 15px;
  font-size: 16px;
  color: var(--text-color);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-weight: 500;
  width: 100%;
  box-sizing: border-box;
  border-left: 3px solid transparent;
}

/* Active state for mobile nav links */
.mobile-nav-links a.active {
  background-color: rgba(232, 109, 94, 0.1);
  color: var(--link-color);
  border-left: 3px solid var(--link-color);
}

/* Hover state for mobile nav links */
.mobile-nav-links a:hover {
  background-color: rgba(232, 109, 94, 0.05);
  color: var(--link-color);
}

/* Improve mobile dark mode toggle with accent color */
.mobile-dark-mode {
  display: flex;
  justify-content: center;
  margin-top: 20px;
  padding: 20px 0;
  border-top: 1px solid var(--border-color);
}

#mobileDarkModeToggle {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--card-bg);
  transition: all 0.3s ease;
  position: relative;
}

#mobileDarkModeToggle:hover {
  background-color: var(--border-color);
}

/* Toggle icon positioning */
#mobileDarkModeToggle .sun,
#mobileDarkModeToggle .moon {
  position: absolute;
  transition: opacity 0.3s ease, transform 0.5s ease;
}

/* Dark mode icon states */
[data-theme="dark"] #mobileDarkModeToggle .sun {
  opacity: 0;
  transform: rotate(-90deg);
}

[data-theme="dark"] #mobileDarkModeToggle .moon {
  opacity: 1;
  transform: rotate(0deg);
}

/* Light mode icon states */
[data-theme="light"] #mobileDarkModeToggle .sun {
  opacity: 1;
  transform: rotate(0deg);
}

[data-theme="light"] #mobileDarkModeToggle .moon {
  opacity: 0;
  transform: rotate(90deg);
}

/* Stealth Mode Indicator */
.stealth-indicator {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  height: 22px;
  vertical-align: middle;
  opacity: 0.95;
  transition: all 0.3s ease;
  transform: translateY(-1px);
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.05));
}

.stealth-indicator:hover {
  opacity: 1;
  transform: translateY(-1px);
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
}

@media (max-width: 768px) {
  .stealth-indicator {
    height: 22px;
    margin-left: 4px;
    transform: translateY(0);
  }
  
  .stealth-indicator:hover {
    transform: translateY(0);
  }
}

/* Mobile image formatting improvements */
@media (max-width: 768px) {
  .project-card .project-image {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin: 0 auto 15px;
    max-width: 100%;
  }
  
  .project-card .project-image img,
  .project-card .project-image video {
    width: 160px;
    height: 160px;
    object-fit: cover;
    border-radius: 4px;
  }
  
  /* Fix for the one/two container setup */
  .project-card .one {
    width: 160px;
    height: 160px;
    position: relative;
    margin: 0 auto;
  }
  
  .project-card .two {
    width: 100%;
    height: 100%;
  }
  
  /* Ensure consistent spacing */
  .project-card {
    padding: 20px;
    margin-bottom: 20px;
  }
  
  /* Improve grid layout on mobile */
  .project-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
}

/* Ensure videos maintain aspect ratio */
.project-card video {
  object-fit: cover;
  width: 100%;
  height: 100%;
}

/* Fix for FL109 logo and other centered elements */
.project-card .project-image div[style*="margin: 0 auto"] {
  margin: 0 auto !important;
}

/* Improve consistency for company logos on mobile */
@media (max-width: 768px) {
  /* Make all company logos consistent size */
  .project-card .one,
  .project-card .two {
    width: 160px !important;
    height: 160px !important;
    position: relative;
    margin: 0 auto;
    border-radius: 4px;
    overflow: hidden;
  }
  
  /* Ensure videos and images maintain proper sizing */
  .project-card .one img,
  .project-card .two img,
  .project-card .one video,
  .project-card .two video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
  }
  
  /* Fix for the container that holds the one/two structure */
  .project-card .project-image {
    width: 160px;
    height: 160px;
    margin: 0 auto 15px;
    padding: 0;
  }
}

/* Ensure proper sizing for all company logos regardless of screen size */
.project-card .one,
.project-card .two {
  border-radius: 4px;
  overflow: hidden;
}

/* Contact form social links styling */
.contact-alternatives {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.contact-alternatives p {
  margin-bottom: 15px;
  font-size: 15px;
  color: var(--text-color-secondary, #666);
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.social-links a {
  display: flex;
  align-items: center;
  padding: 8px 15px;
  background-color: var(--card-bg);
  border-radius: 6px;
  transition: all 0.2s ease;
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
}

.social-links a:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 8px var(--shadow-color);
  background-color: var(--bg-color);
}

.social-icon {
  margin-right: 8px;
  font-size: 18px;
}

/* Dark mode adjustments */
[data-theme="dark"] .social-links a {
  background-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .social-links a:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Make contact nav item clickable */
.vertical-nav a[onclick], 
.mobile-nav-links a[onclick] {
  cursor: pointer;
}

/* Create a wrapper to center the content with space for navbar */
body::before {
  display: none;
}

/* Ensure the body has proper clearfix */
body::after {
  content: "";
  display: table;
  clear: both;
}

/* Fix mobile navigation toggle styling */
.mobile-nav-toggle {
  display: none;
  position: fixed;
  top: 15px;
  right: 15px;
  z-index: 1001;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--bg-color);
  box-shadow: 0 2px 5px var(--shadow-color);
  transition: all 0.3s ease;
  border: none;
  padding: 0;
  align-items: center;
  justify-content: center;
}

/* Ensure toggle bars are visible */
.mobile-nav-toggle .bar {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--text-color);
  margin: 2px 0;
  border-radius: 1px;
  transition: all 0.3s ease;
}

/* Fix mobile nav styling */
.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  height: 100%;
  background-color: var(--bg-color);
  z-index: 999;
  padding: 70px 20px 20px;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  box-shadow: -2px 0 10px var(--shadow-color);
}

/* Show mobile nav when active */
.mobile-nav.active {
  transform: translateX(0);
}

/* Mobile media query fixes */
@media (max-width: 1100px) {
  .mobile-nav-toggle {
    display: flex;
  }
  
  .vertical-nav {
    display: none;
  }
  
  body {
    display: block;
  }
}

/* Hide the main page dark mode toggle on mobile */
@media (max-width: 1100px) {
  /* Hide the header utilities (which contains the dark mode toggle) on mobile */
  .header-utilities {
    display: none !important;
  }
  
  /* Ensure the mobile dark mode toggle is visible */
  .mobile-dark-mode {
    display: flex !important;
    justify-content: center;
    margin-top: 20px;
    padding: 15px 0;
    border-top: 1px solid var(--border-color);
  }
  
  #mobileDarkModeToggle {
    display: flex !important;
  }
}

/* Ensure the mobile dark mode toggle is properly styled */
.mobile-dark-mode {
  display: flex;
  justify-content: center;
  margin-top: 20px;
  padding: 15px 0;
  border-top: 1px solid var(--border-color);
}

#mobileDarkModeToggle {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--card-bg);
  transition: all 0.3s ease;
  position: relative;
}

/* Refined footer attribution styling - more readable but still subtle */
.footer-attribution {
  margin-top: 60px;
  padding-top: 20px;
  border-top: 1px solid rgba(var(--border-color-rgb, 234, 234, 234), 0.4);
  text-align: center;
  font-size: 11px;
  color: rgba(var(--text-color-rgb, 51, 51, 51), 0.6);
  letter-spacing: 0.02em;
}

.footer-attribution a {
  color: rgba(var(--link-color-rgb, 232, 109, 94), 0.7);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-attribution a:hover {
  color: var(--link-color);
  text-decoration: none;
}

/* Dark mode specific adjustments with consistent opacity */
[data-theme="dark"] .footer-attribution {
  color: rgba(255, 255, 255, 0.6);
  border-top-color: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .footer-attribution a {
  color: rgba(255, 138, 122, 0.6);
}

[data-theme="dark"] .footer-attribution a:hover {
  color: rgba(255, 138, 122, 0.8);
}

/* Adjust for mobile */
@media (max-width: 768px) {
  .footer-attribution {
    margin-top: 40px;
    padding-top: 15px;
    font-size: 10px;
  }
}

/* Form button styling improvements */
.form-actions {
  display: flex;
  margin-bottom: 20px;
  gap: 15px;
}

.cancel-button {
  background-color: transparent;
  color: var(--text-color);
  border: 1px solid var(--border-color);
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 400;
  transition: all 0.2s ease;
  flex: 0 0 auto;
  letter-spacing: 0.02em;
}

.cancel-button:hover {
  background-color: rgba(var(--border-color-rgb, 234, 234, 234), 0.3);
}

.submit-button {
  background-color: var(--link-color);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  flex: 1;
  letter-spacing: 0.02em;
}

.submit-button:hover {
  background-color: var(--link-hover);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(var(--shadow-color-rgb, 0, 0, 0), 0.1);
}

/* Ensure mobile styling is consistent */
@media (max-width: 768px) {
  .form-actions {
    margin-top: 10px;
  }
  
  .cancel-button, .submit-button {
    padding: 12px 20px;
    font-size: 14px;
  }
  
  /* Improved close button styling */
  .close-button.mobile-position {
    position: fixed;
    top: 15px;
    left: 15px;
    right: auto;
    font-size: 22px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(var(--bg-color-rgb, 255, 255, 255), 0.9);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(var(--shadow-color-rgb, 0, 0, 0), 0.1);
    z-index: 1002;
    color: var(--text-color);
    border: 1px solid rgba(var(--border-color-rgb, 234, 234, 234), 0.5);
  }
}

/* Contact alternatives styling improvements */
.contact-alternatives {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid rgba(var(--border-color-rgb, 234, 234, 234), 0.5);
}

.contact-alternatives p {
  font-size: 14px;
  color: var(--text-color-secondary, #666);
  margin-bottom: 15px;
  text-align: center;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
}

.social-links a {
  display: flex;
  align-items: center;
  padding: 8px 15px;
  background-color: rgba(var(--card-bg-rgb, 249, 249, 249), 0.7);
  border-radius: 4px;
  transition: all 0.2s ease;
  font-size: 13px;
  color: var(--text-color);
  text-decoration: none;
  border: 1px solid rgba(var(--border-color-rgb, 234, 234, 234), 0.5);
}

.social-links a:hover {
  background-color: rgba(var(--link-color-rgb, 232, 109, 94), 0.08);
  color: var(--link-color);
  transform: translateY(-1px);
}

.social-icon {
  display: inline-flex;
  margin-right: 8px;
  color: var(--link-color);
}