/* Import base styles first */
/* Base CSS - Shared styles across all devices */

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

/* Screen reader only content */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Reduce repaints and reflows */
.card,
.header-line {
  will-change: transform;
}

/* CSS Custom Properties for theming */
:root {
  --foreground-rgb: 0, 0, 0;
  --background-start-rgb: 214, 219, 220;
  --background-end-rgb: 255, 255, 255;
}

/* Theme-based color schemes */
[data-theme='dark'] {
  --foreground-rgb: 255, 255, 255;
  --background-start-rgb: 0, 0, 0;
  --background-end-rgb: 0, 0, 0;
}

[data-theme='light'] {
  --foreground-rgb: 0, 0, 0;
  --background-start-rgb: 255, 255, 255;
  --background-end-rgb: 255, 255, 255;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --foreground-rgb: 255, 255, 255;
    --background-start-rgb: 0, 0, 0;
    --background-end-rgb: 0, 0, 0;
  }
}

/* Base typography and layout */
html,
body {
  margin: 0;
  padding: 0;
  background: linear-gradient(
      to bottom,
      transparent,
      rgb(var(--background-end-rgb))
    )
    rgb(var(--background-start-rgb));
  text-decoration: none;
  color: rgb(var(--foreground-rgb));
  font-family: 'Funnel Sans', system-ui, sans-serif;
}

a,
p,
div,
h1,
h2,
h3,
h4,
h5,
h6,
ul,
ol,
li,
button,
input,
textarea,
select,
option {
  font-family: 'Funnel Sans', system-ui, sans-serif;
  font-optical-sizing: auto;
  font-style: normal;
  color: inherit;
  background: none;
  text-decoration: none;
}

a {
  color: inherit;
  text-decoration: none;
}

a:visited {
  color: inherit;
}

ul,
ol {
  list-style: none;
}

button,
input,
textarea,
select {
  color: inherit;
  padding: 0;
  margin: 0;
  outline: none;
}

img {
  max-inline-size: 100%;
  block-size: auto;
  display: block;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* Animations */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Loading states */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-block-size: 200px;
  font-size: 1.2rem;
  color: #888;
}

.loading::after {
  content: '';
  inline-size: 20px;
  block-size: 20px;
  margin-inline-start: 10px;
  border: 2px solid #888;
  border-block-start: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Error and message states */
.error {
  color: #ff6b6b;
  text-align: center;
  padding: 1rem;
  background: rgba(255, 107, 107, 0.1);
  border-radius: 0.5rem;
  margin: 1rem 0;
}

.no-projects {
  text-align: center;
  color: #888;
  font-size: 1.2rem;
  padding: 2rem;
}

.message {
  padding: 1rem;
  margin-block-end: 1rem;
  border-radius: 0.5rem;
  text-align: center;
}

.message.success {
  background: rgba(76, 175, 80, 0.1);
  color: #4caf50;
  border: 1px solid #4caf50;
}

.message.error {
  background: rgba(244, 67, 54, 0.1);
  color: #f44336;
  border: 1px solid #f44336;
}

/* Disabled states */
input:disabled,
textarea:disabled,
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

button:disabled {
  background-color: #ccc !important;
}

/* Base layout structure */
.layout {
  display: flex;
  flex-direction: column;
  min-block-size: 100vh;
}

.main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}


/* Import modular CSS components */
/* CSS Modules Index */

/* Import all CSS modules */
.contact-section {
  inline-size: 100%;
  max-inline-size: 1140px;
  margin-inline: auto;
  padding: clamp(3rem, 6vw, 6rem) 1.25rem;
}

