:root {
  color-scheme: light;
  --background: #f7f7f5;
  --foreground: #1c1c1e;
  --card: #ffffff;
  --card-foreground: #1c1c1e;
  --accent: #0e7490;
  --primary: var(--accent);
  --primary-foreground: #ffffff;
  --secondary: #eef1f1;
  --secondary-foreground: #1c1c1e;
  --muted: #eef1f1;
  --muted-foreground: #6b6b70;
  --border: rgba(0, 0, 0, 0.10);
  --ring: var(--accent);
  --shadow: rgba(0, 0, 0, 0.04);
  --radius: 0.5rem;
  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

[data-theme="dark"] {
  color-scheme: dark;
  --background: #1a1c20;
  --foreground: #e4e4e7;
  --card: #24272d;
  --card-foreground: #e4e4e7;
  --accent: #38bdf8;
  --primary: var(--accent);
  --primary-foreground: #082f49;
  --secondary: #30343b;
  --secondary-foreground: #e4e4e7;
  --muted: #30343b;
  --muted-foreground: #a1a1aa;
  --border: rgba(255, 255, 255, 0.08);
  --ring: var(--accent);
  --shadow: rgba(0, 0, 0, 0.25);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  isolation: isolate;
  min-width: 320px;
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background-image:
    repeating-linear-gradient(to right, var(--border) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(to bottom, var(--border) 0 1px, transparent 1px 72px);
  background-position: 0 0;
  background-size: 72px 72px;
  content: "";
  pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 15%, transparent 80%);
  mask-image: radial-gradient(ellipse at center, #000 15%, transparent 80%);
  animation: grid-drift 8s linear infinite;
}

button,
a {
  font: inherit;
}

a {
  color: var(--accent);
  transition: color 150ms, opacity 150ms;
}

.container {
  width: 100%;
  max-width: 46rem;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  z-index: 10;
  top: 0;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--background) 90%, transparent);
  backdrop-filter: blur(12px);
}

.header-content {
  display: flex;
  min-height: 5.25rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-title {
  display: inline-flex;
  flex-direction: column;
  color: var(--foreground);
  text-decoration: none;
  transition: color 150ms;
}

.site-title:hover {
  color: var(--accent);
}

.site-kicker,
.eyebrow,
.section-heading h2 {
  color: var(--muted-foreground);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  line-height: 1.4;
  text-transform: uppercase;
}

.site-kicker {
  color: var(--accent);
  animation: neon-pulse 2.8s ease-in-out infinite;
}

@keyframes neon-pulse {
  0%, 100% {
    text-shadow: 0 0 4px color-mix(in srgb, var(--accent) 50%, transparent);
  }
  50% {
    text-shadow: 0 0 9px color-mix(in srgb, var(--accent) 80%, transparent),
      0 0 2px var(--accent);
  }
}

.site-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 0.95;
}

.header-actions,
.card-actions,
.card-meta,
.badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.social-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.social-link {
  display: inline-flex;
  width: 2.25rem;
  height: 2.25rem;
  flex: 0 0 2.25rem;
  align-items: center;
  justify-content: center;
  border-radius: calc(var(--radius) - 0.125rem);
  color: var(--muted-foreground);
  transition: background-color 180ms, color 180ms;
}

.social-link:hover {
  background: var(--muted);
  color: var(--foreground);
}

.social-link svg {
  width: 1.125rem;
  height: 1.125rem;
  fill: currentColor;
}

.social-link svg[fill="none"] {
  fill: none;
}

.header-divider {
  width: 1px;
  height: 1.25rem;
  flex: 0 0 1px;
  margin-inline: 0.25rem;
  background: var(--border);
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.lang-option {
  border: none;
  background: none;
  padding: 0.25rem;
  font: inherit;
  color: var(--muted-foreground);
  cursor: pointer;
  line-height: 1;
  transition: color 150ms;
}

.lang-option:hover {
  color: var(--foreground);
}

.lang-option[aria-current="true"] {
  color: var(--foreground);
}

.lang-sep {
  color: var(--muted-foreground);
  opacity: 0.5;
}

.icon-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.25rem;
  border: none;
  background: none;
  padding: 0;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: color 150ms, transform 150ms;
}

.icon-toggle:active {
  transform: scale(0.9);
}

.icon-toggle:hover {
  color: var(--foreground);
}

.theme-icon {
  width: 1.375rem;
  height: 1.375rem;
}

.icon-moon,
[data-theme="dark"] .icon-sun {
  display: none;
}

[data-theme="dark"] .icon-moon {
  display: block;
}

.button {
  display: inline-flex;
  min-height: 2.25rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--primary);
  border-radius: calc(var(--radius) - 0.125rem);
  background: var(--primary);
  color: var(--primary-foreground);
  padding: 0.45rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms, color 150ms, opacity 150ms;
}

.button:hover {
  opacity: 0.88;
}

.button-outline {
  border-color: var(--border);
  background: var(--background);
  color: var(--foreground);
}

.button-outline:hover {
  background: var(--muted);
  opacity: 1;
}

