@font-face {
  font-family: "Onder";
  src: url("../fonts/6975da2dd04744e6df433e81_ONDER-REGULAR.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --accent: #19cdb9;
  --ink: #111;
  --muted: #858585;
  --sidebar: #efefef;
  --header-height: 114px;
}

* {
  box-sizing: border-box;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--ink);
  background: #fff;
  font-family: Arial, Helvetica, sans-serif;
  animation: fadeIn .6s ease-out both;
}

button,
a {
  font: inherit;
}

.projects-page {
  min-height: 100svh;
  overflow-x: hidden;
}

.projects-header {
  height: var(--header-height);
  padding: 0 41px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
}

.home-link {
  min-width: 150px;
  height: 60px;
  padding: 0 23px;
  border: 1px solid #9d9d9d;
  color: #111;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  text-decoration: none;
  transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.home-link:hover,
.home-link:focus-visible {
  color: #fff;
  background: #111;
  border-color: #111;
}

.projects-contacts {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.projects-contacts a {
  color: #666;
  font-size: 27px;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
}

.projects-contacts a:hover,
.projects-contacts a:focus-visible {
  color: #111;
}

.projects-layout {
  min-height: calc(100svh - var(--header-height));
  background: #222;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(300px, 1fr));
}

.projects-sidebar {
  grid-column: 1;
  grid-row: 1;
  background: var(--sidebar);
  padding: 34px 28px 34px 41px;
}

.projects-filter-label {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 24px;
  line-height: 1.3;
}

.projects-tabs {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}

.projects-tab {
  position: relative;
  border: 0;
  padding: 0;
  color: #151515;
  background: transparent;
  cursor: pointer;
  font-size: 24px;
  line-height: 1.3;
  letter-spacing: 0;
  text-align: left;
}

.projects-tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 2px;
  height: 2px;
  background: var(--accent);
  transition: right 180ms ease;
}

.projects-tab:hover::after,
.projects-tab:focus-visible::after,
.projects-tab.is-active::after {
  right: 0;
}

.projects-tab.is-active {
  font-weight: 400;
}

.projects-grid {
  display: contents;
}

.project-card {
  position: relative;
  min-height: 0;
  color: #fff;
  display: block;
  overflow: hidden;
  isolation: isolate;
  text-decoration: none;
}

.project-card:nth-child(1) {
  grid-column: 2;
  grid-row: 1;
}

.project-card:nth-child(2) {
  grid-column: 3;
  grid-row: 1;
}

.project-card-tall {
  grid-column: 4;
  grid-row: 1 / span 2;
}

.project-card:nth-child(4) {
  grid-column: 1;
  grid-row: 2;
}

.project-card:nth-child(5) {
  grid-column: 2;
  grid-row: 2;
}

.project-card:nth-child(6) {
  grid-column: 3;
  grid-row: 2;
}

.project-card img {
  z-index: -2;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms cubic-bezier(.2, .7, .2, 1), filter 300ms ease;
}

.project-card-forum img {
  object-position: center 78%;
}

.project-card-shade {
  z-index: -1;
  position: absolute;
  inset: 0;
  background: rgba(4, 12, 20, .45);
  transition: background-color 250ms ease;
}

.project-card-copy {
  position: absolute;
  top: 23px;
  left: 18px;
  max-width: calc(100% - 36px);
  padding: 4px 0 8px 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.project-card-copy::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: var(--accent);
}

.project-card-copy small {
  font-size: 11px;
  font-weight: 400;
  line-height: 1;
}

.project-card-copy strong {
  font-size: 32px;
  font-weight: 800;
  line-height: .95;
}

.project-card-copy > span {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
}

.project-card:hover img,
.project-card:focus-visible img {
  transform: scale(1.075);
  filter: saturate(1.06);
}

.project-card:hover .project-card-shade,
.project-card:focus-visible .project-card-shade {
  background: rgba(4, 12, 20, .3);
}

.project-card:focus-visible,
.projects-tab:focus-visible,
.home-link:focus-visible,
.projects-contacts a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

.project-card[hidden] {
  display: none;
}

.projects-layout.is-filtered .project-card:not([hidden]) {
  grid-column: auto;
  grid-row: auto;
}

@media screen and (max-width: 900px) {
  :root {
    --header-height: 96px;
  }

  .projects-header {
    padding: 0 24px;
  }

  .home-link {
    min-width: 126px;
    height: 52px;
    font-size: 20px;
  }

  .projects-contacts a {
    font-size: 20px;
  }

  .projects-layout {
    grid-template-columns: 220px minmax(0, 1fr);
    grid-template-rows: auto;
  }

  .projects-sidebar {
    grid-column: 1;
    grid-row: 1;
    padding: 28px 22px;
  }

  .projects-filter-label,
  .projects-tab {
    font-size: 20px;
  }

  .projects-grid {
    grid-column: 2;
    grid-row: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(3, minmax(270px, 1fr));
  }

  .project-card,
  .project-card-tall {
    grid-column: auto;
    grid-row: auto;
  }
}

@media screen and (max-width: 640px) {
  :root {
    --header-height: 72px;
  }

  .projects-header {
    position: sticky;
    z-index: 20;
    top: 0;
    padding: 0 16px;
  }

  .home-link {
    min-width: 104px;
    height: 44px;
    padding: 0 14px;
    font-size: 17px;
  }

  .projects-contacts {
    gap: 2px;
  }

  .projects-contacts a {
    font-size: 14px;
    line-height: 1.18;
  }

  .projects-layout {
    min-height: 0;
    display: block;
  }

  .projects-sidebar {
    position: sticky;
    z-index: 10;
    top: var(--header-height);
    padding: 14px 16px 16px;
  }

  .projects-filter-label {
    margin-bottom: 8px;
    font-size: 16px;
  }

  .projects-tabs {
    width: 100%;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 16px;
    overflow: visible;
  }

  .projects-tab {
    width: 100%;
    min-height: 40px;
    padding: 6px 4px 6px 0;
    font-size: 16px;
    line-height: 1.15;
    white-space: normal;
  }

  .projects-grid {
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: none;
    grid-auto-rows: min(118vw, 470px);
  }

  .project-card-tall {
    grid-column: auto;
    grid-row: auto;
  }

  .projects-grid .project-card {
    grid-column: 1;
    grid-row: auto;
  }

  .project-card-copy {
    top: 24px;
    left: 20px;
  }

  .project-card-copy strong {
    font-size: 32px;
  }

  .project-card-copy > span {
    font-size: 18px;
  }
}

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

/* Keep the projects-page home control in the same compact visual language. */
.projects-header .home-link {
  min-width: 112px;
  height: 42px;
  padding: 0 16px;
  font-size: 16px;
}

@media screen and (max-width: 640px) {
  .projects-header .home-link {
    min-width: 112px;
    height: 36px;
    padding: 0 14px;
    font-size: 14px;
  }
}