.contact-wrapper {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.contact-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-title {
  font-size: clamp(2.25rem, 4vw, 3.25rem);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.contact-subtitle {
  font-size: 1.125rem;
  line-height: 1.7;
  color: rgba(var(--foreground-rgb), 0.75);
}

.contact-content {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  grid-template-areas: 'info form';
  gap: 3rem;
  align-items: start;
}

.contact-info {
  grid-area: info;
  display: flex;
  flex-direction: column;
}

.contact-info-section {
  padding-block: 1.5rem;
  border-block-end: 1px solid rgba(var(--foreground-rgb), 0.14);
}

.contact-info-section:first-child {
  padding-block-start: 0;
}

.contact-info-section:last-child {
  padding-block-end: 0;
  border-block-end: 0;
}

.contact-info-title {
  margin-block-end: 0.75rem;
  font-size: 1.0625rem;
  line-height: 1.5;
  font-weight: 650;
}

.contact-info-description,
.contact-info-list {
  font-size: 0.9375rem;
  line-height: 1.8;
  color: rgba(var(--foreground-rgb), 0.75);
}

.contact-info-list {
  list-style: disc;
  padding-inline-start: 1.125rem;
}

.contact-info-list li + li {
  margin-block-start: 0.5rem;
}

.contact-form-container {
  grid-area: form;
  min-inline-size: 0;
  padding: 2rem;
  border: 1px solid rgba(var(--foreground-rgb), 0.15);
  border-radius: 0.5rem;
  background: rgba(var(--foreground-rgb), 0.025);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-size: 0.9375rem;
  line-height: 1.5;
  font-weight: 600;
}

.form-help {
  font-size: 0.8125rem;
  line-height: 1.6;
  color: rgba(var(--foreground-rgb), 0.7);
  overflow-wrap: anywhere;
}

.form-help a {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.form-input,
.form-textarea {
  inline-size: 100%;
  min-inline-size: 0;
  padding: 0.75rem;
  border: 1px solid rgba(var(--foreground-rgb), 0.3);
  border-radius: 0.375rem;
  background: rgb(var(--background-end-rgb));
  color: rgb(var(--foreground-rgb));
  font-size: 1rem;
  line-height: 1.5;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: rgba(var(--foreground-rgb), 0.6);
  opacity: 1;
}

.form-input:focus-visible,
.form-textarea:focus-visible,
.contact-form a:focus-visible,
.form-submit:focus-visible {
  outline: 2px solid rgb(var(--foreground-rgb));
  outline-offset: 3px;
}

.form-textarea {
  resize: vertical;
  min-block-size: 9rem;
}

.reason-fieldset {
  min-inline-size: 0;
  border: 0;
}

.reason-fieldset legend {
  padding: 0;
  margin-block-end: 0.5rem;
}

.reason-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.reason-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-block-size: 2.75rem;
  padding: 0.75rem;
  border: 1px solid rgba(var(--foreground-rgb), 0.25);
  border-radius: 0.375rem;
  font-size: 0.875rem;
  line-height: 1.4;
  cursor: pointer;
}

.reason-option input {
  flex-shrink: 0;
  inline-size: 1rem;
  block-size: 1rem;
  accent-color: rgb(var(--foreground-rgb));
  color-scheme: light;
}

[data-theme='dark'] .reason-option input {
  color-scheme: dark;
}

.reason-option:hover,
.reason-option:has(:checked) {
  background: rgba(var(--foreground-rgb), 0.06);
  border-color: rgba(var(--foreground-rgb), 0.5);
}

.reason-option:has(:focus-visible) {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.form-submit {
  min-block-size: 3rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgb(var(--foreground-rgb));
  border-radius: 0.375rem;
  background: rgb(var(--foreground-rgb));
  color: rgb(var(--background-end-rgb));
  font-size: 1rem;
  line-height: 1.5;
  font-weight: 600;
  cursor: pointer;
}

.form-submit:hover:not(:disabled) {
  opacity: 0.85;
}

.contact-form .form-submit:disabled {
  background: rgba(var(--foreground-rgb), 0.15) !important;
  border-color: transparent;
  color: rgba(var(--foreground-rgb), 0.65);
  opacity: 1;
  cursor: wait;
}

.contact-message {
  padding: 0.875rem 1rem;
  border: 1px solid rgba(var(--foreground-rgb), 0.3);
  border-radius: 0.375rem;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.contact-message[data-status='error'] {
  border-inline-start-width: 3px;
}

@media (max-width: 899px) {
  .contact-content {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: 'form' 'info';
    gap: 2.5rem;
  }
}

@media (max-width: 639px) {
  .contact-section {
    padding-block-start: 2rem;
    padding-inline: 0.25rem;
  }

  .contact-wrapper {
    gap: 1.5rem;
  }

  .contact-header {
    gap: 0.75rem;
  }

  .contact-subtitle {
    font-size: 1rem;
  }

  .contact-form-container {
    padding: 0;
    border: 0;
    background: transparent;
  }
}

@media (max-width: 359px) {
  .reason-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.footer {
  margin-block-start: auto;
  background: rgba(var(--foreground-rgb), 0.025);
  border-block-start: 1px solid rgba(var(--foreground-rgb), 0.14);
}

.footer-content,
.footer-bottom-content {
  max-inline-size: 1200px;
  margin-inline: auto;
  padding-inline: 2rem;
}

.footer-content {
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr 1.2fr;
  gap: 2.5rem;
  padding-block: 3rem;
}

.footer-section {
  min-inline-size: 0;
}

.footer-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-block-end: 0.5rem;
}

.footer-subtitle,
.footer-description,
.footer-tech-item,
.footer-link,
.footer-social-link {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: rgba(var(--foreground-rgb), 0.7);
}

.footer-description {
  max-inline-size: 29ch;
  margin-block-start: 1rem;
}

.footer-heading {
  font-size: 0.875rem;
  font-weight: 650;
  margin-block-end: 1rem;
}

.footer-nav,
.footer-tech-list,
.footer-social {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.footer-link,
.footer-social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding-block: 0.125rem;
}

.footer-link:hover,
.footer-social-link:hover {
  color: rgb(var(--foreground-rgb));
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.footer-social-link svg {
  flex-shrink: 0;
}

/* The external badge has black text, so keep its background light in both themes. */
.footer-contributor {
  display: inline-block;
  max-inline-size: 100%;
  margin-block-start: 1.25rem;
  padding: 0.5rem;
  border: 1px solid #dedede;
  border-radius: 0.375rem;
  background: #f5f5f5;
}

.footer-contributor img {
  inline-size: 190px;
  max-inline-size: 100%;
  block-size: auto;
}

.footer-bottom-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-block: 1.25rem;
  border-block-start: 1px solid rgba(var(--foreground-rgb), 0.12);
}

.footer-copyright,
.footer-location {
  font-size: 0.8125rem;
  line-height: 1.6;
  color: rgba(var(--foreground-rgb), 0.65);
}

@media (max-width: 899px) {
  .footer-content {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
  }
}

@media (max-width: 479px) {
  .footer-content,
  .footer-bottom-content {
    padding-inline: 1.25rem;
  }

  .footer-content {
    gap: 2rem 1.25rem;
    padding-block: 2rem;
  }

  .footer-brand,
  .footer-connect {
    grid-column: 1 / -1;
  }

  .footer-description {
    max-inline-size: 36ch;
  }

  .footer-bottom-content {
    flex-direction: column;
  }
}

/* Global Shared Styles */

/* Desktop Styles */
@media (min-width: 1024px) {
  /* Typography */
  .name {
    text-align: center;
    font-size: 3.5rem;
    font-weight: 700;
    margin-block-end: 2rem;
  }

  .title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin: 1rem auto;
  }

  .description {
    font-size: 1.5rem;
    line-height: 1.7;
    text-align: start;
    max-inline-size: 85%;
    margin: 0 auto;
    color: rgba(var(--foreground-rgb), 0.9);
    font-weight: 400;
    letter-spacing: 0.02em;
  }

  .description br {
    margin-block-end: 1.5rem;
    display: block;
    content: '';
  }

  @media (max-width: 1024px) {
    .description {
      max-inline-size: 90%;
      font-size: 1.4rem;
    }
  }

  /* Utility Classes */
  .loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-block-size: 200px;
    font-size: 1.2rem;
    color: #888;
  }

  .loading::after {
    content: '';
    inline-size: 20px;
    block-size: 20px;
    margin-inline-start: 10px;
    border: 2px solid #888;
    border-block-start: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
  }

  .error {
    color: #ff6b6b;
    text-align: center;
    padding: 1rem;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 0.5rem;
    margin: 1rem 0;
  }

  .no-projects {
    text-align: center;
    color: #888;
    font-size: 1.2rem;
    padding: 2rem;
  }

  .message {
    padding: 1rem;
    margin-block-end: 1rem;
    border-radius: 0.5rem;
    text-align: center;
  }

  .message.success {
    background: rgba(76, 175, 80, 0.1);
    color: #4caf50;
    border: 1px solid #4caf50;
  }

  .message.error {
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
    border: 1px solid #f44336;
  }

  /* Disabled states */
  .disabled,
  input:disabled,
  textarea:disabled,
  button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
  }

  button:disabled {
    background-color: #ccc !important;
  }

  /* Animations */
  @keyframes spin {
    0% {
      transform: rotate(0deg);
    }
    100% {
      transform: rotate(360deg);
    }
  }
}

/* Mobile Styles */
@media (max-width: 1023px) {
  /* Typography */
  .name {
    /* Mobile styles will be added later */
    font-size: 2.5rem;
    margin-block-end: 1rem;
  }

  .title {
    /* Mobile styles will be added later */
    font-size: 1.5rem;
  }

  .description {
    /* Mobile styles will be added later */
    font-size: 1.1rem;
    max-inline-size: 100%;
    text-align: center;
  }

  .loading {
    /* Mobile styles will be added later */
    min-block-size: 150px;
    font-size: 1rem;
  }

  .loading::after {
    /* Mobile styles will be added later */
    inline-size: 16px;
    block-size: 16px;
  }

  .error {
    /* Mobile styles will be added later */
    font-size: 0.9rem;
    padding: 0.75rem;
  }

  .no-projects {
    /* Mobile styles will be added later */
    font-size: 1rem;
    padding: 1.5rem;
  }

  .message {
    /* Mobile styles will be added later */
    padding: 0.75rem;
    font-size: 0.9rem;
  }
}

/* Six-page navigation with a native mobile disclosure menu. */
.site-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 50;
  background: rgb(var(--background-end-rgb));
  border-block-end: 1px solid rgba(var(--foreground-rgb), 0.14);
}

