@font-face {
  font-family: 'Lexend';
  src: url('fonts/Lexend-VariableFont_wght.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scrollbar-gutter: stable;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
  max-width: 100%;
}

html.dark-mode {
  color-scheme: dark;
}

.lexend {
  font-family: "Lexend", sans-serif;
  font-optical-sizing: auto;
  font-weight: 800;
  font-style: normal;
}

body {
  font-family: "Lexend", Arial, sans-serif;
  line-height: 1.6;
  background-color: #f9f9f9;
  color: #333;
  padding-bottom: 50px;
  font-optical-sizing: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  max-width: 100%;
}

/* Focus styles */
:focus-visible {
  outline: 3px solid #296dde;
  outline-offset: 2px;
}

.dark-mode :focus-visible {
  outline-color: #88c1fd;
}

a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
select:focus:not(:focus-visible) {
  outline: none;
}

footer a {
  color: inherit;
}

footer a:hover,
footer a:focus-visible {
  text-decoration: underline;
}

.language-switcher label {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
  color: #002b7f;
}

.dark-mode .language-switcher label {
  color: #88c1fd;
}

header {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #f9f9f9;
  padding: 10px 10px 0;
  text-align: center;
}

header a:has(.logo) {
  display: block;
  line-height: 0;
  flex-shrink: 0;
}

.logo {
  display: block;
  max-width: 480px;
  width: 100%;
  height: auto;
  margin: 0 auto;
}

.tagline {
  padding: 0.25rem 1rem 0.5rem;
  margin: 0;
}

section {
  padding: 40px 20px;
  max-width: 900px;
  margin: auto;
}

footer {
  position: fixed;
  bottom: 0;
  width: 100%;
  background-color: #88c1fd;
  color: #1a478f;
  text-align: center;
  padding: 10px 8px;
  border-top: 1px solid transparent;
  box-sizing: border-box;
}

footer p {
  max-width: 100%;
  margin: 0;
  font-size: clamp(0.72rem, 2.8vw, 1rem);
  line-height: 1.5;
  overflow-wrap: break-word;
}

/* Info-Section & Grid */
section.info-section {
  padding: 20px 25px 10px;
  max-width: 1000px;
  margin: auto;
  overflow-x: clip;
  container-type: inline-size;
  container-name: info-section;
}

.info-section p {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 30px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.info-box {
  border-top: 4px solid #002b7f;
  padding: 20px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  text-align: center;
  display: flex;
  flex-direction: column;
  height: 100%;
  align-items: stretch;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
  box-sizing: border-box;
}

.info-box h3,
header .tagline {
  color: #002b7f;
  margin-bottom: 10px;
  font-size: 1.5rem;
}

.info-box h3 {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  line-height: 1.25;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
  box-sizing: border-box;
}

.info-box p {
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 1rem 0;
  flex-grow: 1;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
  box-sizing: border-box;
}

/* Narrow section: squeeze 2x2 first */
@container info-section (max-width: 640px) {
  .info-grid {
    gap: 10px;
  }

  .info-box {
    padding: 12px 8px;
  }

  .info-box h3 {
    font-size: clamp(0.72rem, 3.2cqi, 1rem);
  }

  .info-box p {
    font-size: 0.82rem;
    margin: 0.45rem 0;
  }
}

/* Too narrow for 2x2: stack one per row */
@container info-section (max-width: 560px) {
  .info-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .info-box {
    padding: 16px 14px;
  }

  .info-box h3 {
    font-size: 1.2rem;
  }

  .info-box p {
    font-size: 0.9rem;
    margin: 0.75rem 0;
  }
}

/* Viewport fallback for browsers without container queries */
@media (max-width: 640px) {
  .info-grid {
    gap: 10px;
  }

  .info-box {
    padding: 12px 8px;
  }

  .info-box h3 {
    font-size: clamp(0.72rem, 3.2vw, 1rem);
  }

  .info-box p {
    font-size: 0.82rem;
    margin: 0.45rem 0;
  }
}

@media (max-width: 560px) {
  .info-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .info-box {
    padding: 16px 14px;
  }

  .info-box h3 {
    font-size: 1.2rem;
  }

  .info-box p {
    font-size: 0.9rem;
    margin: 0.75rem 0;
  }
}

.btn {
  background-color: #002b7f;
  color: #fff;
  padding: 0.5rem 1.2rem;
  text-decoration: none;
  border-radius: 0;
  display: inline-block;
  margin-top: auto;
  align-self: center;
}

.btn:hover {
  background-color: #001f4f;
}

/* Projects Section */
.projects-section {
  padding: 40px 20px;
  max-width: 1200px;
  margin: auto;
}

.projects-section h2 {
  text-align: center;
  margin-bottom: 30px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.project-box {
  display: flex;
  flex-direction: column;
  background-color: #fff;
  padding: 20px;
  border-left: 4px solid #002b7f;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  min-height: 630px;
}

.project-box .section {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-box .top {
  display: flex;
  flex-direction: column;
}

.project-box .top h3,
.project-box .top p {
  margin-bottom: 10px;
}

.project-box .top h4 {
  margin-top: 20px;
}

.project-box .top ul {
  margin-bottom: 0;
}

.project-box .bottom {
  display: flex;
  flex-direction: column;
}

.project-box .bottom h4 {
  margin-top: 0;
}

.project-box h3 {
  color: #002b7f;
  margin-bottom: 10px;
  font-size: 1.3rem;
}

.project-box h4 {
  margin-top: 1rem;
  font-weight: bold;
  color: #000;
}

.project-box ul {
  padding-left: 20px;
  margin-bottom: 15px;
  text-align: left;
}

.project-box ul li {
  list-style-type: disc;
  margin-bottom: 5px;
}

@media (max-width: 768px) {
  section.info-section {
    padding: 20px 12px 10px;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .project-box {
    min-height: 0;
  }
}

/* Dark Mode Toggle Button */
.dark-mode-toggle {
  position: fixed;
  bottom: 70px;
  right: 20px;
  background: #002b7f;
  color: white;
  border: none;
  border-radius: 0;
  padding: 8px 16px;
  font-family: "Lexend", Arial, sans-serif;
  font-size: 14px;
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.3s ease;
}

.dark-mode-toggle:hover {
  background-color: #001f4f;
}

.dark-mode .dark-mode-toggle {
  background-color: #88c1fd;
  color: #1a1a1a;
}

.dark-mode .dark-mode-toggle:hover {
  background-color: #5da7fc;
}

.dark-mode {
  background-color: #242424;
  color: #e0e0e0;
}

.dark-mode header {
  background-color: #242424;
}

.dark-mode .info-box,
.dark-mode .project-box {
  background-color: #2d2d2d;
  border-color: #88c1fd;
}

.dark-mode .info-box h3,
.dark-mode .project-box h3,
.dark-mode header .tagline {
  color: #88c1fd;
}

.dark-mode .projects-section h2,
.dark-mode .project-box h4,
.dark-mode .project-box p,
.dark-mode .project-box ul,
.dark-mode .project-box li {
  color: #e0e0e0;
}

.dark-mode .project-box strong {
  color: #88c1fd;
}

.dark-mode .btn {
  background-color: #88c1fd;
  color: #242424;
}

.dark-mode .btn:hover {
  background-color: #5da7fc;
}

.dark-mode footer {
  background-color: #1a1a1a;
  color: #88c1fd;
  border-top-color: #3a3a3a;
}

.dark-mode footer a {
  color: #88c1fd;
  text-decoration: none;
}

.dark-mode footer a:hover {
  color: #5da7fc;
  text-decoration: underline;
}

/* Make Lexend font consistent across all elements */
h1, h2, h3, h4, h5, h6,
p, a, button, li, strong {
  font-family: "Lexend", Arial, sans-serif;
}

/* Language Switcher */
.language-switcher {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

.language-select {
  font-family: "Lexend", Arial, sans-serif;
  padding: 8px 12px;
  border: 2px solid #002b7f;
  border-radius: 4px;
  background-color: white;
  color: #002b7f;
  cursor: pointer;
  font-size: 14px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23002b7f%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 12px top 50%;
  background-size: 8px auto;
  padding-right: 28px;
}

.language-select:hover {
  border-color: #001f4f;
}

.dark-mode .language-select {
  background-color: #2d2d2d;
  color: #88c1fd;
  border-color: #88c1fd;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2388c1fd%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
}

.dark-mode .language-select:hover {
  border-color: #5da7fc;
}

/* Content Pages */
.content-section {
  max-width: 800px;
  margin: 40px auto;
  padding: 0 20px;
}

.content-section h1 {
  color: #002b7f;
  margin-bottom: 30px;
  font-size: 2.1rem;
}

.content-section h2 {
  color: #002b7f;
  margin: 30px 0 15px;
  font-size: 1.5rem;
}

.content-section h3 {
  color: #002b7f;
  margin: 20px 0 10px;
  font-size: 1.2rem;
}

.content-section p {
  margin-bottom: 15px;
  line-height: 1.6;
}

.content-section ul {
  margin-bottom: 15px;
  padding-left: 20px;
}

.content-section li {
  margin-bottom: 5px;
}

/* Dark mode styles for content pages */
.dark-mode .content-section h1,
.dark-mode .content-section h2,
.dark-mode .content-section h3 {
  color: #88c1fd;
}

.dark-mode .content-section p,
.dark-mode .content-section li {
  color: #e0e0e0;
}

/* Back to Home Button */
.back-to-home {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background-color: #002b7f;
  color: white;
  text-decoration: none;
  border-radius: 0;
  margin: 20px;
  font-family: "Lexend", Arial, sans-serif;
  font-size: 14px;
  transition: background-color 0.3s ease;
}

.back-to-home svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.5;
}

.back-to-home:hover {
  background-color: #001f4f;
}

.dark-mode .back-to-home,
.dark-mode .content-section a.back-to-home {
  background-color: #88c1fd;
  color: #242424;
}

.dark-mode .back-to-home:hover,
.dark-mode .content-section a.back-to-home:hover {
  background-color: #5da7fc;
  color: #242424;
}

/* Content Pages Dark Mode */
.dark-mode body {
  background-color: #242424;
  color: #e0e0e0;
}

.dark-mode .content-section {
  color: #e0e0e0;
}

.dark-mode .content-section h1,
.dark-mode .content-section h2,
.dark-mode .content-section h3 {
  color: #88c1fd;
}

.dark-mode .content-section p,
.dark-mode .content-section ul,
.dark-mode .content-section li {
  color: #e0e0e0;
}

.dark-mode .content-section a {
  color: #88c1fd;
}

.dark-mode .content-section a:hover {
  color: #5da7fc;
}

/* JanoLaw / LegalSync content */
.legal-content {
  margin-top: 10px;
}

.legal-content p {
  margin-bottom: 15px;
  line-height: 1.7;
}

.legal-content .placeholder-notice {
  display: block;
}

/* Placeholder Notice */
.placeholder-notice {
  background-color: #fff3cd;
  border: 1px solid #ffeeba;
  color: #856404;
  padding: 15px;
  margin: 20px 0;
  border-radius: 4px;
  font-size: 14px;
}

.dark-mode .placeholder-notice {
  background-color: #2d2d2d;
  border-color: #88c1fd;
  color: #88c1fd;
}

/* 404 Error Page */
.error-section {
  text-align: center;
  padding: 60px 20px 80px;
}

.error-code {
  font-size: 6rem;
  font-weight: 800;
  color: #002b7f;
  line-height: 1;
  margin-bottom: 10px;
}

.error-section h1 {
  margin-bottom: 15px;
}

.error-section p {
  max-width: 480px;
  margin: 0 auto 30px;
  color: #555;
}

.error-home-link {
  margin: 0;
}

.dark-mode .error-code {
  color: #88c1fd;
}

.dark-mode .error-section p {
  color: #b0b0b0;
}