:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: #18283b;
  background: #f3f6f9;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --color-ink: #18283b;
  --color-muted: #66778a;
  --color-blue: #245b86;
  --color-blue-dark: #173c5d;
  --color-blue-soft: #e8f0f6;
  --color-border: #dce4eb;
  --color-surface: #ffffff;
  --color-background: #f3f6f9;
  --shadow-card: 0 8px 28px rgb(25 48 72 / 7%);
  --shadow-card-hover: 0 16px 38px rgb(25 48 72 / 13%);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse at 50% -20%, #e1ebf4 0, transparent 52rem),
    var(--color-background);
  color: var(--color-ink);
}

button,
a {
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid #6b9cc2;
  outline-offset: 3px;
}

.site-header {
  padding: clamp(3.5rem, 8vw, 6.5rem) 1.25rem 2.5rem;
  text-align: center;
}

.site-header h1 {
  margin: 0;
  color: #14283e;
  font-size: clamp(2.35rem, 6vw, 4.25rem);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 1.08;
}

.site-header p {
  margin: 1rem 0 0;
  color: var(--color-muted);
  font-size: clamp(1rem, 2vw, 1.15rem);
  letter-spacing: 0.01em;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
  max-width: 1080px;
  margin: 0 auto 2.5rem;
  padding: 0 1.25rem;
}

.filter-label {
  flex-basis: 100%;
  margin-bottom: 0.25rem;
  color: #8190a0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-align: center;
  text-transform: uppercase;
}

.filter-button {
  padding: 0.48rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: rgb(255 255 255 / 72%);
  color: #526579;
  cursor: pointer;
  font-size: 0.82rem;
  transition:
    color 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.filter-button:hover {
  transform: translateY(-1px);
  border-color: #a9bfd1;
  background: var(--color-blue-soft);
  color: var(--color-blue-dark);
}

.filter-button.is-active {
  border-color: var(--color-blue-dark);
  background: var(--color-blue-dark);
  color: #fff;
}

.project-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
}

.project-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 1rem;
  overflow: hidden;
  border: 1px solid rgb(211 222 232 / 85%);
  border-radius: 1.2rem;
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
  transition:
    transform 200ms ease,
    box-shadow 200ms ease,
    border-color 200ms ease;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: #c4d4e1;
  box-shadow: var(--shadow-card-hover);
}

.project-image,
.carousel {
  width: 100%;
  aspect-ratio: 16 / 10;
  margin: 0 0 1.15rem;
  border-radius: 0.85rem;
  background: #e8edf2;
  object-fit: cover;
}

.carousel {
  position: relative;
  overflow: hidden;
}

.carousel-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 500ms ease;
}

.carousel-image {
  width: 100%;
  height: 100%;
  flex: 0 0 100%;
  object-fit: cover;
}

.carousel-control {
  position: absolute;
  top: 50%;
  display: grid;
  width: 2.35rem;
  height: 2.35rem;
  place-items: center;
  transform: translateY(-50%);
  border: 1px solid rgb(255 255 255 / 55%);
  border-radius: 50%;
  background: rgb(16 35 54 / 68%);
  color: #fff;
  cursor: pointer;
  font-size: 1.45rem;
  line-height: 1;
  transition: background-color 160ms ease;
}

.carousel-control:hover {
  background: rgb(16 35 54 / 92%);
}

.carousel-prev {
  left: 0.65rem;
}

.carousel-next {
  right: 0.65rem;
}

.carousel-dots {
  position: absolute;
  right: 0.7rem;
  bottom: 0.7rem;
  display: flex;
  gap: 0.35rem;
  padding: 0.35rem 0.45rem;
  border-radius: 999px;
  background: rgb(16 35 54 / 55%);
}

.carousel-dot {
  width: 0.48rem;
  height: 0.48rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 58%);
  cursor: pointer;
  transition: background-color 160ms ease, transform 160ms ease;
}

.carousel-dot.is-active {
  transform: scale(1.15);
  background: #fff;
}

.project-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
  margin: 0 0 0.65rem;
}

.project-title {
  color: #1b3047;
  font-size: 1.08rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.35;
}

.project-date {
  flex: 0 0 auto;
  color: #7b8998;
  font-size: 0.76rem;
  font-weight: 500;
  text-align: right;
}

.project-description {
  margin: 0 0 1rem;
  color: #596b7d;
  font-size: 0.89rem;
  line-height: 1.65;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
  margin-top: auto;
}

.project-tag {
  padding: 0.3rem 0.58rem;
  border: 1px solid #e3eaf0;
  border-radius: 999px;
  background: #f5f8fa;
  color: #566b7e;
  font-size: 0.7rem;
  line-height: 1.2;
}

.project-link {
  display: block;
  margin-top: 0.9rem;
  color: var(--color-blue);
  font-size: 0.83rem;
  font-weight: 650;
  text-align: right;
  text-decoration: none;
  transition: color 160ms ease;
}

.project-link:hover {
  color: var(--color-blue-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (min-width: 640px) {
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.4rem;
    padding-right: 1.5rem;
    padding-left: 1.5rem;
  }

  .project-card {
    padding: 1.15rem;
  }
}

@media (min-width: 1024px) {
  .project-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
  }
}

@media (max-width: 420px) {
  .project-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.25rem;
  }

  .project-date {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