.header-inner {
  position: relative;
  max-inline-size: 1200px;
  min-block-size: 5rem;
  margin-inline: auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-inline-end: auto;
  min-inline-size: 0;
}

.header-name {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  white-space: nowrap;
}

.header-page-title {
  font-size: 0.875rem;
  color: rgba(var(--foreground-rgb), 0.65);
}

.header-list {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.header-line {
  display: flex;
  align-items: center;
  justify-content: center;
  min-block-size: 2.75rem;
  padding-inline: 1rem;
  border-radius: 0.375rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: rgba(var(--foreground-rgb), 0.7);
}

.header-line:hover,
.header-line[aria-current='page'],
.header-line[data-section-active='true'] {
  color: rgb(var(--foreground-rgb));
  background: rgba(var(--foreground-rgb), 0.06);
}

.header-line[aria-current='page'] {
  font-weight: 650;
}

.site-header a:focus-visible,
.site-header button:focus-visible,
.header-menu-toggle:focus-visible,
.footer a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
  border-radius: 0.25rem;
}

@media (min-width: 1024px) {
  .site-header {
    position: fixed;
    inset-inline: 0;
  }
}

.header-menu {
  display: none;
}

@media (max-width: 1023px) {
  .header-inner {
    min-block-size: 4.25rem;
    padding: 0.75rem 1.25rem;
    gap: 0.75rem;
  }

  .header-brand {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .header-nav-desktop {
    display: none;
  }

  .header-menu {
    display: block;
    flex-shrink: 0;
  }

  .header-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    inline-size: 2.75rem;
    block-size: 2.75rem;
    border: 1px solid rgba(var(--foreground-rgb), 0.2);
    border-radius: 0.375rem;
    cursor: pointer;
    list-style: none;
  }

  .header-menu-toggle::-webkit-details-marker {
    display: none;
  }

  .header-menu-toggle:hover,
  .header-menu[open] .header-menu-toggle {
    background: rgba(var(--foreground-rgb), 0.06);
  }

  .header-menu-toggle svg {
    inline-size: 1.25rem;
    block-size: 1.25rem;
  }

  .header-close-icon,
  .header-menu[open] .header-menu-icon {
    display: none;
  }

  .header-menu[open] .header-close-icon {
    display: block;
  }

  .header-nav-mobile {
    position: absolute;
    inset-block-start: 100%;
    inset-inline: 0;
    max-block-size: calc(100dvh - 4.5rem);
    overflow-y: auto;
    padding: 0.75rem 1.25rem 1.25rem;
    background: rgb(var(--background-end-rgb));
    border-block-end: 1px solid rgba(var(--foreground-rgb), 0.2);
  }

  .header-nav-mobile .header-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .header-nav-mobile .header-line {
    justify-content: flex-start;
  }
}

