:root {
  --main-bg-color: #1a1a1a;
  --main-bg-gradient: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%);
  --main-text-color: #d0d0d0;
  --white: #ffffff;
  --accent-color: #e0e0e0;
  --border-color: #404040;
  --card-bg: rgba(255, 255, 255, 0.02);
  --card-hover-bg: rgba(255, 255, 255, 0.05);
  --glow-color: rgba(255, 255, 255, 0.05);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@font-face {
  font-family: ShareTechMono;
  src: url(ShareTechMono-Regular.ttf);
  font-display: swap;
}

body {
  background: url("images/background.svg") no-repeat center top, linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%);
  background-attachment: fixed;
  color: var(--main-text-color);
  font-size: 18px;
  line-height: 1.6;
  font-weight: 400;
  font-family: ShareTechMono, Monospace, Courier;
  margin: 0;
  padding: 40px 0;
  min-height: 100vh;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
}

#logo {
  height: 80px;
  transition: transform 0.3s ease;
}

#logo:hover {
  transform: scale(1.05);
}

#container {
  max-width: 730px;
  margin: 0 auto;
  text-align: center;
  padding: 48px 40px 40px;
  background: rgba(26, 26, 26, 0.4);
  backdrop-filter: blur(12px);
  border-radius: 20px;
}

h1 {
  margin-top: 16px;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.subtitle {
  margin-bottom: 16px;
  margin-top: 32px;
  font-size: 1.1em;
}

.formerly {
  font-size: 14px;
  color: #808080;
  margin-top: 0;
  font-style: italic;
}

strong, h1, h2, h3 {
  color: var(--white);
  line-height: 1.2;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--white);
}

/* Animated underline for inline links */
.formerly a,
main > p a,
section > p a,
.subtitle a {
  position: relative;
}

.formerly a::after,
main > p a::after,
section > p a::after,
.subtitle a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent-color);
  transition: width 0.3s ease;
}

.formerly a:hover::after,
main > p a:hover::after,
section > p a:hover::after,
.subtitle a:hover::after {
  width: 100%;
}

/* Project cards */
ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

li {
  margin: 0;
}

li a {
  display: block;
  padding: 16px 20px;
  background: var(--card-bg);
  border-radius: 12px;
  text-align: left;
  transition: all 0.25s ease;
}

li a:hover {
  background: var(--card-hover-bg);
  transform: translateX(4px);
  color: var(--white);
}

li.featured a {
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.04);
  color: var(--white);
}

li.featured a:hover {
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.07);
}

/* Info row (homepage) */
.info-row {
  margin-top: 20px;
}

.info-row p {
  margin: 4px 0;
  font-size: 16px;
  opacity: 0.7;
}

/* Stats banner (homepage) */
.stats-banner {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 24px;
  padding: 16px 24px;
  background: var(--card-bg);
  border-radius: 12px;
  transition: all 0.25s ease;
}

.stats-banner:hover {
  background: var(--card-hover-bg);
  color: var(--main-text-color);
}

.stats-banner-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.stats-banner-number {
  font-size: 1.3em;
  font-weight: bold;
  color: var(--white);
}

.stats-banner-label {
  font-size: 0.7em;
  opacity: 0.6;
}

@media (max-width: 600px) {
  .stats-banner {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
}


/* Sections spacing */
section {
  margin-top: 32px;
}

section:first-of-type {
  margin-top: 24px;
}

main > p {
  margin-top: 24px;
}

/* Focus states for accessibility */
a:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 4px;
  border-radius: 4px;
}

li a:focus-visible {
  outline-offset: 2px;
  border-radius: 12px;
}

/* Responsive */
@media only screen and (max-width: 730px) {
  body {
    padding: 20px 0;
  }

  #container {
    margin: 0 auto;
    padding: 20px 15px;
    border-radius: 8px;
    border: none;
  }

  li a {
    padding: 14px 16px;
  }
}

/* Homepage: a quiet brand surface with one primary contact action. */
body.homepage {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100svh;
  padding: 64px 24px;
  background: #111111;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1.125rem;
}

.homepage::before,
.homepage::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background: url("images/background.svg") no-repeat center center;
  background-size: max(100vw, 1500px) auto;
}

.homepage::before {
  opacity: 0.22;
}

.homepage::after {
  /* Reveal a little extra brightness on the artwork itself, not the page. */
  opacity: 0.1;
  -webkit-mask-image: linear-gradient(110deg, transparent calc(50% - 90px), #000 50%, transparent calc(50% + 90px));
  mask-image: linear-gradient(110deg, transparent calc(50% - 90px), #000 50%, transparent calc(50% + 90px));
  -webkit-mask-size: 300% 100%;
  mask-size: 300% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  animation: artwork-shimmer 28s linear infinite;
}

@keyframes artwork-shimmer {
  0% { -webkit-mask-position: 100% 0; mask-position: 100% 0; }
  40%, 100% { -webkit-mask-position: 0% 0; mask-position: 0% 0; }
}

.homepage #container {
  width: 100%;
  min-width: 0;
  max-width: 720px;
  padding: 0;
  background: none;
  backdrop-filter: none;
  border-radius: 0;
}

.homepage .brand-mark {
  position: relative;
  width: 88px;
  height: 88px;
  margin: 0 auto 28px;
}

.homepage #logo {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: contain;
  transition: none;
}

.homepage .software-mark {
  position: absolute;
  right: -1.25rem;
  bottom: -0.25rem;
  color: #888888;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.875rem;
  line-height: 1;
  user-select: none;
}

.homepage #logo:hover {
  transform: none;
}

.homepage h1 {
  margin: 0;
  font-family: inherit;
  /* Scale gradually with the viewport while respecting the user's text size. */
  font-size: clamp(1.875rem, calc(1.5rem + 2vw), 3rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: normal;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.homepage .contact-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  min-height: 52px;
  max-width: 100%;
  margin-top: 32px;
  padding: 12px 24px;
  border: 1px solid #686868;
  border-radius: 8px;
  color: #f5f5f5;
  font-size: 1rem;
  font-weight: 500;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.homepage .contact-button:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: #b3b3b3;
}

.homepage .contact-button span {
  font-size: 1.25rem;
  line-height: 1;
}

.homepage .contact-detail {
  margin: 12px 0 0;
  color: #a0a0a0;
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

.homepage .company-details {
  max-width: 400px;
  margin: 44px auto 0;
  color: #999999;
  font-size: 0.875rem;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.homepage .company-details::before {
  content: "";
  display: block;
  width: 64px;
  height: 1px;
  margin: 0 auto 24px;
  background: linear-gradient(90deg, transparent, #484848, transparent);
}

.homepage .formerly {
  margin: 0 0 12px;
  color: inherit;
  font-size: inherit;
  font-style: normal;
}

.homepage .formerly a {
  text-decoration: underline;
  text-decoration-color: #555555;
  text-underline-offset: 4px;
}

.homepage .formerly a::after {
  content: none;
}

.homepage address {
  font-style: normal;
}

@media (max-width: 480px) {
  body.homepage {
    padding: 48px 24px;
  }

  .homepage .brand-mark {
    width: 72px;
    height: 72px;
    margin-bottom: 24px;
  }

  .homepage .company-details {
    margin-top: 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .homepage a {
    transition: none;
  }

  .homepage::after {
    content: none;
    animation: none;
  }
}