.button:focus-visible,
.icon-toggle:focus-visible,
.lang-option:focus-visible,
a:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.hero {
  padding-block: 6rem 5rem;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.hero-heading,
h2,
h3 {
  font-family: var(--font-display);
}

.hero-heading {
  margin-block: 1rem;
  font-size: clamp(2.5rem, 9vw, 4rem);
  font-weight: 650;
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.hero > * {
  opacity: 0;
  transform: translateY(0.75rem);
  animation: hero-enter 600ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero > :nth-child(2) {
  animation-delay: 80ms;
}

.hero > :nth-child(3) {
  animation-delay: 160ms;
}

.hero p {
  max-width: 42rem;
  margin-bottom: 0;
  color: var(--muted-foreground);
  font-size: 1.125rem;
}

.projects-section {
  padding-block: 2rem 5rem;
}

.featured-section {
  padding-bottom: 3rem;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

h2 {
  margin-bottom: 0.25rem;
  font-size: 1.875rem;
  letter-spacing: -0.03em;
}

.section-heading h2 {
  margin-bottom: 0.5rem;
}

.section-heading p,
.status {
  margin-bottom: 0;
  color: var(--muted-foreground);
}

.projects-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

.featured-grid {
  display: grid;
}

.card {
  display: flex;
  min-width: 0;
  min-height: 18rem;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--card-foreground);
  padding: 1.5rem;
  transition: border-color 180ms, transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.card:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  transform: translateY(-2px);
}

.featured-card {
  min-height: 0;
  background: color-mix(in srgb, var(--card) 92%, var(--accent));
  padding: 2rem;
  cursor: pointer;
}

.card.featured-card h3 {
  font-size: 1.5rem;
}

.card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.card-description {
  margin-bottom: 1.25rem;
  color: var(--muted-foreground);
}

.project-hero {
  display: block;
  width: 100%;
  aspect-ratio: 1200 / 630;
  margin-bottom: 2rem;
  border-radius: var(--radius);
  object-fit: cover;
}

.project-stats {
  margin-bottom: 1.25rem;
}

.more-projects {
  margin-top: 3rem;
}

.more-projects-list {
  margin: 0;
  border-block: 1px solid var(--border);
  padding: 0;
  list-style: none;
}

.more-projects-list li + li {
  border-top: 1px solid var(--border);
}

.more-project-link {
  display: grid;
  gap: 0.25rem;
  padding-block: 1rem;
  color: var(--foreground);
  text-decoration: none;
}

.more-project-link:hover {
  color: var(--accent);
}

.more-project-link span {
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.back-link {
  display: inline-block;
  margin-top: 1.5rem;
  color: var(--muted-foreground);
  text-decoration: none;
}

.back-link:hover {
  color: var(--accent);
}

.badges {
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--secondary);
  color: var(--secondary-foreground);
  padding: 0.2rem 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.card-footer {
  margin-top: auto;
}

.card-meta {
  min-height: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  color: var(--muted-foreground);
  font-size: 0.75rem;
}

.card-meta span + span::before {
  margin-right: 0.5rem;
  content: "·";
}

.card-actions .button {
  width: 100%;
}

.status[hidden] {
  display: none;
}

.project-dialog {
  width: min(calc(100% - 2rem), 42rem);
  max-height: calc(100dvh - 2rem);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--card-foreground);
  padding: 0;
  box-shadow: 0 1.5rem 4rem var(--shadow);
  overflow: auto;
}

.project-dialog::backdrop {
  background: rgba(0, 0, 0, 0.65);
}

.dialog-content {
  padding: 2rem;
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.dialog-heading h2 {
  margin-bottom: 0;
}

.dialog-description {
  color: var(--muted-foreground);
}

.dialog-image {
  display: block;
  width: 100%;
  max-height: 24rem;
  margin-bottom: 1.5rem;
  border-radius: calc(var(--radius) - 0.125rem);
  object-fit: cover;
}

.dialog-content .card-meta {
  margin-bottom: 1.5rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted-foreground);
  padding-block: 2rem;
  font-size: 0.875rem;
}

.site-footer p {
  margin-bottom: 0;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

@keyframes grid-drift {
  to {
    background-position: 72px 72px;
  }
}

@keyframes hero-enter {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 40rem) {
  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero {
    padding-block: 7rem 5rem;
  }
}

@media (max-width: 28rem) {
  .header-content {
    align-items: flex-start;
    flex-direction: column;
    padding-block: 0.75rem;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .header-actions .button:not(.theme-toggle) {
    flex: 1;
  }

  .dialog-content {
    padding: 1.25rem;
  }

  .footer-content {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .button {
    transition: none;
  }

  body::before,
  .hero > * {
    animation: none;
  }

  .hero > * {
    opacity: 1;
    transform: none;
  }

  .card,
  .social-link,
  .site-title,
  .lang-option,
  .icon-toggle,
  a {
    transition: none;
  }

  .site-kicker {
    animation: none;
    text-shadow: 0 0 6px color-mix(in srgb, var(--accent) 60%, transparent);
  }

  .card:hover {
    transform: none;
  }

  .icon-toggle:active {
    transform: none;
  }
}