/* A single reading column, shared by desktop and mobile. */
.home-section {
  inline-size: 100%;
  max-inline-size: calc(72ch + 2.5rem);
  margin-inline: auto;
  padding: clamp(3rem, 6vw, 6rem) 1.25rem;
}

.home-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.home-title {
  font-size: clamp(2.25rem, 4vw, 3.25rem);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.035em;
  color: rgb(var(--foreground-rgb));
  text-align: start;
}

.home-bio {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-inline-size: 72ch;
}

.home-description {
  font-size: 1.125rem;
  line-height: 1.8;
  color: rgba(var(--foreground-rgb), 0.75);
  text-align: start;
  overflow-wrap: break-word;
}

.home-description:first-child {
  font-size: 1.25rem;
  line-height: 1.75;
  color: rgba(var(--foreground-rgb), 0.9);
}

.home-focus {
  border-inline-start: 2px solid rgba(var(--foreground-rgb), 0.25);
  padding-inline-start: 1.25rem;
  margin-block-start: 0.25rem;
}

@media (max-width: 639px) {
  .home-section {
    padding-inline: 0.25rem;
  }

  .home-content {
    gap: 1.5rem;
  }

  .home-description {
    font-size: 1rem;
    line-height: 1.75;
  }

  .home-description:first-child {
    font-size: 1.125rem;
  }

  .home-focus {
    padding-inline-start: 1rem;
  }
}

