:root {
  --page-bg: #ececec;
  --bar-bg: rgba(255, 255, 255, 0.88);
  --bar-line: rgba(17, 17, 17, 0.1);
  --ink: #111111;
  --muted: #6f6f6f;
  --case-width: 1100px;
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--page-bg);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--page-bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

.case-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 58px;
  padding: 10px max(20px, calc((100vw - var(--case-width)) / 2));
  border-bottom: 1px solid var(--bar-line);
  background: var(--bar-bg);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
}

.case-nav a {
  text-decoration: none;
}

.home-link,
.project-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1;
  transition: background-color 160ms ease, color 160ms ease;
}

.home-link {
  margin-left: -12px;
  font-weight: 500;
}

.home-link:hover,
.project-link:hover,
.home-link:focus-visible,
.project-link:focus-visible {
  background: rgba(0, 0, 0, 0.055);
  outline: none;
}

.project-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.project-link {
  color: var(--muted);
}

.project-link[aria-current="page"] {
  color: var(--ink);
  background: rgba(0, 0, 0, 0.055);
}

.case-study {
  width: min(100%, var(--case-width));
  margin: 0 auto;
  background: #ffffff;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.08);
}

.case-study h1 {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.case-study img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
}

.top-link {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--bar-line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--bar-bg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

.top-link:hover,
.top-link:focus-visible {
  background: #ffffff;
  outline: none;
}

@media (max-width: 640px) {
  .case-nav {
    min-height: 54px;
    padding: 8px 10px;
    gap: 8px;
  }

  .home-link,
  .project-link {
    min-height: 36px;
    padding: 0 10px;
    font-size: 13px;
  }

  .home-link {
    margin-left: 0;
  }

  .top-link {
    right: 12px;
    bottom: 12px;
  }

  .case-study {
    box-shadow: none;
  }
}

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