/* Layout Component Styles */

/* Desktop Styles */
@media (min-width: 1024px) {
  .layout {
    display: flex;
    flex-direction: column;
    min-block-size: 100vh;
  }

  .main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding-block-start: 5rem;
    padding-inline: 2rem;
  }

  @media (min-width: 1440px) {
    .main {
      padding-inline: 3rem;
    }
  }

  .section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1.5rem 2rem;
    max-inline-size: 1200px;
    margin: 0 auto;
    min-block-size: calc(100vh - 8rem);
  }

  .section:has(.description) {
    justify-content: center;
    padding: 2rem 1.5rem;
    min-block-size: calc(100vh - 6rem);
  }
}

/* Mobile Styles */
@media (max-width: 1023px) {
  .layout {
    /* Mobile styles will be added later */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }

  .main {
    /* Mobile styles will be added later */
    flex: 1;
    padding: 1rem;
    padding-top: 0;
  }

  .section {
    /* Mobile styles will be added later */
    padding: 2rem 1rem;
  }
}

/* Shared reading layout for Terms, Privacy and Cookies. */
.legal-section {
  inline-size: 100%;
  max-inline-size: calc(72ch + 2.5rem);
  margin-inline: auto;
  padding: clamp(3rem, 6vw, 6rem) 1.25rem;
}

.legal-content {
  font-size: 1rem;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.legal-header {
  padding-block-end: 1.5rem;
  margin-block-end: 2rem;
  border-block-end: 1px solid rgba(var(--foreground-rgb), 0.14);
}

.legal-content h1 {
  font-size: clamp(2.25rem, 4vw, 3.25rem);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.legal-content .last-updated {
  margin-block: 1rem 0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: rgba(var(--foreground-rgb), 0.65);
}

.legal-content h2 {
  margin-block: 2.5rem 0.75rem;
  font-size: 1.375rem;
  line-height: 1.4;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.legal-header + h2 {
  margin-block-start: 0;
}

.legal-content h3 {
  margin-block: 1.5rem 0.75rem;
  font-size: 1.0625rem;
  line-height: 1.5;
  font-weight: 600;
}

.legal-content p,
.legal-content ul,
.legal-content ol {
  margin-block-end: 1rem;
  color: rgba(var(--foreground-rgb), 0.8);
}

.legal-content ul,
.legal-content ol {
  padding-inline-start: 1.25rem;
}

.legal-content ul {
  list-style: disc;
}

.legal-content ol {
  list-style: decimal;
}

.legal-content li + li {
  margin-block-start: 0.5rem;
}

.legal-content > :last-child {
  margin-block-end: 0;
}

.legal-content a {
  color: rgb(var(--foreground-rgb));
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

.legal-content a:hover {
  text-decoration-thickness: 2px;
}

.legal-content a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
  border-radius: 0.125rem;
}

@media (max-width: 639px) {
  .legal-section {
    padding-block-start: 2rem;
    padding-inline: 0.25rem;
  }

  .legal-header {
    margin-block-end: 1.5rem;
  }

  .legal-content h2 {
    margin-block-start: 2rem;
    font-size: 1.25rem;
  }

  .legal-header + h2 {
    margin-block-start: 0;
  }
}

/* Projects listing */
.projects-section {
  inline-size: 100%;
  max-inline-size: 940px;
  margin-inline: auto;
  padding: clamp(3rem, 6vw, 6rem) 1.25rem;
}

.projects-content {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.projects-intro {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.projects-title {
  font-size: clamp(2.25rem, 4vw, 3.25rem);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.035em;
  color: rgb(var(--foreground-rgb));
}

.projects-subtitle {
  font-size: 1.125rem;
  line-height: 1.7;
  color: rgba(var(--foreground-rgb), 0.75);
}

.projects-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25rem;
}

.projects-search-container {
  inline-size: 100%;
}

.projects-search-wrapper {
  display: flex;
  align-items: center;
  padding: 0.25rem;
  border: 1px solid rgba(var(--foreground-rgb), 0.25);
  border-radius: 0.5rem;
  background: rgba(var(--foreground-rgb), 0.025);
}

.projects-search-wrapper:focus-within {
  outline: 2px solid rgba(var(--foreground-rgb), 0.6);
  outline-offset: 2px;
}

.projects-search-input {
  flex: 1;
  min-inline-size: 0;
  inline-size: 100%;
  padding: 0.75rem;
  border: 0;
  background: transparent;
  color: rgb(var(--foreground-rgb));
  font-size: 1rem;
  line-height: 1.5;
}

.projects-search-input::placeholder {
  color: rgba(var(--foreground-rgb), 0.6);
  opacity: 1;
}

.projects-search-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  inline-size: 2.75rem;
  block-size: 2.75rem;
  border: 0;
  border-radius: 0.25rem;
  color: rgb(var(--foreground-rgb));
  cursor: pointer;
}

.projects-search-submit svg {
  inline-size: 1.125rem;
  block-size: 1.125rem;
}

.projects-search-submit:hover {
  background: rgba(var(--foreground-rgb), 0.08);
}

.projects-filters {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-inline-size: 100%;
}

.projects-filter-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(var(--foreground-rgb), 0.75);
}

.projects-language-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.projects-language-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-block-size: 2.75rem;
  padding: 0.5rem 0.875rem;
  border: 1px solid rgba(var(--foreground-rgb), 0.18);
  border-radius: 2rem;
  font-size: 0.875rem;
  line-height: 1.4;
  font-weight: 500;
  color: rgba(var(--foreground-rgb), 0.75);
}

.projects-language-pill:hover {
  background: rgba(var(--foreground-rgb), 0.05);
  border-color: rgba(var(--foreground-rgb), 0.35);
}

.projects-language-pill.active {
  color: rgb(var(--foreground-rgb));
  background: rgba(var(--foreground-rgb), 0.1);
  border-color: rgba(var(--foreground-rgb), 0.5);
}

.projects-reset {
  display: inline-flex;
  align-items: center;
  min-block-size: 2.75rem;
  font-size: 0.875rem;
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.projects-section a:focus-visible,
.projects-search-submit:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.projects-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.projects-group {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.projects-group-title {
  font-size: 1rem;
  font-weight: 600;
  color: rgba(var(--foreground-rgb), 0.75);
}

.projects-group-items {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.project-item {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.5rem;
  border: 1px solid rgba(var(--foreground-rgb), 0.15);
  border-radius: 0.5rem;
  background: rgba(var(--foreground-rgb), 0.025);
  overflow-wrap: anywhere;
}

.project-item:hover {
  border-color: rgba(var(--foreground-rgb), 0.35);
  background: rgba(var(--foreground-rgb), 0.045);
}

.project-item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.project-item-title {
  min-inline-size: 0;
  font-size: 1.125rem;
  line-height: 1.4;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.project-item-stars {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  flex-shrink: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: rgba(var(--foreground-rgb), 0.65);
}

.project-item-description {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: rgba(var(--foreground-rgb), 0.75);
}

.project-item-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.project-tech {
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  background: rgba(var(--foreground-rgb), 0.06);
  font-size: 0.75rem;
  line-height: 1.5;
  color: rgba(var(--foreground-rgb), 0.7);
}

.projects-empty {
  padding-block: 2rem;
  font-size: 1rem;
  line-height: 1.6;
  color: rgba(var(--foreground-rgb), 0.75);
}

@media (max-width: 639px) {
  .projects-section {
    padding-block-start: 2rem;
    padding-inline: 0.25rem;
  }

  .projects-content {
    gap: 1.5rem;
  }

  .projects-intro {
    gap: 0.75rem;
  }

  .projects-controls {
    gap: 1rem;
  }

  .projects-subtitle {
    font-size: 1rem;
  }

  .project-item {
    padding: 1.125rem;
  }
}

/* Project detail shares the projects page's top-aligned reading width. */
.project-detail-section {
  inline-size: 100%;
  max-inline-size: 940px;
  margin-inline: auto;
  padding: clamp(3rem, 6vw, 6rem) 1.25rem;
}

.project-detail-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2rem;
}

.project-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-block-size: 2.75rem;
  color: rgba(var(--foreground-rgb), 0.7);
  font-size: 0.875rem;
  font-weight: 600;
}

.project-detail-back:hover {
  color: rgb(var(--foreground-rgb));
}

.project-detail-back svg,
.project-detail-github svg {
  inline-size: 1.125rem;
  block-size: 1.125rem;
  flex-shrink: 0;
}

.project-detail-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.project-detail-name {
  font-size: clamp(2.25rem, 4vw, 3.25rem);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}

.project-detail-description {
  max-inline-size: 72ch;
  font-size: 1.125rem;
  line-height: 1.7;
  color: rgba(var(--foreground-rgb), 0.75);
  overflow-wrap: anywhere;
}

.project-detail-technologies {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.project-detail-tech {
  display: inline-flex;
  align-items: center;
  min-block-size: 2rem;
  padding: 0.375rem 0.75rem;
  border: 1px solid rgba(var(--foreground-rgb), 0.18);
  border-radius: 0.375rem;
  font-size: 0.8125rem;
  line-height: 1.3;
  color: rgba(var(--foreground-rgb), 0.75);
}

.project-detail-bottom {
  inline-size: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2rem;
  padding-block-start: 1.75rem;
  border-block-start: 1px solid rgba(var(--foreground-rgb), 0.14);
}

.project-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2.5rem;
  margin: 0;
}

.detail-stat {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.detail-stat-label {
  color: rgba(var(--foreground-rgb), 0.65);
  font-size: 0.75rem;
  font-weight: 600;
}

.detail-stat-value {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.4;
}

.project-detail-github,
.project-detail-github:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  min-block-size: 2.75rem;
  padding: 0.625rem 1rem;
  border-radius: 0.375rem;
  background: rgb(var(--foreground-rgb));
  color: rgb(var(--background-end-rgb));
  font-size: 0.875rem;
  font-weight: 600;
}

.project-detail-github:hover {
  opacity: 0.85;
}

.project-detail-back:focus-visible,
.project-detail-github:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

@media (max-width: 639px) {
  .project-detail-section {
    padding-block-start: 2rem;
    padding-inline: 0.25rem;
  }

  .project-detail-wrapper {
    gap: 1.5rem;
  }

  .project-detail-description {
    font-size: 1rem;
  }

  .project-detail-bottom {
    align-items: stretch;
    gap: 1.75rem;
  }

  .project-detail-github {
    inline-size: 100%;
  }
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  inline-size: 2.75rem;
  block-size: 2.75rem;
  border: 1px solid rgba(var(--foreground-rgb), 0.2);
  border-radius: 50%;
  color: rgb(var(--foreground-rgb));
  background: transparent;
  cursor: pointer;
}

.theme-toggle:hover {
  background: rgba(var(--foreground-rgb), 0.06);
}

.theme-toggle svg {
  inline-size: 1.125rem;
  block-size: 1.125rem;
}

.theme-icon-sun,
[data-theme='dark'] .theme-icon-moon {
  display: none;
}

[data-theme='dark'] .theme-icon-sun {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-icon-moon {
    display: none;
  }

  :root:not([data-theme]) .theme-icon-sun {
    display: block;
  }
}



/* Mobile styles are now integrated into each module */
/* Desktop styles are handled within each module's media queries */
